@stripe/stripe-js 1.20.3 → 1.21.0

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 (53) hide show
  1. package/dist/pure.esm.js +1 -1
  2. package/dist/pure.js +1 -1
  3. package/dist/stripe.esm.js +1 -1
  4. package/dist/stripe.js +1 -1
  5. package/package.json +5 -5
  6. package/src/shared.ts +1 -2
  7. package/types/api/bank-accounts.d.ts +61 -0
  8. package/types/api/cards.d.ts +130 -0
  9. package/types/api/index.d.ts +9 -9
  10. package/types/api/payment-intents.d.ts +330 -0
  11. package/types/api/payment-methods.d.ts +349 -0
  12. package/types/api/setup-intents.d.ts +184 -0
  13. package/types/api/shared.d.ts +124 -126
  14. package/types/api/sources.d.ts +1045 -0
  15. package/types/api/tokens.d.ts +634 -0
  16. package/types/api/verification-sessions.d.ts +9 -0
  17. package/types/index.d.ts +14 -12
  18. package/types/stripe-js/checkout.d.ts +134 -136
  19. package/types/stripe-js/elements/affirm-message.d.ts +59 -61
  20. package/types/stripe-js/elements/afterpay-clearpay-message.d.ts +118 -120
  21. package/types/stripe-js/elements/au-bank-account.d.ts +123 -120
  22. package/types/stripe-js/elements/base.d.ts +263 -263
  23. package/types/stripe-js/elements/card-cvc.d.ts +107 -103
  24. package/types/stripe-js/elements/card-expiry.d.ts +107 -104
  25. package/types/stripe-js/elements/card-number.d.ts +128 -125
  26. package/types/stripe-js/elements/card.d.ts +157 -154
  27. package/types/stripe-js/elements/eps-bank.d.ts +125 -121
  28. package/types/stripe-js/elements/fpx-bank.d.ts +120 -116
  29. package/types/stripe-js/elements/iban.d.ts +134 -131
  30. package/types/stripe-js/elements/ideal-bank.d.ts +125 -121
  31. package/types/stripe-js/elements/index.d.ts +17 -0
  32. package/types/stripe-js/elements/link-authentication.d.ts +92 -94
  33. package/types/stripe-js/elements/p24-bank.d.ts +125 -121
  34. package/types/stripe-js/elements/payment-request-button.d.ts +127 -127
  35. package/types/stripe-js/elements/payment.d.ts +190 -180
  36. package/types/stripe-js/elements/shipping-address.d.ts +123 -125
  37. package/types/stripe-js/elements-group.d.ts +617 -0
  38. package/types/stripe-js/index.d.ts +7 -1069
  39. package/types/stripe-js/payment-intents.d.ts +951 -919
  40. package/types/stripe-js/payment-request.d.ts +503 -503
  41. package/types/stripe-js/setup-intents.d.ts +149 -135
  42. package/types/stripe-js/stripe.d.ts +1070 -0
  43. package/types/stripe-js/token-and-sources.d.ts +80 -80
  44. package/types/utils.d.ts +2 -0
  45. package/types/api/BankAccounts.d.ts +0 -63
  46. package/types/api/Cards.d.ts +0 -130
  47. package/types/api/PaymentIntents.d.ts +0 -329
  48. package/types/api/PaymentMethods.d.ts +0 -349
  49. package/types/api/SetupIntents.d.ts +0 -184
  50. package/types/api/Sources.d.ts +0 -1045
  51. package/types/api/Tokens.d.ts +0 -632
  52. package/types/api/VerificationSessions.d.ts +0 -11
  53. package/types/stripe-js/elements.d.ts +0 -604
