@stripe/stripe-js 9.10.0 → 9.12.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.10.0",
74
+ version: "9.12.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.10.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.12.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.10.0",
70
+ version: "9.12.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.10.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.12.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.10.0",
74
+ version: "9.12.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.10.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.12.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.10.0",
70
+ version: "9.12.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.10.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.12.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);
@@ -175,6 +175,8 @@ export type StripeCheckoutLineItem = {
175
175
  } | null;
176
176
  adjustableQuantity: StripeCheckoutAdjustableQuantity | null;
177
177
  images: string[];
178
+ priceId: string;
179
+ isRemovable: boolean;
178
180
  };
179
181
 
180
182
  export type StripeCheckoutRecurring = {
@@ -232,6 +234,23 @@ export type StripeCheckoutTrial = {
232
234
  trialPeriodDays: number;
233
235
  };
234
236
 
237
+ export type StripeCheckoutOptionalItem = {
238
+ priceId: string;
239
+ name: string;
240
+ description: string | null;
241
+ unitAmount: StripeCheckoutAmount;
242
+ unitAmountDecimal: StripeCheckoutAmount | null;
243
+ unitLabel: string | null;
244
+ quantity: number;
245
+ adjustableQuantity: StripeCheckoutAdjustableQuantity | null;
246
+ recurring: {
247
+ interval: StripeCheckoutBillingInterval;
248
+ intervalCount: number;
249
+ } | null;
250
+ images: string[];
251
+ isSelected: boolean;
252
+ };
253
+
235
254
  export type StripeCheckoutCurrencyOption = StripeCheckoutAmount & {
236
255
  currency: string;
237
256
  currencyConversion?: {fxRate: number; sourceCurrency: string};
@@ -376,6 +395,7 @@ export interface StripeCheckoutSession {
376
395
  taxAmounts: Array<StripeCheckoutTaxAmount> | null;
377
396
  taxIdInfo: StripeCheckoutTaxIdInfo | null;
378
397
  total: StripeCheckoutTotalSummary;
398
+ optionalItems: Array<StripeCheckoutOptionalItem> | null;
379
399
  }
380
400
 
381
401
  export type StripeCheckoutPaymentElementOptions = {
@@ -623,6 +643,27 @@ export type StripeCheckoutUpdateLineItemQuantityResult =
623
643
  | {type: 'success'; session: StripeCheckoutSession}
624
644
  | {type: 'error'; error: AnyBuyerError};
625
645
 
646
+ export type StripeCheckoutAddOptionalLineItemResult =
647
+ | {type: 'success'; session: StripeCheckoutSession}
648
+ | {type: 'error'; error: {message: string; code: null}};
649
+
650
+ export type StripeCheckoutRemoveOptionalLineItemResult =
651
+ | {type: 'success'; session: StripeCheckoutSession}
652
+ | {
653
+ type: 'error';
654
+ error:
655
+ | {
656
+ message: string;
657
+ code: 'promotionCodeAmountInsufficient';
658
+ promotionCodeAmountInsufficient: {
659
+ minimumAmount: number;
660
+ minimumAmountCurrency: string;
661
+ };
662
+ }
663
+ | {message: string; code: 'couponAppliesToNothing'}
664
+ | {message: string; code: null};
665
+ };
666
+
626
667
  export type StripeCheckoutUpdateShippingOptionResult =
627
668
  | {type: 'success'; session: StripeCheckoutSession}
628
669
  | {type: 'error'; error: AnyBuyerError};
@@ -719,6 +760,12 @@ export type StripeCheckoutLoadActionsSuccess = {
719
760
  userFunction: RunServerUpdateFunction
720
761
  ) => Promise<StripeCheckoutRunServerUpdateResult>;
721
762
  validateElements: () => Promise<StripeCheckoutValidateElementsResult>;
763
+ addOptionalLineItem: (
764
+ priceId: string
765
+ ) => Promise<StripeCheckoutAddOptionalLineItemResult>;
766
+ removeOptionalLineItem: (
767
+ priceId: string
768
+ ) => Promise<StripeCheckoutRemoveOptionalLineItemResult>;
722
769
  };
723
770
  export type StripeCheckoutLoadActionsResult =
724
771
  | {type: 'success'; actions: StripeCheckoutLoadActionsSuccess}
@@ -175,6 +175,8 @@ export type StripeCheckoutLineItem = {
175
175
  } | null;
176
176
  adjustableQuantity: StripeCheckoutAdjustableQuantity | null;
177
177
  images: string[];
178
+ priceId: string;
179
+ isRemovable: boolean;
178
180
  };
179
181
 
180
182
  export type StripeCheckoutRecurring = {
@@ -232,6 +234,23 @@ export type StripeCheckoutTrial = {
232
234
  trialPeriodDays: number;
233
235
  };
234
236
 
237
+ export type StripeCheckoutOptionalItem = {
238
+ priceId: string;
239
+ name: string;
240
+ description: string | null;
241
+ unitAmount: StripeCheckoutAmount;
242
+ unitAmountDecimal: StripeCheckoutAmount | null;
243
+ unitLabel: string | null;
244
+ quantity: number;
245
+ adjustableQuantity: StripeCheckoutAdjustableQuantity | null;
246
+ recurring: {
247
+ interval: StripeCheckoutBillingInterval;
248
+ intervalCount: number;
249
+ } | null;
250
+ images: string[];
251
+ isSelected: boolean;
252
+ };
253
+
235
254
  export type StripeCheckoutCurrencyOption = StripeCheckoutAmount & {
236
255
  currency: string;
237
256
  currencyConversion?: {fxRate: number; sourceCurrency: string};
@@ -376,6 +395,7 @@ export interface StripeCheckoutSession {
376
395
  taxAmounts: Array<StripeCheckoutTaxAmount> | null;
377
396
  taxIdInfo: StripeCheckoutTaxIdInfo | null;
378
397
  total: StripeCheckoutTotalSummary;
398
+ optionalItems: Array<StripeCheckoutOptionalItem> | null;
379
399
  }
380
400
 
381
401
  export type StripeCheckoutPaymentElementOptions = {
@@ -623,6 +643,27 @@ export type StripeCheckoutUpdateLineItemQuantityResult =
623
643
  | {type: 'success'; session: StripeCheckoutSession}
624
644
  | {type: 'error'; error: AnyBuyerError};
625
645
 
646
+ export type StripeCheckoutAddOptionalLineItemResult =
647
+ | {type: 'success'; session: StripeCheckoutSession}
648
+ | {type: 'error'; error: {message: string; code: null}};
649
+
650
+ export type StripeCheckoutRemoveOptionalLineItemResult =
651
+ | {type: 'success'; session: StripeCheckoutSession}
652
+ | {
653
+ type: 'error';
654
+ error:
655
+ | {
656
+ message: string;
657
+ code: 'promotionCodeAmountInsufficient';
658
+ promotionCodeAmountInsufficient: {
659
+ minimumAmount: number;
660
+ minimumAmountCurrency: string;
661
+ };
662
+ }
663
+ | {message: string; code: 'couponAppliesToNothing'}
664
+ | {message: string; code: null};
665
+ };
666
+
626
667
  export type StripeCheckoutUpdateShippingOptionResult =
627
668
  | {type: 'success'; session: StripeCheckoutSession}
628
669
  | {type: 'error'; error: AnyBuyerError};
@@ -719,6 +760,12 @@ export type StripeCheckoutLoadActionsSuccess = {
719
760
  userFunction: RunServerUpdateFunction
720
761
  ) => Promise<StripeCheckoutRunServerUpdateResult>;
721
762
  validateElements: () => Promise<StripeCheckoutValidateElementsResult>;
763
+ addOptionalLineItem: (
764
+ priceId: string
765
+ ) => Promise<StripeCheckoutAddOptionalLineItemResult>;
766
+ removeOptionalLineItem: (
767
+ priceId: string
768
+ ) => Promise<StripeCheckoutRemoveOptionalLineItemResult>;
722
769
  };
723
770
  export type StripeCheckoutLoadActionsResult =
724
771
  | {type: 'success'; actions: StripeCheckoutLoadActionsSuccess}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "9.10.0",
3
+ "version": "9.12.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",