## Handle card setup with an Element *`handleCardSetup` has been renamed to [confirmCardSetup](#stripe_confirm_card_setup). In addition to the rename, we have slightly modified the arguments. These changes do not affect the behavior of the method. While we have no plans to ever remove support for `handleCardSetup`, we think the new name and arguments are easier to understand and better convey what the method is doing.* Use `stripe.handleCardSetup(clientSecret, element, data?)` in the [Setup Intents API flow](/payments/save-and-reuse.md) when the customer submits your payment form. It will gather payment information from the `element`, which can be a `card` or `cardNumber` element, along with any other data you provide. It will then confirm the `SetupIntent` and carry out 3DS or other `next_action`s if they are required. > Note that `stripe.handleCardSetup` 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.handleCardSetup` may trigger a [3D Secure](/payments/3d-secure.md) 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. 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.handleCardSetup(...)` - `clientSecret` (string) **required** The [client secret](/api/setup_intents/object.md#setup_intent_object-client_secret) of the `SetupIntent`. - `element` (Element) **required** A `card` or `cardNumber` Element that will be used to create a payment method. - `data` (object) Data to be sent with the request. - `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. ### Handle card setup ```js stripe.handleCardSetup( '{SETUP_INTENT_CLIENT_SECRET}', element, { payment_method_data: { billing_details: { name: 'Jenny Rosen' } } } ).then(function(result) { // Handle result.error or result.setupIntent }); ``` ```es_next const {setupIntent, error} = await stripe.handleCardSetup( '{SETUP_INTENT_CLIENT_SECRET}', element, { payment_method_data: { billing_details: { name: 'Jenny Rosen' } } } ); ```