Bancontact
Bancontact is a Belgian company that offers user-friendly solutions for easy everyday shopping experience.
About Bancontact
Bancontact Payconiq Company provides a simple and reliable online payment solution. Customers can pay with their Bancontact cards or using the Payconiq app.
Accept a Bancontact payment
To accept a Bancontact payment, follow the steps below.
When testing, do not use real customer data. Use the test data prepared by Unzer.
Step 1: Create a bancontact
resource
Make a POST call to /types/bancontact
, with the following parameters in the request body:
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
holder |
No | String | / |
The account holder’s name. |
POST https://api.unzer.com/v1/types/bancontact
Body:
{
"holder" : "test"
}
{
"id": "s-bct-otvqlpgqsh7u",
"method": "bancontact"
}
Property | Type | Description |
---|---|---|
id |
String | The ID of the customers resource that you just created. |
method |
String | The payment method. |
Step 2: Make a charges
call
To charge the Bancontact resource, make a payments/charges
call with the following parameters in the request body:
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
amount |
Yes | Number | / |
The amount to be charged. |
currency |
Yes | String | / |
The transaction currency, in the ISO 4217 alpha-3 format. |
returnUrl |
No | String | / |
After the customer confirms the payment on the Unzer Bank Transfer payment page, returnUrl is called to redirect customer to the shop’s website. |
typeId |
Yes | String | / |
The newly-created payment type ID that you received in response to creating an Unzer Bank Transfer resource (Step 1). |
customerId |
No | String | / |
The ID of the customers resource to be used. |
metadataId |
No | String | / |
The ID of the metadata resource to be used. |
POST https://api.unzer.com/v1/payments/charges
Body:
{
"amount" : "50",
"currency" : "EUR",
"returnUrl" : "https://www.unzer.com",
"orderId": "",
"resources" : {
"typeId" : "s-bct-otvqlpgqsh7u",
"metadataId": "",
"customerId": ""
}
}
{
"id": "s-chg-1",
"isSuccess": false,
"isPending": true,
"isError": false,
"redirectUrl": "https://dev-payment.unzer.com/v1/redirect/bancontact/laksjdfloikwjerklj2lk3j",
....
}
Property | Type | Description |
---|---|---|
id |
String | The transaction’s unique ID. |
isSuccess |
Boolean | Set to true if the transaction was successful. |
isPending |
Boolean | Set to true if the transaction is pending (e.g. if a redirect to an external system is required). |
isError |
Boolean | Set to true if an error occurs. |
redirectUrl |
String | The URL to which the customer will get redirected after the payment. |
Step 3: Forward the customer to the redirect URL
After you charge the Bancontact resource, implement the following flow:
- Redirect the customer to the
redirectUrl
that you received in response to thecharges
call (Step 2). - The customer is forwarded to the Bancontact payment page.
- After a successful payment, the customer is redirected to the
returnURL
that you specified in thecharges
call (Step 2).
Step 4: Check the payment status
After the customer is redirected to the returnUrl
, check the status of the payment.
Make a GET call with the following parameters in the request path:
Parameter | Required | Type | Default | Description | Example |
---|---|---|---|---|---|
resource_ID |
Yes | String | / |
The returned ID of the bancontact resource that you created in Step 1. |
s-bct-otvqlpgqsh7u |
transaction_ID |
Yes | String | / |
The transaction’s unique ID that you received in Step 2. | s-chg-1 |
GET https://api.unzer.com/v1/payments/{resource_ID}>/charges/{transaction_ID}
{
"id": "s-chg-1",
"isSuccess": true,
"isPending": false,
"isError": false,
"redirectUrl": "",
...
}
Property | Type | Description |
---|---|---|
id |
String | The transaction’s unique ID. |
isSuccess |
Boolean | Set to true if the transaction was successful. |
isPending |
Boolean | Set to true if the transaction is pending (e.g. if a redirect to an external system is required). |
isError |
Boolean | Set to true if an error occurs. |
redirectUrl |
String | The URL to which the customer will get redirected after the payment. |