Accept a Bancontact payment
Learn how to accept Bancontact, a common payment method in Belgium.
Bancontact is a single use payment method where customers are required to authenticate their payment. Customers pay with Bancontact by redirecting from your app, authenticating the payment, then returning to your app where you get immediate notification on whether the payment succeeded or failed.
Remarque
Your use of Bancontact must be in accordance with the Bancontact Terms of Service.
Set up StripeServer-side
First, you need a Stripe account. Register now.
Use our official libraries for access to the Stripe API from your application:
Create a PaymentIntentServer-side
A PaymentIntent is an object that represents your intent to collect payment from a customer and tracks the lifecycle of the payment process through each stage.
Create a PaymentIntent
on your server and specify the amount to collect and the eur
currency (Bancontact does not support other currencies). If you have an existing Payment Intents integration, add bancontact
to the list of payment method types.
The default language of the Bancontact authorization page is English (en
). You can match the preferred language of your customer by setting preferred_
to fr
, nl
, or de
.
Retrieve the client secret
The PaymentIntent includes a client secret that the client side uses to securely complete the payment process. You can use different approaches to pass the client secret to the client side.
Submit the payment to StripeClient-side
Create a payment on the client side with the client secret of the PaymentIntent
. The client secret is different from your API keys that authenticate Stripe API requests. It should be handled carefully because it can complete the charge. Do not log it, embed it in URLs, or expose it to anyone but the customer.
Handling the redirect
The following URL query parameters are provided when Stripe redirects the customer to the return_
.
Parameter | Description |
---|---|
payment_ | The unique identifier for the PaymentIntent . |
payment_ | The client secret of the PaymentIntent object. |
You may also append your own query parameters when providing the return_
. They persist throughout the redirect process. The return_
should correspond to a page on your website that provides the status of the payment. You should verify the status of the PaymentIntent
when rendering the return page. You can do so by using the retrievePaymentIntent
function from Stripe.js and passing in the payment_
.
(async () => { const url = new URL(window.location); const clientSecret = url.searchParams.get('payment_intent_client_secret'); const {paymentIntent, error} = await stripe.retrievePaymentIntent(clientSecret); if (error) { // Handle error } else if (paymentIntent && paymentIntent.status === 'succeeded') { // Handle successful payment } })();
Bank account details
You can find details about the bank account the customer used to complete the payment on the resulting charge under payment_method_details.
{ "charges": { "data": [ { "payment_method_details": { "bancontact": { "bank_code": "VAPE", "bank_name": "VAN DE PUT & CO", "bics": "VAPEBE22", "iban_last4": "7061", "preferred_language": "en", "verified_name": "Jenny Rosen" }, "type": "bancontact" }, "id": "src_16xhynE8WzK49JbAs9M21jaR", "object": "source",