@stripe/stripe-js 3.0.3 → 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 (66) hide show
  1. package/README.md +10 -23
  2. package/dist/stripe.js +1 -1
  3. package/dist/stripe.mjs +1 -1
  4. package/package.json +4 -26
  5. package/{dist/pure.js → pure/index.js} +1 -1
  6. package/{dist/pure.mjs → pure/index.mjs} +1 -1
  7. package/types/.eslintrc.yml +0 -3
  8. package/types/api/bank-accounts.d.ts +0 -61
  9. package/types/api/cards.d.ts +0 -130
  10. package/types/api/financial-connections.d.ts +0 -232
  11. package/types/api/index.d.ts +0 -11
  12. package/types/api/orders.d.ts +0 -122
  13. package/types/api/payment-intents.d.ts +0 -330
  14. package/types/api/payment-methods.d.ts +0 -452
  15. package/types/api/setup-intents.d.ts +0 -184
  16. package/types/api/shared.d.ts +0 -125
  17. package/types/api/sources.d.ts +0 -1045
  18. package/types/api/tokens.d.ts +0 -639
  19. package/types/api/verification-sessions.d.ts +0 -9
  20. package/types/index.d.ts +0 -17
  21. package/types/pure.d.ts +0 -5
  22. package/types/stripe-js/checkout.d.ts +0 -153
  23. package/types/stripe-js/custom-checkout.d.ts +0 -220
  24. package/types/stripe-js/elements/address.d.ts +0 -261
  25. package/types/stripe-js/elements/affirm-message.d.ts +0 -65
  26. package/types/stripe-js/elements/afterpay-clearpay-message.d.ts +0 -119
  27. package/types/stripe-js/elements/apple-pay.d.ts +0 -156
  28. package/types/stripe-js/elements/au-bank-account.d.ts +0 -138
  29. package/types/stripe-js/elements/base.d.ts +0 -264
  30. package/types/stripe-js/elements/card-cvc.d.ts +0 -119
  31. package/types/stripe-js/elements/card-expiry.d.ts +0 -119
  32. package/types/stripe-js/elements/card-number.d.ts +0 -200
  33. package/types/stripe-js/elements/card.d.ts +0 -226
  34. package/types/stripe-js/elements/cart.d.ts +0 -224
  35. package/types/stripe-js/elements/eps-bank.d.ts +0 -140
  36. package/types/stripe-js/elements/express-checkout.d.ts +0 -446
  37. package/types/stripe-js/elements/fpx-bank.d.ts +0 -134
  38. package/types/stripe-js/elements/iban.d.ts +0 -135
  39. package/types/stripe-js/elements/ideal-bank.d.ts +0 -140
  40. package/types/stripe-js/elements/index.d.ts +0 -22
  41. package/types/stripe-js/elements/issuing/index.d.ts +0 -5
  42. package/types/stripe-js/elements/issuing/issuing-card-copy-button.d.ts +0 -37
  43. package/types/stripe-js/elements/issuing/issuing-card-cvc-display.d.ts +0 -32
  44. package/types/stripe-js/elements/issuing/issuing-card-expiry-display.d.ts +0 -32
  45. package/types/stripe-js/elements/issuing/issuing-card-number-display.d.ts +0 -40
  46. package/types/stripe-js/elements/issuing/issuing-card-pin-display.d.ts +0 -32
  47. package/types/stripe-js/elements/link-authentication.d.ts +0 -158
  48. package/types/stripe-js/elements/p24-bank.d.ts +0 -140
  49. package/types/stripe-js/elements/payment-method-messaging.d.ts +0 -98
  50. package/types/stripe-js/elements/payment-request-button.d.ts +0 -151
  51. package/types/stripe-js/elements/payment.d.ts +0 -275
  52. package/types/stripe-js/elements/shipping-address.d.ts +0 -215
  53. package/types/stripe-js/elements-group.d.ts +0 -1129
  54. package/types/stripe-js/embedded-checkout.d.ts +0 -30
  55. package/types/stripe-js/ephemeral-keys.d.ts +0 -3
  56. package/types/stripe-js/financial-connections.d.ts +0 -19
  57. package/types/stripe-js/index.d.ts +0 -13
  58. package/types/stripe-js/orders.d.ts +0 -9
  59. package/types/stripe-js/payment-intents.d.ts +0 -1465
  60. package/types/stripe-js/payment-request.d.ts +0 -529
  61. package/types/stripe-js/setup-intents.d.ts +0 -250
  62. package/types/stripe-js/stripe.d.ts +0 -1472
  63. package/types/stripe-js/token-and-sources.d.ts +0 -110
  64. package/types/utils.d.ts +0 -2
  65. /package/{dist/pure.d.mts → pure/index.d.mts} +0 -0
  66. /package/{dist/pure.d.ts → pure/index.d.ts} +0 -0