@@ -0,0 +1,1070 @@
1
+ import * as api from '../api';
2
+ import * as paymentIntents from './payment-intents';
3
+ import * as setupIntents from './setup-intents';
4
+ import * as tokens from './token-and-sources';
5
+ import * as elements from './elements';
6
+
7
+ import {StripeElements, StripeElementsOptions} from './elements-group';
8
+ import {RedirectToCheckoutOptions} from './checkout';
9
+ import {PaymentRequestOptions, PaymentRequest} from './payment-request';
10
+ import {StripeElement, StripeElementLocale} from './elements-group';
11
+ import {CheckoutLocale} from './checkout';
12
+
13
+ export interface Stripe {
14
+ /////////////////////////////
15
+ /// Elements
16
+ ///
17
+ /// https://stripe.com/docs/js/elements_object
18
+ /////////////////////////////
19
+
20
+ /**
21
+ * Create an `Elements` instance, which manages a group of elements.
22
+ */
23
+ elements(options?: StripeElementsOptions): StripeElements;
24
+
25
+ /////////////////////////////
26
+ /// Checkout
27
+ ///
28
+ /// https://stripe.com/docs/js/checkout
29
+ /////////////////////////////
30
+
31
+ /**
32
+ * Use `stripe.redirectToCheckout` to redirect your customers to [Checkout](https://stripe.com/docs/payments/checkout), a Stripe-hosted page to securely collect payment information.
33
+ * When the customer completes their purchase, they are redirected back to your website.
34
+ */
35
+ redirectToCheckout(
36
+ options: RedirectToCheckoutOptions
37
+ ): Promise<never | {error: StripeError}>;
38
+
39
+ /////////////////////////////
40
+ /// Payment Intents
41
+ ///
42
+ /// https://stripe.com/docs/js/payment_intents
43
+ /////////////////////////////
44
+
45
+ /**
46
+ * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
47
+ * 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.
48
+ * Your user will be redirected to the return_url you pass once the confirmation is complete.
49
+ *
50
+ * By default, stripe.`confirmPayment` will always redirect to your return_url after a successful confirmation.
51
+ * If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method.
52
+ * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
53
+ *
54
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_payment
55
+ */
56
+ confirmPayment(options: {
57
+ elements: StripeElements;
58
+ confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
59
+ redirect: 'if_required';
60
+ }): Promise<PaymentIntentResult>;
61
+
62
+ /**
63
+ * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
64
+ * 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.
65
+ * Your user will be redirected to the return_url you pass once the confirmation is complete.
66
+ *
67
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_payment
68
+ */
69
+ confirmPayment(options: {
70
+ elements: StripeElements;
71
+ confirmParams: paymentIntents.ConfirmPaymentData;
72
+ redirect?: 'always';
73
+ }): Promise<never | {error: StripeError}>;
74
+
75
+ /**
76
+ * 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.
77
+ * 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.
78
+ *
79
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
80
+ * `stripe.confirmAcssDebitPayment` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI.
81
+ * It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement.
82
+ * If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data.
83
+ *
84
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_acss_debit_payment
85
+ */
86
+ confirmAcssDebitPayment(
87
+ clientSecret: string,
88
+ data?: paymentIntents.ConfirmAcssDebitPaymentData,
89
+ options?: paymentIntents.ConfirmAcssDebitPaymentOptions
90
+ ): Promise<PaymentIntentResult>;
91
+
92
+ /**
93
+ * Use `stripe.confirmAlipayPayment` in the [Alipay Payments](https://stripe.com/docs/payments/alipay) with Payment Methods flow when the customer submits your payment form.
94
+ * 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.
95
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
96
+ *
97
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
98
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
99
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
100
+ *
101
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_alipay_payment
102
+ */
103
+ confirmAlipayPayment(
104
+ clientSecret: string,
105
+ data?: paymentIntents.ConfirmAlipayPaymentData,
106
+ options?: paymentIntents.ConfirmAlipayPaymentOptions
107
+ ): Promise<PaymentIntentResult>;
108
+
109
+ /**
110
+ * Requires beta access:
111
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
112
+ *
113
+ * 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.
114
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
115
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
116
+ * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-payment-intents) for more details.
117
+ *
118
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
119
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
120
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
121
+ *
122
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_au_becs_debit_payment
123
+ */
124
+ confirmAuBecsDebitPayment(
125
+ clientSecret: string,
126
+ data?: paymentIntents.ConfirmAuBecsDebitPaymentData
127
+ ): Promise<PaymentIntentResult>;
128
+
129
+ /**
130
+ * 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.
131
+ * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
132
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
133
+ *
134
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
135
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
136
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
137
+ *
138
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_payment
139
+ */
140
+ confirmBancontactPayment(
141
+ clientSecret: string,
142
+ data?: paymentIntents.ConfirmBancontactPaymentData,
143
+ options?: paymentIntents.ConfirmBancontactPaymentOptions
144
+ ): Promise<PaymentIntentResult>;
145
+
146
+ /**
147
+ * Use `stripe.confirmBoletoPayment` in the [Boleto Payment](https://stripe.com/docs/payments/boleto) with Payment Methods flow when the customer submits your payment form.
148
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
149
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
150
+ * Refer to our [integration guide](https://stripe.com/docs/payments/boleto) for more details.
151
+ *
152
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
153
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
154
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
155
+ *
156
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_boleto_payment
157
+ */
158
+ confirmBoletoPayment(
159
+ clientSecret: string,
160
+ data?: paymentIntents.ConfirmBoletoPaymentData,
161
+ options?: paymentIntents.ConfirmBoletoPaymentOptions
162
+ ): Promise<PaymentIntentResult>;
163
+
164
+ /**
165
+ * Use `stripe.confirmCardPayment` when the customer submits your payment form.
166
+ * 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.
167
+ *
168
+ * 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.
169
+ *
170
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
171
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
172
+ * 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.
173
+ *
174
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_card_payment
175
+ */
176
+ confirmCardPayment(
177
+ clientSecret: string,
178
+ data?: paymentIntents.ConfirmCardPaymentData,
179
+ options?: paymentIntents.ConfirmCardPaymentOptions
180
+ ): Promise<PaymentIntentResult>;
181
+
182
+ /**
183
+ * Requires beta access:
184
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
185
+ *
186
+ * Use `stripe.confirmCustomerBalancePayment` when the customer submits your payment form.
187
+ *
188
+ * When called, it will confirm the PaymentIntent with data you provide.
189
+ * Refer to our [integration guide](https://stripe.com/docs/payments/bank-transfers) for more details.
190
+ *
191
+ * 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.
192
+ * The confirmation attempt will finish in one of the following result states:
193
+ * 1. If the customer balance was enough to pay the amount, the status is succeeded. The funding_type data is effectively ignored.
194
+ * 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.
195
+ * 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.
196
+ *
197
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_customer_balance_payment
198
+ */
199
+ confirmCustomerBalancePayment(
200
+ clientSecret: string,
201
+ data: paymentIntents.ConfirmCustomerBalancePaymentData,
202
+ options: paymentIntents.ConfirmCustomerBalancePaymentOptions
203
+ ): Promise<PaymentIntentResult>;
204
+
205
+ /**
206
+ * 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.
207
+ * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
208
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
209
+ *
210
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
211
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
212
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
213
+ *
214
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_eps_payment
215
+ */
216
+ confirmEpsPayment(
217
+ clientSecret: string,
218
+ data?: paymentIntents.ConfirmEpsPaymentData,
219
+ options?: paymentIntents.ConfirmEpsPaymentOptions
220
+ ): Promise<PaymentIntentResult>;
221
+
222
+ /**
223
+ * 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.
224
+ * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
225
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
226
+ *
227
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
228
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
229
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
230
+ *
231
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_fpx_payment
232
+ */
233
+ confirmFpxPayment(
234
+ clientSecret: string,
235
+ data?: paymentIntents.ConfirmFpxPaymentData,
236
+ options?: paymentIntents.ConfirmFpxPaymentOptions
237
+ ): Promise<PaymentIntentResult>;
238
+
239
+ /**
240
+ * 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.
241
+ * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
242
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
243
+ *
244
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
245
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
246
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
247
+ *
248
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_giropay_payment
249
+ */
250
+ confirmGiropayPayment(
251
+ clientSecret: string,
252
+ data?: paymentIntents.ConfirmGiropayPaymentData,
253
+ options?: paymentIntents.ConfirmGiropayPaymentOptions
254
+ ): Promise<PaymentIntentResult>;
255
+
256
+ /**
257
+ * Use `stripe.confirmGrabPayPayment` in the [GrabPay payments](https://stripe.com/docs/payments/grabpay) flow when the customer submits your payment form.
258
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents).
259
+ * Refer to our [integration guide](https://stripe.com/docs/payments/grabpay/accept-a-payment) for more details.
260
+ *
261
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_grabpay_payment
262
+ */
263
+
264
+ confirmGrabPayPayment(
265
+ clientSecret: string,
266
+ data?: paymentIntents.ConfirmGrabPayPaymentData,
267
+ options?: paymentIntents.ConfirmGrabPayPaymentOptions
268
+ ): Promise<PaymentIntentResult>;
269
+
270
+ /**
271
+ * Use `stripe.confirmIdealPayment` in the [iDEAL Payments with Payment Methods](https://stripe.com/docs/payments/ideal) flow when the customer submits your payment form.
272
+ * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
273
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
274
+ *
275
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
276
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
277
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
278
+ *
279
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_ideal_payment
280
+ */
281
+ confirmIdealPayment(
282
+ clientSecret: string,
283
+ data?: paymentIntents.ConfirmIdealPaymentData,
284
+ options?: paymentIntents.ConfirmIdealPaymentOptions
285
+ ): Promise<PaymentIntentResult>;
286
+
287
+ /**
288
+ * Requires beta access:
289
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
290
+ *
291
+ * Use `stripe.confirmKlarnaPayment` in the [Klarna Payments](https://stripe.com/docs/payments/klarna) with Payment Methods flow when the customer submits your payment form.
292
+ * 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.
293
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
294
+ *
295
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
296
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
297
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
298
+ *
299
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_klarna_payment
300
+ */
301
+ confirmKlarnaPayment(
302
+ clientSecret: string,
303
+ data?: paymentIntents.ConfirmKlarnaPaymentData,
304
+ options?: paymentIntents.ConfirmKlarnaPaymentOptions
305
+ ): Promise<PaymentIntentResult>;
306
+
307
+ /**
308
+ * Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form.
309
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
310
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
311
+ * Refer to our [integration guide](https://stripe.com/docs/payments/oxxo) for more details.
312
+ *
313
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
314
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
315
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
316
+ *
317
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_oxxo_payment
318
+ */
319
+ confirmOxxoPayment(
320
+ clientSecret: string,
321
+ data?: paymentIntents.ConfirmOxxoPaymentData,
322
+ options?: paymentIntents.ConfirmOxxoPaymentOptions
323
+ ): Promise<PaymentIntentResult>;
324
+
325
+ /**
326
+ * 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.
327
+ * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
328
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
329
+ *
330
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
331
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
332
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
333
+ *
334
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_p24_payment
335
+ */
336
+ confirmP24Payment(
337
+ clientSecret: string,
338
+ data?: paymentIntents.ConfirmP24PaymentData,
339
+ options?: paymentIntents.ConfirmP24PaymentOptions
340
+ ): Promise<PaymentIntentResult>;
341
+
342
+ /**
343
+ * Requires beta access:
344
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
345
+ *
346
+ * Use `stripe.confirmPayNowPayment` in the [PayNow Payments](https://stripe.com/docs/payments/paynow) with Payment Methods flow when the customer submits your payment form.
347
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
348
+ * Refer to our [integration guide](https://stripe.com/docs/payments/paynow) for more details.
349
+ *
350
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
351
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
352
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
353
+ */
354
+ confirmPayNowPayment(
355
+ clientSecret: string,
356
+ data?: paymentIntents.ConfirmPayNowPaymentData,
357
+ options?: paymentIntents.ConfirmPayNowPaymentOptions
358
+ ): Promise<PaymentIntentResult>;
359
+
360
+ /**
361
+ * Requires beta access:
362
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
363
+ *
364
+ * Use `stripe.confirmPayPalPayment` in the [PayPal Payments](https://stripe.com/docs/payments/paypal) with Payment Methods flow when the customer submits your payment form.
365
+ * 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.
366
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
367
+ *
368
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
369
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
370
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
371
+ *
372
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_paypal_payment
373
+ */
374
+ confirmPayPalPayment(
375
+ clientSecret: string,
376
+ data?: paymentIntents.ConfirmPayPalPaymentData
377
+ ): Promise<PaymentIntentResult>;
378
+
379
+ /**
380
+ * Requires beta access:
381
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
382
+ *
383
+ * Use `stripe.confirmPromptPayPayment` in the [PromptPay Payments](https://stripe.com/docs/payments/promptpay) with Payment Methods flow when the customer submits your payment form.
384
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
385
+ * Refer to our [integration guide](https://stripe.com/docs/payments/promptpay) for more details.
386
+ *
387
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
388
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
389
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
390
+ */
391
+ confirmPromptPayPayment(
392
+ clientSecret: string,
393
+ data?: paymentIntents.ConfirmPromptPayPaymentData,
394
+ options?: paymentIntents.ConfirmPromptPayPaymentOptions
395
+ ): Promise<PaymentIntentResult>;
396
+
397
+ /**
398
+ * 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.
399
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
400
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
401
+ * Refer to our [integration guide](https://stripe.com/docs/payments/sepa-debit) for more details.
402
+ *
403
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
404
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
405
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
406
+ *
407
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_sepa_debit_payment
408
+ */
409
+ confirmSepaDebitPayment(
410
+ clientSecret: string,
411
+ data?: paymentIntents.ConfirmSepaDebitPaymentData
412
+ ): Promise<PaymentIntentResult>;
413
+
414
+ /**
415
+ * Use `stripe.confirmSofortPayment` in the [Sofort Payments with Payment Methods](https://stripe.com/docs/payments/sofort) flow when the customer submits your payment form.
416
+ * When called, it will confirm the `PaymentIntent` with `data` you provide. It will then automatically redirect the customer to authorize the transaction.
417
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
418
+ *
419
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
420
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
421
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
422
+ *
423
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_sofort_payment
424
+ */
425
+ confirmSofortPayment(
426
+ clientSecret: string,
427
+ data?: paymentIntents.ConfirmSofortPaymentData
428
+ ): Promise<PaymentIntentResult>;
429
+
430
+ /**
431
+ * Requires beta access:
432
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
433
+ *
434
+ * 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.
435
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
436
+ * Refer to our [integration guide](https://stripe.com/docs/payments/wechat-pay/accept-a-payment) for more details.
437
+ *
438
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
439
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
440
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
441
+ *
442
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_wechat_pay_payment
443
+ */
444
+ confirmWechatPayPayment(
445
+ clientSecret: string,
446
+ data?: paymentIntents.ConfirmWechatPayPaymentData,
447
+ options?: paymentIntents.ConfirmWechatPayPaymentOptions
448
+ ): Promise<PaymentIntentResult>;
449
+
450
+ /**
451
+ * 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.
452
+ * It will throw an error if the `PaymentIntent` has a different status.
453
+ *
454
+ * Note that `stripe.handleCardAction` may take several seconds to complete.
455
+ * During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.
456
+ * 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.
457
+ *
458
+ * Additionally, `stripe.handleCardAction` may trigger a [3D Secure](https://stripe.com/docs/payments/3d-secure) authentication challenge.
459
+ * The authentication challenge requires a context switch that can be hard to follow on a screen-reader.
460
+ * Ensure that your form is accessible by ensuring that success or error messages are clearly read out.
461
+ *
462
+ * @docs https://stripe.com/docs/js/payment_intents/handle_card_action
463
+ */
464
+ handleCardAction(clientSecret: string): Promise<PaymentIntentResult>;
465
+
466
+ /**
467
+ * Use `stripe.verifyMicrodepositsForPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow
468
+ * to verify a customer's bank account with micro-deposits.
469
+ *
470
+ * @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_payment
471
+ */
472
+ verifyMicrodepositsForPayment(
473
+ clientSecret: string,
474
+ data?: paymentIntents.VerifyMicrodepositsForPaymentData
475
+ ): Promise<PaymentIntentResult>;
476
+
477
+ /**
478
+ * 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.
479
+ *
480
+ * @docs https://stripe.com/docs/js/payment_methods/create_payment_method
481
+ */
482
+ createPaymentMethod(
483
+ paymentMethodData: paymentIntents.CreatePaymentMethodData
484
+ ): Promise<PaymentMethodResult>;
485
+
486
+ /**
487
+ * 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).
488
+ *
489
+ * @docs https://stripe.com/docs/js/payment_intents/retrieve_payment_intent
490
+ */
491
+ retrievePaymentIntent(clientSecret: string): Promise<PaymentIntentResult>;
492
+
493
+ /////////////////////////////
494
+ /// Setup Intents
495
+ ///
496
+ /// https://stripe.com/docs/js/setup_intents
497
+ /////////////////////////////
498
+
499
+ /**
500
+ * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
501
+ * 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.
502
+ * Your user will be redirected to the return_url you pass once the confirmation is complete.
503
+ *
504
+ * By default, stripe.`confirmSetup` will always redirect to your return_url after a successful confirmation.
505
+ * If you set `redirect: "if_required"`, then `stripe.confirmSetup` will only redirect if your user chooses a redirect-based payment method.
506
+ * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately.
507
+ *
508
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_setup
509
+ */
510
+ confirmSetup(options: {
511
+ elements: StripeElements;
512
+ confirmParams?: Partial<paymentIntents.ConfirmPaymentData>;
513
+ redirect: 'if_required';
514
+ }): Promise<SetupIntentResult>;
515
+
516
+ /**
517
+ * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element).
518
+ * 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.
519
+ * Your user will be redirected to the return_url you pass once the confirmation is complete.
520
+ *
521
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_setup
522
+ */
523
+ confirmSetup(options: {
524
+ elements: StripeElements;
525
+ confirmParams: paymentIntents.ConfirmPaymentData;
526
+ redirect?: 'always';
527
+ }): Promise<never | {error: StripeError}>;
528
+
529
+ /**
530
+ * 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).
531
+ * 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.
532
+ *
533
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
534
+ * `stripe.confirmAcssDebitSetup` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI.
535
+ * It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement.
536
+ * If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data.
537
+ *
538
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_acss_debit_setup
539
+ */
540
+ confirmAcssDebitSetup(
541
+ clientSecret: string,
542
+ data?: setupIntents.ConfirmAcssDebitSetupData,
543
+ options?: setupIntents.ConfirmAcssDebitSetupOptions
544
+ ): Promise<SetupIntentResult>;
545
+
546
+ /**
547
+ * Requires beta access:
548
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
549
+ *
550
+ * 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.
551
+ * When called, it will confirm the `SetupIntent` with `data` you provide.
552
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
553
+ * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-setup-intents) for more details.
554
+ *
555
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
556
+ * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
557
+ * 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.
558
+ *
559
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_au_becs_debit_setup
560
+ */
561
+ confirmAuBecsDebitSetup(
562
+ clientSecret: string,
563
+ data?: setupIntents.ConfirmAuBecsDebitSetupData
564
+ ): Promise<SetupIntentResult>;
565
+
566
+ /**
567
+ * 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.
568
+ * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide.
569
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
570
+ * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details.
571
+ *
572
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
573
+ * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
574
+ * 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.
575
+ *
576
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_bacs_debit_setup
577
+ */
578
+ confirmBacsDebitSetup(
579
+ clientSecret: string,
580
+ data?: setupIntents.ConfirmBacsDebitSetupData
581
+ ): Promise<SetupIntentResult>;
582
+
583
+ /**
584
+ * 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.
585
+ * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
586
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
587
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
588
+ * Refer to our [integration guide](https://stripe.com/docs/payments/bancontact/set-up-payment) for more details.
589
+ *
590
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
591
+ * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
592
+ * 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.
593
+ *
594
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_setup
595
+ */
596
+ confirmBancontactSetup(
597
+ clientSecret: string,
598
+ data?: setupIntents.ConfirmBancontactSetupData
599
+ ): Promise<SetupIntentResult>;
600
+
601
+ /**
602
+ * Use `stripe.confirmCardSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form.
603
+ * 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.
604
+ *
605
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
606
+ * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
607
+ * 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.
608
+ *
609
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_card_setup
610
+ */
611
+ confirmCardSetup(
612
+ clientSecret: string,
613
+ data?: setupIntents.ConfirmCardSetupData,
614
+ options?: setupIntents.ConfirmCardSetupOptions
615
+ ): Promise<SetupIntentResult>;
616
+
617
+ /**
618
+ * 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.
619
+ * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
620
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
621
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
622
+ * Refer to our [integration guide](https://stripe.com/docs/payments/ideal/set-up-payment) for more details.
623
+ *
624
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
625
+ * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
626
+ * 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.
627
+ *
628
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_ideal_setup
629
+ */
630
+ confirmIdealSetup(
631
+ clientSecret: string,
632
+ data?: setupIntents.ConfirmIdealSetupData
633
+ ): Promise<SetupIntentResult>;
634
+
635
+ /**
636
+ * 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.
637
+ * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
638
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
639
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
640
+ * Refer to our [integration guide](https://stripe.com/docs/payments/paypal/set-up-future-payments) for more details.
641
+ *
642
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
643
+ * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
644
+ * 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.
645
+ *
646
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_paypal_setup
647
+ */
648
+ confirmPayPalSetup(
649
+ clientSecret: string,
650
+ data?: setupIntents.ConfirmPayPalSetupData
651
+ ): Promise<SetupIntentResult>;
652
+
653
+ /**
654
+ * 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.
655
+ * When called, it will confirm the `SetupIntent` with `data` you provide.
656
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
657
+ * Refer to our [integration guide](https://stripe.com/docs/payments/sepa-debit-setup-intents) for more details.
658
+ *
659
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
660
+ * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
661
+ * 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.
662
+ *
663
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_sepa_debit_setup
664
+ */
665
+ confirmSepaDebitSetup(
666
+ clientSecret: string,
667
+ data?: setupIntents.ConfirmSepaDebitSetupData
668
+ ): Promise<SetupIntentResult>;
669
+
670
+ /*
671
+ * 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.
672
+ * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
673
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
674
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
675
+ * Refer to our [integration guide](https://stripe.com/docs/payments/sofort/set-up-payment) for more details.
676
+ *
677
+ * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
678
+ * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
679
+ * 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.
680
+ */
681
+ confirmSofortSetup(
682
+ clientSecret: string,
683
+ data?: setupIntents.ConfirmSofortSetupData
684
+ ): Promise<SetupIntentResult>;
685
+
686
+ /**
687
+ * Use `stripe.confirmAffirmPayment` in the [Affirm payments](https://stripe.com/docs/payments/affirm) flow when the customer submits your payment form.
688
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents).
689
+ * Refer to our [integration guide](https://stripe.com/docs/payments/affirm/accept-a-payment) for more details.
690
+ *
691
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_affirm_payment
692
+ */
693
+
694
+ confirmAffirmPayment(
695
+ clientSecret: string,
696
+ data?: paymentIntents.ConfirmAffirmPaymentData,
697
+ options?: paymentIntents.ConfirmAffirmPaymentOptions
698
+ ): Promise<PaymentIntentResult>;
699
+
700
+ /**
701
+ * Use `stripe.confirmAfterpayClearpayPayment` in the [Afterpay / Clearpay payments](https://stripe.com/docs/payments/afterpay-clearpay) flow when the customer submits your payment form.
702
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents).
703
+ * Refer to our [integration guide](https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment) for more details.
704
+ *
705
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_afterpay_clearpay_payment
706
+ */
707
+
708
+ confirmAfterpayClearpayPayment(
709
+ clientSecret: string,
710
+ data?: paymentIntents.ConfirmAfterpayClearpayPaymentData,
711
+ options?: paymentIntents.ConfirmAfterpayClearpayPaymentOptions
712
+ ): Promise<PaymentIntentResult>;
713
+
714
+ /**
715
+ * 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
716
+ * to verify customer's bank account with micro-deposits.
717
+ *
718
+ * @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_setup
719
+ */
720
+ verifyMicrodepositsForSetup(
721
+ clientSecret: string,
722
+ data?: setupIntents.VerifyMicrodepositsForSetupData
723
+ ): Promise<PaymentIntentResult>;
724
+
725
+ /**
726
+ * Retrieve a [SetupIntent](https://stripe.com/docs/api/setup_intents) using its client secret.
727
+ *
728
+ * @docs https://stripe.com/docs/js/setup_intents/retrieve_setup_intent
729
+ */
730
+ retrieveSetupIntent(clientSecret: string): Promise<SetupIntentResult>;
731
+
732
+ /////////////////////////////
733
+ /// Payment Request
734
+ ///
735
+ /// https://stripe.com/docs/js/payment_request
736
+ /////////////////////////////
737
+
738
+ /**
739
+ * Use `stripe.paymentRequest` to create a `PaymentRequest` object.
740
+ * Creating a `PaymentRequest` requires that you configure it with an `options` object.
741
+ *
742
+ * 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/).
743
+ */
744
+ paymentRequest(options: PaymentRequestOptions): PaymentRequest;
745
+
746
+ /////////////////////////////
747
+ /// Token and Sources
748
+ ///
749
+ /// https://stripe.com/docs/js/tokens_sources
750
+ /////////////////////////////
751
+
752
+ /**
753
+ * 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.
754
+ *
755
+ * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=ibanElement
756
+ */
757
+ createToken(
758
+ tokenType: elements.StripeIbanElement,
759
+ data: tokens.CreateTokenIbanData
760
+ ): Promise<TokenResult>;
761
+
762
+ /**
763
+ * 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.
764
+ *
765
+ * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement
766
+ */
767
+ createToken(
768
+ tokenType: elements.StripeCardElement | elements.StripeCardNumberElement,
769
+ data?: tokens.CreateTokenCardData
770
+ ): Promise<TokenResult>;
771
+
772
+ /**
773
+ * Use `stripe.createToken` to convert personally identifiable information (PII) into a single-use [Token](https://stripe.com/docs/api#tokens) for account identity verification.
774
+ *
775
+ * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=pii
776
+ */
777
+ createToken(
778
+ tokenType: 'pii',
779
+ data: tokens.CreateTokenPiiData
780
+ ): Promise<TokenResult>;
781
+
782
+ /**
783
+ * 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.
784
+ *
785
+ * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=bank_account
786
+ */
787
+ createToken(
788
+ tokenType: 'bank_account',
789
+ data: tokens.CreateTokenBankAccountData
790
+ ): Promise<TokenResult>;
791
+
792
+ /**
793
+ * Use `stripe.createToken` to tokenize the recollected CVC for a saved card.
794
+
795
+ * First, render a `CardCvcElement` to collect the data.
796
+ * Then pass the `CardCvcElement` to `stripe.createToken` to tokenize the collected data.
797
+ *
798
+ * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=cvc_update
799
+ */
800
+ createToken(
801
+ tokenType: 'cvc_update',
802
+ element: elements.StripeCardCvcElement
803
+ ): Promise<TokenResult>;
804
+
805
+ /**
806
+ * Use `stripe.createToken` to create a single-use token that wraps a user’s legal entity information.
807
+ * Use this when creating or updating a Connect account.
808
+ * See the [account tokens documentation](https://stripe.com/docs/connect/account-tokens) to learn more.
809
+ */
810
+ createToken(
811
+ tokenType: 'account',
812
+ data: api.TokenCreateParams.Account
813
+ ): Promise<TokenResult>;
814
+
815
+ /**
816
+ * Use `stripe.createToken` to create a single-use token that represents the details for a person.
817
+ * Use this when creating or updating persons associated with a Connect account.
818
+ * See the [documentation](https://stripe.com/docs/connect/account-tokens) to learn more.
819
+ */
820
+ createToken(
821
+ tokenType: 'person',
822
+ data: api.TokenCreateParams.Person
823
+ ): Promise<TokenResult>;
824
+
825
+ /**
826
+ * 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.
827
+ * See the [Sources documentation](https://stripe.com/docs/sources) for more information about sources.
828
+ */
829
+ createSource(
830
+ element: StripeElement,
831
+ sourceData: tokens.CreateSourceData
832
+ ): Promise<SourceResult>;
833
+
834
+ /**
835
+ * 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.
836
+ * See the [Sources documentation](https://stripe.com/docs/sources) for more information about sources.
837
+ */
838
+ createSource(sourceData: tokens.CreateSourceData): Promise<SourceResult>;
839
+
840
+ /**
841
+ * Retrieve a [Source](https://stripe.com/docs/api#sources) using its unique ID and client secret.
842
+ *
843
+ * @docs https://stripe.com/docs/js/tokens_sources/retrieve_source
844
+ */
845
+ retrieveSource(source: tokens.RetrieveSourceParam): Promise<SourceResult>;
846
+
847
+ /////////////////////////////
848
+ /// Analytics
849
+ ///
850
+ /////////////////////////////
851
+
852
+ /**
853
+ * Use `stripe.registerAppInfo` to register a frontend open source library.
854
+ */
855
+ registerAppInfo(wrapperLibrary: WrapperLibrary): void;
856
+
857
+ /////////////////////////////
858
+ /// Identity
859
+ ///
860
+ /////////////////////////////
861
+
862
+ /**
863
+ * Use `stripe.verifyIdentity` to display an [Identity](https://stripe.com/docs/identity) modal that securely collects verification information.
864
+ *
865
+ * * @docs https://stripe.com/docs/js/identity/modal
866
+ */
867
+ verifyIdentity(clientSecret: string): Promise<VerificationSessionResult>;
868
+ }
869
+
870
+ export type PaymentIntentResult =
871
+ | {paymentIntent: api.PaymentIntent; error?: undefined}
872
+ | {paymentIntent?: undefined; error: StripeError};
873
+
874
+ export type SetupIntentResult =
875
+ | {setupIntent: api.SetupIntent; error?: undefined}
876
+ | {setupIntent?: undefined; error: StripeError};
877
+
878
+ export type PaymentMethodResult =
879
+ | {paymentMethod: api.PaymentMethod; error?: undefined}
880
+ | {paymentMethod?: undefined; error: StripeError};
881
+
882
+ export type SourceResult =
883
+ | {source: api.Source; error?: undefined}
884
+ | {source?: undefined; error: StripeError};
885
+
886
+ export type TokenResult =
887
+ | {token: api.Token; error?: undefined}
888
+ | {token?: undefined; error: StripeError};
889
+
890
+ export type VerificationSessionResult =
891
+ | {verificationSession: api.VerificationSession; error?: undefined}
892
+ | {verificationSession?: undefined; error: StripeError};
893
+
894
+ export interface WrapperLibrary {
895
+ /**
896
+ * Your library’s name, maximum length is 30
897
+ */
898
+ name: string;
899
+
900
+ /**
901
+ * Required for Stripe Verified Partners, optional otherwise
902
+ * Your Partner ID from the Partners section of the Dashboard
903
+ */
904
+ partner_id?: string;
905
+
906
+ /**
907
+ * Your library's version, in the format of x.x.x
908
+ */
909
+ version?: string;
910
+
911
+ /**
912
+ * The URL for your library's website with your contact details
913
+ */
914
+ url?: string;
915
+ }
916
+
917
+ /**
918
+ * Use `Stripe(publishableKey, options?)` to create an instance of the `Stripe` object.
919
+ * The Stripe object is your entrypoint to the rest of the Stripe.js SDK.
920
+ *
921
+ * Your Stripe publishable [API key](https://stripe.com/docs/keys) is required when calling this function, as it identifies your website to Stripe.
922
+ *
923
+ * When you’re ready to accept live payments, replace the test key with your live key in production.
924
+ * Learn more about how API keys work in [test mode and live mode](https://stripe.com/docs/dashboard#viewing-test-data).
925
+ */
926
+ export interface StripeConstructor {
927
+ (
928
+ /**
929
+ * Your publishable key.
930
+ */
931
+ publishableKey: string,
932
+
933
+ /**
934
+ * Initialization options.
935
+ */
936
+ options?: StripeConstructorOptions
937
+ ): Stripe;
938
+ }
939
+
940
+ export interface StripeConstructorOptions {
941
+ /**
942
+ * For usage with [Connect](https://stripe.com/docs/connect) only.
943
+ * Specifying a connected account ID (e.g., `acct_24BFMpJ1svR5A89k`) allows you to perform actions on behalf of that account.
944
+ */
945
+ stripeAccount?: string;
946
+
947
+ /**
948
+ * Override your account's [API version](https://stripe.com/docs/api/versioning).
949
+ */
950
+ apiVersion?: string;
951
+
952
+ /**
953
+ * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) used to globally configure localization in Stripe.js.
954
+ * Setting the locale here will localize error strings for all Stripe.js methods.
955
+ * 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).
956
+ *
957
+ * Supported values depend on which features you are using.
958
+ * Checkout supports a slightly different set of locales than the rest of Stripe.js.
959
+ * If you are planning on using Checkout, make sure to use a [value](#checkout_redirect_to_checkout-options-locale) that it supports.
960
+ */
961
+ locale?: StripeElementLocale | CheckoutLocale;
962
+
963
+ /**
964
+ * Opt-in to prerelease Stripe.js features by passing `betas` when instantiating a `Stripe` object.
965
+ *
966
+ * Supported values for the `betas` option can be found in integration guides for prerelease features.
967
+ * Most users of Stripe.js do not pass this option.
968
+ */
969
+ betas?: string[];
970
+ }
971
+
972
+ export type StripeErrorType =
973
+ /**
974
+ * Failure to connect to Stripe's API.
975
+ */
976
+ | 'api_connection_error'
977
+
978
+ /**
979
+ * API errors cover any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon.
980
+ */
981
+ | 'api_error'
982
+
983
+ /**
984
+ * Failure to properly authenticate yourself in the request.
985
+ */
986
+ | 'authentication_error'
987
+
988
+ /**
989
+ * Card errors are the most common type of error you should expect to handle.
990
+ * They result when the user enters a card that can't be charged for some reason.
991
+ */
992
+ | 'card_error'
993
+
994
+ /**
995
+ * 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.
996
+ */
997
+ | 'idempotency_error'
998
+
999
+ /**
1000
+ * Invalid request errors arise when your request has invalid parameters.
1001
+ */
1002
+ | 'invalid_request_error'
1003
+
1004
+ /**
1005
+ * Too many requests hit the API too quickly.
1006
+ */
1007
+ | 'rate_limit_error'
1008
+
1009
+ /**
1010
+ * 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).
1011
+ */
1012
+ | 'validation_error';
1013
+
1014
+ export interface StripeError {
1015
+ /**
1016
+ * The type of error.
1017
+ */
1018
+ type: StripeErrorType;
1019
+
1020
+ /**
1021
+ * For card errors, the ID of the failed charge
1022
+ */
1023
+ charge?: string;
1024
+
1025
+ /**
1026
+ * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
1027
+ */
1028
+ code?: string;
1029
+
1030
+ /**
1031
+ * 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.
1032
+ */
1033
+ decline_code?: string;
1034
+
1035
+ /**
1036
+ * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
1037
+ */
1038
+ doc_url?: string;
1039
+
1040
+ /**
1041
+ * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
1042
+ */
1043
+ message?: string;
1044
+
1045
+ /**
1046
+ * If the error is parameter-specific, the parameter related to the error.
1047
+ * For example, you can use this to display a message near the correct form field.
1048
+ */
1049
+ param?: string;
1050
+
1051
+ /**
1052
+ * The `PaymentIntent` object for errors returned on a request involving a `PaymentIntent`.
1053
+ */
1054
+ payment_intent?: api.PaymentIntent;
1055
+
1056
+ /**
1057
+ * The `PaymentMethod` object for errors returned on a request involving a `PaymentMethod`.
1058
+ */
1059
+ payment_method?: api.PaymentMethod;
1060
+
1061
+ /**
1062
+ * The `SetupIntent` object for errors returned on a request involving a `SetupIntent`.
1063
+ */
1064
+ setup_intent?: api.SetupIntent;
1065
+
1066
+ /**
1067
+ * The `Source` object for errors returned on a request involving a `Source`.
1068
+ */
1069
+ source?: api.Source;
1070
+ }