PSE with Direct API
About this guide
This page explains how to add PSE (Pagos Seguros en Línea) to your existing Direct API integration. Direct API integration is basically the same for all payment methods, only varying the payment_type_code
and some additional required fields.
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;
- PSE (Pagos Seguros en Línea) enabled in your EBANX Dashboard.
How it works
To complete PSE integration through EBANX Direct API, please follow the steps below.
Enable PSE (Pagos Seguros en Línea)
PSE 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.
Get the available banks to work with PSE (Pagos Seguros en Línea)
To get the list of available banks for PSE, you must call the end-point
/ws/getBankList
.curl -X GET -G 'https://sandbox.ebanxpay.com/ws/getBankList' \-d 'integration_key=your_test_integration_key' \-d 'country_code=co'A successful request will return a array with JSON objects similar to the one below.
[{"code":"banco_agrario","name":"BANCO AGRARIO"},{"code":"banco_av_villas","name":"BANCO AV VILLAS"},{"code":"banco_bbva_colombia_s.a.","name":"BANCO BBVA COLOMBIA S.A."},...]note
To make a payment with PSE, your customers must select which bank they would like to use. The
name
of the banks in responde above, should be displayed in a drop-down field in your payment form (like the example below) and the bankcode
of the selected bank, must be used in the parametereft_code
in the next step.With the response above, your customers will have to s
Call the /ws/direct end-point to get the PSE link (server-side)
With PSE, your consumers are redirected to their online-banking website and the payment is made safely and quickly. To get this redirection link, you just need to call the end-point
ws/direct
(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
To PSE must be eft
eft_code
Code of the selected bank country
Two-letter country code - co
for Colombia.Customer data:
Parameter Description name
Customer name email
Customer e-mail document
Customer Cedula de Ciudadania, Cédula de Extrangeria or NIT. It must be a valid document code. phone_number
Customer phone number Charge parameters:
Parameter Description merchant_payment_code
Unique merchant payment code currency_code
ISO-4217 Currency code of your transaction. Supported values: COP
,USD
andEUR
.amount_total
Total amount to be charged Check the example:
curl -L -X POST 'https://sandbox.ebanxpay.com/ws/direct' \-H 'Content-Type: application/json' \--data-raw '{"integration_key": "{{integratio_key}}","operation": "request","payment": {"name": "José Silva","email": "josecolombia@example.com","phone_number": "0405777687","document": "4023030074","country": "co","payment_type_code": "eft","eft_code": "banco_agrario","merchant_payment_code": "0x0W28D03-T01","currency_code": "COP","amount_total": "100"}}'A successful request will return a JSON response like the one below. The redirection link to PSE environment will be in the parameter
payment.redirect_url
.{"payment": {"hash": "5efc8aca4b12fbb7f069deca9a3cb61c18feb68415aeca4c","pin": "489328391","country": "co","merchant_payment_code": "0x0W28D03-T01","order_number": null,"status": "PE","status_date": null,"open_date": "2020-07-01 13:08:26","confirm_date": null,"transfer_date": null,"amount_br": "100.00","amount_ext": "100.00","amount_iof": "0.00","amount_ext_requested": "100.00","currency_rate": "1.0000","currency_ext": "COP","due_date": "2020-07-04","instalments": "1","payment_type_code": "eft","redirect_url": "https://sandbox.ebanx.com/ws/redirect/execute?hash=5efc8aca4b12fbb7f069deca9a3cb61c18feb68415aeca4c","pre_approved": false,"capture_available": null},"status": "SUCCESS","redirect_url": "https://sandbox.ebanx.com/ws/redirect/execute?hash=5efc8aca4b12fbb7f069deca9a3cb61c18feb68415aeca4c"}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 parameter
redirect_url
. After the redirection, your customers will select the bank and betransferred to their online-banking environment, with all the necessary purchase details to finalize their payment securely and easily.At this point you have a
pending
payment in your EBANX Dashboard.Sandbox environment
You can test this integration in our Sandbox environment as we offer a Online-Banking mock interface.
Check it below:
Wait for the payment
After the payment in the Customer's online-banking environment, it will take sometime to EBANX get informed by the bank. As soon as we get the confirmation, payment status is modified from
pending
toconfirmed
.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.