@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 CHANGED
@@ -42,7 +42,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
42
42
 
43
43
  stripe._registerWrapper({
44
44
  name: 'stripe-js',
45
- version: "5.2.0",
45
+ version: "5.5.0",
46
46
  startTime: startTime
47
47
  });
48
48
  };
package/dist/index.mjs CHANGED
@@ -38,7 +38,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
38
38
 
39
39
  stripe._registerWrapper({
40
40
  name: 'stripe-js',
41
- version: "5.2.0",
41
+ version: "5.5.0",
42
42
  startTime: startTime
43
43
  });
44
44
  };
package/dist/pure.js CHANGED
@@ -58,7 +58,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
58
58
 
59
59
  stripe._registerWrapper({
60
60
  name: 'stripe-js',
61
- version: "5.2.0",
61
+ version: "5.5.0",
62
62
  startTime: startTime
63
63
  });
64
64
  };
package/dist/pure.mjs CHANGED
@@ -54,7 +54,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
54
54
 
55
55
  stripe._registerWrapper({
56
56
  name: 'stripe-js',
57
- version: "5.2.0",
57
+ version: "5.5.0",
58
58
  startTime: startTime
59
59
  });
60
60
  };
@@ -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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "5.3.0",
3
+ "version": "5.5.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",