Authorize Cardinal to complete payment
To authorize a transaction using cardinal (i.e resonseCode = S0), create an html page that has a form that submits on page load with the value of ACSUrl from the response as the action of the form.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<body onload ='form1.submit()'> <!-- NOTE: ACSUrl, TermUrl, MD and PaReq should be replaced with their corresponding values. e.g ACSUrl = "https://testcustomer34.cardinalcommerce.com/V3DSStart?osb=visa-3&VAA=B" TermUrl = "https://sandbox.interswitchng.com/collections/api/v1/pay/cardinalCallBack" MD = "66603" PaReq = "eNpVUttu4jAQffdXoH5AbOeCtGhqKQVp2+2GpmlL9zU4s2AgTuo4Bf6+doBe3uacuficGcPz2iDOnlD2BgVk2HXlCkequr7Knv LN/c0ivD+ufvHssciwZVcC8rTANwHvaDrVaMEDFoRAL5C4EUauS20FlPLt5m4u4jiOogjoGRKo0dzNBA+jOBkDPSECuqxRpBXaXm+UGqVbpSs EOtAEZNNra44iGbuWCyDQm51YW9tOKN3jsi2PgdLWSdkrK9d6Fcimpo6tlEFpaYV1A9T3EKBfOvPeR52zf1CVeF7MH8utnS42f/7iq0yyF168 bPlOztJroL6CQFVaFCHjY5aE0YjzScInPAY68ATK2gsU89/zUchYwJgzf6IItP6x9IRc0ue+U85pbwxqebF6QQTw0DYafRvQz9gZ+ZI/vfVLl 9btM5/pij10u+Vh+v/233IfcrnPZVE0/g5DxTBQuS06FfEwUQ0rpX4KPV+Znj+Ei358lA9Mdboe" --> <form id="form1" action=ACSUrl method="post"> <input name="TermUrl" value=TermUrl> <input name="MD" value=MD> <input name="PaReq" value=PaReq> </form> |
This form opens the Visa cardinal authorization page, where the user can enter their Visa Card iPin/Password and Submit, On Submit done, make the final request to complete the transaction calling the end point below
1 |
POST /api/v3/purchases/otps/auths |
Sample Request
1 2 3 4 5 6 |
{ "paymentId":"66603", // Payment Identifier. "transactionId":"MSPjKBV2Kyg91MQRMep0", // Transaction unique identifier. "eciFlag":"07" // The Electronic Commerce Indicator (ECI) Flag e.g Visa:05: Issuer Liability, // 06: Issuer Liability, 07: Merchant Liability. } |
Sample Response (success)
After the payment request has been sent, the expected successful payment response is similar to this.
1 2 3 4 5 6 7 8 9 |
{ "transactionIdentifier": "GTB|WEB|VNA|23-05-2016|66603|999591", // Transaction unique identifier. "token": "5123453847245380", // Card Number or Token. "tokenExpiryDate": "2004", // Card or Token expiry date in YYMM format. "panLast4Digits": "0002", // Last for digit of payment instrument. "amount": "200.00", // Amount in Naira. "transactionRef": "ESBDEV10003", // Unique transaction reference number. "message": "Approved by Financial Institution" // Response message. } |
Sample Response (failure)
After the payment request has been sent, if there is any error during the request processing, expected failure response is similar to this.
1 2 3 4 5 6 7 8 9 |
{ "errors": [ { "code": "Z5", // Error code. "message": "PAYMENT_ALREADY_PROCESSED" // Error message. } ], "paymentId": "66603" // Transaction unique identifier. } |