package/README.md CHANGED
@@ -1,14 +1,7 @@
1
- # ⚠️ v3.0.x Notice
1
+ # Stripe.js as a CommonJS module or ES module
2
2
 
3
- We are aware of an issue impacting builds for some TypeScript users in our
4
- package releases **v3.0.0**, **v3.0.1**, **v3.0.2** and recommend users to
5
- upgrade to our latest package release
6
- [**v3.0.3**](https://github.com/stripe/stripe-js/releases/tag/v3.0.3) which
7
- contains a fix.
8
-
9
- # Stripe.js ES Module
10
-
11
- Use [Stripe.js](https://stripe.com/docs/stripe-js) as an ES module.
3
+ This package allows [Stripe.js](https://stripe.com/docs/stripe-js) to be
4
+ imported as a CommonJS module or ES module.
12
5
 
13
6
  **Note**: To be
14
7
  [PCI compliant](https://stripe.com/docs/security/guide#validating-pci-compliance),
@@ -86,18 +79,6 @@ Note that we may release new [minor and patch](https://semver.org/) versions of
86
79
  `@stripe/stripe-js` with small but backwards-incompatible fixes to the type
87
80
  declarations. These changes will not affect Stripe.js itself.
88
81
 
89
- ### [`moduleResolution`](https://www.typescriptlang.org/tsconfig#moduleResolution) support
90
-
91
- This package supports the following module resolution strategies:
92
-
93
- - `bundler`
94
- - `node16`
95
- - `nodenext`
96
-
97
- This package does not support `node10` or `node` strategies, which do not
98
- support ES6 modules. Using `node16` or `nodenext` is recommended as a
99
- replacement configuration.
100
-
101
82
  ## Ensuring Stripe.js is available everywhere
102
83
 
103
84
  To best leverage Stripe’s advanced fraud functionality, ensure that Stripe.js is
@@ -137,9 +118,12 @@ one. When you call `loadStripe`, it will use the existing script tag.
137
118
 
138
119
  If you would like to use `loadStripe` in your application, but defer loading the
139
120
  Stripe.js script until `loadStripe` is first called, use the alternative
140
- `@stripe/stripe-js/pure` import path:
121
+ `@stripe/stripe-js/pure` import module:
141
122
 
142
123
  ```js
124
+ // CommonJS module import
125
+ const {loadStripe} = require('@stripe/stripe-js/pure');
126
+ // ES module import
143
127
  import {loadStripe} from '@stripe/stripe-js/pure';
144
128
 
145
129
  // Stripe.js will not be loaded until `loadStripe` is called
@@ -153,6 +137,9 @@ If you would like to
153
137
  altogether, use `loadStripe.setLoadParameters`:
154
138
 
155
139
  ```js
140
+ // CommonJS module import
141
+ const {loadStripe} = require('@stripe/stripe-js/pure');
142
+ // ES module import
156
143
  import {loadStripe} from '@stripe/stripe-js/pure';
157
144
 
158
145
  loadStripe.setLoadParameters({advancedFraudSignals: false});
package/dist/stripe.js CHANGED
@@ -42,7 +42,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
42
42
 
43
43
  stripe._registerWrapper({
44
44
  name: 'stripe-js',
45
- version: "3.0.3",
45
+ version: "3.0.4",
46
46
  startTime: startTime
47
47
  });
48
48
  };
package/dist/stripe.mjs CHANGED
@@ -38,7 +38,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
38
38
 
39
39
  stripe._registerWrapper({
40
40
  name: 'stripe-js',
41
- version: "3.0.3",
41
+ version: "3.0.4",
42
42
  startTime: startTime
43
43
  });
44
44
  };
package/package.json CHANGED
@@ -1,35 +1,13 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "dist/stripe.js",
7
7
  "module": "dist/stripe.mjs",
8
- "exports": {
9
- ".": {
10
- "import": {
11
- "types": "./dist/index.d.mts",
12
- "default": "./dist/stripe.mjs"
13
- },
14
- "require": {
15
- "types": "./dist/index.d.ts",
16
- "default": "./dist/stripe.js"
17
- }
18
- },
19
- "./pure": {
20
- "import": {
21
- "types": "./dist/pure.d.mts",
22
- "default": "./dist/pure.mjs"
23
- },
24
- "require": {
25
- "types": "./dist/pure.d.ts",
26
- "default": "./dist/pure.js"
27
- }
28
- }
29
- },
30
8
  "jsnext:main": "dist/stripe.mjs",
31
- "types": "types/index.d.ts",
32
- "typings": "types/index.d.ts",
9
+ "types": "dist/index.d.ts",
10
+ "typings": "dist/index.d.ts",
33
11
  "scripts": {
34
12
  "test": "yarn lint && yarn test:unit && yarn test:types && yarn typecheck",
35
13
  "test:unit": "jest",
@@ -53,7 +31,7 @@
53
31
  "files": [
54
32
  "dist",
55
33
  "src",
56
- "types"
34
+ "pure"
57
35
  ],
58
36
  "engines": {
59
37
  "node": ">=12.16"
@@ -58,7 +58,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
58
58
 
59
59
  stripe._registerWrapper({
60
60
  name: 'stripe-js',
61
- version: "3.0.3",
61
+ version: "3.0.4",
62
62
  startTime: startTime
63
63
  });
64
64
  };
@@ -54,7 +54,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
54
54
 
55
55
  stripe._registerWrapper({
56
56
  name: 'stripe-js',
57
- version: "3.0.3",
57
+ version: "3.0.4",
58
58
  startTime: startTime
59
59
  });
60
60
  };
@@ -1,3 +0,0 @@
1
- rules:
2
- '@typescript-eslint/triple-slash-reference': 0
3
- '@typescript-eslint/adjacent-overload-signatures': 0
@@ -1,61 +0,0 @@
1
- /**
2
- * The BankAccount object.
3
- */
4
- export interface BankAccount {
5
- /**
6
- * Unique identifier for the object.
7
- */
8
- id: string;
9
-
10
- /**
11
- * String representing the object's type. Objects of the same type share the same value.
12
- */
13
- object: 'bank_account';
14
-
15
- /**
16
- * The name of the person or business that owns the bank account.
17
- */
18
- account_holder_name: string | null;
19
-
20
- /**
21
- * The type of entity that holds the account. This can be either `individual` or `company`.
22
- */
23
- account_holder_type: string | null;
24
-
25
- /**
26
- * Name of the bank associated with the routing number (e.g., `WELLS FARGO`).
27
- */
28
- bank_name: string | null;
29
-
30
- /**
31
- * Two-letter ISO code representing the country the bank account is located in.
32
- */
33
- country: string;
34
-
35
- /**
36
- * Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
37
- */
38
- currency: string;
39
-
40
- /**
41
- * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
42
- */
43
- fingerprint: string | null;
44
-
45
- /**
46
- * The last four digits of the bank account number.
47
- */
48
- last4: string;
49
-
50
- /**
51
- * The routing transit number for the bank account.
52
- */
53
- routing_number: string | null;
54
-
55
- /**
56
- * 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.
57
- *
58
- * 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.
59
- */
60
- status: string;
61
- }
@@ -1,130 +0,0 @@
1
- import {Metadata} from './shared';
2
-
3
- /**
4
- * The Card object.
5
- */
6
- export interface Card {
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: 'card';
16
-
17
- /**
18
- * City/District/Suburb/Town/Village.
19
- */
20
- address_city: string | null;
21
-
22
- /**
23
- * Billing address country, if provided when creating card.
24
- */
25
- address_country: string | null;
26
-
27
- /**
28
- * Address line 1 (Street address/PO Box/Company name).
29
- */
30
- address_line1: string | null;
31
-
32
- /**
33
- * If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
34
- */
35
- address_line1_check: string | null;
36
-
37
- /**
38
- * Address line 2 (Apartment/Suite/Unit/Building).
39
- */
40
- address_line2: string | null;
41
-
42
- /**
43
- * State/County/Province/Region.
44
- */
45
- address_state: string | null;
46
-
47
- /**
48
- * ZIP or postal code.
49
- */
50
- address_zip: string | null;
51
-
52
- /**
53
- * If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
54
- */
55
- address_zip_check: string | null;
56
-
57
- /**
58
- * Card brand. Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`.
59
- */
60
- brand: string;
61
-
62
- /**
63
- * 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.
64
- */
65
- country: string | null;
66
-
67
- /**
68
- * 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).
69
- */
70
- currency?: string | null;
71
-
72
- /**
73
- * 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.
74
- */
75
- customer?: string | null;
76
-
77
- /**
78
- * If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
79
- */
80
- cvc_check: string | null;
81
-
82
- /**
83
- * (For tokenized numbers only.) The last four digits of the device account number.
84
- */
85
- dynamic_last4: string | null;
86
-
87
- /**
88
- * Two-digit number representing the card's expiration month.
89
- */
90
- exp_month: number;
91
-
92
- /**
93
- * Four-digit number representing the card's expiration year.
94
- */
95
- exp_year: number;
96
-
97
- /**
98
- * 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.
99
- */
100
- fingerprint?: string | null;
101
-
102
- /**
103
- * Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
104
- */
105
- funding: string;
106
-
107
- /**
108
- * The last four digits of the card.
109
- */
110
- last4: string;
111
-
112
- /**
113
- * 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.
114
- */
115
- metadata: Metadata;
116
-
117
- /**
118
- * Cardholder name.
119
- */
120
- name: string | null;
121
-
122
- /**
123
- * If the card number is tokenized, this is the method that was used. Can be `apple_pay` or `google_pay`.
124
- */
125
- tokenization_method: string | null;
126
- }
127
-
128
- export namespace Card {
129
- export type AvailablePayoutMethod = 'instant' | 'standard';
130
- }
@@ -1,232 +0,0 @@
1
- type SupportedPaymentMethodType = 'us_bank_account' | 'link';
2
-
3
- interface CommonBalance {
4
- /**
5
- * The time that the external institution calculated this balance. Measured
6
- * in seconds since the Unix epoch.
7
- */
8
- as_of: number;
9
-
10
- /**
11
- * The balances owed to (or by) the account holder.
12
- *
13
- * Each key is a three-letter ISO currency code, in lowercase.
14
- *
15
- * Each value is a integer amount. A positive amount indicates money owed to
16
- * the account holder. A negative amount indicates money owed by the account
17
- * holder.
18
- */
19
- current: {
20
- [key: string]: number | undefined;
21
- };
22
- }
23
-
24
- interface CashBalance {
25
- /**
26
- * Information on a `cash` balance. Only set if `balance.type` is `cash`.
27
- */
28
- cash: {
29
- /**
30
- * The funds available to the account holder. Typically this is the
31
- * current balance less any holds.
32
- *
33
- * Each key is a three-letter ISO currency code, in lowercase.
34
- *
35
- * Each value is a integer amount. A positive amount indicates money owed
36
- * to the account holder. A negative amount indicates money owed by the
37
- * account holder.
38
- */
39
- available: {[key: string]: number | undefined};
40
- };
41
-
42
- type: 'cash';
43
- }
44
-
45
- interface CreditBalance {
46
- /**
47
- * Information on a `credit` balance. Only set if `balance.type` is `credit`.
48
- */
49
- credit: {
50
- /**
51
- * The credit that has been used by the account holder.
52
- *
53
- * Each key is a three-letter ISO currency code, in lowercase
54
- *
55
- * Each value is a integer amount. A positive amount indicates money owed
56
- * to the account holder. A negative amount indicates money owed by the
57
- * account holder.
58
- */
59
- used: {[key: string]: number | undefined};
60
- };
61
-
62
- type: 'credit';
63
- }
64
-
65
- type Balance = (CommonBalance & CashBalance) | (CommonBalance & CreditBalance);
66
-
67
- interface BalanceRefresh {
68
- /**
69
- * The status of the Balance Refresh
70
- */
71
- status: 'pending' | 'succeeded' | 'failed';
72
-
73
- /**
74
- * Time at which the Balance Refresh was attempted. Measured in seconds since the Unix epoch.
75
- */
76
- last_attempted_at: number;
77
- }
78
-
79
- interface OwnershipRefresh {
80
- /**
81
- * The status of the Ownership Refresh
82
- */
83
- status: 'pending' | 'succeeded' | 'failed';
84
-
85
- /**
86
- * Time at which the Ownersip Refresh was attempted. Measured in seconds since the Unix epoch.
87
- */
88
- last_attempted_at: number;
89
- }
90
-
91
- /**
92
- * The Financial Connections Session object
93
- */
94
- export interface FinancialConnectionsSession {
95
- /**
96
- * Unique identifier for the object.
97
- */
98
- id: string;
99
-
100
- /**
101
- * List of accounts collected by the Session
102
- */
103
- accounts: FinancialConnectionsSession.Account[];
104
-
105
- /**
106
- * Filters applied to the Session
107
- */
108
- filters?: FinancialConnectionsSession.Filters;
109
-
110
- /**
111
- * List of data permissions requested in the Session
112
- */
113
- permissions?: FinancialConnectionsSession.Permission[];
114
-
115
- /**
116
- * For webview integrations only. The user will be redirected to this URL to return to your app.
117
- */
118
- return_url?: string;
119
- }
120
-
121
- export namespace FinancialConnectionsSession {
122
- /**
123
- * The Financial Connections Account object
124
- */
125
- export interface Account {
126
- /**
127
- * Unique identifier for the object.
128
- */
129
- id: string;
130
-
131
- /**
132
- * String representing the object's type. `'linked_account'` is present for backwards-compatibility.
133
- */
134
- object: 'linked_account' | 'financial_connections.account';
135
-
136
- /**
137
- * The balance for this Account
138
- */
139
- balance: null | Balance;
140
-
141
- /**
142
- * The most recent Balance Refresh for this Account
143
- */
144
- balance_refresh: null | BalanceRefresh;
145
-
146
- /**
147
- * The type of the account.
148
- */
149
- category: 'cash' | 'credit' | 'investment' | 'other';
150
-
151
- /**
152
- * Time at which the object was created. Measured in seconds since the Unix epoch.
153
- */
154
- created: number;
155
-
156
- /**
157
- * A human-readable name that has been assigned to this account, either by the account holder or by the institution.
158
- */
159
- display_name: string;
160
-
161
- /**
162
- * The name of the institution that holds this account.
163
- */
164
- institution_name: string;
165
-
166
- /**
167
- * The last 4 digits of the account number. If present, this will be 4 numeric characters.
168
- */
169
- last4: string | null;
170
-
171
- /**
172
- * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
173
- */
174
- livemode: boolean;
175
-
176
- /**
177
- * The ID of this account's Ownership resource.
178
- */
179
- ownership: string | null;
180
-
181
- /**
182
- * The most recent Ownership Refresh for this Account
183
- */
184
- ownership_refresh: null | OwnershipRefresh;
185
-
186
- /**
187
- * Permissions granted on this Account
188
- */
189
- permissions: Permission[];
190
-
191
- /**
192
- * The status of the Account
193
- */
194
- status: 'active' | 'inactive' | 'disconnected';
195
-
196
- /**
197
- * The sub-category of the Account
198
- */
199
- subcategory:
200
- | 'checking'
201
- | 'savings'
202
- | 'mortgage'
203
- | 'line_of_credit'
204
- | 'credit_card'
205
- | 'other';
206
-
207
- /**
208
- * The types of Payment Methods which can be set up by this Account
209
- */
210
- supported_payment_method_types: SupportedPaymentMethodType[];
211
- }
212
-
213
- /**
214
- * Filters to restrict the kinds of accounts to collect.
215
- */
216
- export interface Filters {
217
- /**
218
- * List of countries from which to collect accounts.
219
- */
220
- countries?: string[];
221
- }
222
-
223
- /**
224
- * Data features to which access can be requested
225
- */
226
- export type Permission =
227
- | 'payment_method'
228
- | 'balances'
229
- | 'transactions'
230
- | 'ownership'
231
- | 'account_numbers';
232
- }
@@ -1,11 +0,0 @@
1
- export * from './shared';
2
- export * from './payment-methods';
3
- export * from './payment-intents';
4
- export * from './orders';
5
- export * from './setup-intents';
6
- export * from './sources';
7
- export * from './tokens';
8
- export * from './bank-accounts';
9
- export * from './cards';
10
- export * from './verification-sessions';
11
- export * from './financial-connections';