Setup Intents
Confirm a SetupIntent by payment method
Confirm iDEAL setup

stripe.confirmIdealSetup(clientSecret,data?,options?)

Use stripe.confirmIdealSetup in the Set up future payments flow to use iDEAL bank details to set up a SEPA Direct Debit payment method for future payments. When called, it will confirm a SetupIntent with data you provide, and it will automatically redirect the customer to authorize the transaction. Once authorization is complete, the customer will be redirected back to your specified return_url. Note that there are some additional requirements to this flow that are not covered in this reference. Refer to our integration guide for more details.

When you confirm a SetupIntent, it needs to have an attached PaymentMethod. In addition to confirming the SetupIntent, this method can automatically create and attach a new PaymentMethod for you. It can also be called with an existing PaymentMethod, or if you have already attached a PaymentMethod you can call this method without needing to provide any additional data. These use cases are detailed in the sections that follow.

Method parameters
  • clientSecret required string

    The client secret of the SetupIntent.

  • data optional object

    Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters.

    Hide data properties
    • payment_method recommended object | string

      The id of an existing PaymentMethod or an object of collected data. See use cases below for details.

    • return_url recommended string

      The url your customer will be directed to after they complete authentication.

  • options optional object

    An options object to control the behavior of this method.

    Hide options properties

Returns

stripe.confirmIdealSetup will return a Promise which resolves with a result object. This object has either:

  • result.setupIntent: the successful SetupIntent.
  • result.error: an error. Refer to the API reference for all possible errors.

Note that stripe.confirmIdealSetup may take several seconds to complete. During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner. If you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator.

Confirm iDEAL setup
1
2
3
4
5
6
7
8
9
10
11
12
13
stripe .confirmIdealSetup('{SETUP_INTENT_CLIENT_SECRET}', { payment_method: { ideal: idealBankElement, billing_details: { name: 'Jenny Rosen', email: 'jenny@example.com', }, }, }) .then(function(result) { // Handle result.error or result.setupIntent });
Confirm iDEAL setup

with payment data from an Element

Create and attach a new SEPA Direct Debit PaymentMethod with stripe.confirmIdealSetup by passing an idealBank Element to payment_method[ideal]. The new PaymentMethod will be created with the data collected by the Element and will be used to confirm the SetupIntent. Additionally, to create a SEPA Direct Debit PaymentMethod, you are required to collect and include the customer’s name and email address.

Data argument properties
  • payment_method required object

    Pass an object to confirm using data collected by an idealBank Element.

    Hide payment_method properties
    • ideal required Element

      An idealBank Element.

    • billing_details required object

      The customer's billing_details. name and email are required.

      Hide billing_details properties
      • name required string

        The customer's name.

      • email required string

        The customer's email.

  • return_url recommended string

    The url your customer will be directed to after they complete authentication.

Confirm with an Element
1
2
3
4
5
6
7
8
9
10
11
12
13
stripe .confirmIdealSetup('{SETUP_INTENT_CLIENT_SECRET}', { payment_method: { ideal: idealBankElement, billing_details: { name: 'Jenny Rosen', email: 'jenny@example.com', }, }, }) .then(function(result) { // Handle result.error or result.setupIntent });
Confirm iDEAL setup

with an existing payment method

If you have already created a PaymentMethod, you can pass its id to payment_method when calling stripe.confirmIdealSetup and it will be used to confirm the SetupIntent.

Data argument properties
  • payment_method required string

    The id of an existing PaymentMethod.

  • return_url recommended string

    The url your customer will be directed to after they complete authentication.

Confirm with existing payment method
1
2
3
4
5
6
7
stripe .confirmIdealSetup('{SETUP_INTENT_CLIENT_SECRET}', { payment_method: '{PAYMENT_METHOD_ID}', }) .then(function(result) { // Handle result.error or result.setupIntent });
Confirm iDEAL setup

with self collected data

If you already know the customer’s bank or want to collect it yourself, then you do not need to use the idealBank Element. You can pass in the customer’s bank code directly to create a new PaymentMethod and confirm the SetupIntent.

Data argument properties
  • payment_method required object

    Pass an object to confirm using data collected by an idealBank Element.

    Hide payment_method properties
    • ideal required object

      An object detailing the customer's iDEAL bank.

      Hide ideal properties
      • bank required string

        The customer's bank.

    • billing_details required object

      The customer's billing_details. name and email are required.

      Hide billing_details properties
      • name required string

        The customer's name.

      • email required string

        The customer's email.

  • return_url recommended string

    The url your customer will be directed to after they complete authentication.

Confirm with self collected data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
stripe .confirmIdealSetup('{SETUP_INTENT_CLIENT_SECRET}', { payment_method: { ideal: { bank: 'abn_amro', }, billing_details: { name: 'Jenny Rosen', email: 'jenny@example.com', }, }, // Return URL where the customer should be redirected after the authorization. return_url: window.location.href, }) .then(function(result) { if (result.error) { // Inform the customer that there was an error. } });