@stripe/stripe-js 1.20.2 → 1.21.2

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