@stripe/stripe-js 3.0.9 → 3.0.10

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 (129) hide show
  1. package/dist/index.d.mts +12792 -4
  2. package/dist/index.d.ts +12792 -4
  3. package/dist/{index.js → stripe.js} +1 -1
  4. package/dist/{index.mjs → stripe.mjs} +1 -1
  5. package/package.json +10 -11
  6. package/pure/index.d.mts +12771 -1
  7. package/pure/index.d.ts +12771 -1
  8. package/pure/index.js +204 -1
  9. package/pure/index.mjs +200 -1
  10. package/dist/api/bank-accounts.d.mts +0 -61
  11. package/dist/api/bank-accounts.d.ts +0 -61
  12. package/dist/api/cards.d.mts +0 -130
  13. package/dist/api/cards.d.ts +0 -130
  14. package/dist/api/financial-connections.d.mts +0 -232
  15. package/dist/api/financial-connections.d.ts +0 -232
  16. package/dist/api/index.d.mts +0 -11
  17. package/dist/api/index.d.ts +0 -11
  18. package/dist/api/orders.d.mts +0 -122
  19. package/dist/api/orders.d.ts +0 -122
  20. package/dist/api/payment-intents.d.mts +0 -330
  21. package/dist/api/payment-intents.d.ts +0 -330
  22. package/dist/api/payment-methods.d.mts +0 -452
  23. package/dist/api/payment-methods.d.ts +0 -452
  24. package/dist/api/setup-intents.d.mts +0 -184
  25. package/dist/api/setup-intents.d.ts +0 -184
  26. package/dist/api/shared.d.mts +0 -125
  27. package/dist/api/shared.d.ts +0 -125
  28. package/dist/api/sources.d.mts +0 -1045
  29. package/dist/api/sources.d.ts +0 -1045
  30. package/dist/api/tokens.d.mts +0 -639
  31. package/dist/api/tokens.d.ts +0 -639
  32. package/dist/api/verification-sessions.d.mts +0 -9
  33. package/dist/api/verification-sessions.d.ts +0 -9
  34. package/dist/pure.d.mts +0 -5
  35. package/dist/pure.d.ts +0 -5
  36. package/dist/pure.js +0 -204
  37. package/dist/pure.mjs +0 -200
  38. package/dist/shared.d.mts +0 -6
  39. package/dist/shared.d.ts +0 -6
  40. package/dist/stripe-js/checkout.d.mts +0 -153
  41. package/dist/stripe-js/checkout.d.ts +0 -153
  42. package/dist/stripe-js/custom-checkout.d.mts +0 -402
  43. package/dist/stripe-js/custom-checkout.d.ts +0 -402
  44. package/dist/stripe-js/elements/address.d.mts +0 -261
  45. package/dist/stripe-js/elements/address.d.ts +0 -261
  46. package/dist/stripe-js/elements/affirm-message.d.mts +0 -65
  47. package/dist/stripe-js/elements/affirm-message.d.ts +0 -65
  48. package/dist/stripe-js/elements/afterpay-clearpay-message.d.mts +0 -119
  49. package/dist/stripe-js/elements/afterpay-clearpay-message.d.ts +0 -119
  50. package/dist/stripe-js/elements/apple-pay.d.mts +0 -156
  51. package/dist/stripe-js/elements/apple-pay.d.ts +0 -156
  52. package/dist/stripe-js/elements/au-bank-account.d.mts +0 -138
  53. package/dist/stripe-js/elements/au-bank-account.d.ts +0 -138
  54. package/dist/stripe-js/elements/base.d.mts +0 -264
  55. package/dist/stripe-js/elements/base.d.ts +0 -264
  56. package/dist/stripe-js/elements/card-cvc.d.mts +0 -119
  57. package/dist/stripe-js/elements/card-cvc.d.ts +0 -119
  58. package/dist/stripe-js/elements/card-expiry.d.mts +0 -119
  59. package/dist/stripe-js/elements/card-expiry.d.ts +0 -119
  60. package/dist/stripe-js/elements/card-number.d.mts +0 -200
  61. package/dist/stripe-js/elements/card-number.d.ts +0 -200
  62. package/dist/stripe-js/elements/card.d.mts +0 -226
  63. package/dist/stripe-js/elements/card.d.ts +0 -226
  64. package/dist/stripe-js/elements/cart.d.mts +0 -224
  65. package/dist/stripe-js/elements/cart.d.ts +0 -224
  66. package/dist/stripe-js/elements/eps-bank.d.mts +0 -140
  67. package/dist/stripe-js/elements/eps-bank.d.ts +0 -140
  68. package/dist/stripe-js/elements/express-checkout.d.mts +0 -446
  69. package/dist/stripe-js/elements/express-checkout.d.ts +0 -446
  70. package/dist/stripe-js/elements/fpx-bank.d.mts +0 -134
  71. package/dist/stripe-js/elements/fpx-bank.d.ts +0 -134
  72. package/dist/stripe-js/elements/iban.d.mts +0 -135
  73. package/dist/stripe-js/elements/iban.d.ts +0 -135
  74. package/dist/stripe-js/elements/ideal-bank.d.mts +0 -140
  75. package/dist/stripe-js/elements/ideal-bank.d.ts +0 -140
  76. package/dist/stripe-js/elements/index.d.mts +0 -22
  77. package/dist/stripe-js/elements/index.d.ts +0 -22
  78. package/dist/stripe-js/elements/issuing/index.d.mts +0 -5
  79. package/dist/stripe-js/elements/issuing/index.d.ts +0 -5
  80. package/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.mts +0 -37
  81. package/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.ts +0 -37
  82. package/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.mts +0 -32
  83. package/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.ts +0 -32
  84. package/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.mts +0 -32
  85. package/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.ts +0 -32
  86. package/dist/stripe-js/elements/issuing/issuing-card-number-display.d.mts +0 -40
  87. package/dist/stripe-js/elements/issuing/issuing-card-number-display.d.ts +0 -40
  88. package/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.mts +0 -32
  89. package/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.ts +0 -32
  90. package/dist/stripe-js/elements/link-authentication.d.mts +0 -158
  91. package/dist/stripe-js/elements/link-authentication.d.ts +0 -158
  92. package/dist/stripe-js/elements/p24-bank.d.mts +0 -140
  93. package/dist/stripe-js/elements/p24-bank.d.ts +0 -140
  94. package/dist/stripe-js/elements/payment-method-messaging.d.mts +0 -98
  95. package/dist/stripe-js/elements/payment-method-messaging.d.ts +0 -98
  96. package/dist/stripe-js/elements/payment-request-button.d.mts +0 -151
  97. package/dist/stripe-js/elements/payment-request-button.d.ts +0 -151
  98. package/dist/stripe-js/elements/payment.d.mts +0 -275
  99. package/dist/stripe-js/elements/payment.d.ts +0 -275
  100. package/dist/stripe-js/elements/shipping-address.d.mts +0 -215
  101. package/dist/stripe-js/elements/shipping-address.d.ts +0 -215
  102. package/dist/stripe-js/elements-group.d.mts +0 -1129
  103. package/dist/stripe-js/elements-group.d.ts +0 -1129
  104. package/dist/stripe-js/embedded-checkout.d.mts +0 -35
  105. package/dist/stripe-js/embedded-checkout.d.ts +0 -35
  106. package/dist/stripe-js/ephemeral-keys.d.mts +0 -3
  107. package/dist/stripe-js/ephemeral-keys.d.ts +0 -3
  108. package/dist/stripe-js/financial-connections.d.mts +0 -19
  109. package/dist/stripe-js/financial-connections.d.ts +0 -19
  110. package/dist/stripe-js/index.d.mts +0 -13
  111. package/dist/stripe-js/index.d.ts +0 -13
  112. package/dist/stripe-js/orders.d.mts +0 -9
  113. package/dist/stripe-js/orders.d.ts +0 -9
  114. package/dist/stripe-js/payment-intents.d.mts +0 -1470
  115. package/dist/stripe-js/payment-intents.d.ts +0 -1470
  116. package/dist/stripe-js/payment-request.d.mts +0 -529
  117. package/dist/stripe-js/payment-request.d.ts +0 -529
  118. package/dist/stripe-js/setup-intents.d.mts +0 -250
  119. package/dist/stripe-js/setup-intents.d.ts +0 -250
  120. package/dist/stripe-js/stripe.d.mts +0 -1472
  121. package/dist/stripe-js/stripe.d.ts +0 -1472
  122. package/dist/stripe-js/token-and-sources.d.mts +0 -110
  123. package/dist/stripe-js/token-and-sources.d.ts +0 -110
  124. package/dist/utils.d.mts +0 -2
  125. package/dist/utils.d.ts +0 -2
  126. package/lib/index.d.mts +0 -1
  127. package/lib/index.d.ts +0 -1
  128. package/lib/index.js +0 -2
  129. package/lib/index.mjs +0 -1
