3

I'm Integrating PayUmoney IOS SDK in swift, Im getting trouble When I'm doing in live its showing hash mismatch (Hash mismatch1) If I'm doing in test its showing invalid merchant key (Invalid key) I struck here from 2 weeks Did so many things and didn't get any solution for this can any one help it would be awesome. Below is my code, Thank you in Advance.

Note: I want to Integrated only under payUmoney in-built UI Controller. i don't want to integrate in UIWebView.

self.paymentDict = PUMTxnParam()
self.paymentDict.phone = "\(userdetails["userphone"] ?? "")"
self.paymentDict.email = "\(userdetails["useremail"] ?? "")"
self.paymentDict.amount = "\(self.priceLBL.text!)"
self.paymentDict.environment = PUMEnvironment.production
self.paymentDict.firstname = "\(userdetails["username"] ?? "")"
self.paymentDict.key = "TfTP2FUf"
self.paymentDict.merchantid = "1234567"
self.paymentDict.txnID = "\(Int(NSDate().timeIntervalSince1970 * 1000))"
self.paymentDict.surl = "https://www.payumoney.com/mobileapp/payumoney/success.php"
self.paymentDict.furl = "https://www.payumoney.com/mobileapp/payumoney/failure.php"
self.paymentDict.productInfo = "iphoneX"
self.paymentDict.udf1 = ""
self.paymentDict.udf2 = ""
self.paymentDict.udf3 = ""
self.paymentDict.udf4 = ""
self.paymentDict.udf5 = ""
self.paymentDict.udf6 = ""
self.paymentDict.udf7 = ""
self.paymentDict.udf8 = ""
self.paymentDict.udf9 = ""
self.paymentDict.udf10 = ""

After that, I getting hash value from server where passes a parameter and get response of hash value.

self.paymentDict.hashValue = value["payment_hash"] as! String

PlugNPlay.presentPaymentViewController(withTxnParams: self.paymentDict, on: self) { (paymentResponse, error, extrapara) in
    print(paymentResponse?.description ?? "")
    print(error ?? "")
}

Than, Run application and when place order of product than go to payUmoney Payment Controller and show a below error.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Mak K
  • 83
  • 1
  • 10

0 Answers0