Sign in
An image of the Stripe logo
Create account
Sign in
Home
Payments
Business operations
Financial services
Developer tools
All products
Home
Payments
Business operations
Home
Payments
Business operations
Financial services
Developer tools
Support
Overview
Overview
Payment method integration options
Bank debits
Bank redirects
Bancontact
Accept a payment
Save bank details during payment
Set up future payments
BLIK
EPS
FPX
giropay
iDEAL
Przelewy24
Sofort
Bank transfers
Buy now, pay later
Credit transfers (Sources)
Real-time payments
Vouchers
Wallets
Testing
No-code options
HomePaymentsBank redirectsBancontact

Save bank details during a Bancontact payment

Learn how to save your customer's IBAN bank details from a Bancontact payment.

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.

SEPA Direct Debit

See accepting SEPA Direct Debit payments to integrate without Bancontact.

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.

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 Stripe
Server-side

First, you need a Stripe account. Register now.

Use our official libraries for access to the Stripe API from your application:

Terminal
# For detailed setup, see our quickstarts at https://stripe.com/docs/development/quickstart bundle add stripe bundle install

Create a Customer
Server-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.

Terminal
curl https://api.stripe.com/v1/customers \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
: \ -X "POST"

Create a PaymentIntent
Server-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.

curl https://api.stripe.com/v1/payment_intents \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
: \ -d amount=1099 \ -d currency=eur \ -d "payment_method_types[]"=bancontact \ -d customer="{{CUSTOMER_ID}}" \ -d setup_future_usage=off_session

The PaymentIntent includes the payment method ID and a client secret, which is used on the client side to securely complete the payment process instead of passing the entire PaymentIntent object.

You can retrieve the client secret from an endpoint on your server using the browser’s fetch function on the client side. This is generally the best approach when your client side is a single-page application, especially one built with a modern frontend framework such as React. This example shows how to create the server endpoint that serves the client secret:

main.rb
get '/secret' do intent = # ... Create or retrieve the PaymentIntent {client_secret: intent.client_secret}.to_json end

This example demonstrates how to fetch the client secret with JavaScript on the client side:

