## Confirm a Customer Balance payment

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

Use `stripe.confirmCustomerBalancePayment` in the [Customer Balance](https://docs.stripe.com/payments/customer-balance.md) payment flow when the customer submits your payment form.
When called, it will confirm the [PaymentIntent](https://docs.stripe.com/api/payment_intents.md) with `data` you provide.
Refer to our [integration guide](https://docs.stripe.com/payments/bank-transfers/accept-a-payment.md) for more details.

Since the [Customer Balance](https://docs.stripe.com/payments/customer-balance.md) payment method draws from a balance, the attempt will succeed or fail depending on the current balance amount.
To collect more funds from the customer when the cash balance is insufficient, use the customer balance with [bank transfer funding](https://docs.stripe.com/payments/bank-transfers/accept-a-payment.md) parameters.

The confirmation attempt will finish in one of the following result states:
1. If the customer balance is greater than or equal to the amount, the PaymentIntent response will have a `status` of `succeeded`. The `funding_type` will be ignored.
2. If the customer balance is less than the amount, and you do not set the `funding_type`, the PaymentIntent response will have a `status` of `requires_payment_method`.
3. If the customer balance is less than the amount, and you set the `funding_type`, the PaymentIntent response will have a `status` of `requires_action`. The `paymentIntent.next_action.display_bank_transfer_instructions` hash will contain bank transfer details for funding the [Customer Balance](https://docs.stripe.com/payments/customer-balance.md).

> Note that `stripe.confirmCustomerBalancePayment` 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](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-client_secret) of the `PaymentIntent`.

- `data`
  Data to be sent with the request.
Refer to the [Payment Intents API](https://docs.stripe.com/api/payment_intents/confirm.md) for a full list of parameters.
    - `payment_method`
      An object specifying the `customer_balance` type.
      - `customer_balance`
        Set to `{}`.
    - `payment_method_options`
      Additional payment specific configuration options. See the [with collected data](#stripe_confirm_customer_balance_payment-collected) use case below.

- `options`
  An options object to control the behavior of this method.
    - `handleActions`
      Set to `false`.
The [Customer Balance](https://docs.stripe.com/payments/customer-balance.md) does not handle the next actions for you automatically (e.g. displaying bank transfer details). To make future upgrades easier, this option is required to always be sent. Please refer to our [Stripe Customer Balance integration guide](https://docs.stripe.com/payments/bank-transfers.md) for more info.

### with collected data

### Data argument properties

- `payment_method`
  Pass an object to confirm using data collected.
    - `customer_balance`
      Set to `{}`.

- `payment_method_options`
  Additional payment-specific configuration options.
    - `funding_type`
      The funding method type to be used when there are not enough funds in the [Customer Balance](https://docs.stripe.com/payments/customer-balance.md). Permitted values include: `bank_transfer`.
    - `bank_transfer`
      The customer's chosen bank transfer method.
      - `type`
        The list of bank transfer types allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, or `mx_bank_account`.
      - `eu_bank_account`
        Details for the customer's EU bank account transfer.
Required if the type is `eu_bank_account`.
        - `country`
          The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, `NL`.
      - `id_bank_account`
        Details for the customer's Indonesian bank account transfer.
Required if the type is `id_bank_account`.
        - `bank`
          Bank where the account is held. One of `bca`, `bni`.
      - `requested_address_types`
        List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `aba`, `swift`, `sort_code`, `zengin`, `iban`, `spei`, `id_bban`, or `sepa`.

### Example

```title
Confirm with collected data
```

### Example

```title
Confirm a Customer Balance payment
```
