Charge Card
{{URL}}/api/cps/v1/chargeCard
CARD PAYMENT METHOD
The CARD payment method allows users to make payments using credit/debit cards. The following steps outline the process:
- 1Call the Create Payment endpoint to initiate a payment transaction.
- 2Encrypt the chargeCard payload with the rexpay public key and call the Charge Card endpoint with the encrypted payload.
- 3Decrypt the response from the Charge Card endpoint using your privateKey generated.
- 4Based on the responseCode of the Charge Card endpoint:
- 5If 00: Transaction Successful.
- 6If TO: Call Authorize Card endpoint to finalize the transaction.
- 7If SO: A redirect link and HTTP method is part of the response which must be triggered to fill in the necessary data.
- 8Call the Get Transaction Status endpoint to check the status of the transaction.
Object Parameters
Name | Type | Description | Optional Mandatory |
reference | String | reference generated on createPayment | true |
amount | Number | Transaction Amount | true |
customerId | String | Identity number of customer | true |
cardDetails | Object | Details of the card for payment | true |
Object to encrypt
{ "reference" : "(reference generated on createPayment", "amount" : "100", "customerId" : "tname@gmail.com", "cardDetails" : { "authDataVersion" : "1", "pan" : "5976222222299999", "expiryDate" : "1230", "cvv2" : "456", "pin" : "4178" } }
AUTHORIZATION
Username | Password |
Username | {{USERNAME}} |
Password | {{SECRETKEY}} |
BODY PARAMS
{ "encryptedRequest": "-----BEGIN PGP MESSAGE----- Version: Didisoft OpenPGP Library for Java 3.2 hIwDT9UVaCho7XYBA/9W5WiA9I4mQ67igGjKuvVRhbZojqhNKE6S0dXU3HC8BmOm j6LrdLsAe5bhILhPRRf2xl/oaODWy4dUf7Sstx8gcMJhJuvmpYLX6OiYjhhBTK+i mthv+njBLkOdK/0/Ugf+nY/+12IAi/u+Z8/yl17ye5aHLEVHl2vKGPAcSACX39LA OQHGM9z6ccc0n3idnZRMdqb5qkkpsy3InbWzSSzf/WK0Ad7Cc+ASz22OaSfC5Eux jmp7Dblseoif00XWDM6izeeo/DC2Z79oJaeQ+yezIBtZcyTurU1kQtz0UYgsgofY phzHCFg0POQVLP7PYve2G8OAx+M7O8bra3TzZQhiQVCBMP3nt/YuWHEAoqOX8QbB xcQs9EVRpP7HeHmngWSCN1l0qPc8XR50A0RJ/5lnBN4nvRq7eguC4Ad0eF9Frbe2 7fGeR3fCouDjVxHwox0esSR8drVuk2tLOktnUd2LY92mvgcOdrDXkA+tlmkMFUk6 jkU2bfyEf81q9w== =i9oR -----END PGP MESSAGE----- " }
Request Parameters
Name | Type | Description | Optional Mandatory |
encryptedRequest | String | Unique client identification number | true |
Version | Number | Version for | true |
Example Request
var myHeaders = new Headers(); var raw = "{ "encryptedRequest": "-----BEGIN PGP MESSAGE-----\nVersion: Didisoft OpenPGP Library for Java 3.2\n\nhIwDT9UVaCho7XYBA/9W5WiA9I4mQ67igGjKuvVRhbZojqhNKE6S0dXU3HC8BmOm\nj6LrdLsAe5bhILhPRRf2xl/oaODWy4dUf7Sstx8gcMJhJuvmpYLX6OiYjhhBTK+i\nmthv+njBLkOdK/0/Ugf+nY/+12IAi/u+Z8/yl17ye5aHLEVHl2vKGPAcSACX39LA\nOQHGM9z6ccc0n3idnZRMdqb5qkkpsy3InbWzSSzf/WK0Ad7Cc+ASz22OaSfC5Eux\njmp7Dblseoif00XWDM6izeeo/DC2Z79oJaeQ+yezIBtZcyTurU1kQtz0UYgsgofY\nphzHCFg0POQVLP7PYve2G8OAx+M7O8bra3TzZQhiQVCBMP3nt/YuWHEAoqOX8QbB\nxcQs9EVRpP7HeHmngWSCN1l0qPc8XR50A0RJ/5lnBN4nvRq7eguC4Ad0eF9Frbe2\n7fGeR3fCouDjVxHwox0esSR8drVuk2tLOktnUd2LY92mvgcOdrDXkA+tlmkMFUk6\njkU2bfyEf81q9w==\n=i9oR\n-----END PGP MESSAGE-----\n" }"; var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("{{URL}}/api/cps/v1/chargeCard", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
Response Parameters
Name | Type | Description | Optional Mandatory |
reference | String | Reference Id | true |
clientId | String | Client Identification number | true |
paymentUrl | String | URL for payment | true |
status | String | Transaction status | true |
paymentChannel | String | Channed of payment | true |
paymentUrlReference | String | Unique URL for payment | true |
externalPaymentReference | Number | Unique external payment reference number | true |
fees | Number | Transaction charge fee | true |
currency | String | Transaction currency | true |
Example Response
{ "reference": "sm23oyr1122", "clientId": "dummy@gmail.com", "paymentUrl": "https://checkout-dev.globalaccelerex.com/pay/16965521OQbS4EfoEX", "status": "CREATED", "paymentChannel": "DEFAULT", "paymentUrlReference": "16965521OQbS4EfoEX", "externalPaymentReference": "16965521OQbS4EfoEX", "fees": 0.03, "currency": "NGN" }
Did you find this page helpful?