gpt4 book ai didi

ios - 支付宝SDK : Transaction Failed

转载 作者:行者123 更新时间:2023-11-28 06:01:53 24 4
gpt4 key购买 nike

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

enter image description here

我使用了下面的代码

    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 校验和生成工具在后端生成。校验和是一个唯一的字符串,它会根据我们为校验和生成 Api 发送的参数而改变

关于ios - 支付宝SDK : Transaction Failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49400310/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com