@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
@@ -1,98 +0,0 @@
1
- export type StripePaymentMethodMessagingElement = {
2
- /**
3
- * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
4
- * `element.mount` accepts either a CSS Selector (e.g., `'#payment-method-messaging'`) or a DOM element.
5
- */
6
- mount(domElement: string | HTMLElement): void;
7
-
8
- /**
9
- * Removes the element from the DOM and destroys it.
10
- * A destroyed element can not be re-activated or re-mounted to the DOM.
11
- */
12
- destroy(): void;
13
-
14
- /**
15
- * Unmounts the element from the DOM.
16
- * Call `element.mount` to re-attach it to the DOM.
17
- */
18
- unmount(): void;
19
-
20
- /**
21
- * Updates the options the `PaymentMethodMessagingElement` was initialized with.
22
- * Updates are merged into the existing configuration.
23
- */
24
- update(options: Partial<StripePaymentMethodMessagingElementOptions>): void;
25
-
26
- /**
27
- * Triggered when the element is fully loaded and ready to perform method calls.
28
- */
29
- on(
30
- eventType: 'ready',
31
- handler: (event: {elementType: 'paymentMethodMessaging'}) => any
32
- ): StripePaymentMethodMessagingElement;
33
- };
34
-
35
- export interface StripePaymentMethodMessagingElementOptions {
36
- /**
37
- * The total amount in the smallest currency unit.
38
- */
39
- amount: number;
40
-
41
- /**
42
- * The currency to display.
43
- */
44
- currency:
45
- | 'USD'
46
- | 'GBP'
47
- | 'EUR'
48
- | 'DKK'
49
- | 'NOK'
50
- | 'SEK'
51
- | 'AUD'
52
- | 'CAD'
53
- | 'NZD';
54
-
55
- /**
56
- * Payment methods to show messaging for.
57
- */
58
- paymentMethodTypes: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
59
-
60
- /**
61
- * @deprecated Use `paymentMethodTypes` instead.
62
- */
63
- paymentMethods?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
64
-
65
- /**
66
- * The country the end-buyer is in.
67
- */
68
- countryCode:
69
- | 'US'
70
- | 'CA'
71
- | 'AU'
72
- | 'NZ'
73
- | 'GB'
74
- | 'IE'
75
- | 'FR'
76
- | 'ES'
77
- | 'DE'
78
- | 'AT'
79
- | 'BE'
80
- | 'DK'
81
- | 'FI'
82
- | 'IT'
83
- | 'NL'
84
- | 'NO'
85
- | 'SE';
86
-
87
- /**
88
- * The logo color to display in the message. Defaults to black
89
- */
90
- logoColor?: 'black' | 'white' | 'color';
91
-
92
- /**
93
- * The font size of the promotional message.
94
- */
95
- metaData?: {
96
- messagingClientReferenceId: string | null;
97
- };
98
- }
@@ -1,151 +0,0 @@
1
- import {StripeElementBase, StripeElementClasses} from './base';
2
- import {PaymentRequest} from '../payment-request';
3
- import {Omit} from '../../utils';
4
-
5
- export type StripePaymentRequestButtonElement = StripeElementBase & {
6
- /**
7
- * Triggered when the payment request button is clicked.
8
- */
9
- on(
10
- eventType: 'click',
11
- handler: (event: StripePaymentRequestButtonElementClickEvent) => any
12
- ): StripePaymentRequestButtonElement;
13
- once(
14
- eventType: 'click',
15
- handler: (event: StripePaymentRequestButtonElementClickEvent) => any
16
- ): StripePaymentRequestButtonElement;
17
- off(
18
- eventType: 'click',
19
- handler?: (event: StripePaymentRequestButtonElementClickEvent) => any
20
- ): StripePaymentRequestButtonElement;
21
-
22
- /**
23
- * Triggered when the element is fully rendered and can accept `element.focus` calls.
24
- */
25
- on(
26
- eventType: 'ready',
27
- handler: (event: {elementType: 'paymentRequestButton'}) => any
28
- ): StripePaymentRequestButtonElement;
29
- once(
30
- eventType: 'ready',
31
- handler: (event: {elementType: 'paymentRequestButton'}) => any
32
- ): StripePaymentRequestButtonElement;
33
- off(
34
- eventType: 'ready',
35
- handler?: (event: {elementType: 'paymentRequestButton'}) => any
36
- ): StripePaymentRequestButtonElement;
37
-
38
- /**
39
- * Triggered when the element gains focus.
40
- */
41
- on(
42
- eventType: 'focus',
43
- handler: (event: {elementType: 'paymentRequestButton'}) => any
44
- ): StripePaymentRequestButtonElement;
45
- once(
46
- eventType: 'focus',
47
- handler: (event: {elementType: 'paymentRequestButton'}) => any
48
- ): StripePaymentRequestButtonElement;
49
- off(
50
- eventType: 'focus',
51
- handler?: (event: {elementType: 'paymentRequestButton'}) => any
52
- ): StripePaymentRequestButtonElement;
53
-
54
- /**
55
- * Triggered when the element loses focus.
56
- */
57
- on(
58
- eventType: 'blur',
59
- handler: (event: {elementType: 'paymentRequestButton'}) => any
60
- ): StripePaymentRequestButtonElement;
61
- once(
62
- eventType: 'blur',
63
- handler: (event: {elementType: 'paymentRequestButton'}) => any
64
- ): StripePaymentRequestButtonElement;
65
- off(
66
- eventType: 'blur',
67
- handler?: (event: {elementType: 'paymentRequestButton'}) => any
68
- ): StripePaymentRequestButtonElement;
69
-
70
- /**
71
- * Updates the options the `PaymentRequestButtonElement` was initialized with.
72
- * Updates are merged into the existing configuration.
73
- *
74
- * The styles of an `PaymentRequestButtonElement` can be dynamically changed using `element.update`.
75
- * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
76
- */
77
- update(
78
- options: Partial<
79
- Omit<StripePaymentRequestButtonElementOptions, 'paymentRequest'>
80
- >
81
- ): void;
82
- };
83
-
84
- export interface StripePaymentRequestButtonElementOptions {
85
- classes?: StripeElementClasses;
86
-
87
- /**
88
- * An object used to customize the appearance of the Payment Request Button.
89
- * The object must have a single `paymentRequestButton` field, containing any of the following sub-fields
90
- */
91
- style?: {
92
- paymentRequestButton: {
93
- /**
94
- * Preferred button type to display. Available types, by wallet:
95
- *
96
- * Browser card: default, book, buy, or donate.
97
- *
98
- * Google Pay: default, buy, or donate.
99
- *
100
- * Apple Pay: default, book, buy, donate, check-out, subscribe, reload, add-money, top-up, order, rent, support, contribute, tip
101
- *
102
- * When a wallet does not support the provided value, default is used as a fallback.
103
- */
104
- type?:
105
- | 'default'
106
- | 'book'
107
- | 'buy'
108
- | 'donate'
109
- | 'check-out'
110
- | 'subscribe'
111
- | 'reload'
112
- | 'add-money'
113
- | 'top-up'
114
- | 'order'
115
- | 'rent'
116
- | 'support'
117
- | 'contribute'
118
- | 'tip';
119
-
120
- /**
121
- * One of dark, light, or light-outline. The default is dark.
122
- */
123
- theme?: 'dark' | 'light' | 'light-outline';
124
-
125
- /**
126
- * The height of the Payment Request Button. Accepts px unit values.
127
- */
128
- height?: string;
129
-
130
- /**
131
- * The gap between buttons when multile buttons are shown. Accepts px unit values.
132
- */
133
- buttonSpacing?: string;
134
- };
135
- };
136
-
137
- /**
138
- * A `PaymentRequest` object used to configure the element.
139
- */
140
- paymentRequest: PaymentRequest;
141
-
142
- /**
143
- * Disable showing multiple buttons.
144
- * Default is `false`.
145
- */
146
- disableMultipleButtons?: boolean;
147
- }
148
-
149
- export interface StripePaymentRequestButtonElementClickEvent {
150
- preventDefault: () => void;
151
- }
@@ -1,275 +0,0 @@
1
- import {StripeElementBase} from './base';
2
- import {StripeError} from '../stripe';
3
- import {ApplePayOption} from './apple-pay';
4
-
5
- export type StripePaymentElement = StripeElementBase & {
6
- /**
7
- * The change event is triggered when the `Element`'s value changes.
8
- */
9
- on(
10
- eventType: 'change',
11
- handler: (event: StripePaymentElementChangeEvent) => any
12
- ): StripePaymentElement;
13
- once(
14
- eventType: 'change',
15
- handler: (event: StripePaymentElementChangeEvent) => any
16
- ): StripePaymentElement;
17
- off(
18
- eventType: 'change',
19
- handler?: (event: StripePaymentElementChangeEvent) => any
20
- ): StripePaymentElement;
21
-
22
- /**
23
- * Triggered when the element is fully rendered and can accept `element.focus` calls.
24
- */
25
- on(
26
- eventType: 'ready',
27
- handler: (event: {elementType: 'payment'}) => any
28
- ): StripePaymentElement;
29
- once(
30
- eventType: 'ready',
31
- handler: (event: {elementType: 'payment'}) => any
32
- ): StripePaymentElement;
33
- off(
34
- eventType: 'ready',
35
- handler?: (event: {elementType: 'payment'}) => any
36
- ): StripePaymentElement;
37
-
38
- /**
39
- * Triggered when the element gains focus.
40
- */
41
- on(
42
- eventType: 'focus',
43
- handler: (event: {elementType: 'payment'}) => any
44
- ): StripePaymentElement;
45
- once(
46
- eventType: 'focus',
47
- handler: (event: {elementType: 'payment'}) => any
48
- ): StripePaymentElement;
49
- off(
50
- eventType: 'focus',
51
- handler?: (event: {elementType: 'payment'}) => any
52
- ): StripePaymentElement;
53
-
54
- /**
55
- * Triggered when the element loses focus.
56
- */
57
- on(
58
- eventType: 'blur',
59
- handler: (event: {elementType: 'payment'}) => any
60
- ): StripePaymentElement;
61
- once(
62
- eventType: 'blur',
63
- handler: (event: {elementType: 'payment'}) => any
64
- ): StripePaymentElement;
65
- off(
66
- eventType: 'blur',
67
- handler?: (event: {elementType: 'payment'}) => any
68
- ): StripePaymentElement;
69
-
70
- /**
71
- * Triggered when the escape key is pressed within the element.
72
- */
73
- on(
74
- eventType: 'escape',
75
- handler: (event: {elementType: 'payment'}) => any
76
- ): StripePaymentElement;
77
- once(
78
- eventType: 'escape',
79
- handler: (event: {elementType: 'payment'}) => any
80
- ): StripePaymentElement;
81
- off(
82
- eventType: 'escape',
83
- handler?: (event: {elementType: 'payment'}) => any
84
- ): StripePaymentElement;
85
-
86
- /**
87
- * Triggered when the element fails to load.
88
- */
89
- on(
90
- eventType: 'loaderror',
91
- handler: (event: {elementType: 'payment'; error: StripeError}) => any
92
- ): StripePaymentElement;
93
- once(
94
- eventType: 'loaderror',
95
- handler: (event: {elementType: 'payment'; error: StripeError}) => any
96
- ): StripePaymentElement;
97
- off(
98
- eventType: 'loaderror',
99
- handler?: (event: {elementType: 'payment'; error: StripeError}) => any
100
- ): StripePaymentElement;
101
-
102
- /**
103
- * Triggered when the loader UI is mounted to the DOM and ready to be displayed.
104
- */
105
- on(
106
- eventType: 'loaderstart',
107
- handler: (event: {elementType: 'payment'}) => any
108
- ): StripePaymentElement;
109
- once(
110
- eventType: 'loaderstart',
111
- handler: (event: {elementType: 'payment'}) => any
112
- ): StripePaymentElement;
113
- off(
114
- eventType: 'loaderstart',
115
- handler?: (event: {elementType: 'payment'}) => any
116
- ): StripePaymentElement;
117
-
118
- /**
119
- * Updates the options the `PaymentElement` was initialized with.
120
- * Updates are merged into the existing configuration.
121
- */
122
- update(options: Partial<StripePaymentElementOptions>): StripePaymentElement;
123
-
124
- /**
125
- * Collapses the Payment Element into a row of payment method tabs.
126
- */
127
- collapse(): StripePaymentElement;
128
- };
129
-
130
- export interface DefaultValuesOption {
131
- billingDetails?: {
132
- name?: string;
133
- email?: string;
134
- phone?: string;
135
- address?: {
136
- country?: string;
137
- postal_code?: string;
138
- state?: string;
139
- city?: string;
140
- line1?: string;
141
- line2?: string;
142
- };
143
- };
144
- }
145
-
146
- export type FieldOption = 'auto' | 'never';
147
-
148
- export interface FieldsOption {
149
- billingDetails?:
150
- | FieldOption
151
- | {
152
- name?: FieldOption;
153
- email?: FieldOption;
154
- phone?: FieldOption;
155
- address?:
156
- | FieldOption
157
- | {
158
- country?: FieldOption;
159
- postalCode?: FieldOption;
160
- state?: FieldOption;
161
- city?: FieldOption;
162
- line1?: FieldOption;
163
- line2?: FieldOption;
164
- };
165
- };
166
- }
167
-
168
- export type TermOption = 'auto' | 'always' | 'never';
169
-
170
- export interface TermsOption {
171
- applePay?: TermOption;
172
- auBecsDebit?: TermOption;
173
- bancontact?: TermOption;
174
- card?: TermOption;
175
- cashapp?: TermOption;
176
- googlePay?: TermOption;
177
- ideal?: TermOption;
178
- paypal?: TermOption;
179
- sepaDebit?: TermOption;
180
- sofort?: TermOption;
181
- usBankAccount?: TermOption;
182
- }
183
-
184
- export type PaymentWalletOption = 'auto' | 'never';
185
-
186
- export interface PaymentWalletsOption {
187
- applePay?: PaymentWalletOption;
188
- googlePay?: PaymentWalletOption;
189
- }
190
-
191
- export type Layout = 'tabs' | 'accordion' | 'auto';
192
-
193
- export interface LayoutObject {
194
- type: Layout;
195
- defaultCollapsed?: boolean;
196
- radios?: boolean;
197
- spacedAccordionItems?: boolean;
198
- }
199
-
200
- export interface StripePaymentElementOptions {
201
- /**
202
- * Provide initial customer information that will be displayed in the Payment Element.
203
- */
204
- defaultValues?: DefaultValuesOption;
205
-
206
- /**
207
- * Override the business name displayed in the Payment Element.
208
- * By default the PaymentElement will use your Stripe account or business name.
209
- */
210
- business?: {name: string};
211
-
212
- /**
213
- * Override the order in which payment methods are displayed in the Payment Element.
214
- * By default, the Payment Element will use a dynamic ordering that optimizes payment method display for each user.
215
- */
216
- paymentMethodOrder?: string[];
217
-
218
- /**
219
- * Control which fields are displayed in the Payment Element.
220
- */
221
- fields?: FieldsOption;
222
-
223
- /**
224
- * Apply a read-only state to the Payment Element so that payment details can’t be changed.
225
- * Default is false.
226
- */
227
- readOnly?: boolean;
228
-
229
- /**
230
- * Control terms display in the Payment Element.
231
- */
232
- terms?: TermsOption;
233
-
234
- /**
235
- * Control wallets display in the Payment Element.
236
- */
237
- wallets?: PaymentWalletsOption;
238
-
239
- /**
240
- * Specify a layout to use when rendering a Payment Element.
241
- */
242
- layout?: Layout | LayoutObject;
243
-
244
- /**
245
- * Specify the options to be used when the Apple Pay payment interface opens.
246
- */
247
- applePay?: ApplePayOption;
248
- }
249
-
250
- export interface StripePaymentElementChangeEvent {
251
- /**
252
- * The type of element that emitted this event.
253
- */
254
- elementType: 'payment';
255
-
256
- /**
257
- * `true` if the all inputs in the Payment Element are empty.
258
- */
259
- empty: boolean;
260
-
261
- /**
262
- * `true` if the every input in the Payment Element is well-formed and potentially complete.
263
- */
264
- complete: boolean;
265
-
266
- /**
267
- * Whether or not the Payment Element is currently collapsed.
268
- */
269
- collapsed: boolean;
270
-
271
- /**
272
- * An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay").
273
- */
274
- value: {type: string};
275
- }