@stripe/stripe-js 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +11 -3
  2. package/dist/index.d.mts +12626 -0
  3. package/dist/index.d.ts +12626 -0
  4. package/dist/stripe.js +1 -1
  5. package/dist/stripe.mjs +1 -1
  6. package/package.json +5 -26
  7. package/pure/index.d.mts +12626 -0
  8. package/pure/index.d.ts +12626 -0
  9. package/{dist/pure.js → pure/index.js} +1 -1
  10. package/{dist/pure.mjs → pure/index.mjs} +1 -1
  11. package/types/.eslintrc.yml +0 -3
  12. package/types/api/bank-accounts.d.ts +0 -61
  13. package/types/api/cards.d.ts +0 -130
  14. package/types/api/financial-connections.d.ts +0 -232
  15. package/types/api/index.d.ts +0 -11
  16. package/types/api/orders.d.ts +0 -122
  17. package/types/api/payment-intents.d.ts +0 -330
  18. package/types/api/payment-methods.d.ts +0 -452
  19. package/types/api/setup-intents.d.ts +0 -184
  20. package/types/api/shared.d.ts +0 -125
  21. package/types/api/sources.d.ts +0 -1045
  22. package/types/api/tokens.d.ts +0 -639
  23. package/types/api/verification-sessions.d.ts +0 -9
  24. package/types/index.d.mts +0 -17
  25. package/types/index.d.ts +0 -17
  26. package/types/pure.d.mts +0 -5
  27. package/types/pure.d.ts +0 -5
  28. package/types/stripe-js/checkout.d.ts +0 -153
  29. package/types/stripe-js/custom-checkout.d.ts +0 -220
  30. package/types/stripe-js/elements/address.d.ts +0 -261
  31. package/types/stripe-js/elements/affirm-message.d.ts +0 -65
  32. package/types/stripe-js/elements/afterpay-clearpay-message.d.ts +0 -119
  33. package/types/stripe-js/elements/apple-pay.d.ts +0 -156
  34. package/types/stripe-js/elements/au-bank-account.d.ts +0 -138
  35. package/types/stripe-js/elements/base.d.ts +0 -264
  36. package/types/stripe-js/elements/card-cvc.d.ts +0 -119
  37. package/types/stripe-js/elements/card-expiry.d.ts +0 -119
  38. package/types/stripe-js/elements/card-number.d.ts +0 -200
  39. package/types/stripe-js/elements/card.d.ts +0 -226
  40. package/types/stripe-js/elements/cart.d.ts +0 -224
  41. package/types/stripe-js/elements/eps-bank.d.ts +0 -140
  42. package/types/stripe-js/elements/express-checkout.d.ts +0 -446
  43. package/types/stripe-js/elements/fpx-bank.d.ts +0 -134
  44. package/types/stripe-js/elements/iban.d.ts +0 -135
  45. package/types/stripe-js/elements/ideal-bank.d.ts +0 -140
  46. package/types/stripe-js/elements/index.d.ts +0 -22
  47. package/types/stripe-js/elements/issuing/index.d.ts +0 -5
  48. package/types/stripe-js/elements/issuing/issuing-card-copy-button.d.ts +0 -37
  49. package/types/stripe-js/elements/issuing/issuing-card-cvc-display.d.ts +0 -32
  50. package/types/stripe-js/elements/issuing/issuing-card-expiry-display.d.ts +0 -32
  51. package/types/stripe-js/elements/issuing/issuing-card-number-display.d.ts +0 -40
  52. package/types/stripe-js/elements/issuing/issuing-card-pin-display.d.ts +0 -32
  53. package/types/stripe-js/elements/link-authentication.d.ts +0 -158
  54. package/types/stripe-js/elements/p24-bank.d.ts +0 -140
  55. package/types/stripe-js/elements/payment-method-messaging.d.ts +0 -98
  56. package/types/stripe-js/elements/payment-request-button.d.ts +0 -151
  57. package/types/stripe-js/elements/payment.d.ts +0 -275
  58. package/types/stripe-js/elements/shipping-address.d.ts +0 -215
  59. package/types/stripe-js/elements-group.d.ts +0 -1129
  60. package/types/stripe-js/embedded-checkout.d.ts +0 -30
  61. package/types/stripe-js/ephemeral-keys.d.ts +0 -3
  62. package/types/stripe-js/financial-connections.d.ts +0 -19
  63. package/types/stripe-js/index.d.ts +0 -13
  64. package/types/stripe-js/orders.d.ts +0 -9
  65. package/types/stripe-js/payment-intents.d.ts +0 -1465
  66. package/types/stripe-js/payment-request.d.ts +0 -529
  67. package/types/stripe-js/setup-intents.d.ts +0 -250
  68. package/types/stripe-js/stripe.d.ts +0 -1472
  69. package/types/stripe-js/token-and-sources.d.ts +0 -110
  70. package/types/utils.d.ts +0 -2
