Paytm整合swift4:响应是交易完成 ,响应消息是无效的订单ID,但是我生成订单ID在每一笔交易的新,是有这方面的任何可能的解决方案。 参数,我传递:
var orderID = "123456789".randomString(length: 20)
orderDict["MID"] = "RentSe98692194807190"
orderDict["CHANNEL_ID"] = "WAP"
orderDict["INDUSTRY_TYPE_ID"] = "Retail"
orderDict["WEBSITE"] = "APP_STAGING"
orderDict["TXN_AMOUNT"] = "100"
orderDict["ORDER_ID"] = orderID
orderDict["CHECKSUMHASH"] = checksumHash
orderDict["CUST_ID"] = "240"
orderDict["EMAIL"] = "kj@gmail.com" as AnyObject
orderDict["MOBILE_NO"] = "7777777777" as AnyObject
orderDict["REQUEST_TYPE"] = "DEFAULT" as AnyObject
orderDict["THEME"] = "merchant" as AnyObject
orderDict["CALLBACK_URL"] = "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp" as AnyObject
//MARK:- Create Payment
func createPayment(checksumHash : String, orderID : String) {
var custID = ""
var orderID = String()
custID = custID.randomString(length: 20)
print(custID)
var orderDict = [AnyHashable : Any]()
let txnAmt = ((self.amountTextField.text) ?? "0")
print(txnAmt)
orderDict["MID"] = "RentSe98692194807190"
orderDict["CHANNEL_ID"] = "WAP"
orderDict["INDUSTRY_TYPE_ID"] = "Retail"
orderDict["WEBSITE"] = "APP_STAGING"
orderDict["TXN_AMOUNT"] = txnAmt as AnyObject
orderDict["ORDER_ID"] = orderID
orderDict["CHECKSUMHASH"] = checksumHash
orderDict["CUST_ID"] = custID
orderDict["EMAIL"] = "kj@gmail.com" as AnyObject
orderDict["MOBILE_NO"] = "7777777777" as AnyObject
orderDict["REQUEST_TYPE"] = "DEFAULT" as AnyObject
orderDict["THEME"] = "merchant" as AnyObject
orderDict["CALLBACK_URL"] = "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp" as AnyObject
print(custID)
let pgOrder = PGOrder(params: orderDict)
let transaction = PGTransactionViewController.init(transactionFor: pgOrder)
if eServerTypeStaging != eServerTypeNone {
transaction!.serverType = eServerTypeStaging
transaction!.merchant = merchant
transaction!.delegate = self
self.present(transaction!, animated: true, completion: {
})
}
}`