@stripe/stripe-js 5.3.0 → 5.5.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/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/checkout.d.mts +11 -0
- package/dist/stripe-js/checkout.d.ts +11 -0
- package/dist/stripe-js/elements/express-checkout.d.mts +3 -0
- package/dist/stripe-js/elements/express-checkout.d.ts +3 -0
- package/dist/stripe-js/elements-group.d.mts +5 -0
- package/dist/stripe-js/elements-group.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/dist/pure.js
CHANGED
package/dist/pure.mjs
CHANGED
|
@@ -422,6 +422,14 @@ type ConfirmError =
|
|
|
422
422
|
export type StripeCheckoutConfirmResult =
|
|
423
423
|
| {type: 'success'; success: StripeCheckoutSession}
|
|
424
424
|
| {type: 'error'; error: ConfirmError};
|
|
425
|
+
|
|
426
|
+
type RunServerUpdateFunction = (
|
|
427
|
+
session: StripeCheckoutSession
|
|
428
|
+
) => Promise<void>;
|
|
429
|
+
export type StripeCheckoutRunServerUpdateResult =
|
|
430
|
+
| {type: 'success'; success: StripeCheckoutSession}
|
|
431
|
+
| {type: 'error'; error: AnyBuyerError};
|
|
432
|
+
|
|
425
433
|
export interface StripeCheckout {
|
|
426
434
|
/* Custom Checkout methods */
|
|
427
435
|
applyPromotionCode: (
|
|
@@ -458,6 +466,9 @@ export interface StripeCheckout {
|
|
|
458
466
|
}) => Promise<StripeCheckoutConfirmResult>;
|
|
459
467
|
session: () => StripeCheckoutSession;
|
|
460
468
|
on: (event: 'change', handler: StripeCheckoutUpdateHandler) => void;
|
|
469
|
+
runServerUpdate: (
|
|
470
|
+
userFunction: RunServerUpdateFunction
|
|
471
|
+
) => Promise<StripeCheckoutRunServerUpdateResult>;
|
|
461
472
|
|
|
462
473
|
/* Elements methods */
|
|
463
474
|
changeAppearance: (appearance: Appearance) => void;
|
|
@@ -422,6 +422,14 @@ type ConfirmError =
|
|
|
422
422
|
export type StripeCheckoutConfirmResult =
|
|
423
423
|
| {type: 'success'; success: StripeCheckoutSession}
|
|
424
424
|
| {type: 'error'; error: ConfirmError};
|
|
425
|
+
|
|
426
|
+
type RunServerUpdateFunction = (
|
|
427
|
+
session: StripeCheckoutSession
|
|
428
|
+
) => Promise<void>;
|
|
429
|
+
export type StripeCheckoutRunServerUpdateResult =
|
|
430
|
+
| {type: 'success'; success: StripeCheckoutSession}
|
|
431
|
+
| {type: 'error'; error: AnyBuyerError};
|
|
432
|
+
|
|
425
433
|
export interface StripeCheckout {
|
|
426
434
|
/* Custom Checkout methods */
|
|
427
435
|
applyPromotionCode: (
|
|
@@ -458,6 +466,9 @@ export interface StripeCheckout {
|
|
|
458
466
|
}) => Promise<StripeCheckoutConfirmResult>;
|
|
459
467
|
session: () => StripeCheckoutSession;
|
|
460
468
|
on: (event: 'change', handler: StripeCheckoutUpdateHandler) => void;
|
|
469
|
+
runServerUpdate: (
|
|
470
|
+
userFunction: RunServerUpdateFunction
|
|
471
|
+
) => Promise<StripeCheckoutRunServerUpdateResult>;
|
|
461
472
|
|
|
462
473
|
/* Elements methods */
|
|
463
474
|
changeAppearance: (appearance: Appearance) => void;
|
|
@@ -306,9 +306,12 @@ export type GooglePayButtonType =
|
|
|
306
306
|
| 'plain'
|
|
307
307
|
| 'subscribe';
|
|
308
308
|
|
|
309
|
+
export type PayPalButtonType = 'paypal' | 'buynow' | 'checkout' | 'pay';
|
|
310
|
+
|
|
309
311
|
export type ButtonTypeOption = {
|
|
310
312
|
applePay?: ApplePayButtonType;
|
|
311
313
|
googlePay?: GooglePayButtonType;
|
|
314
|
+
paypal?: PayPalButtonType;
|
|
312
315
|
};
|
|
313
316
|
|
|
314
317
|
export interface StripeExpressCheckoutElementOptions {
|
|
@@ -306,9 +306,12 @@ export type GooglePayButtonType =
|
|
|
306
306
|
| 'plain'
|
|
307
307
|
| 'subscribe';
|
|
308
308
|
|
|
309
|
+
export type PayPalButtonType = 'paypal' | 'buynow' | 'checkout' | 'pay';
|
|
310
|
+
|
|
309
311
|
export type ButtonTypeOption = {
|
|
310
312
|
applePay?: ApplePayButtonType;
|
|
311
313
|
googlePay?: GooglePayButtonType;
|
|
314
|
+
paypal?: PayPalButtonType;
|
|
312
315
|
};
|
|
313
316
|
|
|
314
317
|
export interface StripeExpressCheckoutElementOptions {
|
|
@@ -59,6 +59,11 @@ export interface StripeElements {
|
|
|
59
59
|
*/
|
|
60
60
|
update(options: StripeElementsUpdateOptions): void;
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Triggered when the call to elements.update() is complete.
|
|
64
|
+
*/
|
|
65
|
+
on(eventType: 'update-end', handler: () => void): void;
|
|
66
|
+
|
|
62
67
|
/**
|
|
63
68
|
* Fetches updates from the associated PaymentIntent or SetupIntent on an existing
|
|
64
69
|
* instance of Elements, and reflects these updates in the Payment Element.
|
|
@@ -59,6 +59,11 @@ export interface StripeElements {
|
|
|
59
59
|
*/
|
|
60
60
|
update(options: StripeElementsUpdateOptions): void;
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Triggered when the call to elements.update() is complete.
|
|
64
|
+
*/
|
|
65
|
+
on(eventType: 'update-end', handler: () => void): void;
|
|
66
|
+
|
|
62
67
|
/**
|
|
63
68
|
* Fetches updates from the associated PaymentIntent or SetupIntent on an existing
|
|
64
69
|
* instance of Elements, and reflects these updates in the Payment Element.
|