ORDER_ID是无效的Paytm集成在iOS中swift4(Order_id is invalid

2019-10-29 18:43发布

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

Answer 1:

    //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: {

        })
    }
}`


文章来源: Order_id is invalid in Paytm Integration in iOS swift4
标签: swift4 paytm