Setup Intents Use the Setup Intents APIs to save a card and charge it later. For step-by-step instructions on using the Setup Intents APIs, see the set up recurring payments guide. The following Stripe.js methods are available for working with Setup Intents. ## Confirm a setup stripe.confirmSetup(options: object) Use stripe.confirmSetup to confirm a SetupIntent using data collected by the Payment Element, or with manually provided data via confirmParams. When called, stripe.confirmSetup will attempt to complete any required actions, such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. Your user will be redirected to the return_url you pass once the authorization is complete. > The stripe.confirmSetup might take several seconds to complete. > During that time, disable your form from being resubmitted and show a waiting indicator, such as a spinner. If you receive an error result, show this error to the user, re-enable the form, and hide the waiting indicator. - options - elements The Elements instance used to create the Payment Element. Required if you collect payment details before creating an Intent. It's always required if you don't provide a clientSecret. - clientSecret The SetupIntent's client secret. Required if you collect payment details before creating an Intent. It's always required if you don't provide an elements instance containing a client secret. - confirmParams Parameters that will be passed on to the Stripe API. Refer to the Setup Intents API for a full list of parameters. - return_url The URL that Stripe redirects your customer to after they complete authentication. - confirmation_token If collected previously, the ID of the ConfirmationToken to use to confirm this SetupIntent. This is mutually exclusive with the elements parameter. - payment_method_data When you call stripe.confirmSetup, payment details are collected from the Element and passed to the SetupIntents confirm endpoint as the payment_method_data parameter. You can also include additional payment_method_data fields, which will be merged with the data collected from the Element. - billing_details The customer's billing_details. Details collected by Elements will override values passed here. Billing fields that are omitted in the Payment Element via the fields option required. - allow_redisplay Indicates whether the payment method can be displayed to the customer in subsequent checkout flows. The value passed here will override the [allow_redisplay](the relevant part of the product#payment_method_object-allow_redisplay) determined by the provided elements parameter. - expand An array of pass through SetupIntent expansion parameters (learn more). - redirect By default, stripe.confirmSetup will always redirect to your return_url after a successful confirmation. If you set redirect: "if_required", then stripe.confirmSetup will only redirect if your user chooses a redirect-based payment method. Note: Setting if_required requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. When a non-redirect based payment method is successfully confirmed, stripe.confirmSetup will resolve with a {setupIntent} object. ### Example title Confirm a setup intent ## Confirm a SetupIntent by payment method Below are a number of methods used to confirm a SetupIntent for a specific payment method type. ## Confirm card setup stripe.confirmCardSetup(clientSecret: string, data?: object, options?: object) Use stripe.confirmCardSetup in the Setup Intents API flow when the customer submits your payment form. When called, it will confirm the SetupIntent with data you provide and carry out 3DS or other next actions if they are required. 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. > Note that stripe.confirmCardSetup 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. > > Additionally, stripe.confirmCardSetup may trigger a 3D Secure authentication challenge. > This will be shown in a modal dialog and may be confusing for customers using assistive technologies like screen readers. > You should make your form accessible by ensuring that success or error messages are clearly read out after this method completes. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method Either the id of an existing PaymentMethod, or an object containing data to create a PaymentMethod with. See the use case sections below for details. - return_url If you are handling next actions yourself, pass in a return_url. If the subsequent action is redirect_to_url, this URL will be used on the return path for the redirect. - options An options object to control the behavior of this method. - handleActions Set this to false if you want to handle next actions yourself, or if you want to defer next action handling until later (e.g. for use in the PaymentRequest API). Default is true. ### with payment data from an Element ### Data argument properties - payment_method Pass an object to confirm using data collected by a card or cardNumberElement. - card Uses the provided card or cardNumberElement for confirmation. - billing_details The billing_details associated with the card. ### Example title Confirm with an Element ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. ### Example title Confirm with existing payment method ### with an existing token ### Data argument properties - payment_method Pass an object to confirm using an existing token. - card An object of card data. - token Converts the provided token into a PaymentMethod to use for confirmation. - billing_details The billing_details associated with the card. ### Example title Confirm with existing token ### with an attached PaymentMethod ### Example title Confirm with an attached PaymentMethod ### Example title Confirm card setup ## Confirm an ACH Direct Debit setup stripe.confirmUsBankAccountSetup(clientSecret: string, data?: object) Use stripe.confirmUsBankAccountSetup in the Save bank details flow for the ACH Direct Debit payment method to record the customer’s authorization for future payments. When you confirm a SetupIntent, it needs to have an attached PaymentMethod. We suggest using stripe.collectBankAccountForSetup, which automatically collects bank account details and attaches a PaymentMethod. You may also choose to reuse an existing PaymentMethod or manually collect bank account details using the data parameter. These use cases are detailed in the sections that follow. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod or an object of collected data. See use cases below for details. ### with an existing PaymentMethod ### Data argument properties - payment_method The id of an existing PaymentMethod. ### Example title Confirm with an existing PaymentMethod ### with an attached PaymentMethod ### Example title Confirm with an attached PaymentMethod ### with self collected bank account information ### Data argument properties - payment_method Pass an object to confirm using data collected. - billing_details The customer's billing_details. name is required. Providing email allows your customer to receive ACH Direct Debit mandate and microdeposit emails. - name The customer's name. The first and last name must be at minimum 2 characters each. - email The customer's email. - us_bank_account The customer's bank account information. - account_number The customer’s bank account number. - routing_number The routing number of the customer’s bank. - account_holder_type Account holder type: individual or company. - account_type Account type: checkings or savings. Defaults to checking if omitted. ### Example title Confirm with bank account information ### Example title Confirm an ACH Direct Debit setup ## Confirm a Canadian pre-authorized debit setup stripe.confirmAcssDebitSetup(clientSecret: string, data?: object, options?: object) Use stripe.confirmAcssDebitSetup in the Save bank details flow to set up a Canadian pre-authorized debit payment method for future payments. When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the SetupIntent when the user submits the form. 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. stripe.confirmAcssDebitSetup automatically creates a new PaymentMethod for you when your customer completes the modal UI. It can also be called with an existing PaymentMethod, which will load the modal UI to collect a new mandate agreement. These use cases are detailed in the sections that follow. > Note that stripe.confirmAcssDebitSetup may take several seconds to complete. > During that time, disable your form from being resubmitted and show a waiting indicator like a spinner. > If you receive an error result, show it to the customer, re-enable the form, and hide the waiting indicator. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod or an object of collected data. See use cases below for details. - options An options object to control the behavior of this method. - skipMandate Set this to true if you want to skip displaying the mandate confirmation. ### with a new PaymentMethod ### Data argument properties - payment_method Pass an object to confirm using data collected. - billing_details The customer's billing_details. name and email are required. - name The customer's name. The first and last name must be at minimum 2 characters each. - email The customer's email. ### Example title Confirm with a new PaymentMethod ### with an existing PaymentMethod ### Data argument properties - payment_method The id of an existing PaymentMethod. ### Example title Confirm with an existing PaymentMethod ### with an attached PaymentMethod ### Example title Confirm with an attached PaymentMethod ### with self collected bank account information ### Data argument properties - payment_method Pass an object to confirm using data collected. - billing_details The customer's billing_details. name and email are required. - name The customer's name. The first and last name must be at minimum 2 characters each. - email The customer's email. - acss_debit The customer's bank account information. - account_number The customer’s bank account number. - institution_number The institution number of the customer’s bank. - transit_number The transit number of the customer’s bank. ### Example title Confirm with bank account information ### with an existing PaymentMethod but skip mandate display ### Data and options argument paramters - data Data to be sent with the request. - payment_method The id of an existing PaymentMethod. - options An options object to control the behavior of this method. - skipMandate Set to true to skip the on-page modal UI. ### Example title Confirm with an existing PaymentMethod but skip mandate display ### Example title Confirm Canadian pre-authorized debit setup ## Confirm the related setting Debit setup stripe.confirmAuBecsDebitSetup(clientSecret: string, data?: object) Use stripe.confirmAuBecsDebitSetup in the the related setting Direct Debit Payments flow when the customer submits your payment form. When called, it will confirm the SetupIntent with data you provide. 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. > Note that stripe.confirmAuBecsDebitSetup 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod or an object of collected data. See use cases below for details. ### with payment data from an Element ### Data argument properties - payment_method Pass an object to confirm using data collected by an auBankAccount Element. - au_becs_debit An auBankAccountElement. - billing_details The customer's billing_details. name and email are required. - name The customer's name. - email The customer's email. ### Example title Confirm with an Element ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. ### Example title Confirm with existing payment method ### with self collected data ### Data argument properties - payment_method Pass an object to confirm using data collected without an Element. - au_becs_debit An object of self-collected bank account data. - bsb_number A Bank State Branch (BSB) number. - account_number A bank account number. - billing_details The customer's billing_details. name and email are required. - name The account holder's name. - email The customer's email. ### Example title Confirm with self collected data ### Example title Confirm the related setting Debit setup ## Confirm Bacs Debit setup stripe.confirmBacsDebitSetup(clientSecret: string, data?: object) Use stripe.confirmBacsDebitSetup in the Bacs Direct Debit Payments flow when the customer submits your payment form. When called, it will confirm the SetupIntent with data you provide. 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. > Note that stripe.confirmBacsDebitSetup 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod or an object of collected data. See use cases below for details. ### with self collected data ### Data argument properties - payment_method Pass an object to confirm using payment method data. - bacs_debit An object of self-collected bank account data. - account_number A bank account number. - sort_code A sort code. - billing_details The customer's billing_details. name and email are required. - address The account holder's address. - line1 Line 1 of the account holder's address. - city The account holder's city. - country The account holder's country. - postal_code The account holder's postal code. - name The account holder's name. - email The customer's email. ### Example title Confirm with self collected data ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. ### Example title Confirm with existing payment method ### Example title Confirm Bacs Debit setup ## Confirm an Cash App Pay setup stripe.confirmCashappSetup(clientSecret: string, data?: object, options?: object) Use stripe.confirmCashappSetup in the Save payment details flow for the Cash App Pay payment method to record the customer’s authorization for future payments. 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. 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. > Note that stripe.confirmCashappSetup 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod or an object of collected data. See use cases below for details. - return_url The url your customer will be directed to after they complete authentication. - options An options object to control the behavior of this method. - handleActions Set this to false if you would like to [handle displaying the Cash App Pay QR code or handle the authorization redirect](the relevant part of the product?platform=web&ui=API#web-create-setup-intent) yourself. ### Without an existing payment method ### Data argument properties - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with bank account information ### with an existing PaymentMethod ### Data argument properties - payment_method The id of an existing PaymentMethod. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with an existing PaymentMethod ### with an attached PaymentMethod ### Example title Confirm with an attached PaymentMethod ### Example title Confirm a Cash App Pay setup ## Confirm iDEAL setup stripe.confirmIdealSetup(clientSecret: string, data?: object, options?: object) Use stripe.confirmIdealSetup in the Set up future payments flow to use iDEAL bank details to set up a the related setting 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. > 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod or an object of collected data. See use cases below for details. - return_url The url your customer will be directed to after they complete authentication. - options An options object to control the behavior of this method. - handleActions Set this to false if you want to manually handle the authorization redirect. Default is true. ### with payment data from an Element ### Data argument properties - payment_method Pass an object to confirm using data collected by an idealBank Element. - ideal An idealBankElement. - billing_details The customer's billing_details. name and email are required. - name The customer's name. - email The customer's email. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with an Element ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with existing payment method ### with self collected data ### Data argument properties - payment_method Pass an object to confirm using data collected by an idealBank Element. - ideal An object detailing the customer's iDEAL bank. - bank The customer's bank. - billing_details The customer's billing_details. name and email are required. - name The customer's name. - email The customer's email. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with self collected data ### Example title Confirm iDEAL setup ## Confirm a Klarna setup stripe.confirmKlarnaSetup(clientSecret: string, data?: object) Use stripe.confirmKlarnaSetup in the Klarna Payments with Setup Intents flow when the customer submits your setup form. When called, it will confirm the SetupIntent with data you provide, and it will automatically redirect the customer to authorize the setup. Once authorization is complete, the customer will be redirected back to your specified return_url. > Note that stripe.confirmKlarnaSetup 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod. See the use case sections below for details. - return_url The url your customer will be directed to after they complete authentication. ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with existing payment method ### with an attached PaymentMethod ### Example title Confirm with an attached PaymentMethod ### with self collected data ### Data argument properties - payment_method Pass an object to confirm with the customer's email and billing country. - billing_details The customer's billing_details. email and address.country are required. - email The customer's email. - address The customer's billing address. - country The customer's billing country. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with self collected data ### Example title Confirm a Klarna setup ## Confirm a PayPal setup stripe.confirmPayPalSetup(clientSecret: string, data?: object) Use stripe.confirmPayPalSetup in the PayPal Payments with Setup Intents flow when the customer submits your setup form. When called, it will confirm the SetupIntent, and it will automatically redirect the customer to authorize the setup. Once authorization is complete, the customer will be redirected back to your specified return_url. > Note that stripe.confirmPayPalSetup 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod. See the use case sections below for details. - return_url The url your customer will be directed to after they complete authentication. ### with a new PaymentMethod ### Data argument properties - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with a new PaymentMethod ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with existing payment method ### with an attached PaymentMethod ### Example title Confirm with an attached PaymentMethod ### Example title Confirm a PayPal setup ## Confirm a PayTo setup stripe.confirmPayToSetup(clientSecret: string, data?: object, options?: object) Use stripe.confirmPayToSetup in the PayTo Payments with Setup Intents flow when the customer submits your setup form. When called, it will confirm the SetupIntent, and send a request for authorization to the customer. 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. If you've 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. > Note that stripe.confirmPayToSetup might take some time to complete while waiting for customers to authorize the PayTo agreement. > 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method Either the id of an existing PaymentMethod, or an object containing data to create a PaymentMethod with. See the use case sections below for details. - options An options object to control the behavior of this method. - handleActions Set this to false if you want to manually handle polling for SetupIntent updates. Default is true. ### with a new PaymentMethod ### Data argument properties - payment_method Pass payment method billing details. - billing_details The billing_details associated with the payment. The email is required if the customer is paying with PayID. - email - name - payto The PayTo payment method details associated with the customer's bank account. Either pay_id or account_number and bsb_number must be provided. - pay_id - account_number - bsb_number ### Example title Confirm with a new PaymentMethod ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. ### Example title Confirm with existing payment method ### with an attached PaymentMethod ### Example title Confirm with an attached PaymentMethod ### Example title Confirm a PayTo setup ## Confirm the related setting Debit setup stripe.confirmSepaDebitSetup(clientSecret: string, data?: object) Use stripe.confirmSepaDebitSetup in the the related setting Direct Debit with Setup Intents flow when the customer submits your payment form. When called, it will confirm the SetupIntent with data you provide. 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. > Note that stripe.confirmSepaDebitSetup 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod or an object of collected data. See use cases below for details. ### with payment data from an Element ### Data argument properties - payment_method Pass an object to confirm using data collected by an iban Element. - sepa_debit An ibanElement. - billing_details The customer's billing_details. name and email are required. - name The customer's name. - email The customer's email. ### Example title Confirm with an Element ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. ### Example title Confirm with existing payment method ### with self collected data ### Data argument properties - payment_method Pass an object to confirm using data collected by an iban Element. - sepa_debit An object of self-collected the related setting data. - iban An the related setting account number. - billing_details The customer's billing_details. name and email are required. - name The customer's name. - email The customer's email. ### Example title Confirm with self collected data ### Example title Confirm the related setting Debit setup ## Confirm Sofort setup stripe.confirmSofortSetup(clientSecret: string, data?: object, options?: object) Use stripe.confirmSofortSetup in the Set up future payments flow to use the related setting bank details to set up a the related setting 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. > Note that stripe.confirmSofortSetup 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. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method The id of an existing PaymentMethod or an object of collected data. See use cases below for details. - return_url The url your customer will be directed to after they complete authentication. - options An options object to control the behavior of this method. - handleActions Set this to false if you want to manually handle the authorization redirect. Default is true. ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with existing payment method ### with self collected data ### Data argument properties - payment_method Pass an object to confirm with the customer's name and email. - country The country code where customer's bank is located. - billing_details The customer's billing_details. name and email are required. - name The customer's name. - email The customer's email. - return_url The url your customer will be directed to after they complete authentication. ### Example title Confirm with self collected data ### Example title Confirm the related setting setup ## Confirm the related setting setup stripe.confirmTwintSetup(clientSecret: string, data?: object, options?: object) Use stripe.confirmTwintSetup in the the related setting Payments with Setup Intents flow when the customer submits your setup form. When called, it confirms the SetupIntent, and automatically redirects the customer to authorize the setup. After authorization is complete, the customer is redirected back to your specified return_url. > Note that stripe.confirmTwintSetup might take some time to complete while waiting for customers to authorize the setup. > During that time, disable your form from being resubmitted and show a waiting indicator like a spinner. > If you receive an error result, make sure to show the error to the customer, re-enable the form, and hide the waiting indicator. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. Refer to the Setup Intents API for a full list of parameters. - payment_method An object of collected data or an id of an existing PaymentMethod. See the use cases below for details. - return_url The URL your customer is redirected to after they complete authorization. - options An options object to control the behavior of this method. - handleActions Set this to false if you want to manually handle the authorization redirect. Default is true. ### with a new PaymentMethod ### Data argument properties - payment_method Pass an object to confirm using collected data. - type A twint type. - return_url The URL your customer is redirected to after they complete authorization. ### Example title Confirm with a new PaymentMethod ### with an existing payment method ### Data argument properties - payment_method The id of an existing PaymentMethod. - return_url The URL your customer is redirected to after they complete authorization. ### Example title Confirm with existing payment method ### with an attached PaymentMethod ### Data argument properties - return_url The URL your customer is redirected to after they complete authorization. ### Example title Confirm with an attached PaymentMethod ### Example title Confirm the related setting setup ## Retrieve a SetupIntent stripe.retrieveSetupIntent(clientSecret: string) Retrieve a SetupIntent using its client secret. - clientSecret The client secret of the SetupIntent to retrieve. ### Example title Retrieve a SetupIntent ## Verify with micro-deposits for setup stripe.verifyMicrodepositsForSetup(clientSecret: string, data?: object) Use stripe.verifyMicrodepositsForSetup in the Save details for future payments with pre-authorized debit in Canada or Save details for future payments with ACH Direct Debit flow to verify a customer's bank account with micro-deposits. It should be only called when SetupIntent is in the requires_action state, and contains a next_action field that has a type equal to verify_with_microdeposits. Refer to our integration guide for more details. > Verification can fail for several reasons. The failure may happen synchronously as a direct error response, or asynchronously through a payment_intent.payment_failed webhook event. > Refer to our integration guide for more details. - clientSecret The client secret of the SetupIntent. - data Data to be sent with the request. - amounts An array of two positive integers, in cents, equal to the values of the micro-deposits sent to the bank account. - descriptor_code A six-character code starting with SM present in the microdeposit sent to the bank account. ### Example title Verify with micro-deposits for setup ## Handle a next action stripe.handleNextAction(options: object) Use stripe.handleNextAction in the finalizing payments on the server flow to finish confirmation of a SetupIntent with the requires_action status. It will throw an error if the SetupIntent has a different status. Depending on the payment method and required action, the customer may be temporarily redirected from your site and brought back to the return_urlparameter provided when the SetupIntent is confirmed. > Note that stripe.handleNextAction 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. > > Additionally, stripe.handleNextAction may trigger a 3D Secure authentication challenge. > The authentication challenge requires a context switch that can be hard to follow on a screen-reader. > Ensure that your form is accessible by ensuring that success or error messages are clearly read out. - options - clientSecret The client secret of the SetupIntent. ### Example title Handle a next action ## Collect bank account details for setup stripe.collectBankAccountForSetup(options: object) Use stripe.collectBankAccountForSetup in the Save bank details flow for the ACH Direct Debit payment method to collect the customer’s bank account in your payment form. When called, it will automatically load an on-page modal UI to collect bank account details and verification, and attach the PaymentMethod to the SetupIntent. - options Data to be sent with the request. - clientSecret The client secret of the SetupIntent. - params - payment_method_type The payment method type for the bank account details (e.g. us_bank_account) - payment_method_data Payment method specific data to be sent with the request - billing_details The customer's billing_details. name is required. Providing email allows your customer to receive ACH Direct Debit mandate and microdeposit emails. - name The customer's name. The first and last name must be at minimum 2 characters each. - email The customer's email. - address The customer's billing address. - city City, district, suburb, town, or village. - country Two-letter country code (ISO 3166-1 alpha-2). - line1 Address line 1 (e.g., street, PO Box, or company name). - line2 Address line 2 (e.g., apartment, suite, unit, or building). - postal_code ZIP or postal code. - state State, county, province, or region. ### Example title Collect bank account details for setup