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! JSONSerialization.data(withJSONObject: 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)”
print(text)
print(“Completion:———————“)
}
}