Use iDEAL to set up future SEPA Direct Debit payments
Learn how to save bank details from an iDEAL payment and charge your customers later with SEPA Direct Debit.
Caution
We recommend that you follow the Set up future payments guide. If you’ve already integrated with Elements, see the Payment Element migration guide.
iDEAL is a single use payment method where customers are required to authenticate each payment. With this integration, Stripe charges your customer 0.01 EUR through iDEAL to collect their bank details. After your customer authenticates the payment, Stripe refunds the payment and stores your customer’s IBAN in a SEPA Direct Debit payment method. You can then use the SEPA Direct Debit PaymentMethod to accept payments or set up a subscription.
Caution
To use iDEAL to set up SEPA Direct Debit payments, you must activate SEPA Direct Debit in the Dashboard. You must also comply with the iDEAL Terms of Service and SEPA Direct Debit Terms of Service.
Setting up future SEPA Direct Debit payments using iDEAL in your app consists of creating a SetupIntent to track the process, collecting mandate acknowledgement, and redirecting your customer to iDEAL. Stripe uses the SetupIntent to track and handle all the states of the setup until the setup completes.
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 SetupIntentServer-side
Create a SetupIntent
with the Customer’s ID and set payment_method_types to ideal
. The SetupIntent
tracks the steps of the set-up process. For iDEAL, this includes collecting a SEPA Direct Debit mandate from the customer and tracking its validity.
Collect payment method detailsClient-side
Collect payment details on the client with the Payment Element. The Payment Element is a pre-built UI component that simplifies collecting payment details for a variety of payment methods.
The Payment Element contains an iframe that securely sends payment information to Stripe over an HTTPS connection. Avoid placing the Payment Element within another iframe because some payment methods require redirecting to another page for payment confirmation.
The checkout page address must start with https://
rather than http://
for your integration to work. You can test your integration without using HTTPS, but remember to enable it when you’re ready to accept live payments.
Submit the payment method details to StripeClient-side
Rather than sending the entire SetupIntent object to the client, use its client secret. This is different from your API keys that authenticate Stripe API requests. The client secret should be handled carefully because it can complete the setup. Do not log it, embed it in URLs, or expose it to anyone but the customer.
Use stripe.confirmSetup to complete the setup intent using details from the Payment Element. Provide a return_url to this function to indicate where Stripe redirects the user after they complete the setup intent. Your user might first be redirected to an intermediate site, such as a bank authorisation page, before being redirected to the return_
.
Make sure the return_
corresponds to a page on your website that provides the status of the setup intent. When Stripe redirects the customer to the return_
, we provide the following URL query parameters:
Parameter | Description |
---|---|
setup_ | The unique identifier for the SetupIntent . |
setup_ | The client secret of the SetupIntent object. |
Charge the SEPA Direct Debit PaymentMethod laterServer-side
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 SetupIntent and expanding the latest_
field where you will find the generated_
ID inside of payment_
.
Create a PaymentIntent with the SEPA Direct Debit and Customer IDs.
Test your integration
Using your test API keys to confirm the SetupIntent. After confirming, you’re redirected to a test page with options to authorise or fail the payment method setup.
- Click Authorize test payment to test the case when the setup is successful. The SetupIntent transitions from
requires_
toaction succeeded
. - Click Fail test payment to test the case when the customer fails to authenticate. The SetupIntent transitions from
requires_
toaction requires_
.payment_ method