PayTM SDK:交易失败

PayTM SDK : Transaction Failed

我正在将 PayTM 集成到我的 ios (Swift) 中的应用程序中,我是面临标题为“交易失败”且消息为“MissingKeys”的问题

我使用了以下代码

    merchant = PGMerchantConfiguration.default()!

    merchant.checksumGenerationURL = "http://getlook.in/cgi-bin/checksum_generate.cgi"
    merchant.checksumValidationURL = "http://getlook.in/cgi-bin/checksum_validate.cgi"

    merchant.clientSSLCertPath = nil
    merchant.clientSSLCertPassword = nil

    merchant.merchantID = "rriver57770575448885"
    merchant.website = "APP_STAGING"
    merchant.industryID = "Retail"
    merchant.channelID = "WAP"

    var orderDict = [String: String]()

    orderDict["MID"] = "rriver57770575448885" // Merchant ID
    orderDict["CHANNEL_ID"] = "WAP" // Channel Id
    orderDict["INDUSTRY_TYPE_ID"] = "Retail" // Industry Type

    orderDict["WEBSITE"] = "APP_STAGING"
    orderDict["TXN_AMOUNT"] = "10"; // amount to charge                      // mandatory
    orderDict["ORDER_ID"] = "\(Date().timeIntervalSince1970)";//change order id every time on new transaction
    orderDict["REQUEST_TYPE"] = "DEFAULT";// remain same
    orderDict["CUST_ID"] = "123456789027"; // change acc. to your database user/customers
    orderDict["MOBILE_NO"] = "8798987874";// optional
    orderDict["EMAIL"] = "test@paytm.com"; //optional

    let pgOrder = PGOrder(params: orderDict)

    let transaction = PGTransactionViewController.init(transactionFor: pgOrder)

    transaction?.serverType = eServerTypeProduction
    transaction?.merchant = merchant
    transaction?.loggingEnabled = true
    transaction?.delegate = self
    self.present(transaction!, animated: true, completion: nil)

请帮忙!

在此代码中,您遗漏了一个名为 chechSumHash 的参数。也包括在内。

orderDict["CHECKSUMHASH"] = CheckSum;

checkSumHash可以借助Paytm checksum generation kit在后台生成。校验和是一个唯一的字符串,它会根据我们为校验和生成发送的参数而改变 Api