var response = fetch('/secret').then(function(response) { return response.json(); }).then(function(responseJson) { var clientSecret = responseJson.client_secret; // Call stripe.confirmBancontactPayment() with the client secret. });

Collect payment method details and mandate acknowledgement
Client-side

Create a payment form on your client to collect the required billing details from the customer.

​​To process SEPA Direct Debit payments, you must collect a mandate agreement from your customer. Display the following standard authorization text for your customer to implicitly sign the mandate.

Replace Rocket Rides with your company name.

By providing your payment information and confirming this payment, you authorise (A) Rocket Rides and Stripe, our payment service provider and/or PPRO, its local service provider, to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with those instructions. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited. Your rights are explained in a statement that you can obtain from your bank. You agree to receive notifications for future debits up to 2 days before they occur.

​​Setting up a payment method or confirming a PaymentIntent creates the accepted mandate. As the customer has implicitly signed the mandate, you must communicate these terms in your form or through email.

FieldValue
nameThe full name (first and last) of the customer.
emailThe customer’s email.
checkout.html
<form id="payment-form"> <div class="form-row"> <label for="name"> Name </label> <input id="name" name="name" required> </div> <div class="form-row"> <label for="email"> Email </label> <input id="email" name="email" required> </div> <button id="submit-button">Pay with Bancontact</button> <!-- Display mandate acceptance text. --> <div id="mandate-acceptance"> By providing your payment information and confirming this payment, you authorise (A) Rocket Rides and Stripe, our payment service provider, to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with those instructions. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited. Your rights are explained in a statement that you can obtain from your bank. You agree to receive notifications for future debits up to 2 days before they occur. </div> <!-- Used to display form errors. --> <div id="error-message" role="alert"></div> </form>

Submit the payment to Stripe
Client-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.

Call stripe.confirmBancontactPayment to redirect your customer to Bancontact’s website or app to complete the payment. Include a return_url to redirect your customer after they complete the payment. You must also provide the customer’s full name and email in billing_details.

client.js
var stripe = Stripe(
'pk_test_TYooMQauvdEDq54NiTphI7jx'
); var accountholderName = document.getElementById('name'); var accountholderEmail = document.getElementById('email'); // Redirects away from the client stripe.confirmBancontactPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { billing_details: { name: accountholderName.value, email: accountholderEmail.value, }, }, return_url: 'https://example.com/checkout/complete', } ).then(function(result) { if (result.error) { // Inform the customer that there was an error. } });

The return_url should correspond to a page on your website that provides the status of the payment, by verifying the status of the PaymentIntent when rendering the return page. When Stripe redirects the customer to the return_url, the following URL query parameters are provided to verify the status. You may also append your own query parameters to the return_url. They persist throughout the redirect process.

ParameterDescription
payment_intentThe unique identifier for the PaymentIntent
payment_intent_client_secretThe client secret of the PaymentIntent object

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.

curl https://api.stripe.com/v1/payment_intents/{{PAYMENT_INTENT_ID}} \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
:

The SEPA Direct Debit payment method ID is the generated_sepa_debit ID under payment_method_details in the response.

{ "charges": { "data": [ { "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" }, "id": "src_16xhynE8WzK49JbAs9M21jaR",

Create a PaymentIntent with the SEPA Direct Debit and Customer IDs.

curl https://api.stripe.com/v1/payment_intents \ -u
sk_test_4eC39HqLyjWDarjtT1zdp7dc
: \ -d "payment_method_types[]"=sepa_debit \ -d amount=1099 \ -d currency=eur \ -d customer=
"{{CUSTOMER_ID}}"
\ -d payment_method="{{SEPA_DEBIT_PAYMENT_METHOD_ID}}" \ -d confirm=true

Test your integration

Set payment_method.billing_details.email to one of the following values to test the PaymentIntent status transitions. You can include your own custom text at the beginning of the email address followed by an underscore. For example, test_1_generatedSepaDebitIntentsFail@example.com results in a SEPA Direct Debit PaymentMethod that always fails when used with a PaymentIntent.

Email AddressDescription
generatedSepaDebitIntentsSucceed@example.comThe PaymentIntent status transitions from processing to succeeded.
generatedSepaDebitIntentsSucceedDelayed@example.comThe PaymentIntent status transitions from processing to succeeded after three minutes.
generatedSepaDebitIntentsFail@example.comThe PaymentIntent status transitions from processing to requires_payment_method.
generatedSepaDebitIntentsFailDelayed@example.comThe PaymentIntent status transitions from processing to requires_payment_method after three minutes.
generatedSepaDebitIntentsSucceedDisputed@example.comThe PaymentIntent status transitions from processing to succeeded, but a dispute is created immediately.

OptionalHandle post-payment events

OptionalHandle the Bancontact redirect manually

See also

  • Accept a SEPA Direct Debit payment
  • Set up a subscription with SEPA Direct Debit in the EU
Was this page helpful?
Questions? Contact us.
View developer tutorials on YouTube.
Check out our product changelog.
Powered by Markdoc
You can unsubscribe at any time. Read our privacy policy.
On this page
Set up Stripe
Create a Customer
Create a PaymentIntent
Collect payment method details and mandate acknowledgement
Submit the payment to Stripe
Charge the SEPA Direct Debit PaymentMethod later
Test your integration
Handle post-payment events
Handle the Bancontact redirect manually
Stripe Shell
Test mode
▗▄ ▄▟█ █▀▀ ▗▟████▙▖ ██████ ███▗▟█ ███ ███▗▟██▙▖ ▗▟█████▙▖ ███▖ ▀▀ ███ ███▀▀▀ ███ ███▀ ███ ███ ███ ▝▜████▙▖ ███ ███ ███ ███ ███ █████████ ▄▄ ▝███ ███ ▄ ███ ███ ███▄ ███ ███ ▄▄ ▝▜████▛▘ ▝▜███▛ ███ ███ ███▝▜██▛▘ ▝▜█████▛▘ ███ ▀▘
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Login to Stripe docs and press Control + Backtick on your keyboard to start managing your Stripe resources in test mode. - View supported commands: - Find webhook events: - Listen for webhook events: - Call Stripe APIs: stripe [api resource] [operation] (e.g. )
The Stripe Shell is best experienced on desktop.
$