2017-04-07 38 views
5

我想要整合paytm支付網關與swift 3.0。我只是按照githublink。但我有probelm在["CHECKSUMHASH"] =「」。我可以在這個鍵上放什麼。整合Paytm與SWIFT 3.0

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"] = "" 

這給了我無效的校驗和,請告訴我如何生成校驗和。

+0

任何你沒有做它在文檔中聲明的原因? – rmaddy

回答

3

首先,您可以調用您的服務器API來生成校驗和。如果你正在使用Almofire然後調用

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 {} 

請通過所有parameter在這個API。它提供了以下response

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

在這個DictionaryCHECKSUMHASH它傳遞到paytm order

+0

從哪裏可以得到'verifyChecksum.php'和'generateChecksum.php'? –

+0

您可以從此鏈接下載https://github.com/Paytm-Payments/Paytm_App_Checksum_Kit_PHP @MrugeshTank –

+0

ORDER_ID總是返回null ...任何想法? – Elangovan