## Confirm a Setup Intent with an Element *`confirmSetupIntent` has been deprecated. Going forward, if you wish to confirm on the client without handling next actions, simply pass `{handleActions: false}` as a third argument to [confirmCardSetup](#stripe_confirm_card_setup). While we have no plans to ever remove support for `confirmSetupIntent`, we think that explicitly opting out of next action handling is easier to understand and will better convey what the method is doing.* Use `stripe.confirmSetupIntent(clientSecret, element, data)` when the customer submits your save payment method form. It will gather payment information from `element`, along with any other `data` you provide, and confirm the `SetupIntent`. Only use this method if you want to [handle next actions yourself](/payments/payment-intents/verifying-status.md#next-actions). Otherwise, use [stripe.handleCardSetup](#stripe_handle_card_payment). > Note that `stripe.confirmSetupIntent` 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. A Promise which resolves with a `result` object. The object will have either: * `result.setupIntent`: the successful [SetupIntent](/api/setup_intents). * `result.error`: An error. Refer to the [API reference](/api/errors) for all possible errors. **Syntax:** `stripe.confirmSetupIntent(...)` - `clientSecret` (string) **required** The [client secret](/api/setup_intents/object.md#setup_intent_object-client_secret) of the `SetupIntent` to confirm. - `element` (Element) **required** An [Element](/js/element.md) that will be used to create a payment method. - `data` (object) Data to be sent with the request. It can contain the following parameters - `payment_method_data` (object) Use this parameter to supply additional data relevant to the payment method, such as billing details. - `billing_details` (object) The [billing details](/api/payment_methods/create.md#create_payment_method-billing_details) associated with the card. ### Confirm a SetupIntent ```js stripe.confirmSetupIntent( '{SETUP_INTENT_CLIENT_SECRET}', element, { payment_method_data: { billing_details: { name: 'Jenny Rosen' } }, return_url: 'https://example.com/return_url' } ).then(function(result) { // Handle result.error or result.setupIntent }); ``` ```es_next const {setupIntent, error} = await stripe.confirmSetupIntent( '{SETUP_INTENT_CLIENT_SECRET}', element, { payment_method_data: { billing_details: { name: "Jenny Rosen" } }, return_url: 'https://example.com/return_url' } ); ```