## Confirm TWINT setup

`stripe.confirmTwintSetup(clientSecret: string, data?: object, options?: object)`

Use `stripe.confirmTwintSetup` in the [TWINT Payments with Setup Intents](https://docs.stripe.com/payments/twint/set-up-future-payments.md) 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](https://docs.stripe.com/api/setup_intents/object.md#setup_intent_object-client_secret) of the `SetupIntent`.

- `data`
  Data to be sent with the request.
Refer to the [Setup Intents API](https://docs.stripe.com/api/setup_intents/confirm.md) for a full list of parameters.
    - `payment_method`
      An object of collected data or an `id` of an existing [PaymentMethod](https://docs.stripe.com/api/payment_methods.md).
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 TWINT setup
```
