@stripe/stripe-js 7.6.1 → 7.8.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
@@ -55,7 +55,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
55
55
 
56
56
  stripe._registerWrapper({
57
57
  name: 'stripe-js',
58
- version: "7.6.1",
58
+ version: "7.8.0",
59
59
  startTime: startTime
60
60
  });
61
61
  };
@@ -151,7 +151,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
151
151
  var expectedVersion = RELEASE_TRAIN;
152
152
 
153
153
  if (isTestKey && version !== expectedVersion) {
154
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.6.1", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
154
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.8.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
155
155
  }
156
156
 
157
157
  var stripe = maybeStripe.apply(undefined, args);
package/dist/index.mjs CHANGED
@@ -51,7 +51,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
51
51
 
52
52
  stripe._registerWrapper({
53
53
  name: 'stripe-js',
54
- version: "7.6.1",
54
+ version: "7.8.0",
55
55
  startTime: startTime
56
56
  });
57
57
  };
@@ -147,7 +147,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
147
147
  var expectedVersion = RELEASE_TRAIN;
148
148
 
149
149
  if (isTestKey && version !== expectedVersion) {
150
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.6.1", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
150
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.8.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
151
151
  }
152
152
 
153
153
  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: "7.6.1",
74
+ version: "7.8.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -167,7 +167,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
167
167
  var expectedVersion = RELEASE_TRAIN;
168
168
 
169
169
  if (isTestKey && version !== expectedVersion) {
170
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.6.1", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
170
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.8.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
171
171
  }
172
172
 
173
173
  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: "7.6.1",
70
+ version: "7.8.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -163,7 +163,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
163
163
  var expectedVersion = RELEASE_TRAIN;
164
164
 
165
165
  if (isTestKey && version !== expectedVersion) {
166
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.6.1", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
166
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.8.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
167
167
  }
168
168
 
169
169
  var stripe = maybeStripe.apply(undefined, args);
@@ -19,15 +19,16 @@ import {
19
19
  StripeTaxIdElementOptions,
20
20
  } from './elements';
21
21
 
22
- /**
23
- * Requires beta access:
24
- * Contact [Stripe support](https://support.stripe.com/) for more information.
25
- */
22
+ type SavedPaymentMethodOption = {
23
+ enableSave?: 'auto' | 'never';
24
+ enableRedisplay?: 'auto' | 'never';
25
+ };
26
26
 
27
27
  export interface StripeCheckoutElementsOptions {
28
28
  appearance?: Appearance;
29
29
  loader?: 'auto' | 'always' | 'never';
30
30
  fonts?: Array<CssFontSource | CustomFontSource>;
31
+ savedPaymentMethod?: SavedPaymentMethodOption;
31
32
  }
32
33
 
