@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,110 +1,110 @@
1
- declare module '@stripe/stripe-js' {
1
+ import {SourceCreateParams} from '../api';
2
+
3
+ /**
4
+ * An object containing the unique ID and client secret for a `Source`.
5
+ *
6
+ * You can use a `Source` object created with `stripe.createSource` as the argument to `stripe.retrieveSource`, as every `Source` object has both `id` and `client_secret` keys.
7
+ */
8
+ export interface RetrieveSourceParam {
2
9
  /**
3
- * An object containing the unique ID and client secret for a `Source`.
4
- *
5
- * You can use a `Source` object created with `stripe.createSource` as the argument to `stripe.retrieveSource`, as every `Source` object has both `id` and `client_secret` keys.
10
+ * Unique identifier of the `Source`.
6
11
  */
7
- interface RetrieveSourceParam {
8
- /**
9
- * Unique identifier of the `Source`.
10
- */
11
- id: string;
12
-
13
- /**
14
- * A secret available to the web client that created the `Source`, for purposes of retrieving the `Source` later from that same client.
15
- */
16
- client_secret: string;
17
- }
12
+ id: string;
18
13
 
19
14
  /**
20
- * An object containing additional payment information you might have collected.
21
- *
22
- * Although these fields are optional, we highly recommend collecting name and address.
23
- * This information can be used to perform a number of verifications, such as CVC, ZIP, and address verification.
24
- * Radar includes built-in rules that can block payments where the ZIP or CVC verifications with the cardholder’s bank failed.
15
+ * A secret available to the web client that created the `Source`, for purposes of retrieving the `Source` later from that same client.
25
16
  */
26
- interface CreateTokenCardData {
27
- /**
28
- * @recommended
29
- */
30
- name?: string;
17
+ client_secret: string;
18
+ }
31
19
 
32
- address_line1?: string;
20
+ /**
21
+ * An object containing additional payment information you might have collected.
22
+ *
23
+ * Although these fields are optional, we highly recommend collecting name and address.
24
+ * This information can be used to perform a number of verifications, such as CVC, ZIP, and address verification.
25
+ * Radar includes built-in rules that can block payments where the ZIP or CVC verifications with the cardholder’s bank failed.
26
+ */
27
+ export interface CreateTokenCardData {
28
+ /**
29
+ * @recommended
30
+ */
31
+ name?: string;
33
32
 
34
- address_line2?: string;
33
+ address_line1?: string;
35
34
 
36
- address_city?: string;
35
+ address_line2?: string;
37
36
 
38
- address_state?: string;
37
+ address_city?: string;
39
38
 
40
- address_zip?: string;
39
+ address_state?: string;
41
40
 
42
- /**
43
- * A two character country code (for example, `US`).
44
- *
45
- * @recommended
46
- */
47
- address_country?: string;
41
+ address_zip?: string;
48
42
 
49
- /**
50
- * Required in order to [add the card to a Connect account](https://stripe.com/docs/connect/payouts#bank-accounts) (in all other cases, this parameter is not used).
51
- * Currently, the only supported currency for debit card payouts is `usd`.
52
- */
53
- currency?: string;
54
- }
43
+ /**
44
+ * A two character country code (for example, `US`).
45
+ *
46
+ * @recommended
47
+ */
48
+ address_country?: string;
55
49
 
56
- interface CreateTokenIbanData {
57
- /**
58
- * Three character currency code (e.g., `eur`).
59
- */
60
- currency: string;
50
+ /**
51
+ * Required in order to [add the card to a Connect account](https://stripe.com/docs/connect/payouts#bank-accounts) (in all other cases, this parameter is not used).
52
+ * Currently, the only supported currency for debit card payouts is `usd`.
53
+ */
54
+ currency?: string;
55
+ }
61
56
 
62
- account_holder_name: string;
57
+ export interface CreateTokenIbanData {
58
+ /**
59
+ * Three character currency code (e.g., `eur`).
60
+ */
61
+ currency: string;
63
62
 
64
- account_holder_type: string;
65
- }
63
+ account_holder_name: string;
66
64
 
67
- interface CreateTokenPiiData {
68
- personal_id_number: string;
69
- }
65
+ account_holder_type: string;
66
+ }
70
67
 
71
- interface CreateTokenBankAccountData {
72
- country: string;
68
+ export interface CreateTokenPiiData {
69
+ personal_id_number: string;
70
+ }
73
71
 
74
- currency: string;
72
+ export interface CreateTokenBankAccountData {
73
+ country: string;
75
74
 
76
- routing_number?: string;
75
+ currency: string;
77
76
 
78
- account_number: string;
77
+ routing_number?: string;
79
78
 
80
- account_holder_name?: string;
79
+ account_number: string;
81
80
 
82
- account_holder_type: string;
81
+ account_holder_name?: string;
83
82
 
84
- account_type?: string;
85
- }
83
+ account_holder_type: string;
86
84
 
87
- /**
88
- * A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected.
89
- * See the [Sources API](https://stripe.com/docs/api#create_source) reference for details.
90
- *
91
- * You cannot pass raw card information to `stripe.createSource(sourceData)`.
92
- * Instead, you must gather card information in an `Element` and use `stripe.createSource(element, sourceData)`.
93
- * You can also pass an existing card token to convert it into a `Source` object.
94
- */
95
- interface CreateSourceData extends SourceCreateParams {
96
- bancontact?: CreateSourceData.DeprecatedMethodData;
85
+ account_type?: string;
86
+ }
97
87
 
98
- ideal?: CreateSourceData.DeprecatedMethodData;
88
+ /**
89
+ * A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected.
90
+ * See the [Sources API](https://stripe.com/docs/api#create_source) reference for details.
91
+ *
92
+ * You cannot pass raw card information to `stripe.createSource(sourceData)`.
93
+ * Instead, you must gather card information in an `Element` and use `stripe.createSource(element, sourceData)`.
94
+ * You can also pass an existing card token to convert it into a `Source` object.
95
+ */
96
+ export interface CreateSourceData extends SourceCreateParams {
97
+ bancontact?: CreateSourceData.DeprecatedMethodData;
99
98
 
100
- klarna?: CreateSourceData.DeprecatedMethodData;
99
+ ideal?: CreateSourceData.DeprecatedMethodData;
101
100
 
102
- sepa_debit?: CreateSourceData.DeprecatedMethodData;
101
+ klarna?: CreateSourceData.DeprecatedMethodData;
103
102
 
104
- sofort?: CreateSourceData.DeprecatedMethodData;
105
- }
103
+ sepa_debit?: CreateSourceData.DeprecatedMethodData;
104
+
105
+ sofort?: CreateSourceData.DeprecatedMethodData;
106
+ }
106
107
 
107
- namespace CreateSourceData {
108
- type DeprecatedMethodData = Record<string, unknown>;
109
- }
108
+ export namespace CreateSourceData {
109
+ export type DeprecatedMethodData = Record<string, unknown>;
110
110
  }
@@ -0,0 +1,2 @@
1
+ // Polyfill for TypeScript < 3.5 compatibility
2
+ export type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
@@ -1,63 +0,0 @@
1
- declare module '@stripe/stripe-js' {
2
- /**
3
- * The BankAccount object.
4
- */
5
- interface BankAccount {
6
- /**
7
- * Unique identifier for the object.
8
- */
9
- id: string;
10
-
11
- /**
12
- * String representing the object's type. Objects of the same type share the same value.
13
- */
14
- object: 'bank_account';
15
-
16
- /**
17
- * The name of the person or business that owns the bank account.
18
- */
19
- account_holder_name: string | null;
20
-
21
- /**
22
- * The type of entity that holds the account. This can be either `individual` or `company`.
23
- */
24
- account_holder_type: string | null;
25
-
26
- /**
27
- * Name of the bank associated with the routing number (e.g., `WELLS FARGO`).
28
- */
29
- bank_name: string | null;
30
-
31
- /**
32
- * Two-letter ISO code representing the country the bank account is located in.
33
- */
34
- country: string;
35
-
36
- /**
37
- * Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
38
- */
39
- currency: string;
40
-
41
- /**
42
- * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
43
- */
44
- fingerprint: string | null;
45
-
46
- /**
47
- * The last four digits of the bank account number.
48
- */
49
- last4: string;
50
-
51
- /**
52
- * The routing transit number for the bank account.
53
- */
54
- routing_number: string | null;
55
-
56
- /**
57
- * For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated.
58
- *
59
- * For external accounts, possible values are `new` and `errored`. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated.
60
- */
61
- status: string;
62
- }
63
- }
@@ -1,130 +0,0 @@
1
- declare module '@stripe/stripe-js' {
2
- /**
3
- * The Card object.
4
- */
5
- interface Card {
6
- /**
7
- * Unique identifier for the object.
8
- */
9
- id: string;
10
-
11
- /**
12
- * String representing the object's type. Objects of the same type share the same value.
13
- */
14
- object: 'card';
15
-
16
- /**
17
- * City/District/Suburb/Town/Village.
18
- */
19
- address_city: string | null;
20
-
21
- /**
22
- * Billing address country, if provided when creating card.
23
- */
24
- address_country: string | null;
25
-
26
- /**
27
- * Address line 1 (Street address/PO Box/Company name).
28
- */
29
- address_line1: string | null;
30
-
31
- /**
32
- * If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
33
- */
34
- address_line1_check: string | null;
35
-
36
- /**
37
- * Address line 2 (Apartment/Suite/Unit/Building).
38
- */
39
- address_line2: string | null;
40
-
41
- /**
42
- * State/County/Province/Region.
43
- */
44
- address_state: string | null;
45
-
46
- /**
47
- * ZIP or postal code.
48
- */
49
- address_zip: string | null;
50
-
51
- /**
52
- * If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
53
- */
54
- address_zip_check: string | null;
55
-
56
- /**
57
- * Card brand. Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`.
58
- */
59
- brand: string;
60
-
61
- /**
62
- * 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.
63
- */
64
- country: string | null;
65
-
66
- /**
67
- * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
68
- */
69
- currency?: string | null;
70
-
71
- /**
72
- * The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
73
- */
74
- customer?: string | null;
75
-
76
- /**
77
- * If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
78
- */
79
- cvc_check: string | null;
80
-
81
- /**
82
- * (For tokenized numbers only.) The last four digits of the device account number.
83
- */
84
- dynamic_last4: string | null;
85
-
86
- /**
87
- * Two-digit number representing the card's expiration month.
88
- */
89
- exp_month: number;
90
-
91
- /**
92
- * Four-digit number representing the card's expiration year.
93
- */
94
- exp_year: number;
95
-
96
- /**
97
- * 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, for example.
98
- */
99
- fingerprint?: string | null;
100
-
101
- /**
102
- * Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
103
- */
104
- funding: string;
105
-
106
- /**
107
- * The last four digits of the card.
108
- */
109
- last4: string;
110
-
111
- /**
112
- * 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.
113
- */
114
- metadata: Metadata;
115
-
116
- /**
117
- * Cardholder name.
118
- */
119
- name: string | null;
120
-
121
- /**
122
- * If the card number is tokenized, this is the method that was used. Can be `apple_pay` or `google_pay`.
123
- */
124
- tokenization_method: string | null;
125
- }
126
-
127
- namespace Card {
128
- type AvailablePayoutMethod = 'instant' | 'standard';
129
- }
130
- }