@@ -1,153 +0,0 @@
1
- export interface RedirectToCheckoutServerOptions {
2
- /**
3
- * The ID of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions) that is used in [Checkout's server integration](https://stripe.com/docs/payments/checkout/one-time).
4
- */
5
- sessionId: string;
6
- }
7
-
8
- export interface RedirectToCheckoutClientOptions {
9
- /**
10
- * The URL to which Stripe should send customers when payment is complete.
11
- * If you’d like access to the Checkout Session for the successful payment, read more about it in our guide on [fulfilling your payments with webhooks](https://stripe.com/docs/payments/checkout/fulfillment#webhooks).
12
- */
13
- successUrl: string;
14
-
15
- /**
16
- * The URL to which Stripe should send customers when payment is canceled.
17
- */
18
- cancelUrl: string;
19
-
20
- /**
21
- * An array of objects representing the items that your customer would like to purchase.
22
- * These items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout.
23
- */
24
- lineItems?: Array<{
25
- /**
26
- * The ID of the price that the customer would like to purchase. SKU or plan IDs may also be used.
27
- */
28
- price?: string;
29
-
30
- /**
31
- * The quantity of units for the item.
32
- */
33
- quantity?: number;
34
- }>;
35
-
36
- /**
37
- * An array of objects representing the items that your customer would like to purchase.
38
- * These items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout.
39
- *
40
- * @deprecated
41
- */
42
- items?: Array<{
43
- /**
44
- * The ID of the SKU that the customer would like to purchase
45
- */
46
- sku?: string;
47
-
48
- /**
49
- * The ID of the plan that the customer would like to subscribe to.
50
- */
51
- plan?: string;
52
-
53
- /**
54
- * The quantity of units for the item.
55
- */
56
- quantity?: number;
57
- }>;
58
-
59
- /**
60
- * The mode of the Checkout Session. Required if using lineItems.
61
- */
62
- mode?: 'payment' | 'subscription';
63
-
64
- /**
65
- * A unique string to reference the Checkout session.
66
- * This can be a customer ID, a cart ID, or similar.
67
- * It is included in the `checkout.session.completed` webhook and can be used to fulfill the purchase.
68
- */
69
- clientReferenceId?: string;
70
-
71
- /**
72
- * The email address used to create the customer object.
73
- * If you already know your customer's email address, use this attribute to prefill it on Checkout.
74
- */
75
- customerEmail?: string;
76
-
77
- /**
78
- * Specify whether Checkout should collect the customer’s billing address.
79
- * If set to `required`, Checkout will attempt to collect the customer’s billing address.
80
- * If not set or set to `auto` Checkout will only attempt to collect the billing address when necessary.
81
- */
82
- billingAddressCollection?: 'auto' | 'required';
83
-
84
- /**
85
- * Provides configuration for Checkout to collect a shipping address from a customer.
86
- */
87
- shippingAddressCollection?: {
88
- /**
89
- * An array of two-letter ISO country codes representing which countries
90
- * Checkout should provide as options for shipping locations. The codes are
91
- * expected to be uppercase. Unsupported country codes: AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI.
92
- */
93
- allowedCountries: string[];
94
- };
95
-
96
- /**
97
- * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the locale to display Checkout in.
98
- * Default is `auto` (Stripe detects the locale of the browser).
99
- */
100
- locale?: CheckoutLocale;
101
-
102
- /**
103
- * Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the **Submit** button.
104
- * `submitType` can only be specified when using using line items or SKUs, and not subscriptions.
105
- * The default is `auto`.
106
- */
107
- submitType?: 'auto' | 'book' | 'donate' | 'pay';
108
- }
109
-
110
- export type RedirectToCheckoutOptions =
111
- | RedirectToCheckoutServerOptions
112
- | RedirectToCheckoutClientOptions;
113
-
114
- export type CheckoutLocale =
115
- | 'auto'
116
- | 'bg'
117
- | 'cs'
118
- | 'da'
119
- | 'de'
120
- | 'el'
121
- | 'en'
122
- | 'en-GB'
123
- | 'es'
124
- | 'es-419'
125
- | 'et'
126
- | 'fi'
127
- | 'fil'
128
- | 'fr'
129
- | 'fr-CA'
130
- | 'hr'
131
- | 'hu'
132
- | 'id'
133
- | 'it'
134
- | 'ja'
135
- | 'lt'
136
- | 'lv'
137
- | 'ms'
138
- | 'mt'
139
- | 'nb'
140
- | 'nl'
141
- | 'pl'
142
- | 'pt'
143
- | 'pt-BR'
144
- | 'ro'
145
- | 'ru'
146
- | 'sk'
147
- | 'sl'
148
- | 'sv'
149
- | 'th'
150
- | 'tr'
151
- | 'zh'
152
- | 'zh-HK'
153
- | 'zh-TW';
@@ -1,402 +0,0 @@
1
- import {
2
- LayoutObject,
3
- Layout,
4
- TermsOption,
5
- StripePaymentElement,
6
- } from './elements/payment';
7
- import {
8
- AddressMode,
9
- ContactOption,
10
- StripeAddressElement,
11
- } from './elements/address';
12
- import {Appearance, CssFontSource, CustomFontSource} from './elements-group';
13
- import {StripeError} from './stripe';
14
- import {
15
- StripeElementBase,
16
- StripeExpressCheckoutElement,
17
- StripeExpressCheckoutElementConfirmEvent,
18
- StripeExpressCheckoutElementOptions,
19
- StripeExpressCheckoutElementReadyEvent,
20
- } from './elements';
21
-
22
- /**
23
- * Requires beta access:
24
- * Contact [Stripe support](https://support.stripe.com/) for more information.
25
- */
26
-
27
- export interface StripeCustomCheckoutElementsOptions {
28
- appearance?: Appearance;
29
- loader?: 'auto' | 'always' | 'never';
30
- fonts?: Array<CssFontSource | CustomFontSource>;
31
- }
32
-
33
- export interface StripeCustomCheckoutOptions {
34
- clientSecret: string;
35
- elementsOptions?: StripeCustomCheckoutElementsOptions;
36
- }
37
-
38
- /* Custom Checkout types */
39
- export type StripeCustomCheckoutAddress = {
40
- country: string;
41
- line1?: string | null;
42
- line2?: string | null;
43
- city?: string | null;
44
- postal_code?: string | null;
45
- state?: string | null;
46
- };
47
-
48
- export type StripeCustomCheckoutAdjustableQuantity = {
49
- maximum: number;
50
- minimum: number;
51
- };
52
-
53
- export type StripeCustomCheckoutBillingInterval =
54
- | 'day'
55
- | 'month'
56
- | 'week'
57
- | 'year';
58
-
59
- export type StripeCustomCheckoutConfirmationRequirement =
60
- | 'phoneNumber'
61
- | 'shippingAddress'
62
- | 'billingAddress'
63
- | 'paymentDetails'
64
- | 'email';
65
-
66
- export type StripeCustomCheckoutContact = {
67
- name?: string | null;
68
- address: StripeCustomCheckoutAddress;
69
- };
70
-
71
- export type StripeCustomCheckoutDeliveryEstimate = {
72
- maximum: StripeCustomCheckoutEstimate | null;
73
- minimum: StripeCustomCheckoutEstimate | null;
74
- };
75
-
76
- export type StripeCustomCheckoutDiscountAmount = {
77
- amount: number;
78
- displayName: string;
79
- promotionCode: string | null;
80
- recurring:
81
- | {type: 'forever'}
82
- | {type: 'repeating'; durationInMonths: number}
83
- | null;
84
- };
85
-
86
- export type StripeCustomCheckoutDueNext = {
87
- amountSubtotal: number;
88
- amountDiscount: number;
89
- amountTaxInclusive: number;
90
- amountTaxExclusive: number;
91
- billingCycleAnchor: number | null;
92
- };
93
-
94
- export type StripeCustomCheckoutEstimate = {
95
- unit: 'business_day' | 'day' | 'hour' | 'week' | 'month';
96
- value: number;
97
- };
98
-
99
- export type StripeCustomCheckoutLastPaymentError = {
100
- message: string;
101
- };
102
-
103
- export type StripeCustomCheckoutTaxAmount = {
104
- amount: number;
105
- inclusive: boolean;
106
- displayName: string;
107
- };
108
-
109
- export type StripeCustomCheckoutLineItem = {
110
- id: string;
111
- name: string;
112
- amountDiscount: number;
113
- amountSubtotal: number;
114
- amountTaxExclusive: number;
115
- amountTaxInclusive: number;
116
- unitAmount: number;
117
- description: string | null;
118
- quantity: number;
119
- discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null;
120
- taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null;
121
- recurring: {
122
- interval: StripeCustomCheckoutBillingInterval;
123
- intervalCount: number;
124
- isProrated: boolean;
125
- usageType: 'metered' | 'licensed';
126
- } | null;
127
- adjustableQuantity: StripeCustomCheckoutAdjustableQuantity | null;
128
- };
129
-
130
- export type StripeCustomCheckoutRecurring = {
131
- interval: StripeCustomCheckoutBillingInterval;
132
- intervalCount: number;
133
- dueNext: StripeCustomCheckoutDueNext;
134
- trial: StripeCustomCheckoutTrial | null;
135
- };
136
-
137
- export type StripeCustomCheckoutShipping = {
138
- shippingOption: StripeCustomCheckoutShippingOption;
139
- taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null;
140
- };
141
-
142
- export type StripeCustomCheckoutShippingOption = {
143
- id: string;
144
- amount: number;
145
- currency: string;
146
- displayName: string | null;
147
- deliveryEstimate: StripeCustomCheckoutDeliveryEstimate | null;
148
- };
149
-
150
- export type StripeCustomCheckoutStatus =
151
- | {type: 'open'}
152
- | {type: 'expired'}
153
- | {
154
- type: 'complete';
155
- paymentStatus: 'paid' | 'unpaid' | 'no_payment_required';
156
- };
157
-
158
- export type StripeCustomCheckoutTaxStatus =
159
- | {status: 'ready'}
160
- | {status: 'requires_shipping_address'}
161
- | {status: 'requires_billing_address'};
162
-
163
- export type StripeCustomCheckoutTotalSummary = {
164
- appliedBalance: number;
165
- balanceAppliedToNextInvoice: boolean;
166
- discount: number;
167
- shippingRate: number;
168
- subtotal: number;
169
- taxExclusive: number;
170
- taxInclusive: number;
171
- total: number;
172
- };
173
-
174
- export type StripeCustomCheckoutTrial = {
175
- trialEnd: number;
176
- trialPeriodDays: number;
177
- };
178
-
179
- /* Custom Checkout session */
180
- export interface StripeCustomCheckoutSession {
181
- billingAddress: StripeCustomCheckoutContact | null;
182
- canConfirm: boolean;
183
- confirmationRequirements: StripeCustomCheckoutConfirmationRequirement[];
184
- currency: string;
185
- discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null;
186
- email: string | null;
187
- lastPaymentError: StripeCustomCheckoutLastPaymentError | null;
188
- lineItems: Array<StripeCustomCheckoutLineItem>;
189
- phoneNumber: string | null;
190
- recurring: StripeCustomCheckoutRecurring | null;
191
- shipping: StripeCustomCheckoutShipping | null;
192
- shippingAddress: StripeCustomCheckoutContact | null;
193
- shippingOptions: Array<StripeCustomCheckoutShippingOption>;
194
- status: StripeCustomCheckoutStatus;
195
- tax: StripeCustomCheckoutTaxStatus;
196
- taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null;
197
- total: StripeCustomCheckoutTotalSummary;
198
- }
199
-
200
- export type StripeCustomCheckoutResult =
201
- | {session: StripeCustomCheckoutSession; error?: undefined}
202
- | {session?: undefined; error: StripeError};
203
-
204
- export type StripeCustomCheckoutPaymentElementOptions = {
205
- layout?: Layout | LayoutObject;
206
- paymentMethodOrder?: Array<string>;
207
- readonly?: boolean;
208
- terms?: TermsOption;
209
- };
210
-
211
- export type StripeCustomCheckoutAddressElementOptions = {
212
- mode: AddressMode;
213
- contacts?: ContactOption[];
214
- display?: {
215
- name?: 'full' | 'split' | 'organization';
216
- };
217
- };
218
-
219
- export type StripeCustomCheckoutExpressCheckoutElementOptions = {
220
- buttonHeight: StripeExpressCheckoutElementOptions['buttonHeight'];
221
- buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme'];
222
- buttonType: StripeExpressCheckoutElementOptions['buttonType'];
223
- layout: StripeExpressCheckoutElementOptions['layout'];
224
- };
225
-
226
- export type StripeCustomCheckoutUpdateHandler = (
227
- session: StripeCustomCheckoutSession
228
- ) => void;
229
-
230
- export type StripeCustomCheckoutExpressCheckoutElementConfirmEvent = StripeExpressCheckoutElementConfirmEvent & {
231
- confirm: () => Promise<StripeCustomCheckoutResult>;
232
- };
233
-
234
- export type StripeCustomCheckoutExpressCheckoutElement = StripeElementBase & {
235
- /**
236
- * Triggered when the element is fully rendered.
237
- */
238
- on(
239
- eventType: 'ready',
240
- handler: (event: StripeExpressCheckoutElementReadyEvent) => any
241
- ): StripeCustomCheckoutExpressCheckoutElement;
242
- once(
243
- eventType: 'ready',
244
- handler: (event: StripeExpressCheckoutElementReadyEvent) => any
245
- ): StripeCustomCheckoutExpressCheckoutElement;
246
- off(
247
- eventType: 'ready',
248
- handler?: (event: StripeExpressCheckoutElementReadyEvent) => any
249
- ): StripeCustomCheckoutExpressCheckoutElement;
250
-
251
- /**
252
- * Triggered when the element gains focus.
253
- */
254
- on(
255
- eventType: 'focus',
256
- handler: (event: {elementType: 'expressCheckout'}) => any
257
- ): StripeCustomCheckoutExpressCheckoutElement;
258
- once(
259
- eventType: 'focus',
260
- handler: (event: {elementType: 'expressCheckout'}) => any
261
- ): StripeCustomCheckoutExpressCheckoutElement;
262
- off(
263
- eventType: 'focus',
264
- handler?: (event: {elementType: 'expressCheckout'}) => any
265
- ): StripeCustomCheckoutExpressCheckoutElement;
266
-
267
- /**
268
- * Triggered when the element loses focus.
269
- */
270
- on(
271
- eventType: 'blur',
272
- handler: (event: {elementType: 'expressCheckout'}) => any
273
- ): StripeCustomCheckoutExpressCheckoutElement;
274
- once(
275
- eventType: 'blur',
276
- handler: (event: {elementType: 'expressCheckout'}) => any
277
- ): StripeCustomCheckoutExpressCheckoutElement;
278
- off(
279
- eventType: 'blur',
280
- handler?: (event: {elementType: 'expressCheckout'}) => any
281
- ): StripeCustomCheckoutExpressCheckoutElement;
282
-
283
- /**
284
- * Triggered when the escape key is pressed within the element.
285
- */
286
- on(
287
- eventType: 'escape',
288
- handler: (event: {elementType: 'expressCheckout'}) => any
289
- ): StripeCustomCheckoutExpressCheckoutElement;
290
- once(
291
- eventType: 'escape',
292
- handler: (event: {elementType: 'expressCheckout'}) => any
293
- ): StripeCustomCheckoutExpressCheckoutElement;
294
- off(
295
- eventType: 'escape',
296
- handler?: (event: {elementType: 'expressCheckout'}) => any
297
- ): StripeCustomCheckoutExpressCheckoutElement;
298
-
299
- /**
300
- * Triggered when the element fails to load.
301
- */
302
- on(
303
- eventType: 'loaderror',
304
- handler: (event: {
305
- elementType: 'expressCheckout';
306
- error: StripeError;
307
- }) => any
308
- ): StripeCustomCheckoutExpressCheckoutElement;
309
- once(
310
- eventType: 'loaderror',
311
- handler: (event: {
312
- elementType: 'expressCheckout';
313
- error: StripeError;
314
- }) => any
315
- ): StripeCustomCheckoutExpressCheckoutElement;
316
- off(
317
- eventType: 'loaderror',
318
- handler?: (event: {
319
- elementType: 'expressCheckout';
320
- error: StripeError;
321
- }) => any
322
- ): StripeCustomCheckoutExpressCheckoutElement;
323
-
324
- /**
325
- * Triggered when a buyer authorizes a payment within a supported payment method.
326
- */
327
- on(
328
- eventType: 'confirm',
329
- handler: (
330
- event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent
331
- ) => any
332
- ): StripeCustomCheckoutExpressCheckoutElement;
333
- once(
334
- eventType: 'confirm',
335
- handler: (
336
- event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent
337
- ) => any
338
- ): StripeCustomCheckoutExpressCheckoutElement;
339
- off(
340
- eventType: 'confirm',
341
- handler?: (
342
- event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent
343
- ) => any
344
- ): StripeCustomCheckoutExpressCheckoutElement;
345
-
346
- /**
347
- * Updates the options the `ExpressCheckoutElement` was initialized with.
348
- * Updates are merged into the existing configuration.
349
- */
350
- update: StripeExpressCheckoutElement['update'];
351
- };
352
-
353
- export interface StripeCustomCheckout {
354
- /* Custom Checkout methods */
355
- applyPromotionCode: (
356
- promotionCode: string
357
- ) => Promise<StripeCustomCheckoutResult>;
358
- removePromotionCode: () => Promise<StripeCustomCheckoutResult>;
359
- updateShippingAddress: (
360
- shippingAddress: StripeCustomCheckoutContact | null
361
- ) => Promise<StripeCustomCheckoutResult>;
362
- updateBillingAddress: (
363
- billingAddress: StripeCustomCheckoutContact | null
364
- ) => Promise<StripeCustomCheckoutResult>;
365
- updatePhoneNumber: (phoneNumber: string) => void;
366
- updateEmail: (email: string) => void;
367
- updateLineItemQuantity: (args: {
368
- lineItem: string;
369
- quantity: number;
370
- }) => Promise<StripeCustomCheckoutResult>;
371
- updateShippingOption: (
372
- shippingOption: string
373
- ) => Promise<StripeCustomCheckoutResult>;
374
- confirm: (args?: {
375
- return_url?: string;
376
- }) => Promise<StripeCustomCheckoutResult>;
377
- session: () => StripeCustomCheckoutSession;
378
- on: (event: 'change', handler: StripeCustomCheckoutUpdateHandler) => void;
379
-
380
- /* Elements methods */
381
- changeAppearance: (appearance: Appearance) => void;
382
- getElement(elementType: 'payment'): StripePaymentElement | null;
383
- getElement(
384
- elementType: 'address',
385
- mode: AddressMode
386
- ): StripeAddressElement | null;
387
- getElement(
388
- elementType: 'expressCheckout'
389
- ): StripeCustomCheckoutExpressCheckoutElement | null;
390
- createElement(
391
- elementType: 'payment',
392
- options?: StripeCustomCheckoutPaymentElementOptions
393
- ): StripePaymentElement;
394
- createElement(
395
- elementType: 'address',
396
- options: StripeCustomCheckoutAddressElementOptions
397
- ): StripeAddressElement;
398
- createElement(
399
- elementType: 'expressCheckout',
400
- options: StripeCustomCheckoutExpressCheckoutElementOptions
401
- ): StripeCustomCheckoutExpressCheckoutElement;
402
- }