@stripe/stripe-js 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +11 -3
  2. package/dist/index.d.mts +12626 -0
  3. package/dist/index.d.ts +12626 -0
  4. package/dist/stripe.js +1 -1
  5. package/dist/stripe.mjs +1 -1
  6. package/package.json +5 -26
  7. package/pure/index.d.mts +12626 -0
  8. package/pure/index.d.ts +12626 -0
  9. package/{dist/pure.js → pure/index.js} +1 -1
  10. package/{dist/pure.mjs → pure/index.mjs} +1 -1
  11. package/types/.eslintrc.yml +0 -3
  12. package/types/api/bank-accounts.d.ts +0 -61
  13. package/types/api/cards.d.ts +0 -130
  14. package/types/api/financial-connections.d.ts +0 -232
  15. package/types/api/index.d.ts +0 -11
  16. package/types/api/orders.d.ts +0 -122
  17. package/types/api/payment-intents.d.ts +0 -330
  18. package/types/api/payment-methods.d.ts +0 -452
  19. package/types/api/setup-intents.d.ts +0 -184
  20. package/types/api/shared.d.ts +0 -125
  21. package/types/api/sources.d.ts +0 -1045
  22. package/types/api/tokens.d.ts +0 -639
  23. package/types/api/verification-sessions.d.ts +0 -9
  24. package/types/index.d.mts +0 -17
  25. package/types/index.d.ts +0 -17
  26. package/types/pure.d.mts +0 -5
  27. package/types/pure.d.ts +0 -5
  28. package/types/stripe-js/checkout.d.ts +0 -153
  29. package/types/stripe-js/custom-checkout.d.ts +0 -220
  30. package/types/stripe-js/elements/address.d.ts +0 -261
  31. package/types/stripe-js/elements/affirm-message.d.ts +0 -65
  32. package/types/stripe-js/elements/afterpay-clearpay-message.d.ts +0 -119
  33. package/types/stripe-js/elements/apple-pay.d.ts +0 -156
  34. package/types/stripe-js/elements/au-bank-account.d.ts +0 -138
  35. package/types/stripe-js/elements/base.d.ts +0 -264
  36. package/types/stripe-js/elements/card-cvc.d.ts +0 -119
  37. package/types/stripe-js/elements/card-expiry.d.ts +0 -119
  38. package/types/stripe-js/elements/card-number.d.ts +0 -200
  39. package/types/stripe-js/elements/card.d.ts +0 -226
  40. package/types/stripe-js/elements/cart.d.ts +0 -224
  41. package/types/stripe-js/elements/eps-bank.d.ts +0 -140
  42. package/types/stripe-js/elements/express-checkout.d.ts +0 -446
  43. package/types/stripe-js/elements/fpx-bank.d.ts +0 -134
  44. package/types/stripe-js/elements/iban.d.ts +0 -135
  45. package/types/stripe-js/elements/ideal-bank.d.ts +0 -140
  46. package/types/stripe-js/elements/index.d.ts +0 -22
  47. package/types/stripe-js/elements/issuing/index.d.ts +0 -5
  48. package/types/stripe-js/elements/issuing/issuing-card-copy-button.d.ts +0 -37
  49. package/types/stripe-js/elements/issuing/issuing-card-cvc-display.d.ts +0 -32
  50. package/types/stripe-js/elements/issuing/issuing-card-expiry-display.d.ts +0 -32
  51. package/types/stripe-js/elements/issuing/issuing-card-number-display.d.ts +0 -40
  52. package/types/stripe-js/elements/issuing/issuing-card-pin-display.d.ts +0 -32
  53. package/types/stripe-js/elements/link-authentication.d.ts +0 -158
  54. package/types/stripe-js/elements/p24-bank.d.ts +0 -140
  55. package/types/stripe-js/elements/payment-method-messaging.d.ts +0 -98
  56. package/types/stripe-js/elements/payment-request-button.d.ts +0 -151
  57. package/types/stripe-js/elements/payment.d.ts +0 -275
  58. package/types/stripe-js/elements/shipping-address.d.ts +0 -215
  59. package/types/stripe-js/elements-group.d.ts +0 -1129
  60. package/types/stripe-js/embedded-checkout.d.ts +0 -30
  61. package/types/stripe-js/ephemeral-keys.d.ts +0 -3
  62. package/types/stripe-js/financial-connections.d.ts +0 -19
  63. package/types/stripe-js/index.d.ts +0 -13
  64. package/types/stripe-js/orders.d.ts +0 -9
  65. package/types/stripe-js/payment-intents.d.ts +0 -1465
  66. package/types/stripe-js/payment-request.d.ts +0 -529
  67. package/types/stripe-js/setup-intents.d.ts +0 -250
  68. package/types/stripe-js/stripe.d.ts +0 -1472
  69. package/types/stripe-js/token-and-sources.d.ts +0 -110
  70. package/types/utils.d.ts +0 -2
