@stripe/stripe-js 9.0.0-rc.0 → 9.0.0-rc.2

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.0.0-rc.0",
74
+ version: "9.0.0-rc.2",
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.0.0-rc.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.0.0-rc.2", " 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.0.0-rc.0",
70
+ version: "9.0.0-rc.2",
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.0.0-rc.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.0.0-rc.2", " 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.0.0-rc.0",
74
+ version: "9.0.0-rc.2",
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.0.0-rc.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.0.0-rc.2", " 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.0.0-rc.0",
70
+ version: "9.0.0-rc.2",
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.0.0-rc.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.0.0-rc.2", " 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);
@@ -15,11 +15,11 @@ import {
15
15
  StripeExpressCheckoutElementConfirmEvent,
16
16
  StripeExpressCheckoutElementOptions,
17
17
  StripeExpressCheckoutElementReadyEvent,
18
- StripePaymentFormElement,
18
+ StripeCheckoutForm,
19
19
  StripeTaxIdElement,
20
20
  StripeTaxIdElementOptions,
21
21
  PaymentWalletsOption,
22
- StripePaymentFormElementConfirmEvent,
22
+ StripeCheckoutFormConfirmEvent,
23
23
  ExpressCheckoutPaymentMethodsOption,
24
24
  } from './elements';
25
25
 
@@ -36,7 +36,7 @@ export interface StripeCheckoutElementsOptions {
36
36
  syncAddressCheckbox?: 'billing' | 'shipping' | 'none';
37
37
  }
38
38
 
