Save bank details during a Bancontact payment
Learn how to save your customer's IBAN bank details from a Bancontact payment.
Caution
We recommend that you follow the Save payment details during payment guide. If you’ve already integrated with Elements, see the Payment Element migration guide.
Bancontact is a popular single use payment method in Belgium where customers are required to authenticate their payment. Customers pay with Bancontact by redirecting from your website, authorizing the payment, then returning to your website where you get immediate notification on whether the payment succeeded or failed.
You can use Bancontact to save your customer’s IBAN bank details into a SEPA Direct Debit PaymentMethod. You can then use the SEPA Direct Debit PaymentMethod to accept payments or set up a subscription. This reduces friction for your customer as they don’t have to enter their IBAN again. You also receive their verified name and validated IBAN.
Caution
To use Bancontact to set up SEPA Direct Debit payments, you must activate SEPA Direct Debit in the Dashboard. You must also comply with the Bancontact Terms of Service and SEPA Direct Debit Terms of Service.
Accepting Bancontact payments consists of creating a PaymentIntent object to track a payment, collecting payment method details and mandate acknowledgement, and submitting the payment to Stripe for processing. Stripe uses the PaymentIntent to track and handle all the states of the payment until the payment completes. Use the ID of the SEPA Direct Debit PaymentMethod collected from your initial Bancontact PaymentIntent to create future payments.
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 CustomerServer-side
Create a Customer when they create an account with your business and associate it with your internal representation of their account. This enables you to retrieve and use their saved payment method details later.
Create a PaymentIntentServer-side
Create a PaymentIntent
on your server and specify the amount
to collect, the eur
currency, the customer ID, and off_session as an argument for setup future usage. If you have an existing Payment Intents integration, add bancontact
to the list of payment method types.
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.
Collect payment method details and mandate acknowledgementClient-side
Create a payment form on your client to collect the required billing details from the customer.
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.
When your customer submits a payment, Stripe redirects them to the return_
and includes the following URL query parameters. The return page can use them to get the status of the PaymentIntent so it can display the payment status to the customer.
When you specify the return_
, you can also append your own query parameters for use on the return page.
Parameter | Description |
---|---|
payment_ | The unique identifier for the PaymentIntent . |
payment_ | The client secret of the PaymentIntent object. For subscription integrations, this client_secret is also exposed on the Invoice object through confirmation_ |
When the customer is redirected back to your site, you can use the payment_
to query for the PaymentIntent and display the transaction status to your customer.
Charge the SEPA Direct Debit PaymentMethod later
When you need to charge your customer again, create a new PaymentIntent. Find the ID of the SEPA Direct Debit payment method by retrieving the previous PaymentIntent and expanding the latest_
field where you will find the generated_
ID inside of payment_
.
The SEPA Direct Debit payment method ID is the generated_
ID under payment_method_details in the response.
{ "latest_charge": { "payment_method_details": { "bancontact": { "bank_code": "VAPE", "bank_name": "VAN DE PUT & CO", "bics": "VAPEBE22", "iban_last4": "7061", "generated_sepa_debit": "pm_1GrddXGf98efjktuBIi3ag7aJQ", "preferred_language": "en", "verified_name": "Jenny Rosen" }, "type": "bancontact" }, }, "payment_method_options": { "bancontact": {}
Create a PaymentIntent with the SEPA Direct Debit and Customer IDs.
OptionalHandle post-payment events
Stripe sends a payment_intent.succeeded event when the payment completes. Use the Dashboard, a custom webhook, or a partner solution to receive these events and run actions, like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.
Listen for these events rather than waiting on a callback from the client. On the client, the customer could close the browser window or quit the app before the callback executes, and malicious clients could manipulate the response. Setting up your integration to listen for asynchronous events also helps you accept more payment methods in the future. Learn about the differences between all supported payment methods.
Receive events and run business actions 
There are a few options for receiving and running business actions.
Manually
Use the Stripe Dashboard to view all your Stripe payments, send email receipts, handle payouts, or retry failed payments.
Custom code
Build a webhook handler to listen for events and build custom asynchronous payment flows. Test and debug your webhook integration locally with the Stripe CLI.
Prebuilt apps
Handle common business events, like automation or marketing and sales, by integrating a partner application.
OptionalHandle the Bancontact redirect manually
We recommend relying on Stripe.js to handle Bancontact redirects and payments client-side with confirmBancontactPayment
. Using Stripe.js helps extend your integration to other payment methods. However, you can also manually redirect your customers on your server by following these steps:
Create and confirm a PaymentIntent of type
bancontact
. You must provide thepayment_
property, which you should collect from your customer. Note that, by specifyingmethod_ data. billing_ details. name payment_
, a PaymentMethod is created and immediately used with this PaymentIntent.method_ data You must also provide the URL where your customer is redirected to after they complete their payment in the
return_
field. You may optionally provide your own query parameters in this URL. These parameters will be included in the final URL upon completing the redirect flow.url
- Check that the
PaymentIntent
has a status ofrequires_
and the type foraction next_
isaction redirect_
.to_ url
{ "status": "requires_action", "next_action": { "type": "redirect_to_url", "redirect_to_url": { "url": "https://hooks.stripe.com/...", "return_url": "https://example.com/checkout/complete" } }, "id": "pi_1G1sgdKi6xqXeNtkldRRE6HT", "object": "payment_intent", ... }
- Redirect the customer to the URL provided in the
next_
property. This code example is approximate—the redirect method might be different in your web framework.action. redirect_ to_ url. url
Your customer is redirected to the return_
when they complete the payment process. The payment_
and payment_
URL query parameters are included along with any of your own query parameters. Stripe recommends setting up a webhook endpoint to programmatically confirm the status of a payment.