@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,224 +0,0 @@
1
- import {StripeElementBase} from './base';
2
- import {StripeError} from '../stripe';
3
-
4
- export type StripeCartElement = StripeElementBase & {
5
- /**
6
- * The change event is triggered when the `Element`'s value changes.
7
- */
8
- on(
9
- eventType: 'change',
10
- handler: (event: StripeCartElementPayloadEvent) => any
11
- ): StripeCartElement;
12
- once(
13
- eventType: 'change',
14
- handler: (event: StripeCartElementPayloadEvent) => any
15
- ): StripeCartElement;
16
- off(
17
- eventType: 'change',
18
- handler?: (event: StripeCartElementPayloadEvent) => any
19
- ): StripeCartElement;
20
-
21
- /**
22
- * Triggered when the element is fully rendered and can accept `element.focus` calls.
23
- */
24
- on(
25
- eventType: 'ready',
26
- handler: (event: StripeCartElementPayloadEvent) => any
27
- ): StripeCartElement;
28
- once(
29
- eventType: 'ready',
30
- handler: (event: StripeCartElementPayloadEvent) => any
31
- ): StripeCartElement;
32
- off(
33
- eventType: 'ready',
34
- handler?: (event: StripeCartElementPayloadEvent) => any
35
- ): StripeCartElement;
36
-
37
- /**
38
- * Triggered when the element fails to load.
39
- */
40
- on(
41
- eventType: 'loaderror',
42
- handler: (event: {elementType: 'cart'; error: StripeError}) => any
43
- ): StripeCartElement;
44
- once(
45
- eventType: 'loaderror',
46
- handler: (event: {elementType: 'cart'; error: StripeError}) => any
47
- ): StripeCartElement;
48
- off(
49
- eventType: 'loaderror',
50
- handler?: (event: {elementType: 'cart'; error: StripeError}) => any
51
- ): StripeCartElement;
52
-
53
- /**
54
- * Triggered when the 'checkout' button in the element is clicked
55
- */
56
- on(
57
- eventType: 'checkout',
58
- handler: (event: StripeCartElementPayloadEvent) => any
59
- ): StripeCartElement;
60
- once(
61
- eventType: 'checkout',
62
- handler: (event: StripeCartElementPayloadEvent) => any
63
- ): StripeCartElement;
64
- off(
65
- eventType: 'checkout',
66
- handler?: (event: StripeCartElementPayloadEvent) => any
67
- ): StripeCartElement;
68
-
69
- /**
70
- * Triggered when a line item in the element is clicked
71
- */
72
- on(
73
- eventType: 'lineitemclick',
74
- handler: (event: StripeCartElementLineItemClickEvent) => any
75
- ): StripeCartElement;
76
- once(
77
- eventType: 'lineitemclick',
78
- handler: (event: StripeCartElementLineItemClickEvent) => any
79
- ): StripeCartElement;
80
- off(
81
- eventType: 'lineitemclick',
82
- handler?: (event: StripeCartElementLineItemClickEvent) => any
83
- ): StripeCartElement;
84
-
85
- /**
86
- * Updates the options the `CartElement` was initialized with.
87
- * Updates are merged into the existing configuration.
88
- */
89
- update(options: StripeCartElementUpdateOptions): StripeCartElement;
90
-
91
- /**
92
- * Makes the Cart Element visible
93
- */
94
- show(): StripeCartElement;
95
-
96
- /**
97
- * Makes the Cart Element not visible
98
- */
99
- hide(): StripeCartElement;
100
-
101
- /**
102
- * Cancels the "Check Out" button loader and displays an error message regarding why going to checkout failed
103
- */
104
- cancelCheckout(errorMessage?: string | null): StripeCartElement;
105
-
106
- /**
107
- * Adds a line item to the CartSession
108
- */
109
- addLineItem(
110
- lineItemData:
111
- | {
112
- product: string;
113
- price?: null;
114
- item_details?: null;
115
- quantity?: number | null;
116
- }
117
- | {
118
- product?: null;
119
- price: string;
120
- item_details?: null;
121
- quantity?: number | null;
122
- }
123
- | {
124
- price?: null;
125
- product?: null;
126
- item_details: CartItemDetails;
127
- quantity?: number | null;
128
- }
129
- ): Promise<{error?: StripeError}>;
130
- };
131
-
132
- export type CartItemDetails = {
133
- external_id: string;
134
- name: string;
135
- description?: string;
136
- image?: string;
137
- unit_amount: number;
138
- };
139
-
140
- export type CartDescriptor = 'cart' | 'bag' | 'basket';
141
-
142
- export type CartShowOnAdd = 'never' | 'auto';
143
-
144
- export interface StripeCartElementOptions {
145
- /**
146
- * Identifies the CartSession the Element will display and modify.
147
- */
148
- clientSecret: string;
149
-
150
- /**
151
- * Override the verbiage used within the Element to refer to itself.
152
- * By default the Cart Element will use the term 'cart'.
153
- */
154
- descriptor?: CartDescriptor | null;
155
-
156
- /**
157
- * Override the text used in the title of the Element.
158
- * By default the Cart Element will use the title 'Your [descriptor]'.
159
- */
160
- header?: {
161
- text?: string | null;
162
- };
163
-
164
- /**
165
- * Control whether the Element automatically appears when items are added to the cart.
166
- * By default, the Cart Element will use 'auto'.
167
- */
168
- showOnAdd?: CartShowOnAdd | null;
169
- }
170
-
171
- /*
172
- * Updatable options for an `Elements` instance
173
- */
174
- export interface StripeCartElementUpdateOptions {
175
- /**
176
- * Override the text used in the title of the Element.
177
- * By default the Cart Element will use the title 'Your [descriptor]'.
178
- */
179
- header?: {
180
- text?: string | null;
181
- };
182
-
183
- /**
184
- * Control whether the Element automatically appears when items are added to the cart.
185
- * By default, the Cart Element will use 'auto'.
186
- */
187
- showOnAdd?: CartShowOnAdd | null;
188
- }
189
-
190
- export interface StripeCartElementPayloadEvent {
191
- /**
192
- * The type of element that emitted this event.
193
- */
194
- elementType: 'cart';
195
-
196
- /**
197
- * The ID of the CartSession associated with the Element.
198
- */
199
- id: string;
200
-
201
- /**
202
- * The number of line items currently in the cart.
203
- */
204
- lineItems: {
205
- count: number;
206
- };
207
- }
208
-
209
- export interface StripeCartElementLineItemClickEvent {
210
- /**
211
- * The type of element that emitted this event.
212
- */
213
- elementType: 'cart';
214
-
215
- /**
216
- * The ID of the CartSession associated with the Element.
217
- */
218
- preventDefault: () => void;
219
-
220
- /**
221
- * The type of element that emitted this event.
222
- */
223
- url: string;
224
- }
@@ -1,140 +0,0 @@
1
- import {
2
- StripeElementBase,
3
- StripeElementStyle,
4
- StripeElementClasses,
5
- StripeElementChangeEvent,
6
- } from './base';
7
-
8
- export type StripeEpsBankElement = StripeElementBase & {
9
- /**
10
- * The change event is triggered when the `Element`'s value changes.
11
- */
12
- on(
13
- eventType: 'change',
14
- handler: (event: StripeEpsBankElementChangeEvent) => any
15
- ): StripeEpsBankElement;
16
- once(
17
- eventType: 'change',
18
- handler: (event: StripeEpsBankElementChangeEvent) => any
19
- ): StripeEpsBankElement;
20
- off(
21
- eventType: 'change',
22
- handler: (event: StripeEpsBankElementChangeEvent) => any
23
- ): StripeEpsBankElement;
24
-
25
- /**
26
- * Triggered when the element is fully rendered and can accept `element.focus` calls.
27
- */
28
- on(
29
- eventType: 'ready',
30
- handler: (event: {elementType: 'epsBank'}) => any
31
- ): StripeEpsBankElement;
32
- once(
33
- eventType: 'ready',
34
- handler: (event: {elementType: 'epsBank'}) => any
35
- ): StripeEpsBankElement;
36
- off(
37
- eventType: 'ready',
38
- handler: (event: {elementType: 'epsBank'}) => any
39
- ): StripeEpsBankElement;
40
-
41
- /**
42
- * Triggered when the element gains focus.
43
- */
44
- on(
45
- eventType: 'focus',
46
- handler: (event: {elementType: 'epsBank'}) => any
47
- ): StripeEpsBankElement;
48
- once(
49
- eventType: 'focus',
50
- handler: (event: {elementType: 'epsBank'}) => any
51
- ): StripeEpsBankElement;
52
- off(
53
- eventType: 'focus',
54
- handler: (event: {elementType: 'epsBank'}) => any
55
- ): StripeEpsBankElement;
56
-
57
- /**
58
- * Triggered when the element loses focus.
59
- */
60
- on(
61
- eventType: 'blur',
62
- handler: (event: {elementType: 'epsBank'}) => any
63
- ): StripeEpsBankElement;
64
- once(
65
- eventType: 'blur',
66
- handler: (event: {elementType: 'epsBank'}) => any
67
- ): StripeEpsBankElement;
68
- off(
69
- eventType: 'blur',
70
- handler: (event: {elementType: 'epsBank'}) => any
71
- ): StripeEpsBankElement;
72
-
73
- /**
74
- * Triggered when the escape key is pressed within the element.
75
- */
76
- on(
77
- eventType: 'escape',
78
- handler: (event: {elementType: 'epsBank'}) => any
79
- ): StripeEpsBankElement;
80
- once(
81
- eventType: 'escape',
82
- handler: (event: {elementType: 'epsBank'}) => any
83
- ): StripeEpsBankElement;
84
- off(
85
- eventType: 'escape',
86
- handler: (event: {elementType: 'epsBank'}) => any
87
- ): StripeEpsBankElement;
88
-
89
- /**
90
- * Updates the options the `EpsBankElement` was initialized with.
91
- * Updates are merged into the existing configuration.
92
- *
93
- * The styles of an `EpsBankElement` can be dynamically changed using `element.update`.
94
- * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
95
- */
96
- update(options: Partial<StripeEpsBankElementOptions>): void;
97
- };
98
-
99
- export interface StripeEpsBankElementOptions {
100
- classes?: StripeElementClasses;
101
-
102
- style?: StripeElementStyle;
103
-
104
- /**
105
- * Appearance of the icon in the Element.
106
- */
107
- iconStyle?: 'default' | 'solid';
108
-
109
- /**
110
- * A pre-filled value for the Element.
111
- * Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`).
112
- */
113
- value?: string;
114
-
115
- /**
116
- * Hides the icon in the Element.
117
- * Default is `false`.
118
- */
119
- hideIcon?: boolean;
120
-
121
- /**
122
- * Applies a disabled state to the Element such that user input is not accepted.
123
- * Default is false.
124
- */
125
- disabled?: boolean;
126
- }
127
-
128
- export interface StripeEpsBankElementChangeEvent
129
- extends StripeElementChangeEvent {
130
- /**
131
- * The type of element that emitted this event.
132
- */
133
- elementType: 'epsBank';
134
-
135
- /**
136
- * A pre-filled value for the Element.
137
- * Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`).
138
- */
139
- value?: string;
140
- }