@stripe/stripe-js 10.1.0 → 10.2.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: "10.1.0",
74
+ version: "10.2.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -180,7 +180,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
180
180
  var expectedVersion = RELEASE_TRAIN;
181
181
 
182
182
  if (isTestKey && version !== expectedVersion) {
183
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("10.1.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
183
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("10.2.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
184
184
  }
185
185
 
186
186
  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: "10.1.0",
70
+ version: "10.2.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -176,7 +176,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
176
176
  var expectedVersion = RELEASE_TRAIN;
177
177
 
178
178
  if (isTestKey && version !== expectedVersion) {
179
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("10.1.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
179
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("10.2.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
180
180
  }
181
181
 
182
182
  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: "10.1.0",
74
+ version: "10.2.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -180,7 +180,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
180
180
  var expectedVersion = RELEASE_TRAIN;
181
181
 
182
182
  if (isTestKey && version !== expectedVersion) {
183
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("10.1.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
183
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("10.2.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
184
184
  }
185
185
 
186
186
  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: "10.1.0",
70
+ version: "10.2.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -176,7 +176,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
176
176
  var expectedVersion = RELEASE_TRAIN;
177
177
 
178
178
  if (isTestKey && version !== expectedVersion) {
179
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("10.1.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
179
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("10.2.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
180
180
  }
181
181
 
182
182
  var stripe = maybeStripe.apply(undefined, args);
@@ -405,6 +405,10 @@ export type StripeCheckoutTaxIdInfo = {
405
405
  export interface StripeCheckoutSession {
406
406
  billingAddress: StripeCheckoutContact | null;
407
407
  businessName: string | null;
408
+ nameCollection: {
409
+ individualName: string | null;
410
+ businessName: string | null;
411
+ } | null;
408
412
  canConfirm: boolean;
409
413
  currency: string;
410
414
  currencyOptions: Array<StripeCheckoutCurrencyOption> | null;
@@ -671,6 +675,7 @@ export type StripeCheckoutExpressCheckoutElement = StripeElementBase & {
671
675
  type AnyBuyerError = {message: string; code: null};
672
676
  type ApplyPromotionCodeError =
673
677
  | {message: string; code: 'invalidCode'}
678
+ | {message: string; code: 'promotionCodeAmountInsufficient'}
674
679
  | AnyBuyerError;
675
680
  export type StripeCheckoutApplyPromotionCodeResult =
676
681
  | {type: 'success'; session: StripeCheckoutSession}
@@ -688,6 +693,14 @@ export type StripeCheckoutUpdatePhoneNumberResult =
688
693
  | {type: 'success'; session: StripeCheckoutSession}
689
694
  | {type: 'error'; error: never};
690
695
 
696
+ export type StripeCheckoutUpdateIndividualNameResult =
697
+ | {type: 'success'; session: StripeCheckoutSession}
698
+ | {type: 'error'; error: never};
699
+
700
+ export type StripeCheckoutUpdateBusinessNameResult =
701
+ | {type: 'success'; session: StripeCheckoutSession}
702
+ | {type: 'error'; error: never};
703
+
691
704
  type UpdateEmailError =
692
705
  | {message: string; code: 'incompleteEmail'}
693
706
  | {message: string; code: 'invalidEmail'};
@@ -789,6 +802,12 @@ export type StripeCheckoutLoadActionsSuccess = {
789
802
  updateEmail: (
790
803
  email: string | null
791
804
  ) => Promise<StripeCheckoutUpdateEmailResult>;
805
+ updateIndividualName: (
806
+ individualName: string | null
807
+ ) => Promise<StripeCheckoutUpdateIndividualNameResult>;
808
+ updateBusinessName: (
809
+ businessName: string | null
810
+ ) => Promise<StripeCheckoutUpdateBusinessNameResult>;
792
811
  updateLineItemQuantity: (args: {
793
812
  lineItem: string;
794
813
  quantity: number;
@@ -837,6 +856,8 @@ export type StripeCheckoutFormLoadActionsSuccess = Omit<
837
856
  StripeCheckoutLoadActionsSuccess,
838
857
  | 'updateEmail'
839
858
  | 'updatePhoneNumber'
859
+ | 'updateIndividualName'
860
+ | 'updateBusinessName'
840
861
  | 'updateShippingAddress'
841
862
  | 'updateBillingAddress'
842
863
  | 'updateTaxIdInfo'
@@ -857,6 +878,7 @@ export interface StripeCheckoutElementsSdk {
857
878
  getShippingAddressElement(): StripeAddressElement | null;
858
879
  getExpressCheckoutElement(): StripeCheckoutExpressCheckoutElement | null;
859
880
  getCurrencySelectorElement(): StripeCurrencySelectorElement | null;
881
+ getContactDetailsElement(): StripeContactDetailsElement | null;
860
882
  /* Requires beta header when initializing Stripe: @docs https://docs.stripe.com/tax/advanced/tax-ids?payment-ui=embedded-components#render-tax-id-element */
861
883
  getTaxIdElement(): StripeTaxIdElement | null;
862
884
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
@@ -405,6 +405,10 @@ export type StripeCheckoutTaxIdInfo = {
405
405
  export interface StripeCheckoutSession {
406
406
  billingAddress: StripeCheckoutContact | null;
407
407
  businessName: string | null;
408
+ nameCollection: {
409
+ individualName: string | null;
410
+ businessName: string | null;
411
+ } | null;
408
412
  canConfirm: boolean;
409
413
  currency: string;
410
414
  currencyOptions: Array<StripeCheckoutCurrencyOption> | null;
@@ -671,6 +675,7 @@ export type StripeCheckoutExpressCheckoutElement = StripeElementBase & {
671
675
  type AnyBuyerError = {message: string; code: null};
672
676
  type ApplyPromotionCodeError =
673
677
  | {message: string; code: 'invalidCode'}
678
+ | {message: string; code: 'promotionCodeAmountInsufficient'}
674
679
  | AnyBuyerError;
675
680
  export type StripeCheckoutApplyPromotionCodeResult =
676
681
  | {type: 'success'; session: StripeCheckoutSession}
@@ -688,6 +693,14 @@ export type StripeCheckoutUpdatePhoneNumberResult =
688
693
  | {type: 'success'; session: StripeCheckoutSession}
689
694
  | {type: 'error'; error: never};
690
695
 
696
+ export type StripeCheckoutUpdateIndividualNameResult =
697
+ | {type: 'success'; session: StripeCheckoutSession}
698
+ | {type: 'error'; error: never};
699
+
700
+ export type StripeCheckoutUpdateBusinessNameResult =
701
+ | {type: 'success'; session: StripeCheckoutSession}
702
+ | {type: 'error'; error: never};
703
+
691
704
  type UpdateEmailError =
692
705
  | {message: string; code: 'incompleteEmail'}
693
706
  | {message: string; code: 'invalidEmail'};
@@ -789,6 +802,12 @@ export type StripeCheckoutLoadActionsSuccess = {
789
802
  updateEmail: (
790
803
  email: string | null
791
804
  ) => Promise<StripeCheckoutUpdateEmailResult>;
805
+ updateIndividualName: (
806
+ individualName: string | null
807
+ ) => Promise<StripeCheckoutUpdateIndividualNameResult>;
808
+ updateBusinessName: (
809
+ businessName: string | null
810
+ ) => Promise<StripeCheckoutUpdateBusinessNameResult>;
792
811
  updateLineItemQuantity: (args: {
793
812
  lineItem: string;
794
813
  quantity: number;
@@ -837,6 +856,8 @@ export type StripeCheckoutFormLoadActionsSuccess = Omit<
837
856
  StripeCheckoutLoadActionsSuccess,
838
857
  | 'updateEmail'
839
858
  | 'updatePhoneNumber'
859
+ | 'updateIndividualName'
860
+ | 'updateBusinessName'
840
861
  | 'updateShippingAddress'
841
862
  | 'updateBillingAddress'
842
863
  | 'updateTaxIdInfo'
@@ -857,6 +878,7 @@ export interface StripeCheckoutElementsSdk {
857
878
  getShippingAddressElement(): StripeAddressElement | null;
858
879
  getExpressCheckoutElement(): StripeCheckoutExpressCheckoutElement | null;
859
880
  getCurrencySelectorElement(): StripeCurrencySelectorElement | null;
881
+ getContactDetailsElement(): StripeContactDetailsElement | null;
860
882
  /* Requires beta header when initializing Stripe: @docs https://docs.stripe.com/tax/advanced/tax-ids?payment-ui=embedded-components#render-tax-id-element */
861
883
  getTaxIdElement(): StripeTaxIdElement | null;
862
884
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
@@ -40,6 +40,7 @@ export interface StripePaymentMethodMessagingElementOptions {
40
40
 
41
41
  /**
42
42
  * The currency to display.
43
+ * @docs https://docs.stripe.com/js/elements_object/create_element?type=paymentMethodMessaging#elements_create-options-currency
43
44
  */
44
45
  currency:
45
46
  | 'AUD'
@@ -52,6 +53,7 @@ export interface StripePaymentMethodMessagingElementOptions {
52
53
  | 'NOK'
53
54
  | 'NZD'
54
55
  | 'PLN'
56
+ | 'RON'
55
57
  | 'SEK'
56
58
  | 'USD';
57
59
 
@@ -40,6 +40,7 @@ export interface StripePaymentMethodMessagingElementOptions {
40
40
 
41
41
  /**
42
42
  * The currency to display.
43
+ * @docs https://docs.stripe.com/js/elements_object/create_element?type=paymentMethodMessaging#elements_create-options-currency
43
44
  */
44
45
  currency:
45
46
  | 'AUD'
@@ -52,6 +53,7 @@ export interface StripePaymentMethodMessagingElementOptions {
52
53
  | 'NOK'
53
54
  | 'NZD'
54
55
  | 'PLN'
56
+ | 'RON'
55
57
  | 'SEK'
56
58
  | 'USD';
57
59
 
@@ -413,6 +413,11 @@ export interface StripePaymentElementOptions {
413
413
  applePay?: ApplePayOption;
414
414
  }
415
415
 
416
+ type PaymentElementLayoutObjectUpdateOptions = Omit<
417
+ LayoutObject,
418
+ 'defaultCollapsed' | 'paymentMethodLogoPosition'
419
+ >;
420
+
416
421
  /**
417
422
  * The subset of `StripePaymentElementOptions` that can be updated after the
418
423
  * `PaymentElement` has been created.
@@ -427,10 +432,15 @@ export type StripePaymentElementUpdateOptions = Pick<
427
432
  | 'fields'
428
433
  | 'readOnly'
429
434
  | 'terms'
430
- | 'layout'
431
435
  | 'applePay'
432
436
  | 'walletOptions'
433
- >;
437
+ > & {
438
+ /**
439
+ * Specify a layout to use when rendering a Payment Element.
440
+ * `defaultCollapsed` and `paymentMethodLogoPosition` can't be updated.
441
+ */
442
+ layout?: Layout | PaymentElementLayoutObjectUpdateOptions;
443
+ };
434
444
 
435
445
  export interface StripePaymentElementChangeEvent {
436
446
  /**
@@ -413,6 +413,11 @@ export interface StripePaymentElementOptions {
413
413
  applePay?: ApplePayOption;
414
414
  }
415
415
 
416
+ type PaymentElementLayoutObjectUpdateOptions = Omit<
417
+ LayoutObject,
418
+ 'defaultCollapsed' | 'paymentMethodLogoPosition'
419
+ >;
420
+
416
421
  /**
417
422
  * The subset of `StripePaymentElementOptions` that can be updated after the
418
423
  * `PaymentElement` has been created.
@@ -427,10 +432,15 @@ export type StripePaymentElementUpdateOptions = Pick<
427
432
  | 'fields'
428
433
  | 'readOnly'
429
434
  | 'terms'
430
- | 'layout'
431
435
  | 'applePay'
432
436
  | 'walletOptions'
433
- >;
437
+ > & {
438
+ /**
439
+ * Specify a layout to use when rendering a Payment Element.
440
+ * `defaultCollapsed` and `paymentMethodLogoPosition` can't be updated.
441
+ */
442
+ layout?: Layout | PaymentElementLayoutObjectUpdateOptions;
443
+ };
434
444
 
435
445
  export interface StripePaymentElementChangeEvent {
436
446
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",