gpt4 book ai didi

swift - ios Swift 中 Paytm 支付缺失参数问题

转载 作者:行者123 更新时间:2023-11-30 10:56:07 24 4
gpt4 key购买 nike

我正在尝试将 Paytm 付款集成到 iOS 应用程序中。当我尝试将参数传递给 pgtransaction 时,收到错误消息 CUST_ID 参数丢失。但我正在传递那把 key 。请参阅下面的实现代码:

func beginPayment()
{
productionInstance = productionInstance.createProductionEnvironment()
let useMobiNumb = userMobileNumber.dropFirst()
print(useMobiNumb)
let type :ServerType = .eServerTypeProduction
let order = PGOrder(orderID: "", customerID: "", amount: "", eMail: "", mobile: "")
order.params = ["MID": MID,"ORDER_ID": orderId!,"CUST_ID": useMobiNumb,"CHANNEL_ID": "WAP","WEBSITE": "VMartP","TXN_AMOUNT": orderValue!,"INDUSTRY_TYPE_ID": IndustryTypeId,"CHECKSUMHASH": checkSumHash!,"CALLBACK_URL": "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=\(String(describing: orderId!))"]
self.txnController = self.txnController.initTransaction(for: order) as! PGTransactionViewController
self.txnController.title = "Paytm Payments"
self.txnController.setLoggingEnabled(true)
if(type != ServerType.eServerTypeNone)
{
self.txnController.serverType = type;
}
else
{
return
}
self.txnController.merchant = PGMerchantConfiguration.defaultConfiguration()
self.txnController.delegate = self
self.navigationController?.pushViewController(self.txnController, animated: true)
}

我在调试区域收到此消息:

PGTransactionViewController::initWithTransactionParameters: ["ORDER_ID": "Order_26122018158277", "CHANNEL_ID": "WAP", "INDUSTRY_TYPE_ID": "Retail109", "CALLBACK_URL": "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=Optional(\"Order_26122018158277\")", "CUST_ID": "918309909071", "TXN_AMOUNT": "27.00", "WEBSITE": "WEBSTAGING", "MID": "VMartP95907532925453", "CHECKSUMHASH": "YCd9N8GZYfYvyFGlBpdNnnEqMYhtWio2l9z3IjrqW2qsaG3l6ZiO6cP6zNBBZTRNSyePm5WV0/bm7zw77mMIKv45g6TrWPEuWFa8qe3yDSw="]
PGTransactionViewController:loadView
PGTransactionViewController::viewDidLoad
PGTransactionViewController::viewWillAppear
PGTransactionViewController::viewDidAppear
Calling Delegate errorMisssingParameter
Optional(Error Domain=com.paytm.payments Code=-1 "MissingKeys" UserInfo={NSLocalizedRecoveryOptions=(
OK
), NSLocalizedDescription=MissingKeys, NSLocalizedFailureReason=CUST_ID is/are missing parameters.})

谁能告诉我哪里错了?谢谢

最佳答案

order.params = ["MID": "\(MID)","ORDER_ID": "\(orderId!)","CUST_ID": "\(custID!)","CHANNEL_ID": "WAP","WEBSITE": "VMartP","TXN_AMOUNT": "\(orderValue!)","INDUSTRY_TYPE_ID": "\(IndustryTypeId)","CHECKSUMHASH": "\(checkSumHash!)","CALLBACK_URL": "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=" + orderId!]

我不知道为什么 Paytm SDK 不接受像以前那样的参数传递。当我尝试通过插值传递参数时,它接受并给出成功响应。

关于swift - ios Swift 中 Paytm 支付缺失参数问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53940354/

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