I am trying to integrate CrediMax SDK:
https://github.com/Mastercard-Gateway/gateway-ios-sdk in iOS Mobile app.
- I create a session for payment and that is successfull and response mention below
{"success":true,"statusCode":"200","data":{"sessionId":"SESSION0002791451838N2104331F28","merchant":"E13043***","result":"SUCCESS","sessionVersion":"fb828aee01"}}
But when i am trying to update session its always showing an error
error == The operation couldn’t be completed. (MPGSDK.GatewayError error 0.)
here is my effort
func updateSession() {
print("session id == \(transaction?.sessionId ?? "")\napiVersion == \(transaction?.apiVersion ?? "")")
guard let sessionId = transaction?.sessionId, let apiVersion = transaction?.apiVersion else { return }
var request = GatewayMap()
request[at: "sourceOfFunds.provided.card.nameOnCard"] = "Museer Ahamad Ansari"
request[at: "sourceOfFunds.provided.card.number"] = "6071235068******"
request[at: "sourceOfFunds.provided.card.securityCode"] = "123"
request[at: "sourceOfFunds.provided.card.expiry.month"] = "02"
request[at: "sourceOfFunds.provided.card.expiry.year"] = "23"
gateway.updateSession(sessionId, apiVersion: apiVersion, payload: request, completion: updateSessionHandler(_:))
}
// MARK: - Handle the Update Response
// Call the gateway to update the session.
fileprivate func updateSessionHandler(_ result: GatewayResult<GatewayMap>) {
DispatchQueue.main.async {
self.loadingViewController.dismiss(animated: true) {
switch result {
case .success(_):
self.performSegue(withIdentifier: "showConfirmation", sender: nil)
case .error(let error):
print("error == \(error.localizedDescription)")
self.showError(error)
}
}
}
}