@@ -1,452 +0,0 @@
1
- import {StripeElement, StripeElements} from '../stripe-js';
2
- import {Metadata, MetadataParam, Address} from './shared';
3
-
4
- /**
5
- * The PaymentMethod object.
6
- */
7
- export interface PaymentMethod {
8
- /**
9
- * Unique identifier for the object.
10
- */
11
- id: string;
12
-
13
- /**
14
- * String representing the object's type. Objects of the same type share the same value.
15
- */
16
- object: 'payment_method';
17
-
18
- billing_details: PaymentMethod.BillingDetails;
19
-
20
- card?: PaymentMethod.Card;
21
-
22
- card_present?: PaymentMethod.CardPresent;
23
-
24
- /**
25
- * Time at which the object was created. Measured in seconds since the Unix epoch.
26
- */
27
- created: number;
28
-
29
- /**
30
- * The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
31
- */
32
- customer: string | null;
33
-
34
- eps?: PaymentMethod.Eps;
35
-
36
- fpx?: PaymentMethod.Fpx;
37
-
38
- grabpay?: PaymentMethod.GrabPay;
39
-
40
- ideal?: PaymentMethod.Ideal;
41
-
42
- p24?: PaymentMethod.P24;
43
-
44
- /**
45
- * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
46
- */
47
- livemode: boolean;
48
-
49
- /**
50
- * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
51
- */
52
- metadata: Metadata;
53
-
54
- sepa_debit?: PaymentMethod.SepaDebit;
55
-
56
- /**
57
- * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
58
- */
59
- type: string;
60
-
61
- affirm?: PaymentMethod.Affirm;
62
-
63
- afterpay_clearpay?: PaymentMethod.AfterpayClearpay;
64
-
65
- acss_debit?: PaymentMethod.AcssDebit;
66
-
67
- au_becs_debit?: PaymentMethod.AuBecsDebit;
68
-
69
- us_bank_account?: PaymentMethod.UsBankAccount;
70
- }
71
-
72
- export namespace PaymentMethod {
73
- export interface AuBecsDebit {
74
- /**
75
- * Bank State Branch
76
- */
77
- bsb_number: string | null;
78
-
79
- /**
80
- * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
81
- */
82
- fingerprint: string | null;
83
-
84
- /**
85
- * Last four characters of the account number.
86
- */
87
- last4: string | null;
88
- }
89
-
90
- export interface BillingDetails {
91
- /**
92
- * Billing address.
93
- */
94
- address: Address | null;
95
-
96
- /**
97
- * Email address.
98
- */
99
- email: string | null;
100
-
101
- /**
102
- * Full name.
103
- */
104
- name: string | null;
105
-
106
- /**
107
- * Billing phone number (including extension).
108
- */
109
- phone: string | null;
110
- }
111
-
112
- export interface Card {
113
- /**
114
- * Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
115
- */
116
- brand: string;
117
-
118
- /**
119
- * Checks on Card address and CVC if provided.
120
- */
121
- checks: Card.Checks | null;
122
-
123
- /**
124
- * Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
125
- */
126
- country: string | null;
127
-
128
- /**
129
- * Two-digit number representing the card's expiration month.
130
- */
131
- exp_month: number;
132
-
133
- /**
134
- * Four-digit number representing the card's expiration year.
135
- */
136
- exp_year: number;
137
-
138
- /**
139
- * Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number.
140
- */
141
- fingerprint?: string | null;
142
-
143
- /**
144
- * Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
145
- */
146
- funding: string;
147
-
148
- /**
149
- * The last four digits of the card.
150
- */
151
- last4: string;
152
-
153
- /**
154
- * Contains details on how this Card maybe be used for 3D Secure authentication.
155
- */
156
- three_d_secure_usage: Card.ThreeDSecureUsage | null;
157
-
158
- /**
159
- * If this Card is part of a card wallet, this contains the details of the card wallet.
160
- */
161
- wallet: null | {[k: string]: any};
162
- }
163
-
164
- export namespace Card {
165
- export interface Checks {
166
- /**
167
- * If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
168
- */
169
- address_line1_check: string | null;
170
-
171
- /**
172
- * If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
173
- */
174
- address_postal_code_check: string | null;
175
-
176
- /**
177
- * If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
178
- */
179
- cvc_check: string | null;
180
- }
181
-
182
- export interface ThreeDSecureUsage {
183
- /**
184
- * Whether 3D Secure is supported on this card.
185
- */
186
- supported: boolean;
187
- }
188
- }
189
-
190
- export interface CardPresent {}
191
-
192
- export interface Eps {
193
- /**
194
- * The customer's bank.
195
- */
196
- bank: string;
197
- }
198
-
199
- export interface Fpx {
200
- /**
201
- * The customer's bank.
202
- */
203
- bank: string;
204
- }
205
-
206
- export interface GrabPay {}
207
-
208
- export interface Ideal {
209
- /**
210
- * The customer's bank, if provided.
211
- */
212
- bank: string | null;
213
-
214
- /**
215
- * The Bank Identifier Code of the customer's bank, if the bank was provided.
216
- */
217
- bic: string | null;
218
- }
219
-
220
- export interface P24 {
221
- /**
222
- * The customer's bank.
223
- */
224
- bank: string;
225
- }
226
-
227
- export interface SepaDebit {
228
- /**
229
- * Bank code of bank associated with the bank account.
230
- */
231
- bank_code: string | null;
232
-
233
- /**
234
- * Branch code of bank associated with the bank account.
235
- */
236
- branch_code: string | null;
237
-
238
- /**
239
- * Two-letter ISO code representing the country the bank account is located in.
240
- */
241
- country: string | null;
242
-
243
- /**
244
- * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
245
- */
246
- fingerprint: string | null;
247
-
248
- /**
249
- * Last four characters of the IBAN.
250
- */
251
- last4: string | null;
252
- }
253
-
254
- export interface Affirm {}
255
-
256
- export interface AfterpayClearpay {}
257
-
258
- export interface AcssDebit {
259
- /**
260
- * Customer’s bank account number.
261
- */
262
- account_number: string;
263
-
264
- /**
265
- * Institution number of the customer’s bank.
266
- */
267
- institution_number: string;
268
-
269
- /**
270
- * Transit number of the customer’s bank.
271
- */
272
- transit_number: string;
273
- }
274
-
275
- export interface UsBankAccount {
276
- /**
277
- * Customer’s bank account number.
278
- */
279
- account_number: string;
280
-
281
- /**
282
- * The routing transit number for the bank account.
283
- */
284
- routing_number: string;
285
-
286
- /**
287
- * The type of entity that holds the account. This can be either `individual` or `company`.
288
- */
289
- account_holder_type: string;
290
-
291
- /**
292
- * Account type: checkings or savings. Defaults to checking if omitted.
293
- */
294
- account_type: string;
295
-
296
- /**
297
- * The name of the bank.
298
- */
299
- bank_name: string;
300
-
301
- /**
302
- * The ID of the Financial Connections Account used to create the payment method.
303
- */
304
- financial_connections_account: string;
305
-
306
- /**
307
- * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
308
- */
309
- fingerprint: string;
310
-
311
- /**
312
- * Last four digits of the bank account number.
313
- */
314
- last4: string;
315
-
316
- /**
317
- * Contains information about US bank account networks that can be used.
318
- */
319
- networks: {
320
- /**
321
- * The preferred network.
322
- */
323
- preferred: string;
324
-
325
- /**
326
- * All supported networks.
327
- */
328
- supported: string[];
329
- };
330
- }
331
- }
332
-
333
- export interface PaymentMethodCreateParams {
334
- /**
335
- * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
336
- */
337
- billing_details?: PaymentMethodCreateParams.BillingDetails;
338
-
339
- /**
340
- * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
341
- */
342
- metadata?: MetadataParam;
343
-
344
- /**
345
- * The PaymentMethod to share.
346
- */
347
- payment_method?: string;
348
-
349
- /**
350
- * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Required unless `payment_method` is specified (see the [Cloning PaymentMethods](https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods) guide)
351
- */
352
- type?: string;
353
- }
354
-
355
- export interface CreatePaymentMethodFromElements {
356
- /**
357
- * The Elements instance
358
- *
359
- * @docs https://stripe.com/docs/js/elements_object
360
- */
361
- elements: StripeElements;
362
-
363
- /**
364
- * Parameters that will be passed on to the PaymentMethod API
365
- *
366
- * @docs https://stripe.com/docs/api/payment_methods/create
367
- */
368
- params?: PaymentMethodCreateParams;
369
-
370
- /**
371
- * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
372
- */
373
- metadata?: MetadataParam;
374
- }
375
- export interface CreatePaymentMethodFromElement {
376
- /**
377
- * The specific Element used to collect payment details
378
- *
379
- * @docs https://stripe.com/docs/js/element
380
- */
381
- element: StripeElement;
382
-
383
- /**
384
- * Parameters that will be passed on to the PaymentMethod API
385
- *
386
- * @docs https://stripe.com/docs/api/payment_methods/create
387
- */
388
- params?: PaymentMethodCreateParams;
389
-
390
- /**
391
- * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
392
- */
393
- metadata?: MetadataParam;
394
- }
395
-
396
- export namespace PaymentMethodCreateParams {
397
- export interface BillingDetails {
398
- /**
399
- * Billing address.
400
- */
401
- address?: BillingDetails.Address;
402
-
403
- /**
404
- * Email address.
405
- */
406
- email?: string;
407
-
408
- /**
409
- * Full name.
410
- */
411
- name?: string;
412
-
413
- /**
414
- * Billing phone number (including extension).
415
- */
416
- phone?: string;
417
- }
418
-
419
- export namespace BillingDetails {
420
- export interface Address {
421
- /**
422
- * City, district, suburb, town, or village.
423
- */
424
- city?: string;
425
-
426
- /**
427
- * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
428
- */
429
- country?: string;
430
-
431
- /**
432
- * Address line 1 (e.g., street, PO Box, or company name).
433
- */
434
- line1?: string;
435
-
436
- /**
437
- * Address line 2 (e.g., apartment, suite, unit, or building).
438
- */
439
- line2?: string;
440
-
441
- /**
442
- * ZIP or postal code.
443
- */
444
- postal_code?: string;
445
-
446
- /**
447
- * State, county, province, or region.
448
- */
449
- state?: string;
450
- }
451
- }
452
- }
@@ -1,184 +0,0 @@
1
- import {PaymentMethod} from './payment-methods';
2
-
3
- /**
4
- * The SetupIntent object.
5
- */
6
- export interface SetupIntent {
7
- /**
8
- * Unique identifier for the object.
9
- */
10
- id: string;
11
-
12
- /**
13
- * String representing the object's type. Objects of the same type share the same value.
14
- */
15
- object: 'setup_intent';
16
-
17
- /**
18
- * Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
19
- */
20
- cancellation_reason: SetupIntent.CancellationReason | null;
21
-
22
- /**
23
- * The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
24
- *
25
- * The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
26
- */
27
- client_secret: string | null;
28
-
29
- /**
30
- * Time at which the object was created. Measured in seconds since the Unix epoch.
31
- */
32
- created: number;
33
-
34
- /**
35
- * An arbitrary string attached to the object. Often useful for displaying to users.
36
- */
37
- description: string | null;
38
-
39
- /**
40
- * The error encountered in the previous SetupIntent confirmation.
41
- */
42
- last_setup_error: SetupIntent.LastSetupError | null;
43
-
44
- /**
45
- * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
46
- */
47
- livemode: boolean;
48
-
49
- /**
50
- * If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
51
- */
52
- next_action: SetupIntent.NextAction | null;
53
-
54
- /**
55
- * ID of the payment method used with this SetupIntent, or the PaymentMethod itself if this field is expanded.
56
- */
57
- payment_method: string | null | PaymentMethod;
58
-
59
- /**
60
- * The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
61
- */
62
- payment_method_types: Array<string>;
63
-
64
- /**
65
- * [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.
66
- */
67
- status: SetupIntent.Status;
68
-
69
- /**
70
- * Indicates how the payment method is intended to be used in the future.
71
- *
72
- * Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.
73
- */
74
- usage: string;
75
- }
76
-
77
- export namespace SetupIntent {
78
- export type CancellationReason =
79
- | 'abandoned'
80
- | 'duplicate'
81
- | 'requested_by_customer';
82
-
83
- export interface LastSetupError {
84
- /**
85
- * For card errors, the ID of the failed charge.
86
- */
87
- charge?: string;
88
-
89
- /**
90
- * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
91
- */
92
- code?: string;
93
-
94
- /**
95
- * 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.
96
- */
97
- decline_code?: string;
98
-
99
- /**
100
- * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
101
- */
102
- doc_url?: string;
103
-
104
- /**
105
- * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
106
- */
107
- message?: string;
108
-
109
- /**
110
- * If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
111
- */
112
- param?: string;
113
-
114
- payment_method?: PaymentMethod;
115
-
116
- /**
117
- * The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error`
118
- */
119
- type: LastSetupError.Type;
120
- }
121
-
122
- export namespace LastSetupError {
123
- export type Type =
124
- | 'api_connection_error'
125
- | 'api_error'
126
- | 'authentication_error'
127
- | 'card_error'
128
- | 'idempotency_error'
129
- | 'invalid_request_error'
130
- | 'rate_limit_error';
131
- }
132
-
133
- export interface NextAction {
134
- redirect_to_url?: NextAction.RedirectToUrl;
135
-
136
- /**
137
- * Type of the next action to perform, one of `redirect_to_url` or `use_stripe_sdk`.
138
- */
139
- type: string;
140
-
141
- /**
142
- * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
143
- */
144
- use_stripe_sdk?: NextAction.UseStripeSdk;
145
- }
146
-
147
- export namespace NextAction {
148
- export interface RedirectToUrl {
149
- /**
150
- * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
151
- */
152
- return_url: string | null;
153
-
154
- /**
155
- * The URL you must redirect your customer to in order to authenticate.
156
- */
157
- url: string | null;
158
- }
159
-
160
- export interface UseStripeSdk {}
161
- }
162
-
163
- export type Status =
164
- | 'canceled'
165
- | 'processing'
166
- | 'requires_action'
167
- | 'requires_confirmation'
168
- | 'requires_payment_method'
169
- | 'succeeded';
170
- }
171
-
172
- export interface SetupIntentConfirmParams {
173
- /**
174
- * This hash contains details about the Mandate to create
175
- */
176
- mandate_data?: {[k: string]: any};
177
-
178
- /**
179
- * The URL to redirect your customer back to after they authenticate on the payment method's app or site.
180
- * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
181
- * This parameter is only used for cards and other redirect-based payment methods.
182
- */
183
- return_url?: string;
184
- }