PhonePe Integration in iOS swift issue with PhonePePayment Sdk

  Kiến thức lập trình

implementing phonepe in iOS by using PhonePePayment sdk

this is the function which I am using to open phonepe payment gateway but it gives error this

failure(PhonePePayment.TransactionFailureError.networkFailure(code: “400”, message: “Key not found for the merchant”))

how to solve that

I tried this function

func phonepaycall(){
let requestBody: [String: Any] = [
“merchantId”: merchantId,
“merchantTransactionId”: merchantTransactionId,
“merchantUserId”: merchantUserId,
“amount”: amount,
“callbackUrl”: callbackUrl,
“mobileNumber”: mobileNumber,
“paymentInstrument”: [
“type”: paymentInstrumentType
print(“request body in phonepecall : (requestBody)”)
let requestBodyData = try! requestBody, options: [])
let base64Body = requestBodyData.base64EncodedString()
let checksum = sha256(base64Body + apiEndPoint + salt) + “###” + saltIndex
print(“checksum is here : (checksum)”)
let headers: [String: String] = [:]
let request : DPSTransactionRequest = DPSTransactionRequest (
body : base64Body,
apiEndPoint : apiEndPoint,
checksum : checksum,
headers : headers,
appSchema : “”
PPPayment(environment: .sandbox, enableLogging: true, appId: nil)
.startPG(transactionRequest: request, on: self, animated: true)
{ _, result in
let text = “(result)”

New contributor

vani jain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website