@stripe/stripe-js 9.12.1 → 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.12.1",
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.12.1", " 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.12.1",
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.12.1", " 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.12.1",
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.12.1", " 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.12.1",
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.12.1", " 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 = {
@@ -468,6 +470,21 @@ export type StripeCheckoutFormOptions = {
468
470
  */
469
471
  paymentMethods?: ExpressCheckoutPaymentMethodsOption;
470
472
  };
473
+
474
+ /**
475
+ * Client-side feature configuration for the CheckoutForm.
476
+ */
477
+ features?: {
478
+ /**
479
+ * Control whether the promotion code collection UI is displayed in the CheckoutForm.
480
+ *
481
+ * Only applies when `allow_promotion_codes`is enabled on the Checkout Session.
482
+ *
483
+ * @default 'auto'
484
+ * @docs https://stripe.com/docs/checkout/promotion-codes
485
+ */
486
+ promotionCodeCollection?: 'auto' | 'never';
487
+ };
471
488
  };
472
489
 
473
490
  export type StripeCheckoutExpressCheckoutElementOptions = {
@@ -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 = {
@@ -468,6 +470,21 @@ export type StripeCheckoutFormOptions = {
468
470
  */
469
471
  paymentMethods?: ExpressCheckoutPaymentMethodsOption;
470
472
  };
473
+
474
+ /**
475
+ * Client-side feature configuration for the CheckoutForm.
476
+ */
477
+ features?: {
478
+ /**
479
+ * Control whether the promotion code collection UI is displayed in the CheckoutForm.
480
+ *
481
+ * Only applies when `allow_promotion_codes`is enabled on the Checkout Session.
482
+ *
483
+ * @default 'auto'
484
+ * @docs https://stripe.com/docs/checkout/promotion-codes
485
+ */
486
+ promotionCodeCollection?: 'auto' | 'never';
487
+ };
471
488
  };
472
489
 
473
490
  export type StripeCheckoutExpressCheckoutElementOptions = {
@@ -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
  }
@@ -167,7 +167,9 @@ export type StripePaymentElement = StripeElementBase & {
167
167
  * Updates the options the `PaymentElement` was initialized with.
168
168
  * Updates are merged into the existing configuration.
169
169
  */
170
- update(options: Partial<StripePaymentElementOptions>): StripePaymentElement;
170
+ update(
171
+ options: Partial<StripePaymentElementUpdateOptions>
172
+ ): StripePaymentElement;
171
173
 
172
174
  /**
173
175
  * Collapses the Payment Element into a row of payment method tabs.
@@ -334,6 +336,11 @@ export interface PaymentWalletsOption {
334
336
  link?: PaymentWalletOption;
335
337
  }
336
338
 
339
+ export interface PaymentWalletOptionsOption {
340
+ emailRequired?: boolean;
341
+ phoneNumberRequired?: boolean;
342
+ }
343
+
337
344
  export type Layout = 'tabs' | 'accordion' | 'auto';
338
345
  type RadiosOption = 'auto' | 'never' | 'always' | 'if_multiple';
339
346
 
@@ -390,6 +397,11 @@ export interface StripePaymentElementOptions {
390
397
  */
391
398
  wallets?: PaymentWalletsOption;
392
399
 
400
+ /**
401
+ * Control wallet behavior options in the Payment Element.
402
+ */
403
+ walletOptions?: PaymentWalletOptionsOption;
404
+
393
405
  /**
394
406
  * Specify a layout to use when rendering a Payment Element.
395
407
  */
@@ -401,6 +413,25 @@ export interface StripePaymentElementOptions {
401
413
  applePay?: ApplePayOption;
402
414
  }
403
415
 
416
+ /**
417
+ * The subset of `StripePaymentElementOptions` that can be updated after the
418
+ * `PaymentElement` has been created.
419
+ *
420
+ * @see https://docs.stripe.com/js/elements_object/update_payment_element
421
+ */
422
+ export type StripePaymentElementUpdateOptions = Pick<
423
+ StripePaymentElementOptions,
424
+ | 'defaultValues'
425
+ | 'business'
426
+ | 'paymentMethodOrder'
427
+ | 'fields'
428
+ | 'readOnly'
429
+ | 'terms'
430
+ | 'layout'
431
+ | 'applePay'
432
+ | 'walletOptions'
433
+ >;
434
+
404
435
  export interface StripePaymentElementChangeEvent {
405
436
  /**
406
437
  * The type of element that emitted this event.
@@ -167,7 +167,9 @@ export type StripePaymentElement = StripeElementBase & {
167
167
  * Updates the options the `PaymentElement` was initialized with.
168
168
  * Updates are merged into the existing configuration.
169
169
  */
170
- update(options: Partial<StripePaymentElementOptions>): StripePaymentElement;
170
+ update(
171
+ options: Partial<StripePaymentElementUpdateOptions>
172
+ ): StripePaymentElement;
171
173
 
172
174
  /**
173
175
  * Collapses the Payment Element into a row of payment method tabs.
@@ -334,6 +336,11 @@ export interface PaymentWalletsOption {
334
336
  link?: PaymentWalletOption;
335
337
  }
336
338
 
339
+ export interface PaymentWalletOptionsOption {
340
+ emailRequired?: boolean;
341
+ phoneNumberRequired?: boolean;
342
+ }
343
+
337
344
  export type Layout = 'tabs' | 'accordion' | 'auto';
338
345
  type RadiosOption = 'auto' | 'never' | 'always' | 'if_multiple';
339
346
 
@@ -390,6 +397,11 @@ export interface StripePaymentElementOptions {
390
397
  */
391
398
  wallets?: PaymentWalletsOption;
392
399
 
400
+ /**
401
+ * Control wallet behavior options in the Payment Element.
402
+ */
403
+ walletOptions?: PaymentWalletOptionsOption;
404
+
393
405
  /**
394
406
  * Specify a layout to use when rendering a Payment Element.
395
407
  */
@@ -401,6 +413,25 @@ export interface StripePaymentElementOptions {
401
413
  applePay?: ApplePayOption;
402
414
  }
403
415
 
416
+ /**
417
+ * The subset of `StripePaymentElementOptions` that can be updated after the
418
+ * `PaymentElement` has been created.
419
+ *
420
+ * @see https://docs.stripe.com/js/elements_object/update_payment_element
421
+ */
422
+ export type StripePaymentElementUpdateOptions = Pick<
423
+ StripePaymentElementOptions,
424
+ | 'defaultValues'
425
+ | 'business'
426
+ | 'paymentMethodOrder'
427
+ | 'fields'
428
+ | 'readOnly'
429
+ | 'terms'
430
+ | 'layout'
431
+ | 'applePay'
432
+ | 'walletOptions'
433
+ >;
434
+
404
435
  export interface StripePaymentElementChangeEvent {
405
436
  /**
406
437
  * The type of element that emitted this event.
@@ -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.12.1",
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",