Bank cards
Bank cards are among the most popular online payment methods in the world. There are different types of bank cards and several stages of payment. Find out how payment by credit card works online.
To accept card payments, you must prepare and send the correct information. Then a link to a payment page is received. Redirect your customers to this page to get paid
Initiate a payment by card with the API
To initiate a payment by card, you must provide information such as surname, first name, email, amount, etc.
You can also pass another parameter which is the URL to contact when the transaction changes state. Some parameters are mandatory and some are not. See the following table for more information
Parameter | Required? | Description |
---|---|---|
senderPhoneNumber | Yes | Customer number It must respect the E.164 format without the + sign.Format: [country code][local phone number] Ex: 22951010588 |
senderFirstName | Yes | Customer first name |
senderLastName | Yes | Customer's last name |
amount | Yes | Amount to be recovered from the customer |
currency | Yes | Currency View supported currencies |
title | Yes | Customer title. Ex: Mr , Dr |
Yes | Customer Email | |
address | Yes | Customer address |
locality | Yes | Customer locality |
county | Yes | Customer district |
postalCode | Yes | Customer zip code |
webhookUrl | No | URL that we will contact to notify you of updates regarding the initiated payment. |
successRedirectionUrl | No | Redirection URL in case of successful payment |
errorRedirectionUrl | No | Redirection URL in case of payment failure |
- HTTP
- Curl
POST https://apis.chipdeals.me/momo/requestpayment?apikey=test_FOdigzgSopV8GZggZa89 HTTP/1.1content-type: application/json{ "senderFirstName": "Iyam", "senderLastName": "EVERICH", "senderPhoneNumber": "22951010588", "amount": 250, "currency": "XOF", "title": "Mr", "email": "myuser@gmail.com", "address": "Cotonou", "locality": "Litoral", "district": "BJ", "postalCode": "229", "successRedirectionUrl":"https://webhook.site/3896e3d6-7014-42f3-a394-a91a04edb367/success", "errorRedirectionUrl":"https://webhook.site/3896e3d6-7014-42f3-a394-a91a04edb367/error"}
HTTP/1.1 200 OKcontent-type: application/jsondate: Tue, 22 Nov 2022 18:31:44 GMTconnection: closeX-Powered-By: Chipdeals Inc{ "success": true, "message": "", "payment": { "reference": "498a8055-1e94-48aa-ba25-703bb8e74ba7", "senderPhoneNumber": "22951010588", "senderCountryCode": "BJ", "senderOperator": "CARD", "senderFirstName": "Iyam", "senderLastName": "EVERICH", "originalCurrency": "XOF", "currency": "XOF", "status": "pending", "statusMessage": "Waiting user validation", "statusMessageCode": 204, "startTimestampInSecond": 1669141903, "endTimestampInSecond": 0, "amount": 250, "originalAmount": 250, "transactionType": "payment", "checkoutUrl": "https://apis.chipdeals.me/momo/checkout/3def8342-feca-4bde-b2d6-2b04715e4f1f/index.html", "successRedirectionUrl": "https://webhook.site/3896e3d6-7014-42f3-a394-a91a04edb367/success", "errorRedirectionUrl": "https://webhook.site/3896e3d6-7014-42f3-a394-a91a04edb367/error" }}
curl --request POST \'https://apis.chipdeals.me/momo/requestpayment?apikey=test_FOdigzgSopV8GZggZa89' \--header 'Content-Type: application/json' \--data-raw '{ "senderFirstName": "Iyam", "senderLastName": "EVERICH", "senderPhoneNumber": "22951010588", "amount": 250, "currency": "XOF", "title": "Mr", "email": "myuser@gmail.com", "address": "Cotonou", "locality": "Litoral", "district": "BJ", "postalCode": "229", "successRedirectionUrl":"https://webhook.site/3896e3d6-7014-42f3-a394-a91a04edb367/success", "errorRedirectionUrl":"https://webhook.site/3896e3d6-7014-42f3-a394-a91a04edb367/error"}'
{ "success": true, "message": "", "payment": { "reference": "7b6ee320-3eed-4262-b3db-6b8939884c96", "senderPhoneNumber": "22951010588", "senderCountryCode": "BJ", "senderOperator": "CARD", "senderFirstName": "Iyam", "senderLastName": "EVERICH", "originalCurrency": "XOF", "currency": "XOF", "status": "pending", "statusMessage": "Waiting user validation", "statusMessageCode": 204, "startTimestampInSecond": 1669141832, "endTimestampInSecond": 0, "amount": 250, "originalAmount": 250, "transactionType": "payment", "checkoutUrl": "https://apis.chipdeals.me/momo/checkout/3def8342-feca-4bde-b2d6-2b04715e4f1f/index.html", "successRedirectionUrl": "https://webhook.site/3896e3d6-7014-42f3-a394-a91a04edb367/success", "errorRedirectionUrl": "https://webhook.site/3896e3d6-7014-42f3-a394-a91a04edb367/error" }}
Redirect link
The typical lifecycle of a customer's payment experience goes as follows:
- When your customers are ready to finalize their purchases, your application must allow them to enter their information and then make a request to Chipdeals.
- The response provides a URL with the
checkoutUrl
property in response. Redirect your customers to this payment page hosted by Chipdeals. - Your customers enter their payment information on the dedicated page and finalize the transaction.
- After validation of the transaction, a redirection is made to the redirection page submitted in the
successRedirectionUrl
orerrorRedirectionUrl
property depending on the state of the transaction. A webhook is then triggered if available.
Test Environment
We can't stress this enough: please test our APIs against our sandbox environment before pushing them into production. We prefer to avoid service interruptions in production caused by untested code.
To test how credit card payments work, please use these dummy card numbers.
Each card number corresponds to a specific instance of the transaction status.
Test number | Case tested |
---|---|
4556 3304 3448 0100 | Your information is incorrectly filled out. Please restart the payment |
4539 7343 2895 5261 | Unable to make this payment. Please try again later |
4111 1111 1111 1111 | Payment successful |
Customer Authentication
Some banks, especially in some more regulated regions, ask their customers to authenticate their purchases (for example by texting them a code which they must then enter on the bank's website). We automatically redirect your customers to this page when necessary.
Permission
The bank verifies that the customer has sufficient funds. If so, these funds are transferred to the merchant's account with us. They will be fully available for transfer after 48 hours. If necessary, the bank sends us a payment failure.
Payment made
The funds move from the issuing bank to the merchant's account.