Capitec with Direct API
About this guide
This guide explains how to integrate Capitec Pay into your existing Direct API setup. The Direct API integration process is generally the same across all payment methods, with only minor variations in the payment_type_code
and some additional required fields.
What is Capitec Pay?
Capitec Pay is an EFT payment method that offers Capitec users a simpler way to make transactions. Instead of entering bank details or logging into a bank account, users can authorize a one-time or recurring payment using their mobile number or ID number from one of their Capitec accounts.
Availability:
Capitec Pay integration through Direct API is available to the following countries:
- South Africa
If you are not integrated with EBANX Direct API yet, please take a look in this basic guide about it. Are you not sure if EBANX Direct API is the best option for your e-commerce? Please, talk with one of our integration specialists.
What you will need
Before starting your integration, please make sure that you have:
- An EBANX Sandbox account. That's not the case? Please sign up for an Sandbox Account here;
- Capitec Pay enabled in your EBANX Dashboard.
How it works
To complete Capitec Pay integration through EBANX Direct API, please follow the steps below.
Enable Capitec
Capitec Pay availability may vary depending on your contract. So the first step is to check if it is active in your EBANX dashboard.
All set? We can go ahead to next step, otherwise, please get in touch with our integration specialists.
Call the /ws/direct end-point to get the Capitec link (server-side)
With Capitec Pay, consumers are redirected to Capitec Bank app to approve the transaction. To get this redirection link, call the
/ws/direct
endpoint (server-side) with the following required fields:Basic Parameters:
Parameter Description operation
Operation must be request integration_key
Your unique and secret integration key payment_type_code
For Capitec Pay, use capitec-pay country
Two-letter country code - ZA for South Africa Customer Data:
Parameter Description name
Customer name email
Customer email phone_number
Customer phone number Charge Parameters:
Parameter Description merchant_payment_code
Unique merchant payment code currency_code
ISO-4217 Currency code transaction. Supported value: ZAR amount_total
Total amount to be charged notification_urlcountry
URL to notify merchants when a transaction status changes Request example:
curl -L -X POST 'https://sandbox.ebanxpay.com/ws/direct' \-H 'Content-Type: application/json' \--data-raw '{"integration_key": "{{integration_key}}","payment": {"name": "John Example","email": "email@example.com","phone_number": "8522847035","payment_type_code": "capitec-pay","country": "ZA","merchant_payment_code": "merchant_payment_code_here","currency_code": "ZAR","amount_total": "1","redirect_url": "https://your-call-back-url.com","notification_url": "https://your-notification-url.com"}}'A successful request will return a JSON response like the example below. The paying user will need to log into their Capitec Bank app to approve the transaction.
{"payment": {"hash": "63daaad563d447b3b4ab570fc519333b053447befdffcd67","country": "za","merchant_payment_code": "rimi9m6blfagmqga2c1","order_number": "1234567","status": "PE","status_date": null,"open_date": "2023-01-01 01:01:01","confirm_date": null,"transfer_date": null,"amount_br": "50.00","amount_ext": "50.00","amount_iof": "0.00","currency_rate": "1.0000","currency_ext": "ZAR","due_date": "2023-01-01 01:01:01","instalments": "1","payment_type_code": "capitec-pay","redirect_url": "https://sandbox.ebanx.com/ws/redirect/execute?hash=63daaad563d447b3b4ab570fc519333b053447befdffcd67","pre_approved": false,"capture_available": null},"status": "SUCCESS","redirect_url": "https://sandbox.ebanx.com/ws/redirect/execute?hash=63daaad563d447b3b4ab570fc519333b053447befdffcd67"}info
The complete API reference for the end-point
ws/direct
can be found here. We strongly recommend you to take a look in all the available options.Redirect customer to the returned URL
Redirect your customer to the URL returned in the
redirect_url
parameter. After the redirection, your customer will be transferred to the Capitec environment, where they'll complete the steps to finalize their payment securely. At this point you have apending
payment in your EBANX Dashboard.Wait for the payment
Once the customer successfully completes the transaction, it will take some time for EBANX to receive confirmation from Capitec Bank. The payment status will be updated from
pending
toconfirmed
as soon as we receive it. If your customers don't complete the payment within the expiration time, it will be automatically canceled.If your customers don't conclude the payment, it will be automatically canceled.
Getting help
We hope this article was enlightening, but in case we’ve failed to take out your doubts you have the following options to keep on seeking for answers:
- If you’re not our partner yet and would like to know more about our prices and conditions please fill our this form and our commercial team will get in touch with you.
- In case you’re already our partner please get in touch with our support team at integration@ebanx.com.