@stripe/stripe-js 9.13.0 → 9.14.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
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
71
71
 
72
72
  stripe._registerWrapper({
73
73
  name: 'stripe-js',
74
- version: "9.13.0",
74
+ version: "9.14.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -172,7 +172,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
172
172
  var expectedVersion = RELEASE_TRAIN;
173
173
 
174
174
  if (isTestKey && version !== expectedVersion) {
175
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.13.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
175
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.14.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
176
176
  }
177
177
 
178
178
  var stripe = maybeStripe.apply(undefined, args);
package/dist/index.mjs CHANGED
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
67
67
 
68
68
  stripe._registerWrapper({
69
69
  name: 'stripe-js',
70
- version: "9.13.0",
70
+ version: "9.14.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -168,7 +168,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
168
168
  var expectedVersion = RELEASE_TRAIN;
169
169
 
170
170
  if (isTestKey && version !== expectedVersion) {
171
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.13.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
171
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.14.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
172
172
  }
173
173
 
174
174
  var stripe = maybeStripe.apply(undefined, args);
package/dist/pure.js CHANGED
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
71
71
 
72
72
  stripe._registerWrapper({
73
73
  name: 'stripe-js',
74
- version: "9.13.0",
74
+ version: "9.14.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -172,7 +172,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
172
172
  var expectedVersion = RELEASE_TRAIN;
173
173
 
174
174
  if (isTestKey && version !== expectedVersion) {
175
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.13.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
175
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.14.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
176
176
  }
177
177
 
178
178
  var stripe = maybeStripe.apply(undefined, args);
package/dist/pure.mjs CHANGED
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
67
67
 
68
68
  stripe._registerWrapper({
69
69
  name: 'stripe-js',
70
- version: "9.13.0",
70
+ version: "9.14.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -168,7 +168,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
168
168
  var expectedVersion = RELEASE_TRAIN;
169
169
 
170
170
  if (isTestKey && version !== expectedVersion) {
171
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.13.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
171
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.14.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
172
172
  }
173
173
 
174
174
  var stripe = maybeStripe.apply(undefined, args);
@@ -3,6 +3,7 @@ import {
3
3
  Layout,
4
4
  TermsOption,
5
5
  StripePaymentElement,
6
+ PaymentWalletOptionsOption,
6
7
  } from './elements/payment';
7
8
  import {ContactOption, StripeAddressElement} from './elements/address';
8
9
  import {Appearance, CssFontSource, CustomFontSource} from './elements-group';
@@ -405,6 +406,7 @@ export type StripeCheckoutPaymentElementOptions = {
405
406
  terms?: TermsOption;
406
407
  fields?: FieldsOption;
407
408
  wallets?: PaymentWalletsOption;
409
+ walletOptions?: PaymentWalletOptionsOption;
408
410
  };
409
411
 
410
412
  export type StripeCheckoutAddressElementOptions = {
@@ -3,6 +3,7 @@ import {
3
3
  Layout,
4
4
  TermsOption,
5
5
  StripePaymentElement,
6
+ PaymentWalletOptionsOption,
6
7
  } from './elements/payment';
7
8
  import {ContactOption, StripeAddressElement} from './elements/address';
8
9
  import {Appearance, CssFontSource, CustomFontSource} from './elements-group';
@@ -405,6 +406,7 @@ export type StripeCheckoutPaymentElementOptions = {
405
406
  terms?: TermsOption;
406
407
  fields?: FieldsOption;
407
408
  wallets?: PaymentWalletsOption;
409
+ walletOptions?: PaymentWalletOptionsOption;
408
410
  };
409
411
 
410
412
  export type StripeCheckoutAddressElementOptions = {
@@ -607,6 +607,7 @@ export interface StripeExpressCheckoutElementAvailablePaymentMethodsChangeEvent
607
607
  paypal?: {available: boolean};
608
608
  amazonPay?: {available: boolean};
609
609
  klarna?: {available: boolean};
610
+ [customPaymentMethodId: string]: {available: boolean} | undefined;
610
611
  }
611
612
  | undefined;
612
613
  }
@@ -607,6 +607,7 @@ export interface StripeExpressCheckoutElementAvailablePaymentMethodsChangeEvent
607
607
  paypal?: {available: boolean};
608
608
  amazonPay?: {available: boolean};
609
609
  klarna?: {available: boolean};
610
+ [customPaymentMethodId: string]: {available: boolean} | undefined;
610
611
  }
611
612
  | undefined;
612
613
  }
@@ -336,6 +336,11 @@ export interface PaymentWalletsOption {
336
336
  link?: PaymentWalletOption;
337
337
  }
338
338
 
339
+ export interface PaymentWalletOptionsOption {
340
+ emailRequired?: boolean;
341
+ phoneNumberRequired?: boolean;
342
+ }
343
+
339
344
  export type Layout = 'tabs' | 'accordion' | 'auto';
340
345
  type RadiosOption = 'auto' | 'never' | 'always' | 'if_multiple';
341
346
 
@@ -392,6 +397,11 @@ export interface StripePaymentElementOptions {
392
397
  */
393
398
  wallets?: PaymentWalletsOption;
394
399
 
400
+ /**
401
+ * Control wallet behavior options in the Payment Element.
402
+ */
403
+ walletOptions?: PaymentWalletOptionsOption;
404
+
395
405
  /**
396
406
  * Specify a layout to use when rendering a Payment Element.
397
407
  */
@@ -419,6 +429,7 @@ export type StripePaymentElementUpdateOptions = Pick<
419
429
  | 'terms'
420
430
  | 'layout'
421
431
  | 'applePay'
432
+ | 'walletOptions'
422
433
  >;
423
434
 
424
435
  export interface StripePaymentElementChangeEvent {
@@ -336,6 +336,11 @@ export interface PaymentWalletsOption {
336
336
  link?: PaymentWalletOption;
337
337
  }
338
338
 
339
+ export interface PaymentWalletOptionsOption {
340
+ emailRequired?: boolean;
341
+ phoneNumberRequired?: boolean;
342
+ }
343
+
339
344
  export type Layout = 'tabs' | 'accordion' | 'auto';
340
345
  type RadiosOption = 'auto' | 'never' | 'always' | 'if_multiple';
341
346
 
@@ -392,6 +397,11 @@ export interface StripePaymentElementOptions {
392
397
  */
393
398
  wallets?: PaymentWalletsOption;
394
399
 
400
+ /**
401
+ * Control wallet behavior options in the Payment Element.
402
+ */
403
+ walletOptions?: PaymentWalletOptionsOption;
404
+
395
405
  /**
396
406
  * Specify a layout to use when rendering a Payment Element.
397
407
  */
@@ -419,6 +429,7 @@ export type StripePaymentElementUpdateOptions = Pick<
419
429
  | 'terms'
420
430
  | 'layout'
421
431
  | 'applePay'
432
+ | 'walletOptions'
422
433
  >;
423
434
 
424
435
  export interface StripePaymentElementChangeEvent {
@@ -1404,15 +1404,94 @@ export interface CustomPaymentMethod {
1404
1404
  /**
1405
1405
  * Additional options to configure the Custom Payment Method.
1406
1406
  */
1407
- options: {
1407
+ options?: {
1408
1408
  /**
1409
1409
  * The payment form type.
1410
1410
  */
1411
- type: 'static';
1411
+ type: 'static' | 'embedded';
1412
1412
 
1413
1413
  /**
1414
1414
  * Display additional information about the payment method, max 100 characters.
1415
1415
  */
1416
1416
  subtitle?: string;
1417
+
1418
+ /**
1419
+ * Requires beta access:
1420
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
1421
+ *
1422
+ * Options for the embedded Custom Payment Method. Required for type: 'embedded'.
1423
+ */
1424
+ embedded?: {
1425
+ /**
1426
+ * Function for rendering custom content in the Custom Payment Method form, called on mount.
1427
+ */
1428
+ handleRender: (container: HTMLDivElement) => void;
1429
+
1430
+ /**
1431
+ * Function for cleaning up the Custom Payment Method form, called when the Custom Payment Method is removed and on unmount.
1432
+ */
1433
+ handleDestroy?: () => void;
1434
+ };
1435
+ };
1436
+
1437
+ /**
1438
+ * Additional options to configure the Custom Payment Method in the Payment Element. Alias for `options`.
1439
+ */
1440
+ payment?: {
1441
+ /**
1442
+ * The payment form type.
1443
+ */
1444
+ type: 'static' | 'embedded';
1445
+
1446
+ /**
1447
+ * Display additional information about the payment method, max 100 characters.
1448
+ */
1449
+ subtitle?: string;
1450
+
1451
+ /**
1452
+ * Requires beta access:
1453
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
1454
+ *
1455
+ * Options for the embedded Custom Payment Method. Required for type: 'embedded'.
1456
+ */
1457
+ embedded?: {
1458
+ /**
1459
+ * Function for rendering custom content in the Custom Payment Method form, called on mount.
1460
+ */
1461
+ handleRender: (container: HTMLDivElement) => void;
1462
+
1463
+ /**
1464
+ * Function for cleaning up the Custom Payment Method form, called when the Custom Payment Method is removed and on unmount.
1465
+ */
1466
+ handleDestroy?: () => void;
1467
+ };
1468
+ };
1469
+
1470
+ /**
1471
+ * Requires beta access:
1472
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
1473
+ *
1474
+ * Additional options to configure the Custom Payment Method in the Express Checkout Element.
1475
+ */
1476
+ expressCheckout?: {
1477
+ /**
1478
+ * The payment button type.
1479
+ */
1480
+ type: 'embedded';
1481
+
1482
+ /**
1483
+ * Options for the embedded Custom Payment Method.
1484
+ */
1485
+ embedded: {
1486
+ /**
1487
+ * Function for rendering custom content in the Custom Payment Method button, called on mount.
1488
+ */
1489
+ handleRender: (container: HTMLDivElement) => void;
1490
+
1491
+ /**
1492
+ * Function for cleaning up the Custom Payment Method button, called when the Custom Payment Method is removed and on unmount.
1493
+ */
1494
+ handleDestroy?: () => void;
1495
+ };
1417
1496
  };
1418
1497
  }
@@ -1404,15 +1404,94 @@ export interface CustomPaymentMethod {
1404
1404
  /**
1405
1405
  * Additional options to configure the Custom Payment Method.
1406
1406
  */
1407
- options: {
1407
+ options?: {
1408
1408
  /**
1409
1409
  * The payment form type.
1410
1410
  */
1411
- type: 'static';
1411
+ type: 'static' | 'embedded';
1412
1412
 
1413
1413
  /**
1414
1414
  * Display additional information about the payment method, max 100 characters.
1415
1415
  */
1416
1416
  subtitle?: string;
1417
+
1418
+ /**
1419
+ * Requires beta access:
1420
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
1421
+ *
1422
+ * Options for the embedded Custom Payment Method. Required for type: 'embedded'.
1423
+ */
1424
+ embedded?: {
1425
+ /**
1426
+ * Function for rendering custom content in the Custom Payment Method form, called on mount.
1427
+ */
1428
+ handleRender: (container: HTMLDivElement) => void;
1429
+
1430
+ /**
1431
+ * Function for cleaning up the Custom Payment Method form, called when the Custom Payment Method is removed and on unmount.
1432
+ */
1433
+ handleDestroy?: () => void;
1434
+ };
1435
+ };
1436
+
1437
+ /**
1438
+ * Additional options to configure the Custom Payment Method in the Payment Element. Alias for `options`.
1439
+ */
1440
+ payment?: {
1441
+ /**
1442
+ * The payment form type.
1443
+ */
1444
+ type: 'static' | 'embedded';
1445
+
1446
+ /**
1447
+ * Display additional information about the payment method, max 100 characters.
1448
+ */
1449
+ subtitle?: string;
1450
+
1451
+ /**
1452
+ * Requires beta access:
1453
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
1454
+ *
1455
+ * Options for the embedded Custom Payment Method. Required for type: 'embedded'.
1456
+ */
1457
+ embedded?: {
1458
+ /**
1459
+ * Function for rendering custom content in the Custom Payment Method form, called on mount.
1460
+ */
1461
+ handleRender: (container: HTMLDivElement) => void;
1462
+
1463
+ /**
1464
+ * Function for cleaning up the Custom Payment Method form, called when the Custom Payment Method is removed and on unmount.
1465
+ */
1466
+ handleDestroy?: () => void;
1467
+ };
1468
+ };
1469
+
1470
+ /**
1471
+ * Requires beta access:
1472
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
1473
+ *
1474
+ * Additional options to configure the Custom Payment Method in the Express Checkout Element.
1475
+ */
1476
+ expressCheckout?: {
1477
+ /**
1478
+ * The payment button type.
1479
+ */
1480
+ type: 'embedded';
1481
+
1482
+ /**
1483
+ * Options for the embedded Custom Payment Method.
1484
+ */
1485
+ embedded: {
1486
+ /**
1487
+ * Function for rendering custom content in the Custom Payment Method button, called on mount.
1488
+ */
1489
+ handleRender: (container: HTMLDivElement) => void;
1490
+
1491
+ /**
1492
+ * Function for cleaning up the Custom Payment Method button, called when the Custom Payment Method is removed and on unmount.
1493
+ */
1494
+ handleDestroy?: () => void;
1495
+ };
1417
1496
  };
1418
1497
  }
@@ -162,10 +162,7 @@ export interface StripeEmbeddedCheckoutOptions {
162
162
  */
163
163
  onComplete?: () => void;
164
164
  /**
165
- * onShippingDetailsChange is called when the customer completes the shipping details form.
166
- *
167
- * The callback is required when [permissions.update.shipping_details](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-shipping_details) is set to `server_only`.
168
- * For a step-by-step guide on using this callback to customize shipping options during checkout, see [Customize Shipping Options](https://docs.stripe.com/payments/checkout/custom-shipping-options).
165
+ * @deprecated Dynamic shipping updates are deprecated in Embedded Checkout.
169
166
  */
170
167
  onShippingDetailsChange?: (
171
168
  event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
@@ -162,10 +162,7 @@ export interface StripeEmbeddedCheckoutOptions {
162
162
  */
163
163
  onComplete?: () => void;
164
164
  /**
165
- * onShippingDetailsChange is called when the customer completes the shipping details form.
166
- *
167
- * The callback is required when [permissions.update.shipping_details](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-shipping_details) is set to `server_only`.
168
- * For a step-by-step guide on using this callback to customize shipping options during checkout, see [Customize Shipping Options](https://docs.stripe.com/payments/checkout/custom-shipping-options).
165
+ * @deprecated Dynamic shipping updates are deprecated in Embedded Checkout.
169
166
  */
170
167
  onShippingDetailsChange?: (
171
168
  event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "9.13.0",
3
+ "version": "9.14.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",