Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate Paytm with swift 3.0

Tags:

ios

swift3

paytm

I want to integrate paytm payment gateway with swift 3.0.I just follow github link . but i have probelm in ["CHECKSUMHASH"]= "" . What can i put in this key.

orderDict["MID"] = strMid
                            orderDict["ORDER_ID"] = strOrderId
                            orderDict["CUST_ID"] = strCustomerId
                            orderDict["INDUSTRY_TYPE_ID"] = strIndustryType
                            orderDict["CHANNEL_ID"] = strChanalID
                            orderDict["TXN_AMOUNT"] = strAmt
                            orderDict["WEBSITE"] = strWebsite
                            orderDict["CALLBACK_URL"] = "http://xxxxx.co.in/verifyChecksum.php"
                    orderDict["CHECKSUMHASH"] = ""

This gives me invalid checksum please tell me how can i generate checksum.

like image 998
Rohit kumar swami Avatar asked Apr 07 '17 05:04

Rohit kumar swami


2 Answers

First of all you can call your server api for generate checksum. If you are using Almofire then call

var parameters:[String:String]?
        parameters = ["MID":strMid,"ORDER_ID":strOrderId ,"INDUSTRY_TYPE_ID":strIndustryType,"CHANNEL_ID":strChanalID,"TXN_AMOUNT":strAmt,"WEBSITE":strWebsite, "CUST_ID":strCustomerId,"CALLBACK_URL":"http://xxxxxxx.co.in/verifyChecksum.php"]
                    showHud(self.view)
        print(parameters)

        Alamofire.request("http://xxxxxx.co.in/generateChecksum.php", method: .post, parameters: parameters,encoding: URLEncoding.default, headers: nil).responseJSON {}

Please pass all parameter in this api . It gives below response

{
  "CHECKSUMHASH": "xxxxxxxxxxxxx",
  "ORDER_ID": "xxxxxxxx",
  "payt_STATUS": "1"
}

In this Dictionary you get CHECKSUMHASH It Pass into paytm order.

like image 107
Vinod Kumar Avatar answered Nov 10 '22 22:11

Vinod Kumar


For integrating PayTm in swift you app you can find this link on github.

like image 1
Ruchin Somal Avatar answered Nov 10 '22 22:11

Ruchin Somal