@stripe/stripe-js 4.6.0 → 4.8.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.
- package/dist/api/setup-intents.d.mts +28 -3
- package/dist/api/setup-intents.d.ts +28 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/pure.js +1 -1
- package/dist/pure.mjs +1 -1
- package/dist/stripe-js/elements/payment.d.mts +135 -0
- package/dist/stripe-js/elements/payment.d.ts +135 -0
- package/dist/stripe-js/elements-group.d.mts +5 -0
- package/dist/stripe-js/elements-group.d.ts +5 -0
- package/dist/stripe-js/embedded-checkout.d.mts +30 -0
- package/dist/stripe-js/embedded-checkout.d.ts +30 -0
- package/package.json +1 -1
|
@@ -131,17 +131,25 @@ export namespace SetupIntent {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
export interface NextAction {
|
|
134
|
-
redirect_to_url?: NextAction.RedirectToUrl;
|
|
135
|
-
|
|
136
134
|
/**
|
|
137
|
-
* Type of the next action to perform, one of `redirect_to_url` or `
|
|
135
|
+
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, or `verify_with_microdeposits`.
|
|
138
136
|
*/
|
|
139
137
|
type: string;
|
|
140
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Contains instructions for authenticating a payment by redirecting your customer to another page or application.
|
|
141
|
+
*/
|
|
142
|
+
redirect_to_url?: NextAction.RedirectToUrl;
|
|
143
|
+
|
|
141
144
|
/**
|
|
142
145
|
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
|
|
143
146
|
*/
|
|
144
147
|
use_stripe_sdk?: NextAction.UseStripeSdk;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Contains details describing microdeposits verification flow.
|
|
151
|
+
*/
|
|
152
|
+
verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
|
|
145
153
|
}
|
|
146
154
|
|
|
147
155
|
export namespace NextAction {
|
|
@@ -158,6 +166,23 @@ export namespace SetupIntent {
|
|
|
158
166
|
}
|
|
159
167
|
|
|
160
168
|
export interface UseStripeSdk {}
|
|
169
|
+
|
|
170
|
+
export interface VerifyWithMicrodeposits {
|
|
171
|
+
/**
|
|
172
|
+
* The timestamp when the microdeposits are expected to land.
|
|
173
|
+
*/
|
|
174
|
+
arrival_date: number;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The URL for the hosted verification page, which allows customers to verify their bank account.
|
|
178
|
+
*/
|
|
179
|
+
hosted_verification_url: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
|
|
183
|
+
*/
|
|
184
|
+
microdeposit_type: string | null;
|
|
185
|
+
}
|
|
161
186
|
}
|
|
162
187
|
|
|
163
188
|
export type Status =
|
|
@@ -131,17 +131,25 @@ export namespace SetupIntent {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
export interface NextAction {
|
|
134
|
-
redirect_to_url?: NextAction.RedirectToUrl;
|
|
135
|
-
|
|
136
134
|
/**
|
|
137
|
-
* Type of the next action to perform, one of `redirect_to_url` or `
|
|
135
|
+
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, or `verify_with_microdeposits`.
|
|
138
136
|
*/
|
|
139
137
|
type: string;
|
|
140
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Contains instructions for authenticating a payment by redirecting your customer to another page or application.
|
|
141
|
+
*/
|
|
142
|
+
redirect_to_url?: NextAction.RedirectToUrl;
|
|
143
|
+
|
|
141
144
|
/**
|
|
142
145
|
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
|
|
143
146
|
*/
|
|
144
147
|
use_stripe_sdk?: NextAction.UseStripeSdk;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Contains details describing microdeposits verification flow.
|
|
151
|
+
*/
|
|
152
|
+
verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
|
|
145
153
|
}
|
|
146
154
|
|
|
147
155
|
export namespace NextAction {
|
|
@@ -158,6 +166,23 @@ export namespace SetupIntent {
|
|
|
158
166
|
}
|
|
159
167
|
|
|
160
168
|
export interface UseStripeSdk {}
|
|
169
|
+
|
|
170
|
+
export interface VerifyWithMicrodeposits {
|
|
171
|
+
/**
|
|
172
|
+
* The timestamp when the microdeposits are expected to land.
|
|
173
|
+
*/
|
|
174
|
+
arrival_date: number;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The URL for the hosted verification page, which allows customers to verify their bank account.
|
|
178
|
+
*/
|
|
179
|
+
hosted_verification_url: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
|
|
183
|
+
*/
|
|
184
|
+
microdeposit_type: string | null;
|
|
185
|
+
}
|
|
161
186
|
}
|
|
162
187
|
|
|
163
188
|
export type Status =
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/dist/pure.js
CHANGED
package/dist/pure.mjs
CHANGED
|
@@ -116,6 +116,31 @@ export type StripePaymentElement = StripeElementBase & {
|
|
|
116
116
|
handler?: (event: {elementType: 'payment'}) => any
|
|
117
117
|
): StripePaymentElement;
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* The change event is triggered when the `Element`'s value changes.
|
|
121
|
+
* Represents the details of a selected Card payment method.
|
|
122
|
+
*/
|
|
123
|
+
on(
|
|
124
|
+
eventType: 'carddetailschange',
|
|
125
|
+
handler: (event: StripePaymentElementCardDetailsChangeEvent) => any
|
|
126
|
+
): StripePaymentElement;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Triggered when a Saved Payment Method is updated.
|
|
130
|
+
*/
|
|
131
|
+
on(
|
|
132
|
+
eventType: 'savedpaymentmethodupdate',
|
|
133
|
+
handler: (event: StripePaymentElementSavedPaymentMethodUpdateEvent) => any
|
|
134
|
+
): StripePaymentElement;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Triggered when a Saved Payment Method is removed.
|
|
138
|
+
*/
|
|
139
|
+
on(
|
|
140
|
+
eventType: 'savedpaymentmethodremove',
|
|
141
|
+
handler: (event: StripePaymentElementSavedPaymentMethodRemoveEvent) => any
|
|
142
|
+
): StripePaymentElement;
|
|
143
|
+
|
|
119
144
|
/**
|
|
120
145
|
* Updates the options the `PaymentElement` was initialized with.
|
|
121
146
|
* Updates are merged into the existing configuration.
|
|
@@ -158,6 +183,7 @@ export interface FieldsOption {
|
|
|
158
183
|
phone?: FieldOption;
|
|
159
184
|
address?:
|
|
160
185
|
| FieldOption
|
|
186
|
+
| 'if_required'
|
|
161
187
|
| {
|
|
162
188
|
country?: FieldOption;
|
|
163
189
|
postalCode?: FieldOption;
|
|
@@ -297,3 +323,112 @@ export interface StripePaymentElementChangeEvent {
|
|
|
297
323
|
};
|
|
298
324
|
};
|
|
299
325
|
}
|
|
326
|
+
|
|
327
|
+
type CardBrand =
|
|
328
|
+
| 'amex'
|
|
329
|
+
| 'diners'
|
|
330
|
+
| 'discover'
|
|
331
|
+
| 'eftpos_au'
|
|
332
|
+
| 'jcb'
|
|
333
|
+
| 'mastercard'
|
|
334
|
+
| 'unionpay'
|
|
335
|
+
| 'visa'
|
|
336
|
+
| 'unknown';
|
|
337
|
+
type CardFunding = 'credit' | 'debit' | 'prepaid' | 'unknown';
|
|
338
|
+
|
|
339
|
+
export interface StripePaymentElementCardDetailsChangeEvent {
|
|
340
|
+
/**
|
|
341
|
+
* The type of element that emitted this event.
|
|
342
|
+
*/
|
|
343
|
+
elementType: 'payment';
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* `true` when the card details are loading.
|
|
347
|
+
*/
|
|
348
|
+
loading: boolean;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* The card details for the selected payment method.
|
|
352
|
+
* Undefined while loading and for non card payment methods.
|
|
353
|
+
*/
|
|
354
|
+
details?: {
|
|
355
|
+
brands: CardBrand[] | null;
|
|
356
|
+
funding: CardFunding | null;
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface StripePaymentElementSavedPaymentMethodUpdateEvent {
|
|
361
|
+
/**
|
|
362
|
+
* The type of element that emitted this event.
|
|
363
|
+
*/
|
|
364
|
+
elementType: 'payment';
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* `true` when the saved payment method is successfully updated.
|
|
368
|
+
*/
|
|
369
|
+
success: boolean;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Error message if the saved payment method update fails.
|
|
373
|
+
*/
|
|
374
|
+
error?: string;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* The updated saved payment method.
|
|
378
|
+
*/
|
|
379
|
+
payment_method: {
|
|
380
|
+
id: string;
|
|
381
|
+
type: string;
|
|
382
|
+
billing_details: {
|
|
383
|
+
address: {
|
|
384
|
+
city: null | string;
|
|
385
|
+
country: null | string;
|
|
386
|
+
line1: null | string;
|
|
387
|
+
line2: null | string;
|
|
388
|
+
postal_code: null | string;
|
|
389
|
+
state: null | string;
|
|
390
|
+
};
|
|
391
|
+
name: null | string;
|
|
392
|
+
email: null | string;
|
|
393
|
+
phone: null | string;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface StripePaymentElementSavedPaymentMethodRemoveEvent {
|
|
399
|
+
/**
|
|
400
|
+
* The type of element that emitted this event.
|
|
401
|
+
*/
|
|
402
|
+
elementType: 'payment';
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* `true` when the saved payment method is successfully removed.
|
|
406
|
+
*/
|
|
407
|
+
success: boolean;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Error message if the saved payment method removal fails.
|
|
411
|
+
*/
|
|
412
|
+
error?: string;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* The removed saved payment method.
|
|
416
|
+
*/
|
|
417
|
+
payment_method: {
|
|
418
|
+
id: string;
|
|
419
|
+
type: string;
|
|
420
|
+
billing_details: {
|
|
421
|
+
address: {
|
|
422
|
+
city: null | string;
|
|
423
|
+
country: null | string;
|
|
424
|
+
line1: null | string;
|
|
425
|
+
line2: null | string;
|
|
426
|
+
postal_code: null | string;
|
|
427
|
+
state: null | string;
|
|
428
|
+
};
|
|
429
|
+
name: null | string;
|
|
430
|
+
email: null | string;
|
|
431
|
+
phone: null | string;
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
}
|
|
@@ -116,6 +116,31 @@ export type StripePaymentElement = StripeElementBase & {
|
|
|
116
116
|
handler?: (event: {elementType: 'payment'}) => any
|
|
117
117
|
): StripePaymentElement;
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* The change event is triggered when the `Element`'s value changes.
|
|
121
|
+
* Represents the details of a selected Card payment method.
|
|
122
|
+
*/
|
|
123
|
+
on(
|
|
124
|
+
eventType: 'carddetailschange',
|
|
125
|
+
handler: (event: StripePaymentElementCardDetailsChangeEvent) => any
|
|
126
|
+
): StripePaymentElement;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Triggered when a Saved Payment Method is updated.
|
|
130
|
+
*/
|
|
131
|
+
on(
|
|
132
|
+
eventType: 'savedpaymentmethodupdate',
|
|
133
|
+
handler: (event: StripePaymentElementSavedPaymentMethodUpdateEvent) => any
|
|
134
|
+
): StripePaymentElement;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Triggered when a Saved Payment Method is removed.
|
|
138
|
+
*/
|
|
139
|
+
on(
|
|
140
|
+
eventType: 'savedpaymentmethodremove',
|
|
141
|
+
handler: (event: StripePaymentElementSavedPaymentMethodRemoveEvent) => any
|
|
142
|
+
): StripePaymentElement;
|
|
143
|
+
|
|
119
144
|
/**
|
|
120
145
|
* Updates the options the `PaymentElement` was initialized with.
|
|
121
146
|
* Updates are merged into the existing configuration.
|
|
@@ -158,6 +183,7 @@ export interface FieldsOption {
|
|
|
158
183
|
phone?: FieldOption;
|
|
159
184
|
address?:
|
|
160
185
|
| FieldOption
|
|
186
|
+
| 'if_required'
|
|
161
187
|
| {
|
|
162
188
|
country?: FieldOption;
|
|
163
189
|
postalCode?: FieldOption;
|
|
@@ -297,3 +323,112 @@ export interface StripePaymentElementChangeEvent {
|
|
|
297
323
|
};
|
|
298
324
|
};
|
|
299
325
|
}
|
|
326
|
+
|
|
327
|
+
type CardBrand =
|
|
328
|
+
| 'amex'
|
|
329
|
+
| 'diners'
|
|
330
|
+
| 'discover'
|
|
331
|
+
| 'eftpos_au'
|
|
332
|
+
| 'jcb'
|
|
333
|
+
| 'mastercard'
|
|
334
|
+
| 'unionpay'
|
|
335
|
+
| 'visa'
|
|
336
|
+
| 'unknown';
|
|
337
|
+
type CardFunding = 'credit' | 'debit' | 'prepaid' | 'unknown';
|
|
338
|
+
|
|
339
|
+
export interface StripePaymentElementCardDetailsChangeEvent {
|
|
340
|
+
/**
|
|
341
|
+
* The type of element that emitted this event.
|
|
342
|
+
*/
|
|
343
|
+
elementType: 'payment';
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* `true` when the card details are loading.
|
|
347
|
+
*/
|
|
348
|
+
loading: boolean;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* The card details for the selected payment method.
|
|
352
|
+
* Undefined while loading and for non card payment methods.
|
|
353
|
+
*/
|
|
354
|
+
details?: {
|
|
355
|
+
brands: CardBrand[] | null;
|
|
356
|
+
funding: CardFunding | null;
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface StripePaymentElementSavedPaymentMethodUpdateEvent {
|
|
361
|
+
/**
|
|
362
|
+
* The type of element that emitted this event.
|
|
363
|
+
*/
|
|
364
|
+
elementType: 'payment';
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* `true` when the saved payment method is successfully updated.
|
|
368
|
+
*/
|
|
369
|
+
success: boolean;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Error message if the saved payment method update fails.
|
|
373
|
+
*/
|
|
374
|
+
error?: string;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* The updated saved payment method.
|
|
378
|
+
*/
|
|
379
|
+
payment_method: {
|
|
380
|
+
id: string;
|
|
381
|
+
type: string;
|
|
382
|
+
billing_details: {
|
|
383
|
+
address: {
|
|
384
|
+
city: null | string;
|
|
385
|
+
country: null | string;
|
|
386
|
+
line1: null | string;
|
|
387
|
+
line2: null | string;
|
|
388
|
+
postal_code: null | string;
|
|
389
|
+
state: null | string;
|
|
390
|
+
};
|
|
391
|
+
name: null | string;
|
|
392
|
+
email: null | string;
|
|
393
|
+
phone: null | string;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface StripePaymentElementSavedPaymentMethodRemoveEvent {
|
|
399
|
+
/**
|
|
400
|
+
* The type of element that emitted this event.
|
|
401
|
+
*/
|
|
402
|
+
elementType: 'payment';
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* `true` when the saved payment method is successfully removed.
|
|
406
|
+
*/
|
|
407
|
+
success: boolean;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Error message if the saved payment method removal fails.
|
|
411
|
+
*/
|
|
412
|
+
error?: string;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* The removed saved payment method.
|
|
416
|
+
*/
|
|
417
|
+
payment_method: {
|
|
418
|
+
id: string;
|
|
419
|
+
type: string;
|
|
420
|
+
billing_details: {
|
|
421
|
+
address: {
|
|
422
|
+
city: null | string;
|
|
423
|
+
country: null | string;
|
|
424
|
+
line1: null | string;
|
|
425
|
+
line2: null | string;
|
|
426
|
+
postal_code: null | string;
|
|
427
|
+
state: null | string;
|
|
428
|
+
};
|
|
429
|
+
name: null | string;
|
|
430
|
+
email: null | string;
|
|
431
|
+
phone: null | string;
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
}
|
|
@@ -900,6 +900,11 @@ export interface StripeElementsUpdateOptions {
|
|
|
900
900
|
* @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf
|
|
901
901
|
*/
|
|
902
902
|
on_behalf_of?: string;
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Display saved PaymentMethods and Customer information.
|
|
906
|
+
*/
|
|
907
|
+
customerSessionClientSecret?: string;
|
|
903
908
|
}
|
|
904
909
|
|
|
905
910
|
/*
|
|
@@ -900,6 +900,11 @@ export interface StripeElementsUpdateOptions {
|
|
|
900
900
|
* @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf
|
|
901
901
|
*/
|
|
902
902
|
on_behalf_of?: string;
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Display saved PaymentMethods and Customer information.
|
|
906
|
+
*/
|
|
907
|
+
customerSessionClientSecret?: string;
|
|
903
908
|
}
|
|
904
909
|
|
|
905
910
|
/*
|
|
@@ -17,6 +17,29 @@ export type StripeEmbeddedCheckoutShippingDetailsChangeEvent = {
|
|
|
17
17
|
shippingDetails: StripeEmbeddedCheckoutShippingDetails;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
export type StripeEmbeddedCheckoutLineItem = {
|
|
21
|
+
id?: string;
|
|
22
|
+
quantity?: number;
|
|
23
|
+
price?: string;
|
|
24
|
+
display?: {
|
|
25
|
+
name?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
images?: string[];
|
|
28
|
+
};
|
|
29
|
+
pricingSpec?: {
|
|
30
|
+
unitAmount?: number;
|
|
31
|
+
unitAmountDecimal?: string;
|
|
32
|
+
currency?: string;
|
|
33
|
+
taxBehavior?: 'inclusive' | 'exclusive' | 'unspecified';
|
|
34
|
+
taxCode?: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type StripeEmbeddedCheckoutLineItemsChangeEvent = {
|
|
39
|
+
checkoutSessionId: string;
|
|
40
|
+
lineItems: StripeEmbeddedCheckoutLineItem[];
|
|
41
|
+
};
|
|
42
|
+
|
|
20
43
|
export type ResultAction =
|
|
21
44
|
| {type: 'accept'}
|
|
22
45
|
| {type: 'reject'; errorMessage?: string};
|
|
@@ -45,6 +68,13 @@ export interface StripeEmbeddedCheckoutOptions {
|
|
|
45
68
|
onShippingDetailsChange?: (
|
|
46
69
|
event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
|
|
47
70
|
) => Promise<ResultAction>;
|
|
71
|
+
/**
|
|
72
|
+
* onLineItemsChange is called when the customer adds, removes, or modifies a line item.
|
|
73
|
+
* The callback is required when [permissions.update.line_items](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-line_items) is set to `server_only`.
|
|
74
|
+
*/
|
|
75
|
+
onLineItemsChange?: (
|
|
76
|
+
event: StripeEmbeddedCheckoutLineItemsChangeEvent
|
|
77
|
+
) => Promise<ResultAction>;
|
|
48
78
|
}
|
|
49
79
|
|
|
50
80
|
export interface StripeEmbeddedCheckout {
|
|
@@ -17,6 +17,29 @@ export type StripeEmbeddedCheckoutShippingDetailsChangeEvent = {
|
|
|
17
17
|
shippingDetails: StripeEmbeddedCheckoutShippingDetails;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
export type StripeEmbeddedCheckoutLineItem = {
|
|
21
|
+
id?: string;
|
|
22
|
+
quantity?: number;
|
|
23
|
+
price?: string;
|
|
24
|
+
display?: {
|
|
25
|
+
name?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
images?: string[];
|
|
28
|
+
};
|
|
29
|
+
pricingSpec?: {
|
|
30
|
+
unitAmount?: number;
|
|
31
|
+
unitAmountDecimal?: string;
|
|
32
|
+
currency?: string;
|
|
33
|
+
taxBehavior?: 'inclusive' | 'exclusive' | 'unspecified';
|
|
34
|
+
taxCode?: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type StripeEmbeddedCheckoutLineItemsChangeEvent = {
|
|
39
|
+
checkoutSessionId: string;
|
|
40
|
+
lineItems: StripeEmbeddedCheckoutLineItem[];
|
|
41
|
+
};
|
|
42
|
+
|
|
20
43
|
export type ResultAction =
|
|
21
44
|
| {type: 'accept'}
|
|
22
45
|
| {type: 'reject'; errorMessage?: string};
|
|
@@ -45,6 +68,13 @@ export interface StripeEmbeddedCheckoutOptions {
|
|
|
45
68
|
onShippingDetailsChange?: (
|
|
46
69
|
event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
|
|
47
70
|
) => Promise<ResultAction>;
|
|
71
|
+
/**
|
|
72
|
+
* onLineItemsChange is called when the customer adds, removes, or modifies a line item.
|
|
73
|
+
* The callback is required when [permissions.update.line_items](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-line_items) is set to `server_only`.
|
|
74
|
+
*/
|
|
75
|
+
onLineItemsChange?: (
|
|
76
|
+
event: StripeEmbeddedCheckoutLineItemsChangeEvent
|
|
77
|
+
) => Promise<ResultAction>;
|
|
48
78
|
}
|
|
49
79
|
|
|
50
80
|
export interface StripeEmbeddedCheckout {
|