33
34
  export interface StripeCheckoutOptions {
@@ -600,6 +601,7 @@ export interface StripeCheckout {
600
601
 
601
602
  /* Elements methods */
602
603
  changeAppearance: (appearance: Appearance) => void;
604
+ loadFonts: (fonts: Array<CssFontSource | CustomFontSource>) => void;
603
605
  getPaymentElement(): StripePaymentElement | null;
604
606
  getBillingAddressElement(): StripeAddressElement | null;
605
607
  getShippingAddressElement(): StripeAddressElement | null;
@@ -19,15 +19,16 @@ import {
19
19
  StripeTaxIdElementOptions,
20
20
  } from './elements';
21
21
 
22
- /**
23
- * Requires beta access:
24
- * Contact [Stripe support](https://support.stripe.com/) for more information.
25
- */
22
+ type SavedPaymentMethodOption = {
23
+ enableSave?: 'auto' | 'never';
24
+ enableRedisplay?: 'auto' | 'never';
25
+ };
26
26
 
27
27
  export interface StripeCheckoutElementsOptions {
28
28
  appearance?: Appearance;
29
29
  loader?: 'auto' | 'always' | 'never';
30
30
  fonts?: Array<CssFontSource | CustomFontSource>;
31
+ savedPaymentMethod?: SavedPaymentMethodOption;
31
32
  }
32
33
 
33
34
  export interface StripeCheckoutOptions {
@@ -600,6 +601,7 @@ export interface StripeCheckout {
600
601
 
601
602
  /* Elements methods */
602
603
  changeAppearance: (appearance: Appearance) => void;
604
+ loadFonts: (fonts: Array<CssFontSource | CustomFontSource>) => void;
603
605
  getPaymentElement(): StripePaymentElement | null;
604
606
  getBillingAddressElement(): StripeAddressElement | null;
605
607
  getShippingAddressElement(): StripeAddressElement | null;
@@ -1,3 +1,4 @@
1
+ export * from './issuing-add-to-wallet-button';
1
2
  export * from './issuing-card-number-display';
2
3
  export * from './issuing-card-cvc-display';
3
4
  export * from './issuing-card-expiry-display';
@@ -1,3 +1,4 @@
1
+ export * from './issuing-add-to-wallet-button';
1
2
  export * from './issuing-card-number-display';
2
3
  export * from './issuing-card-cvc-display';
3
4
  export * from './issuing-card-expiry-display';
@@ -0,0 +1,70 @@
1
+ import {StripeElementBase} from '../base';
2
+
3
+ export type StripeIssuingAddToWalletButtonElement = StripeElementBase & {
4
+ /**
5
+ * Triggered when the element is clicked.
6
+ */
7
+ on(
8
+ eventType: 'click',
9
+ handler: (event: {elementType: 'issuingAddToWalletButton'}) => any
10
+ ): StripeIssuingAddToWalletButtonElement;
11
+ once(
12
+ eventType: 'click',
13
+ handler: (event: {elementType: 'issuingAddToWalletButton'}) => any
14
+ ): StripeIssuingAddToWalletButtonElement;
15
+ off(
16
+ eventType: 'click',
17
+ handler?: (event: {elementType: 'issuingAddToWalletButton'}) => any
18
+ ): StripeIssuingAddToWalletButtonElement;
19
+
20
+ /**
21
+ * Triggered when add to wallet flow is complete.
22
+ */
23
+ on(
24
+ eventType: 'success',
25
+ handler: (event: {elementType: 'issuingAddToWalletButton'}) => any
26
+ ): StripeIssuingAddToWalletButtonElement;
27
+ once(
28
+ eventType: 'success',
29
+ handler: (event: {elementType: 'issuingAddToWalletButton'}) => any
30
+ ): StripeIssuingAddToWalletButtonElement;
31
+ off(
32
+ eventType: 'success',
33
+ handler?: (event: {elementType: 'issuingAddToWalletButton'}) => any
34
+ ): StripeIssuingAddToWalletButtonElement;
35
+
36
+ /**
37
+ * Updates the options the `IssuingAddToWalletButtonElement` was initialized with.
38
+ * Updates are merged into the existing configuration.
39
+ */
40
+ update(options: Partial<StripeIssuingAddToWalletButtonElementOptions>): void;
41
+ };
42
+
43
+ export interface StripeIssuingAddToWalletButtonElementOptions {
44
+ /**
45
+ * The token (e.g. `ic_abc123`) of the issued card to add to the user's wallet.
46
+ */
47
+ issuingCard: string;
48
+
49
+ /**
50
+ * The secret component of the ephemeral key with which to authenticate this sensitive
51
+ * card provisioning request
52
+ */
53
+ ephemeralKeySecret: string;
54
+
55
+ /**
56
+ * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
57
+ */
58
+ nonce: string;
59
+
60
+ /**
61
+ * The type of Add to Wallet button to display. For now, only 'apple' is supported.
62
+ */
63
+ wallet: 'apple';
64
+
65
+ /**
66
+ * The height of the button in pixels. Defaults to 44px.
67
+ * Must be between 36px and 55px.
68
+ */
69
+ buttonHeight?: number;
70
+ }
@@ -0,0 +1,70 @@
1
+ import {StripeElementBase} from '../base';
2
+
3
+ export type StripeIssuingAddToWalletButtonElement = StripeElementBase & {
4
+ /**
5
+ * Triggered when the element is clicked.
6
+ */
7
+ on(
8
+ eventType: 'click',
9
+ handler: (event: {elementType: 'issuingAddToWalletButton'}) => any
10
+ ): StripeIssuingAddToWalletButtonElement;
11
+ once(
12
+ eventType: 'click',
13
+ handler: (event: {elementType: 'issuingAddToWalletButton'}) => any
14
+ ): StripeIssuingAddToWalletButtonElement;
15
+ off(
16
+ eventType: 'click',
17
+ handler?: (event: {elementType: 'issuingAddToWalletButton'}) => any
18
+ ): StripeIssuingAddToWalletButtonElement;
19
+
20
+ /**
21
+ * Triggered when add to wallet flow is complete.
22
+ */
23
+ on(
24
+ eventType: 'success',
25
+ handler: (event: {elementType: 'issuingAddToWalletButton'}) => any
26
+ ): StripeIssuingAddToWalletButtonElement;
27
+ once(
28
+ eventType: 'success',
29
+ handler: (event: {elementType: 'issuingAddToWalletButton'}) => any
30
+ ): StripeIssuingAddToWalletButtonElement;
31
+ off(
32
+ eventType: 'success',
33
+ handler?: (event: {elementType: 'issuingAddToWalletButton'}) => any
34
+ ): StripeIssuingAddToWalletButtonElement;
35
+
36
+ /**
37
+ * Updates the options the `IssuingAddToWalletButtonElement` was initialized with.
38
+ * Updates are merged into the existing configuration.
39
+ */
40
+ update(options: Partial<StripeIssuingAddToWalletButtonElementOptions>): void;
41
+ };
42
+
43
+ export interface StripeIssuingAddToWalletButtonElementOptions {
44
+ /**
45
+ * The token (e.g. `ic_abc123`) of the issued card to add to the user's wallet.
46
+ */
47
+ issuingCard: string;
48
+
49
+ /**
50
+ * The secret component of the ephemeral key with which to authenticate this sensitive
51
+ * card provisioning request
52
+ */
53
+ ephemeralKeySecret: string;
54
+
55
+ /**
56
+ * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
57
+ */
58
+ nonce: string;
59
+
60
+ /**
61
+ * The type of Add to Wallet button to display. For now, only 'apple' is supported.
62
+ */
63
+ wallet: 'apple';
64
+
65
+ /**
66
+ * The height of the button in pixels. Defaults to 44px.
67
+ * Must be between 36px and 55px.
68
+ */
69
+ buttonHeight?: number;
70
+ }
@@ -521,7 +521,8 @@ export type StripeElementType =
521
521
  | 'issuingCardExpiryDisplay'
522
522
  | 'issuingCardPinDisplay'
523
523
  | 'issuingCardCopyButton'
524
- | 'taxId';
524
+ | 'taxId'
525
+ | 'issuingAddToWalletButton';
525
526
 
526
527
  export type StripeElement =
527
528
  | StripeAddressElement
@@ -791,6 +792,20 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
791
792
  */
792
793
  payment_method_types?: string[];
793
794
 
795
+ /**
796
+ * The list of payment method types to exclude from use with this payment.
797
+ *
798
+ * @docs https://stripe.com/docs/payments/payment-methods/overview
799
+ */
800
+ excludedPaymentMethodTypes?: string[];
801
+
802
+ /**
803
+ * The list of payment method types to allow for use with this payment. From this list, Stripe will automatically render the relevant payment methods for this payment.
804
+ *
805
+ * @docs https://stripe.com/docs/payments/payment-methods/overview
806
+ */
807
+ allowedPaymentMethodTypes?: string[];
808
+
794
809
  /**
795
810
  * When using automatic payment methods (omitting paymentMethodTypes), provide a
796
811
  * payment method configuration ID for deriving payment methods.
@@ -854,6 +869,11 @@ export interface StripeElementsUpdateOptions {
854
869
  */
855
870
  locale?: StripeElementLocale;
856
871
 
872
+ /**
873
+ * An array of custom fonts to update, which elements created from the `Elements` object can use.
874
+ */
875
+ fonts?: Array<CssFontSource | CustomFontSource>;
876
+
857
877
  /**
858
878
  * Match the design of your site with the appearance option.
859
879
  * The layout of each Element stays consistent, but you can modify colors, fonts, borders, padding, and more.
@@ -919,6 +939,20 @@ export interface StripeElementsUpdateOptions {
919
939
  */
920
940
  paymentMethodTypes?: string[];
921
941
 
942
+ /**
943
+ * The list of payment method types to exclude from use with this payment.
944
+ *
945
+ * @docs https://stripe.com/docs/payments/payment-methods/overview
946
+ */
947
+ excludedPaymentMethodTypes?: string[];
948
+
949
+ /**
950
+ * The list of payment method types to allow for use with this payment. From this list, Stripe will automatically render the relevant payment methods for this payment.
951
+ *
952
+ * @docs https://stripe.com/docs/payments/payment-methods/overview
953
+ */
954
+ allowedPaymentMethodTypes?: string[];
955
+
922
956
  /**
923
957
  * The Stripe account ID which is the business of record.
924
958
  *
@@ -521,7 +521,8 @@ export type StripeElementType =
521
521
  | 'issuingCardExpiryDisplay'
522
522
  | 'issuingCardPinDisplay'
523
523
  | 'issuingCardCopyButton'
524
- | 'taxId';
524
+ | 'taxId'
525
+ | 'issuingAddToWalletButton';
525
526
 
526
527
  export type StripeElement =
527
528
  | StripeAddressElement
@@ -791,6 +792,20 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
791
792
  */
792
793
  payment_method_types?: string[];
793
794
 
795
+ /**
796
+ * The list of payment method types to exclude from use with this payment.
797
+ *
798
+ * @docs https://stripe.com/docs/payments/payment-methods/overview
799
+ */
800
+ excludedPaymentMethodTypes?: string[];
801
+
802
+ /**
803
+ * The list of payment method types to allow for use with this payment. From this list, Stripe will automatically render the relevant payment methods for this payment.
804
+ *
805
+ * @docs https://stripe.com/docs/payments/payment-methods/overview
806
+ */
807
+ allowedPaymentMethodTypes?: string[];
808
+
794
809
  /**
795
810
  * When using automatic payment methods (omitting paymentMethodTypes), provide a
796
811
  * payment method configuration ID for deriving payment methods.
@@ -854,6 +869,11 @@ export interface StripeElementsUpdateOptions {
854
869
  */
855
870
  locale?: StripeElementLocale;
856
871
 
872
+ /**
873
+ * An array of custom fonts to update, which elements created from the `Elements` object can use.
874
+ */
875
+ fonts?: Array<CssFontSource | CustomFontSource>;
876
+
857
877
  /**
858
878
  * Match the design of your site with the appearance option.
859
879
  * The layout of each Element stays consistent, but you can modify colors, fonts, borders, padding, and more.
@@ -919,6 +939,20 @@ export interface StripeElementsUpdateOptions {
919
939
  */
920
940
  paymentMethodTypes?: string[];
921
941
 
942
+ /**
943
+ * The list of payment method types to exclude from use with this payment.
944
+ *
945
+ * @docs https://stripe.com/docs/payments/payment-methods/overview
946
+ */
947
+ excludedPaymentMethodTypes?: string[];
948
+
949
+ /**
950
+ * The list of payment method types to allow for use with this payment. From this list, Stripe will automatically render the relevant payment methods for this payment.
951
+ *
952
+ * @docs https://stripe.com/docs/payments/payment-methods/overview
953
+ */
954
+ allowedPaymentMethodTypes?: string[];
955
+
922
956
  /**
923
957
  * The Stripe account ID which is the business of record.
924
958
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "7.6.1",
3
+ "version": "7.8.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",