@stripe/stripe-js
Version:
Stripe.js loading utility
814 lines (756 loc) • 84.8 kB
TypeScript
import * as api from '../api';
import * as paymentIntents from './payment-intents';
import * as setupIntents from './setup-intents';
import * as confirmationTokens from './confirmation-tokens';
import * as orders from './orders';
import * as tokens from './token-and-sources';
import * as elements from './elements';
import * as financialConnections from './financial-connections';
import * as ephemeralKeys from './ephemeral-keys';
import {
StripeElements,
StripeElementsOptionsClientSecret,
StripeElementsOptionsMode,
} from './elements-group';
import {CheckoutLocale, RedirectToCheckoutOptions} from './hosted-checkout';
import {PaymentRequestOptions, PaymentRequest} from './payment-request';
import {StripeElement, StripeElementLocale} from './elements-group';
import {StripeCheckoutOptions, StripeCheckout} from './checkout';
import {
StripeEmbeddedCheckoutOptions,
StripeEmbeddedCheckout,
} from './embedded-checkout';
export interface Stripe {
/////////////////////////////
/// Elements
///
/// https://stripe.com/docs/js/elements_object
/////////////////////////////
/**
* Create an `Elements` instance, which manages a group of elements.
*
* https://stripe.com/docs/js/elements_object/create
*/
elements(options?: StripeElementsOptionsClientSecret): StripeElements;
/**
* Create an `Elements` instance, which manages a group of elements.
*
* https://stripe.com/docs/js/elements_object/create_without_intent
*/
elements(options?: StripeElementsOptionsMode): StripeElements;
/////////////////////////////
/// Checkout
///
/// https://stripe.com/docs/js/checkout
/////////////////////////////
/**
* Use `stripe.redirectToCheckout` to redirect your customers to [Checkout](https://stripe.com/docs/payments/checkout), a Stripe-hosted page to securely collect payment information.
* When the customer completes their purchase, they are redirected back to your website.
*/
redirectToCheckout(
options: RedirectToCheckoutOptions
): Promise<never | {error: StripeError}>;
/////////////////////////////
/// Payment Intents
///
/// https://stripe.com/docs/js/payment_intents
/////////////////////////////
/**
* Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
* When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), 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 confirmation is complete.
*
* By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation.
* If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method.
* Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment
*/
confirmPayment(options: {
elements: StripeElements;
confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
redirect: 'if_required';
}): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
* When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), 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 confirmation is complete.
*
* By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation.
* If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method.
* Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment
*/
confirmPayment(options: {
elements?: StripeElements;
clientSecret: string;
confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
redirect: 'if_required';
}): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
* When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), 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 confirmation is complete.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment
*/
confirmPayment(options: {
elements: StripeElements;
confirmParams: paymentIntents.ConfirmPaymentData;
redirect?: 'always';
}): Promise<never | {error: StripeError}>;
/**
* Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
* When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), 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 confirmation is complete.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment
*/
confirmPayment(options: {
elements?: StripeElements;
clientSecret: string;
confirmParams: paymentIntents.ConfirmPaymentData;
redirect?: 'always';
}): Promise<never | {error: StripeError}>;
/**
* Use `stripe.confirmAcssDebitPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow when the customer submits your payment form.
* When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) when the user submits the form.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* `stripe.confirmAcssDebitPayment` 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.
* If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_acss_debit_payment
*/
confirmAcssDebitPayment(
clientSecret: string,
data?: paymentIntents.ConfirmAcssDebitPaymentData,
options?: paymentIntents.ConfirmAcssDebitPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmUsBankAccountPayment` in the [Accept a payment](https://stripe.com/docs/payments/ach-debit/accept-a-payment) flow for the [ACH Direct Debit]((https://stripe.com/docs/payments/ach-debit) payment method to record the customer’s authorization for payment.
*
* When you confirm a [PaymentIntent](https://stripe.com/docs/api/payment_intents), it needs to have an attached PaymentMethod.
* Use `stripe.collectBankAccountForPayment` to collect and attach a [PaymentMethod](https://stripe.com/docs/api/payment_methods), or provide bank account details using the `data` parameter if a `PaymentMethod` was not already provided.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_us_bank_account_payment
*/
confirmUsBankAccountPayment(
clientSecret: string,
data?: paymentIntents.ConfirmUsBankAccountPaymentData
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmAlipayPayment` in the [Alipay Payments](https://stripe.com/docs/payments/alipay) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_alipay_payment
*/
confirmAlipayPayment(
clientSecret: string,
data?: paymentIntents.ConfirmAlipayPaymentData,
options?: paymentIntents.ConfirmAlipayPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Use `stripe.confirmAuBecsDebitPayment` in the [BECS Direct Debit Payments](https://stripe.com/docs/payments/payment-methods/au-becs-debit) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-payment-intents) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_au_becs_debit_payment
*/
confirmAuBecsDebitPayment(
clientSecret: string,
data?: paymentIntents.ConfirmAuBecsDebitPaymentData
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmBancontactPayment` in the [Bancontact Payments with Payment Methods](https://stripe.com/docs/payments/bancontact#web) flow when the customer submits your payment form.
* When called, it will confirm the `PaymentIntent` 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_payment
*/
confirmBancontactPayment(
clientSecret: string,
data?: paymentIntents.ConfirmBancontactPaymentData,
options?: paymentIntents.ConfirmBancontactPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Use `stripe.confirmBilliePayment` in the [Billie Payments](https://stripe.com/docs/payments/billie) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*/
confirmBilliePayment(
clientSecret: string,
data?: paymentIntents.ConfirmBilliePaymentData,
options?: paymentIntents.ConfirmBilliePaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form.
* When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_blik_payment
*/
confirmBlikPayment(
clientSecret: string,
data: paymentIntents.ConfirmBlikPaymentData,
options?: paymentIntents.ConfirmBlikPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmBoletoPayment` in the [Boleto Payment](https://stripe.com/docs/payments/boleto) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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](https://stripe.com/docs/payments/boleto) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_boleto_payment
*/
confirmBoletoPayment(
clientSecret: string,
data?: paymentIntents.ConfirmBoletoPaymentData,
options?: paymentIntents.ConfirmBoletoPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmCardPayment` when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide and carry out 3DS or other next actions if they are required.
*
* If you are using [Dynamic 3D Secure](https://stripe.com/docs/payments/3d-secure#three-ds-radar), `stripe.confirmCardPayment` will trigger your Radar rules to execute and may open a dialog for your customer to authenticate their payment.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_card_payment
*/
confirmCardPayment(
clientSecret: string,
data?: paymentIntents.ConfirmCardPaymentData,
options?: paymentIntents.ConfirmCardPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmCashappPayment` in the [Cash App Payments](https://stripe.com/docs/payments/cash-app-pay) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
* Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_payment
*/
confirmCashappPayment(
clientSecret: string,
data?: paymentIntents.ConfirmCashappPaymentData,
options?: paymentIntents.ConfirmCashappPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Use `stripe.confirmCustomerBalancePayment` when the customer submits your payment form.
*
* When called, it will confirm the PaymentIntent with data you provide.
* Refer to our [integration guide](https://stripe.com/docs/payments/bank-transfers) for more details.
*
* Since the Customer Balance 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 parameters.
* The confirmation attempt will finish in one of the following result states:
* 1. If the customer balance was enough to pay the amount, the status is succeeded. The funding_type data is effectively ignored.
* 2. If the balance was not enough to pay the amount, and you didn't send the funding_type, the status is requires_payment_method.
* 3. If the balance was not enough to pay the amount, and you did send the funding_type, the status is requires_action. The paymentIntent.next_action.display_bank_transfer_instructions hash contains bank transfer details for funding the Customer Balance.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_customer_balance_payment
*/
confirmCustomerBalancePayment(
clientSecret: string,
data: paymentIntents.ConfirmCustomerBalancePaymentData,
options: paymentIntents.ConfirmCustomerBalancePaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmEpsPayment` in the [EPS Payments with Payment Methods](https://stripe.com/docs/payments/eps#web) flow when the customer submits your payment form.
* When called, it will confirm the `PaymentIntent` 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_eps_payment
*/
confirmEpsPayment(
clientSecret: string,
data?: paymentIntents.ConfirmEpsPaymentData,
options?: paymentIntents.ConfirmEpsPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmFpxPayment` in the [FPX Payments with Payment Methods](https://stripe.com/docs/payments/fpx#web) flow when the customer submits your payment form.
* When called, it will confirm the `PaymentIntent` 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_fpx_payment
*/
confirmFpxPayment(
clientSecret: string,
data?: paymentIntents.ConfirmFpxPaymentData,
options?: paymentIntents.ConfirmFpxPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmGiropayPayment` in the [giropay Payments with Payment Methods](https://stripe.com/docs/payments/giropay#web) flow when the customer submits your payment form.
* When called, it will confirm the `PaymentIntent` 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_giropay_payment
*/
confirmGiropayPayment(
clientSecret: string,
data?: paymentIntents.ConfirmGiropayPaymentData,
options?: paymentIntents.ConfirmGiropayPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmGrabPayPayment` in the [GrabPay payments](https://stripe.com/docs/payments/grabpay) flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents).
* Refer to our [integration guide](https://stripe.com/docs/payments/grabpay/accept-a-payment) for more details.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_grabpay_payment
*/
confirmGrabPayPayment(
clientSecret: string,
data?: paymentIntents.ConfirmGrabPayPaymentData,
options?: paymentIntents.ConfirmGrabPayPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmIdealPayment` in the [iDEAL Payments with Payment Methods](https://stripe.com/docs/payments/ideal) flow when the customer submits your payment form.
* When called, it will confirm the `PaymentIntent` 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_ideal_payment
*/
confirmIdealPayment(
clientSecret: string,
data?: paymentIntents.ConfirmIdealPaymentData,
options?: paymentIntents.ConfirmIdealPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Use `stripe.confirmKlarnaPayment` in the [Klarna Payments](https://stripe.com/docs/payments/klarna) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_klarna_payment
*/
confirmKlarnaPayment(
clientSecret: string,
data?: paymentIntents.ConfirmKlarnaPaymentData,
options?: paymentIntents.ConfirmKlarnaPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmKonbiniPayment` in the [Konbini](https://stripe.com/docs/payments/konbini) payment flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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](https://stripe.com/docs/payments/konbini/accept-a-payment) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_konbini_payment
*/
confirmKonbiniPayment(
clientSecret: string,
data?: paymentIntents.ConfirmKonbiniPaymentData,
options?: paymentIntents.ConfirmKonbiniPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmMobilepayPayment` in the [Mobilepay Payments](https://docs.stripe.com/payments/mobilepay) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
* Refer to our [integration guide](https://docs.stripe.com/payments/mobilepay) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_mobilepay_payment
*/
confirmMobilepayPayment(
clientSecret: string,
data?: paymentIntents.ConfirmMobilepayPaymentData,
options?: paymentIntents.ConfirmMobilepayPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmMultibancoPayment` in the [Multibanco Payment](https://stripe.com/docs/payments/multibanco) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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](https://stripe.com/docs/payments/multibanco) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_multibanco_payment
*/
confirmMultibancoPayment(
clientSecret: string,
data?: paymentIntents.ConfirmMultibancoPaymentData,
options?: paymentIntents.ConfirmMultibancoPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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](https://stripe.com/docs/payments/oxxo) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_oxxo_payment
*/
confirmOxxoPayment(
clientSecret: string,
data?: paymentIntents.ConfirmOxxoPaymentData,
options?: paymentIntents.ConfirmOxxoPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmP24Payment` in the [Przelewy24 Payments with Payment Methods](https://stripe.com/docs/payments/p24#web) flow when the customer submits your payment form.
* When called, it will confirm the `PaymentIntent` 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_p24_payment
*/
confirmP24Payment(
clientSecret: string,
data?: paymentIntents.ConfirmP24PaymentData,
options?: paymentIntents.ConfirmP24PaymentOptions
): Promise<PaymentIntentResult>;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Use `stripe.confirmPayNowPayment` in the [PayNow Payments](https://stripe.com/docs/payments/paynow) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
* Refer to our [integration guide](https://stripe.com/docs/payments/paynow) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*/
confirmPayNowPayment(
clientSecret: string,
data?: paymentIntents.ConfirmPayNowPaymentData,
options?: paymentIntents.ConfirmPayNowPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Use `stripe.confirmPayPalPayment` in the [PayPal Payments](https://stripe.com/docs/payments/paypal) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_paypal_payment
*/
confirmPayPalPayment(
clientSecret: string,
data?: paymentIntents.ConfirmPayPalPaymentData
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmPixPayment` in the [Pix Payments](https://stripe.com/docs/payments/pix) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
* Refer to our [integration guide](https://stripe.com/docs/payments/pix) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_pix_payment
*/
confirmPixPayment(
clientSecret: string,
data?: paymentIntents.ConfirmPixPaymentData,
options?: paymentIntents.ConfirmPixPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Use `stripe.confirmPromptPayPayment` in the [PromptPay Payments](https://stripe.com/docs/payments/promptpay) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
* Refer to our [integration guide](https://stripe.com/docs/payments/promptpay) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*/
confirmPromptPayPayment(
clientSecret: string,
data?: paymentIntents.ConfirmPromptPayPaymentData,
options?: paymentIntents.ConfirmPromptPayPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmSepaDebitPayment` in the [SEPA Direct Debit Payments](https://stripe.com/docs/payments/sepa-debit) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) 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](https://stripe.com/docs/payments/sepa-debit) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_sepa_debit_payment
*/
confirmSepaDebitPayment(
clientSecret: string,
data?: paymentIntents.ConfirmSepaDebitPaymentData
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmSofortPayment` in the [Sofort Payments with Payment Methods](https://stripe.com/docs/payments/sofort) flow when the customer submits your payment form.
* When called, it will confirm the `PaymentIntent` with `data` you provide. It will then automatically redirect the customer to authorize the transaction.
* Once authorization is complete, the customer will be redirected back to your specified `return_url`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_sofort_payment
*/
confirmSofortPayment(
clientSecret: string,
data?: paymentIntents.ConfirmSofortPaymentData,
options?: paymentIntents.ConfirmSofortPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.confirmTwintPayment` in the [TWINT Payments with Payment Methods](https://stripe.com/docs/payments/twint) flow when the customer submits your payment form.
* When called, it will confirm the `PaymentIntent` 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`.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_twint_payment
*/
confirmTwintPayment(
clientSecret: string,
data?: paymentIntents.ConfirmTwintPaymentData,
options?: paymentIntents.ConfirmTwintPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*
* Use `stripe.confirmWechatPayPayment` in the [Wechat Pay Payments](https://stripe.com/docs/payments/wechat-pay) with Payment Methods flow when the customer submits your payment form.
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
* Refer to our [integration guide](https://stripe.com/docs/payments/wechat-pay/accept-a-payment) for more details.
*
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
* In addition to confirming the `PaymentIntent`, 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.
*
* @docs https://stripe.com/docs/js/payment_intents/confirm_wechat_pay_payment
*/
confirmWechatPayPayment(
clientSecret: string,
data?: paymentIntents.ConfirmWechatPayPaymentData,
options?: paymentIntents.ConfirmWechatPayPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use `stripe.handleCardAction` in the Payment Intents API [manual confirmation](https://stripe.com/docs/payments/payment-intents/web-manual) flow to handle a [PaymentIntent](https://stripe.com/docs/api/payment_intents) with the `requires_action` status.
* It will throw an error if the `PaymentIntent` has a different status.
*
* Note that `stripe.handleCardAction` 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.handleCardAction` may trigger a [3D Secure](https://stripe.com/docs/payments/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.
*
* @docs https://stripe.com/docs/js/payment_intents/handle_card_action
*/
handleCardAction(clientSecret: string): Promise<PaymentIntentResult>;
/**
* Use `stripe.handleNextAction` in the [finalizing payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server) flow to finish confirmation of a [PaymentIntent](https://stripe.com/docs/api/payment_intents) or [SetupIntent](https://stripe.com/docs/api/setup_intents) with the `requires_action` status.
* It will throw an error if the `PaymentIntent` or `SetupIntent` has a different status.
*
* 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](https://stripe.com/docs/payments/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.
*
* @docs https://stripe.com/docs/js/payment_intents/handle_next_action
*/
handleNextAction(options: {
clientSecret: string;
}): Promise<PaymentIntentOrSetupIntentResult>;
/**
* Use `stripe.verifyMicrodepositsForPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow
* to verify a customer's bank account with micro-deposits.
*
* @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_payment
*/
verifyMicrodepositsForPayment(
clientSecret: string,
data?: paymentIntents.VerifyMicrodepositsForPaymentData
): Promise<PaymentIntentResult>;
/**
* Use stripe.createRadarSession to create a [Radar Session](https://stripe.com/docs/radar/radar-session) in your checkout flow or when saving card details.
* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
* This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
* By using Radar Sessions, you can capture critical fraud information without tokenizing on Stripe.
*/
createRadarSession(): Promise<RadarSessionPayload>;
/**
* Use `stripe.collectBankAccountForPayment` in the [Accept a payment flow](https://stripe.com/docs/payments/ach-debit/accept-a-payment) for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit)
* payment method to collect the customer’s bank account in your payment form.
*
* @docs https://stripe.com/docs/js/payment_intents/collect_bank_account_for_payment
*/
collectBankAccountForPayment(
options: paymentIntents.CollectBankAccountForPaymentOptions
): Promise<PaymentIntentResult>;
/**
* Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call.
*
* @docs https://stripe.com/docs/js/payment_methods/create_payment_method
*/
createPaymentMethod(
paymentMethodData: paymentIntents.CreatePaymentMethodData
): Promise<PaymentMethodResult>;
/**
* Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call.
*
* @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements
*/
createPaymentMethod(
options: paymentIntents.CreatePaymentMethodFromElements
): Promise<PaymentMethodResult>;
/**
* Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call.
*
* @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements
*/
createPaymentMethod(
options: paymentIntents.CreatePaymentMethodFromElement
): Promise<PaymentMethodResult>;
/**
* Use stripe.createConfirmationToken to convert payment information collected by elements into a [ConfirmationToken](https://stripe.com/docs/api/confirmation_tokens) object that you safely pass to your server to use in an API call.
*
* @docs https://stripe.com/docs/js/confirmation_tokens/create_confirmation_token
*/
createConfirmationToken(
options: confirmationTokens.CreateConfirmationToken
): Promise<ConfirmationTokenResult>;
/**
* Retrieve a [PaymentIntent](https://stripe.com/docs/api/payment_intents) using its [client secret](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret).
*
* @docs https://stripe.com/docs/js/payment_intents/retrieve_payment_intent
*/
retrievePaymentIntent(clientSecret: string): Promise<PaymentIntentResult>;
/////////////////////////////
/// Setup Intents
///
/// https://stripe.com/docs/js/setup_intents
/////////////////////////////
/**
* Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
* When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), 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 confirmation is complete.
*
* 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.
* Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
*
* @docs https://stripe.com/docs/js/setup_intents/confirm_setup
*/
confirmSetup(options: {
elements: StripeElements;
confirmParams?: Partial<setupIntents.ConfirmSetupData>;
redirect: 'if_required';
}): Promise<SetupIntentResult>;
/**
* Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
* When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), 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 confirmation is complete.
*
* 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.
* Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
*
* @docs https://stripe.com/docs/js/setup_intents/confirm_setup
*/
confirmSetup(options: {
elements?: StripeElements;
clientSecret: string;
confirmParams?: Partial<setupIntents.ConfirmSetupData>;
redirect: 'if_required';
}): Promise<SetupIntentResult>;
/**
* Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
* When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), 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 confirmation is complete.
*
* @docs https://stripe.com/docs/js/setup_intents/confirm_setup
*/
confirmSetup(options: {
elements: StripeElements;
confirmParams: setupIntents.ConfirmSetupData;
redirect?: 'always';
}): Promise<never | {error: StripeError}>;
/**
* Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
* When called, `stripe.confirmSetup` will attem