39
- export interface StripeCheckoutOptions {
39
+ export interface StripeCheckoutElementsSdkOptions {
40
40
  clientSecret: Promise<string> | string;
41
41
  elementsOptions?: StripeCheckoutElementsOptions;
42
42
  adaptivePricing?: {allowed?: boolean};
@@ -48,6 +48,20 @@ export interface StripeCheckoutOptions {
48
48
  };
49
49
  }
50
50
 
51
+ export interface StripeCheckoutFormSdkOptions {
52
+ clientSecret: Promise<string> | string;
53
+ appearance?: Omit<Appearance, 'rules'>;
54
+ loader?: 'auto' | 'always' | 'never';
55
+ fonts?: Array<CssFontSource | CustomFontSource>;
56
+ savedPaymentMethod?: SavedPaymentMethodOption;
57
+ defaultValues?: {
58
+ billingAddress?: StripeCheckoutContact;
59
+ shippingAddress?: StripeCheckoutContact;
60
+ email?: string;
61
+ phoneNumber?: string;
62
+ };
63
+ }
64
+
51
65
  /* Elements with CheckoutSessions API types */
52
66
  export type StripeCheckoutAddress = {
53
67
  country: string;
@@ -369,7 +383,7 @@ export type StripeCheckoutAddressElementOptions = {
369
383
  };
370
384
 
371
385
  /**
372
- * Wallet button theme options for PaymentFormElement.
386
+ * Wallet button theme options for CheckoutForm.
373
387
  */
374
388
  export type PaymentFormWalletButtonTheme = {
375
389
  applePay?: 'black' | 'white' | 'white-outline';
@@ -378,14 +392,14 @@ export type PaymentFormWalletButtonTheme = {
378
392
  klarna?: 'dark' | 'light' | 'outlined';
379
393
  };
380
394
 
381
- export type StripeCheckoutPaymentFormElementOptions = {
395
+ export type StripeCheckoutFormOptions = {
382
396
  /**
383
- * The layout of the PaymentFormElement.
397
+ * The layout of the CheckoutForm.
384
398
  */
385
399
  layout?: 'expanded' | 'compact';
386
400
 
387
401
  /**
388
- * An array of saved addresses to display in the PaymentFormElement.
402
+ * An array of saved addresses to display in the CheckoutForm.
389
403
  */
390
404
  contacts?: ContactOption[];
391
405
 
@@ -398,7 +412,7 @@ export type StripeCheckoutPaymentFormElementOptions = {
398
412
  */
399
413
  buttonTheme?: PaymentFormWalletButtonTheme;
400
414
  /**
401
- * Control payment method display for express checkout in the PaymentFormElement.
415
+ * Control payment method display for express checkout in the CheckoutForm.
402
416
  */
403
417
  paymentMethods?: ExpressCheckoutPaymentMethodsOption;
404
418
  };
@@ -644,7 +658,7 @@ type LoadActionsSuccess = {
644
658
  billingAddress?: StripeCheckoutContact;
645
659
  shippingAddress?: StripeCheckoutContact;
646
660
  expressCheckoutConfirmEvent?: StripeExpressCheckoutElementConfirmEvent;
647
- paymentFormConfirmEvent?: StripePaymentFormElementConfirmEvent;
661
+ formConfirmEvent?: StripeCheckoutFormConfirmEvent;
648
662
  onRequiresApproval?: () => Promise<void>;
649
663
  }) => Promise<StripeCheckoutConfirmResult>;
650
664
  getSession: () => StripeCheckoutSession;
@@ -656,17 +670,14 @@ export type StripeCheckoutLoadActionsResult =
656
670
  | {type: 'success'; actions: LoadActionsSuccess}
657
671
  | {type: 'error'; error: LoadActionsError};
658
672
 
659
- export interface StripeCheckout {
673
+ export interface StripeCheckoutElementsSdk {
660
674
  on: (event: 'change', handler: StripeCheckoutUpdateHandler) => void;
661
675
  loadActions: () => Promise<StripeCheckoutLoadActionsResult>;
662
676
 
663
- /* Elements methods */
664
677
  changeAppearance: (appearance: Appearance) => void;
665
678
  loadFonts: (fonts: Array<CssFontSource | CustomFontSource>) => void;
666
679
 
667
680
  getPaymentElement(): StripePaymentElement | null;
668
- /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
669
- getPaymentFormElement(): StripePaymentFormElement | null;
670
681
  getBillingAddressElement(): StripeAddressElement | null;
671
682
  getShippingAddressElement(): StripeAddressElement | null;
672
683
  getExpressCheckoutElement(): StripeCheckoutExpressCheckoutElement | null;
@@ -677,10 +688,6 @@ export interface StripeCheckout {
677
688
  createPaymentElement(
678
689
  options?: StripeCheckoutPaymentElementOptions
679
690
  ): StripePaymentElement;
680
- /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
681
- createPaymentFormElement(
682
- options?: StripeCheckoutPaymentFormElementOptions
683
- ): StripePaymentFormElement;
684
691
  createBillingAddressElement(
685
692
  options?: StripeCheckoutAddressElementOptions
686
693
  ): StripeAddressElement;
@@ -694,3 +701,20 @@ export interface StripeCheckout {
694
701
  /* Requires beta header when initializing Stripe: @docs https://docs.stripe.com/tax/advanced/tax-ids?payment-ui=embedded-components#render-tax-id-element */
695
702
  createTaxIdElement(options?: StripeTaxIdElementOptions): StripeTaxIdElement;
696
703
  }
704
+
705
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
706
+ export interface StripeCheckoutFormSdk {
707
+ on: (event: 'change', handler: StripeCheckoutUpdateHandler) => void;
708
+ loadActions: () => Promise<StripeCheckoutLoadActionsResult>;
709
+
710
+ changeAppearance: (appearance: Omit<Appearance, 'rules'>) => void;
711
+ loadFonts: (fonts: Array<CssFontSource | CustomFontSource>) => void;
712
+
713
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
714
+ createForm(options?: StripeCheckoutFormOptions): StripeCheckoutForm;
715
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
716
+ getForm(): StripeCheckoutForm | null;
717
+
718
+ createCurrencySelectorElement(): StripeCurrencySelectorElement;
719
+ getCurrencySelectorElement(): StripeCurrencySelectorElement | null;
720
+ }
@@ -15,11 +15,11 @@ import {
15
15
  StripeExpressCheckoutElementConfirmEvent,
16
16
  StripeExpressCheckoutElementOptions,
17
17
  StripeExpressCheckoutElementReadyEvent,
18
- StripePaymentFormElement,
18
+ StripeCheckoutForm,
19
19
  StripeTaxIdElement,
20
20
  StripeTaxIdElementOptions,
21
21
  PaymentWalletsOption,
22
- StripePaymentFormElementConfirmEvent,
22
+ StripeCheckoutFormConfirmEvent,
23
23
  ExpressCheckoutPaymentMethodsOption,
24
24
  } from './elements';
25
25
 
@@ -36,7 +36,7 @@ export interface StripeCheckoutElementsOptions {
36
36
  syncAddressCheckbox?: 'billing' | 'shipping' | 'none';
37
37
  }
38
38
 
39
- export interface StripeCheckoutOptions {
39
+ export interface StripeCheckoutElementsSdkOptions {
40
40
  clientSecret: Promise<string> | string;
41
41
  elementsOptions?: StripeCheckoutElementsOptions;
42
42
  adaptivePricing?: {allowed?: boolean};
@@ -48,6 +48,20 @@ export interface StripeCheckoutOptions {
48
48
  };
49
49
  }
50
50
 
51
+ export interface StripeCheckoutFormSdkOptions {
52
+ clientSecret: Promise<string> | string;
53
+ appearance?: Omit<Appearance, 'rules'>;
54
+ loader?: 'auto' | 'always' | 'never';
55
+ fonts?: Array<CssFontSource | CustomFontSource>;
56
+ savedPaymentMethod?: SavedPaymentMethodOption;
57
+ defaultValues?: {
58
+ billingAddress?: StripeCheckoutContact;
59
+ shippingAddress?: StripeCheckoutContact;
60
+ email?: string;
61
+ phoneNumber?: string;
62
+ };
63
+ }
64
+
51
65
  /* Elements with CheckoutSessions API types */
52
66
  export type StripeCheckoutAddress = {
53
67
  country: string;
@@ -369,7 +383,7 @@ export type StripeCheckoutAddressElementOptions = {
369
383
  };
370
384
 
371
385
  /**
372
- * Wallet button theme options for PaymentFormElement.
386
+ * Wallet button theme options for CheckoutForm.
373
387
  */
374
388
  export type PaymentFormWalletButtonTheme = {
375
389
  applePay?: 'black' | 'white' | 'white-outline';
@@ -378,14 +392,14 @@ export type PaymentFormWalletButtonTheme = {
378
392
  klarna?: 'dark' | 'light' | 'outlined';
379
393
  };
380
394
 
381
- export type StripeCheckoutPaymentFormElementOptions = {
395
+ export type StripeCheckoutFormOptions = {
382
396
  /**
383
- * The layout of the PaymentFormElement.
397
+ * The layout of the CheckoutForm.
384
398
  */
385
399
  layout?: 'expanded' | 'compact';
386
400
 
387
401
  /**
388
- * An array of saved addresses to display in the PaymentFormElement.
402
+ * An array of saved addresses to display in the CheckoutForm.
389
403
  */
390
404
  contacts?: ContactOption[];
391
405
 
@@ -398,7 +412,7 @@ export type StripeCheckoutPaymentFormElementOptions = {
398
412
  */
399
413
  buttonTheme?: PaymentFormWalletButtonTheme;
400
414
  /**
401
- * Control payment method display for express checkout in the PaymentFormElement.
415
+ * Control payment method display for express checkout in the CheckoutForm.
402
416
  */
403
417
  paymentMethods?: ExpressCheckoutPaymentMethodsOption;
404
418
  };
@@ -644,7 +658,7 @@ type LoadActionsSuccess = {
644
658
  billingAddress?: StripeCheckoutContact;
645
659
  shippingAddress?: StripeCheckoutContact;
646
660
  expressCheckoutConfirmEvent?: StripeExpressCheckoutElementConfirmEvent;
647
- paymentFormConfirmEvent?: StripePaymentFormElementConfirmEvent;
661
+ formConfirmEvent?: StripeCheckoutFormConfirmEvent;
648
662
  onRequiresApproval?: () => Promise<void>;
649
663
  }) => Promise<StripeCheckoutConfirmResult>;
650
664
  getSession: () => StripeCheckoutSession;
@@ -656,17 +670,14 @@ export type StripeCheckoutLoadActionsResult =
656
670
  | {type: 'success'; actions: LoadActionsSuccess}
657
671
  | {type: 'error'; error: LoadActionsError};
658
672
 
659
- export interface StripeCheckout {
673
+ export interface StripeCheckoutElementsSdk {
660
674
  on: (event: 'change', handler: StripeCheckoutUpdateHandler) => void;
661
675
  loadActions: () => Promise<StripeCheckoutLoadActionsResult>;
662
676
 
663
- /* Elements methods */
664
677
  changeAppearance: (appearance: Appearance) => void;
665
678
  loadFonts: (fonts: Array<CssFontSource | CustomFontSource>) => void;
666
679
 
667
680
  getPaymentElement(): StripePaymentElement | null;
668
- /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
669
- getPaymentFormElement(): StripePaymentFormElement | null;
670
681
  getBillingAddressElement(): StripeAddressElement | null;
671
682
  getShippingAddressElement(): StripeAddressElement | null;
672
683
  getExpressCheckoutElement(): StripeCheckoutExpressCheckoutElement | null;
@@ -677,10 +688,6 @@ export interface StripeCheckout {
677
688
  createPaymentElement(
678
689
  options?: StripeCheckoutPaymentElementOptions
679
690
  ): StripePaymentElement;
680
- /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
681
- createPaymentFormElement(
682
- options?: StripeCheckoutPaymentFormElementOptions
683
- ): StripePaymentFormElement;
684
691
  createBillingAddressElement(
685
692
  options?: StripeCheckoutAddressElementOptions
686
693
  ): StripeAddressElement;
@@ -694,3 +701,20 @@ export interface StripeCheckout {
694
701
  /* Requires beta header when initializing Stripe: @docs https://docs.stripe.com/tax/advanced/tax-ids?payment-ui=embedded-components#render-tax-id-element */
695
702
  createTaxIdElement(options?: StripeTaxIdElementOptions): StripeTaxIdElement;
696
703
  }
704
+
705
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
706
+ export interface StripeCheckoutFormSdk {
707
+ on: (event: 'change', handler: StripeCheckoutUpdateHandler) => void;
708
+ loadActions: () => Promise<StripeCheckoutLoadActionsResult>;
709
+
710
+ changeAppearance: (appearance: Omit<Appearance, 'rules'>) => void;
711
+ loadFonts: (fonts: Array<CssFontSource | CustomFontSource>) => void;
712
+
713
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
714
+ createForm(options?: StripeCheckoutFormOptions): StripeCheckoutForm;
715
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
716
+ getForm(): StripeCheckoutForm | null;
717
+
718
+ createCurrencySelectorElement(): StripeCurrencySelectorElement;
719
+ getCurrencySelectorElement(): StripeCurrencySelectorElement | null;
720
+ }
@@ -123,7 +123,9 @@ export type StripeAddressElement = StripeElementBase & {
123
123
  /**
124
124
  * Validates and retrieves form values from the `AddressElement`.
125
125
  */
126
- getValue(): Promise<
126
+ getValue(
127
+ options?: AddressElementGetValueOptions
128
+ ): Promise<
127
129
  Pick<StripeAddressElementChangeEvent, 'complete' | 'isNewAddress' | 'value'>
128
130
  >;
129
131
  };
@@ -260,6 +262,10 @@ export interface StripeAddressElementChangeEvent {
260
262
  };
261
263
  }
262
264
 
265
+ export interface AddressElementGetValueOptions {
266
+ format?: 'latin' | 'localized';
267
+ }
268
+
263
269
  export interface StripeAddressElementGetElementOptions {
264
270
  mode: AddressMode;
265
271
  }
@@ -123,7 +123,9 @@ export type StripeAddressElement = StripeElementBase & {
123
123
  /**
124
124
  * Validates and retrieves form values from the `AddressElement`.
125
125
  */
126
- getValue(): Promise<
126
+ getValue(
127
+ options?: AddressElementGetValueOptions
128
+ ): Promise<
127
129
  Pick<StripeAddressElementChangeEvent, 'complete' | 'isNewAddress' | 'value'>
128
130
  >;
129
131
  };
@@ -260,6 +262,10 @@ export interface StripeAddressElementChangeEvent {
260
262
  };
261
263
  }
262
264
 
265
+ export interface AddressElementGetValueOptions {
266
+ format?: 'latin' | 'localized';
267
+ }
268
+
263
269
  export interface StripeAddressElementGetElementOptions {
264
270
  mode: AddressMode;
265
271
  }