如何在iOS PayTm集成中生成“checksumGenerationURL”和“checksumValidationURL”?

我想要将Paytm SDK集成到我的应用程序中。 我有MerchantId and Merchant key 。 但是我没有这些Url。 如何生成这些url?

我将PayTM SDK整合到swift应用程序中,并且工作正常。

我被困约15天的问题是URL生成:

checkSumGenerationURLcheckSumValidationURL

早些时候我使用PayTM提供的url,但由于这一点,每次尝试付款都会失败。

所以这里是最终的解决scheme:我坐在我的服务器团队,然后决定在我们自己的服务器处理它,然后尝试之后。

它工作很好。

 So here is final set of parameters you need to pass : //Step 1: Create a default merchant config object PGMerchantConfiguration *mc = [PGMerchantConfiguration defaultConfiguration]; //Step 2: If you have your own checksum generation and validation url set this here. Otherwise use the default Paytm urls mc.checksumGenerationURL = @"generate checksum url by handling in own server"; mc.checksumValidationURL = @"generate checksum url by handling in own server"; //Step 3: Create the order with whatever params you want to add. But make sure that you include the merchant mandatory params NSMutableDictionary *orderDict = [NSMutableDictionary new]; //Merchant configuration in the order object orderDict[@"MID"] = @"abc1111"; orderDict[@"CHANNEL_ID"] = @"WAP"; orderDict[@"INDUSTRY_TYPE_ID"] = @"Education"; orderDict[@"WEBSITE"] = @"companyname"; //Order configuration in the order object orderDict[@"TXN_AMOUNT"] = @"100"; orderDict[@"ORDER_ID"] = [Feepayment generateOrderIDWithPrefix:@"111"]; orderDict[@"REQUEST_TYPE"] = @"DEFAULT"; orderDict[@"CUST_ID"] = @"abc7777"; 

这里是iOS Swift2.2中的校验生成方法(应用端)

//调用这个方法createCheckSumString(hashValue)

其中hasValue是您添加了所有PAYTM参数的参数,它是一个stringtypes。

这里是方法:

 func createCheckSumString(input: String) -> String { let cstr = input.cStringUsingEncoding(NSUTF8StringEncoding) var data = NSData(bytes: cstr, length: input.length) var digest = [UInt8](count: CC_SHA512_DIGEST_LENGTH, repeatedValue: 0) // This is an iOS5-specific method. // It takes in the data, how much data, and then output format, which in this case is an int array. CC_SHA512(data.bytes, Int(data.length), digest) var output = String(capacity: CC_SHA512_DIGEST_LENGTH * 2) // Parse through the CC_SHA256 results (stored inside of digest[]). for i in 0..<CC_SHA512_DIGEST_LENGTH { output += String(format: "%02x", digest[i]) } return output } 

注意 – 导入CommonDigest(在Objective C中,这样我们就添加#include <CommonCrypto/CommonDigest.h>这样CC_SHA512_DIGEST_LENGTH工作就可以随意分享评论。