@@ -1,1472 +0,0 @@
1
- import * as api from '../api';
2
- import * as paymentIntents from './payment-intents';
3
- import * as setupIntents from './setup-intents';
4
- import * as orders from './orders';
5
- import * as tokens from './token-and-sources';
6
- import * as elements from './elements';
7
- import * as financialConnections from './financial-connections';
8
- import * as ephemeralKeys from './ephemeral-keys';
9
-
10
- import {
11
- StripeElements,
12
- StripeElementsOptionsClientSecret,
13
- StripeElementsOptionsMode,
14
- } from './elements-group';
15
- import {CheckoutLocale, RedirectToCheckoutOptions} from './checkout';
16
- import {PaymentRequestOptions, PaymentRequest} from './payment-request';
17
- import {StripeElement, StripeElementLocale} from './elements-group';
18
- import {
19
- StripeCustomCheckoutOptions,
20
- StripeCustomCheckout,
21
- } from './custom-checkout';
22
- import {
23
- StripeEmbeddedCheckoutOptions,
24
- StripeEmbeddedCheckout,
25
- } from './embedded-checkout';
26
-
27
- export interface Stripe {
28
- /////////////////////////////
29
- /// Elements
30
- ///
31
- /// https://stripe.com/docs/js/elements_object
32
- /////////////////////////////
33
-
34
- /**
35
- * Create an `Elements` instance, which manages a group of elements.
36
- *
37
- * https://stripe.com/docs/js/elements_object/create
38
- */
39
- elements(options?: StripeElementsOptionsClientSecret): StripeElements;
40
-
41
- /**
42
- * Create an `Elements` instance, which manages a group of elements.
43
- *
44
- * https://stripe.com/docs/js/elements_object/create_without_intent
45
- */
46
- elements(options?: StripeElementsOptionsMode): StripeElements;
47
-
48
- /////////////////////////////
49
- /// Checkout
50
- ///
51
- /// https://stripe.com/docs/js/checkout
52
- /////////////////////////////
53
-
54
- /**
55
- * Use `stripe.redirectToCheckout` to redirect your customers to [Checkout](https://stripe.com/docs/payments/checkout), a Stripe-hosted page to securely collect payment information.
56
- * When the customer completes their purchase, they are redirected back to your website.
57
- */
58
- redirectToCheckout(
59
- options: RedirectToCheckoutOptions
60
- ): Promise<never | {error: StripeError}>;
61
-
62
- /////////////////////////////
63
- /// Payment Intents
64
- ///
65
- /// https://stripe.com/docs/js/payment_intents
66
- /////////////////////////////
67
-
68
- /**
69
- * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
70
- * 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.
71
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
72
- *
73
- * By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation.
74
- * If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method.
75
- * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
76
- *
77
- * @docs https://stripe.com/docs/js/payment_intents/confirm_payment
78
- */
79
- confirmPayment(options: {
80
- elements: StripeElements;
81
- confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
82
- redirect: 'if_required';
83
- }): Promise<PaymentIntentResult>;
84
-
85
- /**
86
- * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
87
- * 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.
88
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
89
- *
90
- * By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation.
91
- * If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method.
92
- * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
93
- *
94
- * @docs https://stripe.com/docs/js/payment_intents/confirm_payment
95
- */
96
- confirmPayment(options: {
97
- elements?: StripeElements;
98
- clientSecret: string;
99
- confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
100
- redirect: 'if_required';
101
- }): Promise<PaymentIntentResult>;
102
-
103
- /**
104
- * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
105
- * 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.
106
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
107
- *
108
- * @docs https://stripe.com/docs/js/payment_intents/confirm_payment
109
- */
110
- confirmPayment(options: {
111
- elements: StripeElements;
112
- confirmParams: paymentIntents.ConfirmPaymentData;
113
- redirect?: 'always';
114
- }): Promise<never | {error: StripeError}>;
115
-
116
- /**
117
- * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
118
- * 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.
119
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
120
- *
121
- * @docs https://stripe.com/docs/js/payment_intents/confirm_payment
122
- */
123
- confirmPayment(options: {
124
- elements?: StripeElements;
125
- clientSecret: string;
126
- confirmParams: paymentIntents.ConfirmPaymentData;
127
- redirect?: 'always';
128
- }): Promise<never | {error: StripeError}>;
129
-
130
- /**
131
- * 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.
132
- * 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.
133
- *
134
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
135
- * `stripe.confirmAcssDebitPayment` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI.
136
- * It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement.
137
- * If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data.
138
- *
139
- * @docs https://stripe.com/docs/js/payment_intents/confirm_acss_debit_payment
140
- */
141
- confirmAcssDebitPayment(
142
- clientSecret: string,
143
- data?: paymentIntents.ConfirmAcssDebitPaymentData,
144
- options?: paymentIntents.ConfirmAcssDebitPaymentOptions
145
- ): Promise<PaymentIntentResult>;
146
-
147
- /**
148
- * 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.
149
- *
150
- * When you confirm a [PaymentIntent](https://stripe.com/docs/api/payment_intents), it needs to have an attached PaymentMethod.
151
- * 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.
152
- *
153
- * @docs https://stripe.com/docs/js/payment_intents/confirm_us_bank_account_payment
154
- */
155
- confirmUsBankAccountPayment(
156
- clientSecret: string,
157
- data?: paymentIntents.ConfirmUsBankAccountPaymentData
158
- ): Promise<PaymentIntentResult>;
159
-
160
- /**
161
- * Use `stripe.confirmAlipayPayment` in the [Alipay Payments](https://stripe.com/docs/payments/alipay) with Payment Methods flow when the customer submits your payment form.
162
- * 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.
163
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
164
- *
165
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
166
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
167
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
168
- *
169
- * @docs https://stripe.com/docs/js/payment_intents/confirm_alipay_payment
170
- */
171
- confirmAlipayPayment(
172
- clientSecret: string,
173
- data?: paymentIntents.ConfirmAlipayPaymentData,
174
- options?: paymentIntents.ConfirmAlipayPaymentOptions
175
- ): Promise<PaymentIntentResult>;
176
-
177
- /**
178
- * Requires beta access:
179
- * Contact [Stripe support](https://support.stripe.com/) for more information.
180
- *
181
- * 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.
182
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
183
- * Note that there are some additional requirements to this flow that are not covered in this reference.
184
- * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-payment-intents) for more details.
185
- *
186
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
187
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
188
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
189
- *
190
- * @docs https://stripe.com/docs/js/payment_intents/confirm_au_becs_debit_payment
191
- */
192
- confirmAuBecsDebitPayment(
193
- clientSecret: string,
194
- data?: paymentIntents.ConfirmAuBecsDebitPaymentData
195
- ): Promise<PaymentIntentResult>;
196
-
197
- /**
198
- * 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.
199
- * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
200
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
201
- *
202
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
203
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
204
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
205
- *
206
- * @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_payment
207
- */
208
- confirmBancontactPayment(
209
- clientSecret: string,
210
- data?: paymentIntents.ConfirmBancontactPaymentData,
211
- options?: paymentIntents.ConfirmBancontactPaymentOptions
212
- ): Promise<PaymentIntentResult>;
213
-
214
- /**
215
- * Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form.
216
- * When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction.
217
- *
218
- * @docs https://stripe.com/docs/js/payment_intents/confirm_blik_payment
219
- */
220
- confirmBlikPayment(
221
- clientSecret: string,
222
- data: paymentIntents.ConfirmBlikPaymentData,
223
- options?: paymentIntents.ConfirmBlikPaymentOptions
224
- ): Promise<PaymentIntentResult>;
225
-
226
- /**
227
- * Use `stripe.confirmBoletoPayment` in the [Boleto Payment](https://stripe.com/docs/payments/boleto) with Payment Methods flow when the customer submits your payment form.
228
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
229
- * Note that there are some additional requirements to this flow that are not covered in this reference.
230
- * Refer to our [integration guide](https://stripe.com/docs/payments/boleto) for more details.
231
- *
232
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
233
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
234
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
235
- *
236
- * @docs https://stripe.com/docs/js/payment_intents/confirm_boleto_payment
237
- */
238
- confirmBoletoPayment(
239
- clientSecret: string,
240
- data?: paymentIntents.ConfirmBoletoPaymentData,
241
- options?: paymentIntents.ConfirmBoletoPaymentOptions
242
- ): Promise<PaymentIntentResult>;
243
-
244
- /**
245
- * Use `stripe.confirmCardPayment` when the customer submits your payment form.
246
- * 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.
247
- *
248
- * 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.
249
- *
250
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
251
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
252
- * 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.
253
- *
254
- * @docs https://stripe.com/docs/js/payment_intents/confirm_card_payment
255
- */
256
- confirmCardPayment(
257
- clientSecret: string,
258
- data?: paymentIntents.ConfirmCardPaymentData,
259
- options?: paymentIntents.ConfirmCardPaymentOptions
260
- ): Promise<PaymentIntentResult>;
261
-
262
- /**
263
- * 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.
264
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
265
- * Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details.
266
- *
267
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
268
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
269
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
270
- *
271
- * @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_payment
272
- */
273
- confirmCashappPayment(
274
- clientSecret: string,
275
- data?: paymentIntents.ConfirmCashappPaymentData,
276
- options?: paymentIntents.ConfirmCashappPaymentOptions
277
- ): Promise<PaymentIntentResult>;
278
-
279
- /**
280
- * Requires beta access:
281
- * Contact [Stripe support](https://support.stripe.com/) for more information.
282
- *
283
- * Use `stripe.confirmCustomerBalancePayment` when the customer submits your payment form.
284
- *
285
- * When called, it will confirm the PaymentIntent with data you provide.
286
- * Refer to our [integration guide](https://stripe.com/docs/payments/bank-transfers) for more details.
287
- *
288
- * 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.
289
- * The confirmation attempt will finish in one of the following result states:
290
- * 1. If the customer balance was enough to pay the amount, the status is succeeded. The funding_type data is effectively ignored.
291
- * 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.
292
- * 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.
293
- *
294
- * @docs https://stripe.com/docs/js/payment_intents/confirm_customer_balance_payment
295
- */
296
- confirmCustomerBalancePayment(
297
- clientSecret: string,
298
- data: paymentIntents.ConfirmCustomerBalancePaymentData,
299
- options: paymentIntents.ConfirmCustomerBalancePaymentOptions
300
- ): Promise<PaymentIntentResult>;
301
-
302
- /**
303
- * 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.
304
- * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
305
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
306
- *
307
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
308
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
309
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
310
- *
311
- * @docs https://stripe.com/docs/js/payment_intents/confirm_eps_payment
312
- */
313
- confirmEpsPayment(
314
- clientSecret: string,
315
- data?: paymentIntents.ConfirmEpsPaymentData,
316
- options?: paymentIntents.ConfirmEpsPaymentOptions
317
- ): Promise<PaymentIntentResult>;
318
-
319
- /**
320
- * 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.
321
- * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
322
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
323
- *
324
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
325
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
326
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
327
- *
328
- * @docs https://stripe.com/docs/js/payment_intents/confirm_fpx_payment
329
- */
330
- confirmFpxPayment(
331
- clientSecret: string,
332
- data?: paymentIntents.ConfirmFpxPaymentData,
333
- options?: paymentIntents.ConfirmFpxPaymentOptions
334
- ): Promise<PaymentIntentResult>;
335
-
336
- /**
337
- * 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.
338
- * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
339
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
340
- *
341
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
342
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
343
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
344
- *
345
- * @docs https://stripe.com/docs/js/payment_intents/confirm_giropay_payment
346
- */
347
- confirmGiropayPayment(
348
- clientSecret: string,
349
- data?: paymentIntents.ConfirmGiropayPaymentData,
350
- options?: paymentIntents.ConfirmGiropayPaymentOptions
351
- ): Promise<PaymentIntentResult>;
352
-
353
- /**
354
- * Use `stripe.confirmGrabPayPayment` in the [GrabPay payments](https://stripe.com/docs/payments/grabpay) flow when the customer submits your payment form.
355
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents).
356
- * Refer to our [integration guide](https://stripe.com/docs/payments/grabpay/accept-a-payment) for more details.
357
- *
358
- * @docs https://stripe.com/docs/js/payment_intents/confirm_grabpay_payment
359
- */
360
-
361
- confirmGrabPayPayment(
362
- clientSecret: string,
363
- data?: paymentIntents.ConfirmGrabPayPaymentData,
364
- options?: paymentIntents.ConfirmGrabPayPaymentOptions
365
- ): Promise<PaymentIntentResult>;
366
-
367
- /**
368
- * Use `stripe.confirmIdealPayment` in the [iDEAL Payments with Payment Methods](https://stripe.com/docs/payments/ideal) flow when the customer submits your payment form.
369
- * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
370
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
371
- *
372
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
373
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
374
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
375
- *
376
- * @docs https://stripe.com/docs/js/payment_intents/confirm_ideal_payment
377
- */
378
- confirmIdealPayment(
379
- clientSecret: string,
380
- data?: paymentIntents.ConfirmIdealPaymentData,
381
- options?: paymentIntents.ConfirmIdealPaymentOptions
382
- ): Promise<PaymentIntentResult>;
383
-
384
- /**
385
- * Requires beta access:
386
- * Contact [Stripe support](https://support.stripe.com/) for more information.
387
- *
388
- * Use `stripe.confirmKlarnaPayment` in the [Klarna Payments](https://stripe.com/docs/payments/klarna) with Payment Methods flow when the customer submits your payment form.
389
- * 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.
390
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
391
- *
392
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
393
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
394
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
395
- *
396
- * @docs https://stripe.com/docs/js/payment_intents/confirm_klarna_payment
397
- */
398
- confirmKlarnaPayment(
399
- clientSecret: string,
400
- data?: paymentIntents.ConfirmKlarnaPaymentData,
401
- options?: paymentIntents.ConfirmKlarnaPaymentOptions
402
- ): Promise<PaymentIntentResult>;
403
-
404
- /**
405
- * Use `stripe.confirmKonbiniPayment` in the [Konbini](https://stripe.com/docs/payments/konbini) payment flow when the customer submits your payment form.
406
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
407
- * Note that there are some additional requirements to this flow that are not covered in this reference.
408
- * Refer to our [integration guide](https://stripe.com/docs/payments/konbini/accept-a-payment) for more details.
409
- *
410
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
411
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
412
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
413
- *
414
- * @docs https://stripe.com/docs/js/payment_intents/confirm_konbini_payment
415
- */
416
- confirmKonbiniPayment(
417
- clientSecret: string,
418
- data?: paymentIntents.ConfirmKonbiniPaymentData,
419
- options?: paymentIntents.ConfirmKonbiniPaymentOptions
420
- ): Promise<PaymentIntentResult>;
421
-
422
- /**
423
- * Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form.
424
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
425
- * Note that there are some additional requirements to this flow that are not covered in this reference.
426
- * Refer to our [integration guide](https://stripe.com/docs/payments/oxxo) for more details.
427
- *
428
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
429
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
430
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
431
- *
432
- * @docs https://stripe.com/docs/js/payment_intents/confirm_oxxo_payment
433
- */
434
- confirmOxxoPayment(
435
- clientSecret: string,
436
- data?: paymentIntents.ConfirmOxxoPaymentData,
437
- options?: paymentIntents.ConfirmOxxoPaymentOptions
438
- ): Promise<PaymentIntentResult>;
439
-
440
- /**
441
- * 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.
442
- * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
443
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
444
- *
445
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
446
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
447
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
448
- *
449
- * @docs https://stripe.com/docs/js/payment_intents/confirm_p24_payment
450
- */
451
- confirmP24Payment(
452
- clientSecret: string,
453
- data?: paymentIntents.ConfirmP24PaymentData,
454
- options?: paymentIntents.ConfirmP24PaymentOptions
455
- ): Promise<PaymentIntentResult>;
456
-
457
- /**
458
- * Requires beta access:
459
- * Contact [Stripe support](https://support.stripe.com/) for more information.
460
- *
461
- * Use `stripe.confirmPayNowPayment` in the [PayNow Payments](https://stripe.com/docs/payments/paynow) with Payment Methods flow when the customer submits your payment form.
462
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
463
- * Refer to our [integration guide](https://stripe.com/docs/payments/paynow) for more details.
464
- *
465
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
466
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
467
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
468
- */
469
- confirmPayNowPayment(
470
- clientSecret: string,
471
- data?: paymentIntents.ConfirmPayNowPaymentData,
472
- options?: paymentIntents.ConfirmPayNowPaymentOptions
473
- ): Promise<PaymentIntentResult>;
474
-
475
- /**
476
- * Requires beta access:
477
- * Contact [Stripe support](https://support.stripe.com/) for more information.
478
- *
479
- * Use `stripe.confirmPayPalPayment` in the [PayPal Payments](https://stripe.com/docs/payments/paypal) with Payment Methods flow when the customer submits your payment form.
480
- * 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.
481
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
482
- *
483
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
484
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
485
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
486
- *
487
- * @docs https://stripe.com/docs/js/payment_intents/confirm_paypal_payment
488
- */
489
- confirmPayPalPayment(
490
- clientSecret: string,
491
- data?: paymentIntents.ConfirmPayPalPaymentData
492
- ): Promise<PaymentIntentResult>;
493
-
494
- /**
495
-
496
- * Use `stripe.confirmPixPayment` in the [Pix Payments](https://stripe.com/docs/payments/pix) with Payment Methods flow when the customer submits your payment form.
497
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
498
- * Refer to our [integration guide](https://stripe.com/docs/payments/pix) for more details.
499
- *
500
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
501
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
502
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
503
- *
504
- * @docs https://stripe.com/docs/js/payment_intents/confirm_pix_payment
505
- */
506
- confirmPixPayment(
507
- clientSecret: string,
508
- data?: paymentIntents.ConfirmPixPaymentData,
509
- options?: paymentIntents.ConfirmPixPaymentOptions
510
- ): Promise<PaymentIntentResult>;
511
-
512
- /**
513
- * Requires beta access:
514
- * Contact [Stripe support](https://support.stripe.com/) for more information.
515
- *
516
- * Use `stripe.confirmPromptPayPayment` in the [PromptPay Payments](https://stripe.com/docs/payments/promptpay) with Payment Methods flow when the customer submits your payment form.
517
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
518
- * Refer to our [integration guide](https://stripe.com/docs/payments/promptpay) for more details.
519
- *
520
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
521
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
522
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
523
- */
524
- confirmPromptPayPayment(
525
- clientSecret: string,
526
- data?: paymentIntents.ConfirmPromptPayPaymentData,
527
- options?: paymentIntents.ConfirmPromptPayPaymentOptions
528
- ): Promise<PaymentIntentResult>;
529
-
530
- /**
531
- * 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.
532
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
533
- * Note that there are some additional requirements to this flow that are not covered in this reference.
534
- * Refer to our [integration guide](https://stripe.com/docs/payments/sepa-debit) for more details.
535
- *
536
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
537
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
538
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
539
- *
540
- * @docs https://stripe.com/docs/js/payment_intents/confirm_sepa_debit_payment
541
- */
542
- confirmSepaDebitPayment(
543
- clientSecret: string,
544
- data?: paymentIntents.ConfirmSepaDebitPaymentData
545
- ): Promise<PaymentIntentResult>;
546
-
547
- /**
548
- * Use `stripe.confirmSofortPayment` in the [Sofort Payments with Payment Methods](https://stripe.com/docs/payments/sofort) flow when the customer submits your payment form.
549
- * When called, it will confirm the `PaymentIntent` with `data` you provide. It will then automatically redirect the customer to authorize the transaction.
550
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
551
- *
552
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
553
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
554
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
555
- *
556
- * @docs https://stripe.com/docs/js/payment_intents/confirm_sofort_payment
557
- */
558
- confirmSofortPayment(
559
- clientSecret: string,
560
- data?: paymentIntents.ConfirmSofortPaymentData,
561
- options?: paymentIntents.ConfirmSofortPaymentOptions
562
- ): Promise<PaymentIntentResult>;
563
-
564
- /**
565
- * Requires beta access:
566
- * Contact [Stripe support](https://support.stripe.com/) for more information.
567
- *
568
- * 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.
569
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
570
- * Refer to our [integration guide](https://stripe.com/docs/payments/wechat-pay/accept-a-payment) for more details.
571
- *
572
- * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
573
- * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
574
- * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
575
- *
576
- * @docs https://stripe.com/docs/js/payment_intents/confirm_wechat_pay_payment
577
- */
578
- confirmWechatPayPayment(
579
- clientSecret: string,
580
- data?: paymentIntents.ConfirmWechatPayPaymentData,
581
- options?: paymentIntents.ConfirmWechatPayPaymentOptions
582
- ): Promise<PaymentIntentResult>;
583
-
584
- /**
585
- * 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.
586
- * It will throw an error if the `PaymentIntent` has a different status.
587
- *
588
- * Note that `stripe.handleCardAction` may take several seconds to complete.
589
- * During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.
590
- * 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.
591
- *
592
- * Additionally, `stripe.handleCardAction` may trigger a [3D Secure](https://stripe.com/docs/payments/3d-secure) authentication challenge.
593
- * The authentication challenge requires a context switch that can be hard to follow on a screen-reader.
594
- * Ensure that your form is accessible by ensuring that success or error messages are clearly read out.
595
- *
596
- * @docs https://stripe.com/docs/js/payment_intents/handle_card_action
597
- */
598
- handleCardAction(clientSecret: string): Promise<PaymentIntentResult>;
599
-
600
- /**
601
- * 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.
602
- * It will throw an error if the `PaymentIntent` or `SetupIntent` has a different status.
603
- *
604
- * Note that `stripe.handleNextAction` may take several seconds to complete.
605
- * During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.
606
- * 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.
607
- *
608
- * Additionally, `stripe.handleNextAction` may trigger a [3D Secure](https://stripe.com/docs/payments/3d-secure) authentication challenge.
609
- * The authentication challenge requires a context switch that can be hard to follow on a screen-reader.
610
- * Ensure that your form is accessible by ensuring that success or error messages are clearly read out.
611
- *
612
- * @docs https://stripe.com/docs/js/payment_intents/handle_next_action
613
- */
614
- handleNextAction(options: {
615
- clientSecret: string;
616
- }): Promise<PaymentIntentOrSetupIntentResult>;
617
-
618
- /**
619
- * Use `stripe.verifyMicrodepositsForPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow
620
- * to verify a customer's bank account with micro-deposits.
621
- *
622
- * @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_payment
623
- */
624
- verifyMicrodepositsForPayment(
625
- clientSecret: string,
626
- data?: paymentIntents.VerifyMicrodepositsForPaymentData
627
- ): Promise<PaymentIntentResult>;
628
-
629
- /**
630
- * Use stripe.createRadarSession to create a [Radar Session](https://stripe.com/docs/radar/radar-session) in your checkout flow or when saving card details.
631
- * A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
632
- * This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
633
- * By using Radar Sessions, you can capture critical fraud information without tokenizing on Stripe.
634
- */
635
- createRadarSession(): Promise<RadarSessionPayload>;
636
-
637
- /**
638
- * 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)
639
- * payment method to collect the customer’s bank account in your payment form.
640
- *
641
- * @docs https://stripe.com/docs/js/payment_intents/collect_bank_account_for_payment
642
- */
643
- collectBankAccountForPayment(
644
- options: paymentIntents.CollectBankAccountForPaymentOptions
645
- ): Promise<PaymentIntentResult>;
646
-
647
- /**
648
- * 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.
649
- *
650
- * @docs https://stripe.com/docs/js/payment_methods/create_payment_method
651
- */
652
- createPaymentMethod(
653
- paymentMethodData: paymentIntents.CreatePaymentMethodData
654
- ): Promise<PaymentMethodResult>;
655
-
656
- /**
657
- * 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.
658
- *
659
- * @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements
660
- */
661
- createPaymentMethod(
662
- options: paymentIntents.CreatePaymentMethodFromElements
663
- ): Promise<PaymentMethodResult>;
664
-
665
- /**
666
- * 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.
667
- *
668
- * @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements
669
- */
670
- createPaymentMethod(
671
- options: paymentIntents.CreatePaymentMethodFromElement
672
- ): Promise<PaymentMethodResult>;
673
-
674
- /**
675
- * 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).
676
- *
677
- * @docs https://stripe.com/docs/js/payment_intents/retrieve_payment_intent
678
- */
679
- retrievePaymentIntent(clientSecret: string): Promise<PaymentIntentResult>;
680
-
681
- /////////////////////////////
682
- /// Setup Intents
683
- ///
684
- /// https://stripe.com/docs/js/setup_intents
685
- /////////////////////////////
686
-
687
- /**
688
- * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
689
- * 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.
690
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
691
- *
692
- * By default, stripe.`confirmSetup` will always redirect to your return_url after a successful confirmation.
693
- * If you set `redirect: "if_required"`, then `stripe.confirmSetup` will only redirect if your user chooses a redirect-based payment method.
694
- * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
695
- *
696
- * @docs https://stripe.com/docs/js/setup_intents/confirm_setup
697
- */
698
- confirmSetup(options: {
699
- elements: StripeElements;
700
- confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
701
- redirect: 'if_required';
702
- }): Promise<SetupIntentResult>;
703
-
704
- /**
705
- * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
706
- * 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.
707
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
708
- *
709
- * By default, stripe.`confirmSetup` will always redirect to your return_url after a successful confirmation.
710
- * If you set `redirect: "if_required"`, then `stripe.confirmSetup` will only redirect if your user chooses a redirect-based payment method.
711
- * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
712
- *
713
- * @docs https://stripe.com/docs/js/setup_intents/confirm_setup
714
- */
715
- confirmSetup(options: {
716
- elements?: StripeElements;
717
- clientSecret: string;
718
- confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
719
- redirect: 'if_required';
720
- }): Promise<SetupIntentResult>;
721
-
722
- /**
723
- * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
724
- * 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.
725
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
726
- *
727
- * @docs https://stripe.com/docs/js/setup_intents/confirm_setup
728
- */
729
- confirmSetup(options: {
730
- elements: StripeElements;
731
- confirmParams: paymentIntents.ConfirmPaymentData;
732
- redirect?: 'always';
733
- }): Promise<never | {error: StripeError}>;
734
-
735
- /**
736
- * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
737
- * 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.
738
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
739
- *
740
- * @docs https://stripe.com/docs/js/setup_intents/confirm_setup
741
- */
742
- confirmSetup(options: {
743
- elements?: StripeElements;
744
- clientSecret: string;
745
- confirmParams: paymentIntents.ConfirmPaymentData;
746
- redirect?: 'always';
747
- }): Promise<never | {error: StripeError}>;
748
-
749
- /**
750
- * Use `stripe.confirmAcssDebitSetup` to [save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment).
751
- * When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) when the user submits the form.
752
- *
753
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
754
- * `stripe.confirmAcssDebitSetup` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI.
755
- * It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement.
756
- * If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data.
757
- *
758
- * @docs https://stripe.com/docs/js/setup_intents/confirm_acss_debit_setup
759
- */
760
- confirmAcssDebitSetup(
761
- clientSecret: string,
762
- data?: setupIntents.ConfirmAcssDebitSetupData,
763
- options?: setupIntents.ConfirmAcssDebitSetupOptions
764
- ): Promise<SetupIntentResult>;
765
-
766
- /**
767
- * Use `stripe.confirmUsBankAccountSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit payment](https://stripe.com/docs/payments/ach-debit) method to record the customer’s authorization for future payments.
768
- *
769
- * When you confirm a [SetupIntent](https://stripe.com/docs/api/setup_intents), it needs to have an attached PaymentMethod.
770
- * Use `stripe.collectBankAccountForSetup` 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.
771
- *
772
- * @docs https://stripe.com/docs/js/setup_intents/confirm_us_bank_account_setup
773
- */
774
- confirmUsBankAccountSetup(
775
- clientSecret: string,
776
- data?: setupIntents.ConfirmUsBankAccountSetupData
777
- ): Promise<SetupIntentResult>;
778
-
779
- /**
780
- * Requires beta access:
781
- * Contact [Stripe support](https://support.stripe.com/) for more information.
782
- *
783
- * Use `stripe.confirmAuBecsDebitSetup` in the [BECS Direct Debit with Setup Intents](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-setup-intents) flow when the customer submits your payment form.
784
- * When called, it will confirm the `SetupIntent` with `data` you provide.
785
- * Note that there are some additional requirements to this flow that are not covered in this reference.
786
- * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-setup-intents) for more details.
787
- *
788
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
789
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
790
- * 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.
791
- *
792
- * @docs https://stripe.com/docs/js/setup_intents/confirm_au_becs_debit_setup
793
- */
794
- confirmAuBecsDebitSetup(
795
- clientSecret: string,
796
- data?: setupIntents.ConfirmAuBecsDebitSetupData
797
- ): Promise<SetupIntentResult>;
798
-
799
- /**
800
- * Use `stripe.confirmBacsDebitSetup` in the [Bacs Direct Debit Payments](https://stripe.com/docs/payments/payment-methods/bacs-debit) flow when the customer submits your payment form.
801
- * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide.
802
- * Note that there are some additional requirements to this flow that are not covered in this reference.
803
- * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details.
804
- *
805
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
806
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
807
- * 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.
808
- *
809
- * @docs https://stripe.com/docs/js/setup_intents/confirm_bacs_debit_setup
810
- */
811
- confirmBacsDebitSetup(
812
- clientSecret: string,
813
- data?: setupIntents.ConfirmBacsDebitSetupData
814
- ): Promise<SetupIntentResult>;
815
-
816
- /**
817
- * Use `stripe.confirmBancontactSetup` in the [Set up future payments](https://stripe.com/docs/payments/bancontact/set-up-payment) flow to use Bancontact bank details to set up a SEPA Direct Debit payment method for future payments.
818
- * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
819
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
820
- * Note that there are some additional requirements to this flow that are not covered in this reference.
821
- * Refer to our [integration guide](https://stripe.com/docs/payments/bancontact/set-up-payment) for more details.
822
- *
823
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
824
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
825
- * 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.
826
- *
827
- * @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_setup
828
- */
829
- confirmBancontactSetup(
830
- clientSecret: string,
831
- data?: setupIntents.ConfirmBancontactSetupData
832
- ): Promise<SetupIntentResult>;
833
-
834
- /**
835
- * Use `stripe.confirmCardSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form.
836
- * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide and carry out 3DS or other next actions if they are required.
837
- *
838
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
839
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
840
- * 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.
841
- *
842
- * @docs https://stripe.com/docs/js/setup_intents/confirm_card_setup
843
- */
844
- confirmCardSetup(
845
- clientSecret: string,
846
- data?: setupIntents.ConfirmCardSetupData,
847
- options?: setupIntents.ConfirmCardSetupOptions
848
- ): Promise<SetupIntentResult>;
849
-
850
- /**
851
- * Use `stripe.confirmCashappSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form.
852
- * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide.
853
- * Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details..
854
- *
855
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
856
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
857
- * 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.
858
- *
859
- * @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_setup
860
- */
861
- confirmCashappSetup(
862
- clientSecret: string,
863
- data?: setupIntents.ConfirmCashappSetupData,
864
- options?: setupIntents.ConfirmCashappSetupOptions
865
- ): Promise<SetupIntentResult>;
866
-
867
- /**
868
- * Use `stripe.confirmIdealSetup` in the [Set up future payments](https://stripe.com/docs/payments/ideal/set-up-payment) flow to use iDEAL bank details to set up a SEPA Direct Debit payment method for future payments.
869
- * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
870
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
871
- * Note that there are some additional requirements to this flow that are not covered in this reference.
872
- * Refer to our [integration guide](https://stripe.com/docs/payments/ideal/set-up-payment) for more details.
873
- *
874
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
875
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
876
- * 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.
877
- *
878
- * @docs https://stripe.com/docs/js/setup_intents/confirm_ideal_setup
879
- */
880
- confirmIdealSetup(
881
- clientSecret: string,
882
- data?: setupIntents.ConfirmIdealSetupData
883
- ): Promise<SetupIntentResult>;
884
-
885
- /**
886
- * Use `stripe.confirmPayPalSetup` in the [Set up future payments](https://stripe.com/docs/payments/paypal/set-up-future-payments) flow when the customer submits your payment form.
887
- * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
888
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
889
- * Note that there are some additional requirements to this flow that are not covered in this reference.
890
- * Refer to our [integration guide](https://stripe.com/docs/payments/paypal/set-up-future-payments) for more details.
891
- *
892
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
893
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
894
- * 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.
895
- *
896
- * @docs https://stripe.com/docs/js/setup_intents/confirm_paypal_setup
897
- */
898
- confirmPayPalSetup(
899
- clientSecret: string,
900
- data?: setupIntents.ConfirmPayPalSetupData
901
- ): Promise<SetupIntentResult>;
902
-
903
- /**
904
- * Use `stripe.confirmSepaDebitSetup` in the [SEPA Direct Debit with Setup Intents](https://stripe.com/docs/payments/sepa-debit-setup-intents) flow when the customer submits your payment form.
905
- * When called, it will confirm the `SetupIntent` with `data` you provide.
906
- * Note that there are some additional requirements to this flow that are not covered in this reference.
907
- * Refer to our [integration guide](https://stripe.com/docs/payments/sepa-debit-setup-intents) for more details.
908
- *
909
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
910
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
911
- * 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.
912
- *
913
- * @docs https://stripe.com/docs/js/setup_intents/confirm_sepa_debit_setup
914
- */
915
- confirmSepaDebitSetup(
916
- clientSecret: string,
917
- data?: setupIntents.ConfirmSepaDebitSetupData
918
- ): Promise<SetupIntentResult>;
919
-
920
- /*
921
- * Use `stripe.confirmSofortSetup` in the [Set up future payments](https://stripe.com/docs/payments/sofort/set-up-payment) flow to use SOFORT bank details to set up a SEPA Direct Debit payment method for future payments.
922
- * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
923
- * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
924
- * Note that there are some additional requirements to this flow that are not covered in this reference.
925
- * Refer to our [integration guide](https://stripe.com/docs/payments/sofort/set-up-payment) for more details.
926
- *
927
- * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
928
- * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
929
- * 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.
930
- */
931
- confirmSofortSetup(
932
- clientSecret: string,
933
- data?: setupIntents.ConfirmSofortSetupData,
934
- options?: setupIntents.ConfirmSofortSetupOptions
935
- ): Promise<SetupIntentResult>;
936
-
937
- /**
938
- * Use `stripe.confirmAffirmPayment` in the [Affirm payments](https://stripe.com/docs/payments/affirm) flow when the customer submits your payment form.
939
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents).
940
- * Refer to our [integration guide](https://stripe.com/docs/payments/affirm/accept-a-payment) for more details.
941
- *
942
- * @docs https://stripe.com/docs/js/payment_intents/confirm_affirm_payment
943
- */
944
-
945
- confirmAffirmPayment(
946
- clientSecret: string,
947
- data?: paymentIntents.ConfirmAffirmPaymentData,
948
- options?: paymentIntents.ConfirmAffirmPaymentOptions
949
- ): Promise<PaymentIntentResult>;
950
-
951
- /**
952
- * Use `stripe.confirmAfterpayClearpayPayment` in the [Afterpay / Clearpay payments](https://stripe.com/docs/payments/afterpay-clearpay) flow when the customer submits your payment form.
953
- * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents).
954
- * Refer to our [integration guide](https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment) for more details.
955
- *
956
- * @docs https://stripe.com/docs/js/payment_intents/confirm_afterpay_clearpay_payment
957
- */
958
-
959
- confirmAfterpayClearpayPayment(
960
- clientSecret: string,
961
- data?: paymentIntents.ConfirmAfterpayClearpayPaymentData,
962
- options?: paymentIntents.ConfirmAfterpayClearpayPaymentOptions
963
- ): Promise<PaymentIntentResult>;
964
-
965
- /**
966
- * Use `stripe.verifyMicrodepositsForSetup` in the [Save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment) flow
967
- * to verify customer's bank account with micro-deposits.
968
- *
969
- * @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_setup
970
- */
971
- verifyMicrodepositsForSetup(
972
- clientSecret: string,
973
- data?: setupIntents.VerifyMicrodepositsForSetupData
974
- ): Promise<SetupIntentResult>;
975
-
976
- /**
977
- * Use `stripe.collectBankAccountForSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit)
978
- * payment method to collect the customer’s bank account in your payment form.
979
- *
980
- * @docs https://stripe.com/docs/js/setup_intents/collect_bank_account_for_setup
981
- */
982
- collectBankAccountForSetup(
983
- options: setupIntents.CollectBankAccountForSetupOptions
984
- ): Promise<SetupIntentResult>;
985
-
986
- /**
987
- * Retrieve a [SetupIntent](https://stripe.com/docs/api/setup_intents) using its client secret.
988
- *
989
- * @docs https://stripe.com/docs/js/setup_intents/retrieve_setup_intent
990
- */
991
- retrieveSetupIntent(clientSecret: string): Promise<SetupIntentResult>;
992
-
993
- /////////////////////////////
994
- /// Orders
995
- ///
996
- /// https://stripe.com/docs/js/orders
997
- /////////////////////////////
998
-
999
- /**
1000
- * Use `stripe.processOrder` to submit and confirm payment for an [Order](https://stripe.com/docs/api/orders_v2) using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
1001
- * When called, `stripe.processOrder` will attempt to complete any required actions, such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page.
1002
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
1003
- *
1004
- * By default, `stripe.processOrder` will always redirect to your return_url after a successful confirmation.
1005
- * If you set `redirect: "if_required"`, then `stripe.processOrder` will only redirect if your user chooses a redirect-based method.
1006
- * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
1007
- *
1008
- * @docs https://stripe.com/docs/js/orders/process_order
1009
- */
1010
- processOrder(options: {
1011
- elements: StripeElements;
1012
- confirmParams?: Partial<orders.ProcessOrderParams>;
1013
- redirect: 'if_required';
1014
- }): Promise<ProcessOrderResult>;
1015
-
1016
- /**
1017
- * Use `stripe.processOrder` to submit and confirm payment for an [Order](https://stripe.com/docs/api/orders_v2) using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
1018
- * When called, `stripe.processOrder` will attempt to complete any required actions, such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page.
1019
- * Your user will be redirected to the return_url you pass once the confirmation is complete.
1020
- *
1021
- * @docs https://stripe.com/docs/js/orders/process_order
1022
- */
1023
- processOrder(options: {
1024
- elements: StripeElements;
1025
- confirmParams: orders.ProcessOrderParams;
1026
- redirect?: 'always';
1027
- }): Promise<never | {error: StripeError}>;
1028
-
1029
- /**
1030
- * Retrieve an [Order](https://stripe.com/docs/api/orders_v2) using its [client secret](https://stripe.com/docs/api/orders_v2/object#order_v2_object-client_secret).
1031
- *
1032
- * @docs https://stripe.com/docs/js/orders/retrieve_order
1033
- */
1034
- retrieveOrder(clientSecret: string): Promise<RetrieveOrderResult>;
1035
-
1036
- /////////////////////////////
1037
- /// Payment Request
1038
- ///
1039
- /// https://stripe.com/docs/js/payment_request
1040
- /////////////////////////////
1041
-
1042
- /**
1043
- * Use `stripe.paymentRequest` to create a `PaymentRequest` object.
1044
- * Creating a `PaymentRequest` requires that you configure it with an `options` object.
1045
- *
1046
- * In Safari, `stripe.paymentRequest` uses Apple Pay, and in other browsers it uses the [Payment Request API standard](https://www.w3.org/TR/payment-request/).
1047
- */
1048
- paymentRequest(options: PaymentRequestOptions): PaymentRequest;
1049
-
1050
- /////////////////////////////
1051
- /// Token and Sources
1052
- ///
1053
- /// https://stripe.com/docs/js/tokens_sources
1054
- /////////////////////////////
1055
-
1056
- /**
1057
- * Use `stripe.createToken` to convert information collected by an `IbanElement` into a single-use [Token](https://stripe.com/docs/api#tokens) that you safely pass to your server to use in an API call.
1058
- *
1059
- * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=ibanElement
1060
- */
1061
- createToken(
1062
- tokenType: elements.StripeIbanElement,
1063
- data: tokens.CreateTokenIbanData
1064
- ): Promise<TokenResult>;
1065
-
1066
- /**
1067
- * Use `stripe.createToken` to convert information collected by card elements into a single-use [Token](https://stripe.com/docs/api#tokens) that you safely pass to your server to use in an API call.
1068
- *
1069
- * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement
1070
- */
1071
- createToken(
1072
- tokenType: elements.StripeCardElement | elements.StripeCardNumberElement,
1073
- data?: tokens.CreateTokenCardData
1074
- ): Promise<TokenResult>;
1075
-
1076
- /**
1077
- * Use `stripe.createToken` to convert personally identifiable information (PII) into a single-use [Token](https://stripe.com/docs/api#tokens) for account identity verification.
1078
- *
1079
- * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=pii
1080
- */
1081
- createToken(
1082
- tokenType: 'pii',
1083
- data: tokens.CreateTokenPiiData
1084
- ): Promise<TokenResult>;
1085
-
1086
- /**
1087
- * Use `stripe.createToken` to convert bank account information into a single-use token that you safely pass to your server to use in an API call.
1088
- *
1089
- * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=bank_account
1090
- */
1091
- createToken(
1092
- tokenType: 'bank_account',
1093
- data: tokens.CreateTokenBankAccountData
1094
- ): Promise<TokenResult>;
1095
-
1096
- /**
1097
- * Use `stripe.createToken` to tokenize the recollected CVC for a saved card.
1098
-
1099
- * First, render a `CardCvcElement` to collect the data.
1100
- * Then pass the `CardCvcElement` to `stripe.createToken` to tokenize the collected data.
1101
- *
1102
- * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=cvc_update
1103
- */
1104
- createToken(
1105
- tokenType: 'cvc_update',
1106
- element: elements.StripeCardCvcElement
1107
- ): Promise<TokenResult>;
1108
-
1109
- /**
1110
- * Use `stripe.createToken` to create a single-use token that wraps a user’s legal entity information.
1111
- * Use this when creating or updating a Connect account.
1112
- * See the [account tokens documentation](https://stripe.com/docs/connect/account-tokens) to learn more.
1113
- */
1114
- createToken(
1115
- tokenType: 'account',
1116
- data: api.TokenCreateParams.Account
1117
- ): Promise<TokenResult>;
1118
-
1119
- /**
1120
- * Use `stripe.createToken` to create a single-use token that represents the details for a person.
1121
- * Use this when creating or updating persons associated with a Connect account.
1122
- * See the [documentation](https://stripe.com/docs/connect/account-tokens) to learn more.
1123
- */
1124
- createToken(
1125
- tokenType: 'person',
1126
- data: api.TokenCreateParams.Person
1127
- ): Promise<TokenResult>;
1128
-
1129
- /**
1130
- * Use `stripe.createSource` to convert payment information collected by elements into a `Source` object that you safely pass to your server to use in an API call.
1131
- * See the [Sources documentation](https://stripe.com/docs/sources) for more information about sources.
1132
- */
1133
- createSource(
1134
- element: StripeElement,
1135
- sourceData: tokens.CreateSourceData
1136
- ): Promise<SourceResult>;
1137
-
1138
- /**
1139
- * Use `stripe.createSource` to convert raw payment information into a `Source` object that you safely pass to your server to use in an API call.
1140
- * See the [Sources documentation](https://stripe.com/docs/sources) for more information about sources.
1141
- */
1142
- createSource(sourceData: tokens.CreateSourceData): Promise<SourceResult>;
1143
-
1144
- /**
1145
- * Retrieve a [Source](https://stripe.com/docs/api#sources) using its unique ID and client secret.
1146
- *
1147
- * @docs https://stripe.com/docs/js/tokens_sources/retrieve_source
1148
- */
1149
- retrieveSource(source: tokens.RetrieveSourceParam): Promise<SourceResult>;
1150
-
1151
- /////////////////////////////
1152
- /// Analytics
1153
- ///
1154
- /////////////////////////////
1155
-
1156
- /**
1157
- * Use `stripe.registerAppInfo` to register a frontend open source library.
1158
- */
1159
- registerAppInfo(wrapperLibrary: WrapperLibrary): void;
1160
-
1161
- /////////////////////////////
1162
- /// Identity
1163
- ///
1164
- /////////////////////////////
1165
-
1166
- /**
1167
- * Use `stripe.verifyIdentity` to display an [Identity](https://stripe.com/docs/identity) modal that securely collects verification information.
1168
- *
1169
- * * @docs https://stripe.com/docs/js/identity/modal
1170
- */
1171
- verifyIdentity(clientSecret: string): Promise<VerificationSessionResult>;
1172
-
1173
- /////////////////////////////
1174
- /// Financial Connections
1175
- ///
1176
- /////////////////////////////
1177
-
1178
- /**
1179
- * Use `stripe.collectFinancialConnectionsAccounts` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect financial accounts.
1180
- *
1181
- * * @docs https://stripe.com/docs/js/financial_connections/collect_financial_connections_accounts
1182
- */
1183
- collectFinancialConnectionsAccounts(
1184
- options: financialConnections.CollectFinancialConnectionsAccountsOptions
1185
- ): Promise<FinancialConnectionsSessionResult>;
1186
-
1187
- /**
1188
- * Use `stripe.collectBankAccountToken` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect a [Bank Account Token](https://stripe.com/docs/api/tokens/object).
1189
- *
1190
- * * @docs https://stripe.com/docs/js/financial_connections/collect_bank_account_token
1191
- */
1192
- collectBankAccountToken(
1193
- options: financialConnections.CollectBankAccountTokenOptions
1194
- ): Promise<CollectBankAccountTokenResult>;
1195
-
1196
- /**
1197
- * Use `stripe.createEphemeralKeyNonce` to create an ephemeral key nonce that lets you securely create ephemeral keys
1198
- *
1199
- * * @docs https://stripe.com/docs/js/issuing/create_ephemeral_key_nonce
1200
- */
1201
- createEphemeralKeyNonce(
1202
- options: ephemeralKeys.EphemeralKeyNonceOptions
1203
- ): Promise<EphemeralKeyNonceResult>;
1204
-
1205
- /**
1206
- * Requires beta access:
1207
- * Contact [Stripe support](https://support.stripe.com/) for more information.
1208
- */
1209
- initCustomCheckout(
1210
- options: StripeCustomCheckoutOptions
1211
- ): Promise<StripeCustomCheckout>;
1212
-
1213
- /**
1214
- * Use `stripe.initEmbeddedCheckout` to initialize an embedded Checkout instance
1215
- *
1216
- * * @docs https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=embedded-checkout
1217
- */
1218
- initEmbeddedCheckout(
1219
- options: StripeEmbeddedCheckoutOptions
1220
- ): Promise<StripeEmbeddedCheckout>;
1221
- }
1222
-
1223
- export type PaymentIntentResult =
1224
- | {paymentIntent: api.PaymentIntent; error?: undefined}
1225
- | {paymentIntent?: undefined; error: StripeError};
1226
-
1227
- export type SetupIntentResult =
1228
- | {setupIntent: api.SetupIntent; error?: undefined}
1229
- | {setupIntent?: undefined; error: StripeError};
1230
-
1231
- export type PaymentIntentOrSetupIntentResult =
1232
- | {
1233
- paymentIntent: api.PaymentIntent;
1234
- setupIntent?: undefined;
1235
- error?: undefined;
1236
- }
1237
- | {paymentIntent?: undefined; setupIntent: api.SetupIntent; error?: undefined}
1238
- | {paymentIntent?: undefined; setupIntent?: undefined; error: StripeError};
1239
-
1240
- export type ProcessOrderResult =
1241
- | {paymentIntent: api.PaymentIntent; order: api.Order; error?: undefined}
1242
- | {paymentIntent?: undefined; order: api.Order; error?: undefined}
1243
- | {paymentIntent?: undefined; order?: undefined; error: StripeError};
1244
-
1245
- export type RetrieveOrderResult =
1246
- | {order: api.Order; error?: undefined}
1247
- | {order?: undefined; error: StripeError};
1248
-
1249
- export type PaymentMethodResult =
1250
- | {paymentMethod: api.PaymentMethod; error?: undefined}
1251
- | {paymentMethod?: undefined; error: StripeError};
1252
-
1253
- export type SourceResult =
1254
- | {source: api.Source; error?: undefined}
1255
- | {source?: undefined; error: StripeError};
1256
-
1257
- export type TokenResult =
1258
- | {token: api.Token; error?: undefined}
1259
- | {token?: undefined; error: StripeError};
1260
-
1261
- export type VerificationSessionResult =
1262
- | {verificationSession: api.VerificationSession; error?: undefined}
1263
- | {verificationSession?: undefined; error: StripeError};
1264
-
1265
- export type FinancialConnectionsSessionResult =
1266
- | {
1267
- financialConnectionsSession: api.FinancialConnectionsSession;
1268
- error?: undefined;
1269
- }
1270
- | {financialConnectionsSession: undefined; error: StripeError};
1271
-
1272
- export type CollectBankAccountTokenResult =
1273
- | {
1274
- financialConnectionsSession: api.FinancialConnectionsSession;
1275
- token: api.BankAccountToken;
1276
- error?: undefined;
1277
- }
1278
- | {
1279
- financialConnectionsSession: undefined;
1280
- token: undefined;
1281
- error: StripeError;
1282
- };
1283
-
1284
- export type EphemeralKeyNonceResult =
1285
- | {nonce: string; error?: undefined}
1286
- | {nonce?: undefined; error: StripeError};
1287
-
1288
- /* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
1289
- This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
1290
- You can find more details about how Radar uses this data by reading about how Radar performs [advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection).
1291
- */
1292
- export type RadarSessionPayload =
1293
- | {radarSession: Record<any, any>; error?: undefined}
1294
- | {radarSession?: undefined; error: StripeError};
1295
-
1296
- export interface WrapperLibrary {
1297
- /**
1298
- * Your library’s name, maximum length is 30
1299
- */
1300
- name: string;
1301
-
1302
- /**
1303
- * Required for Stripe Verified Partners, optional otherwise
1304
- * Your Partner ID from the Partners section of the Dashboard
1305
- */
1306
- partner_id?: string;
1307
-
1308
- /**
1309
- * Your library's version, in the format of x.x.x
1310
- */
1311
- version?: string;
1312
-
1313
- /**
1314
- * The URL for your library's website with your contact details
1315
- */
1316
- url?: string;
1317
- }
1318
-
1319
- /**
1320
- * Use `Stripe(publishableKey, options?)` to create an instance of the `Stripe` object.
1321
- * The Stripe object is your entrypoint to the rest of the Stripe.js SDK.
1322
- *
1323
- * Your Stripe publishable [API key](https://stripe.com/docs/keys) is required when calling this function, as it identifies your website to Stripe.
1324
- *
1325
- * When you’re ready to accept live payments, replace the test key with your live key in production.
1326
- * Learn more about how API keys work in [test mode and live mode](https://stripe.com/docs/dashboard#viewing-test-data).
1327
- */
1328
- export interface StripeConstructor {
1329
- (
1330
- /**
1331
- * Your publishable key.
1332
- */
1333
- publishableKey: string,
1334
-
1335
- /**
1336
- * Initialization options.
1337
- */
1338
- options?: StripeConstructorOptions
1339
- ): Stripe;
1340
- }
1341
-
1342
- export interface StripeConstructorOptions {
1343
- /**
1344
- * For usage with [Connect](https://stripe.com/docs/connect) only.
1345
- * Specifying a connected account ID (e.g., `acct_24BFMpJ1svR5A89k`) allows you to perform actions on behalf of that account.
1346
- */
1347
- stripeAccount?: string;
1348
-
1349
- /**
1350
- * Override your account's [API version](https://stripe.com/docs/api/versioning).
1351
- */
1352
- apiVersion?: string;
1353
-
1354
- /**
1355
- * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) used to globally configure localization in Stripe.js.
1356
- * Setting the locale here will localize error strings for all Stripe.js methods.
1357
- * It will also configure the locale for [Elements](#element_mount) and [Checkout](https://stripe.com/docs/js/checkout/redirect_to_checkout). Default is `auto` (Stripe detects the locale of the browser).
1358
- *
1359
- * Supported values depend on which features you are using.
1360
- * Checkout supports a slightly different set of locales than the rest of Stripe.js.
1361
- * If you are planning on using Checkout, make sure to use a [value](#checkout_redirect_to_checkout-options-locale) that it supports.
1362
- */
1363
- locale?: StripeElementLocale | CheckoutLocale;
1364
-
1365
- /**
1366
- * Opt-in to prerelease Stripe.js features by passing `betas` when instantiating a `Stripe` object.
1367
- *
1368
- * Supported values for the `betas` option can be found in integration guides for prerelease features.
1369
- * Most users of Stripe.js do not pass this option.
1370
- */
1371
- betas?: string[];
1372
- }
1373
-
1374
- export type StripeErrorType =
1375
- /**
1376
- * Failure to connect to Stripe's API.
1377
- */
1378
- | 'api_connection_error'
1379
-
1380
- /**
1381
- * API errors cover any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon.
1382
- */
1383
- | 'api_error'
1384
-
1385
- /**
1386
- * Failure to properly authenticate yourself in the request.
1387
- */
1388
- | 'authentication_error'
1389
-
1390
- /**
1391
- * Card errors are the most common type of error you should expect to handle.
1392
- * They result when the user enters a card that can't be charged for some reason.
1393
- */
1394
- | 'card_error'
1395
-
1396
- /**
1397
- * Idempotency errors occur when an `Idempotency-Key` is re-used on a request that does not match the first request's API endpoint and parameters.
1398
- */
1399
- | 'idempotency_error'
1400
-
1401
- /**
1402
- * Invalid request errors arise when your request has invalid parameters.
1403
- */
1404
- | 'invalid_request_error'
1405
-
1406
- /**
1407
- * Too many requests hit the API too quickly.
1408
- */
1409
- | 'rate_limit_error'
1410
-
1411
- /**
1412
- * Errors triggered by our client-side libraries when failing to validate fields (e.g., when a card number or expiration date is invalid or incomplete).
1413
- */
1414
- | 'validation_error';
1415
-
1416
- export interface StripeError {
1417
- /**
1418
- * The type of error.
1419
- */
1420
- type: StripeErrorType;
1421
-
1422
- /**
1423
- * For card errors, the ID of the failed charge
1424
- */
1425
- charge?: string;
1426
-
1427
- /**
1428
- * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
1429
- */
1430
- code?: string;
1431
-
1432
- /**
1433
- * For card errors resulting from a card issuer decline, a short string indicating the [card issuer’s reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
1434
- */
1435
- decline_code?: string;
1436
-
1437
- /**
1438
- * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
1439
- */
1440
- doc_url?: string;
1441
-
1442
- /**
1443
- * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
1444
- */
1445
- message?: string;
1446
-
1447
- /**
1448
- * If the error is parameter-specific, the parameter related to the error.
1449
- * For example, you can use this to display a message near the correct form field.
1450
- */
1451
- param?: string;
1452
-
1453
- /**
1454
- * The `PaymentIntent` object for errors returned on a request involving a `PaymentIntent`.
1455
- */
1456
- payment_intent?: api.PaymentIntent;
1457
-
1458
- /**
1459
- * The `PaymentMethod` object for errors returned on a request involving a `PaymentMethod`.
1460
- */
1461
- payment_method?: api.PaymentMethod;
1462
-
1463
- /**
1464
- * The `SetupIntent` object for errors returned on a request involving a `SetupIntent`.
1465
- */
1466
- setup_intent?: api.SetupIntent;
1467
-
1468
- /**
1469
- * The `Source` object for errors returned on a request involving a `Source`.
1470
- */
1471
- source?: api.Source;
1472
- }