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