iOS Swift中PayTM付款缺少参数问题

时间:2018-12-27 05:54:35

标签: swift payment-gateway paytm

我正在尝试将Paytm付款集成到iOS应用中。当我尝试将参数传递给pgtransaction时,出现消息CUST_ID参数丢失的错误。但是我正在传递那个钥匙。请参见下面的实现代码:

DisplayWeight

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

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

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

2 个答案:

答案 0 :(得分:0)

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不像以前那样接受参数传递。当我尝试通过插值传递参数时,它接受并给出成功响应。

答案 1 :(得分:0)

ORDER_ID : long(1553684683)

由于该long关键字,我们都面临着这个问题。因此,将其更改为String并传递给SDK。

示例:

"CUST_ID": "918309909071"
"ORDER_ID" : "1553684683"