@stripe/stripe-js 3.5.0 → 4.1.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
@@ -42,7 +42,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
42
42
 
43
43
  stripe._registerWrapper({
44
44
  name: 'stripe-js',
45
- version: "3.4.1",
45
+ version: "4.0.0",
46
46
  startTime: startTime
47
47
  });
48
48
  };
package/dist/index.mjs CHANGED
@@ -38,7 +38,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
38
38
 
39
39
  stripe._registerWrapper({
40
40
  name: 'stripe-js',
41
- version: "3.4.1",
41
+ version: "4.0.0",
42
42
  startTime: startTime
43
43
  });
44
44
  };
package/dist/pure.js CHANGED
@@ -58,7 +58,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
58
58
 
59
59
  stripe._registerWrapper({
60
60
  name: 'stripe-js',
61
- version: "3.4.1",
61
+ version: "4.0.0",
62
62
  startTime: startTime
63
63
  });
64
64
  };
package/dist/pure.mjs CHANGED
@@ -54,7 +54,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
54
54
 
55
55
  stripe._registerWrapper({
56
56
  name: 'stripe-js',
57
- version: "3.4.1",
57
+ version: "4.0.0",
58
58
  startTime: startTime
59
59
  });
60
60
  };
@@ -245,20 +245,34 @@ export type LayoutOption = {
245
245
  overflow?: 'auto' | 'never';
246
246
  };
247
247
 
248
- export type ExpressCheckoutWalletOption = 'always' | 'auto' | 'never';
248
+ export type ExpressCheckoutPaymentMethodOptionWithAlways =
249
+ | 'always'
250
+ | ExpressCheckoutPaymentMethodOption;
251
+ export type ExpressCheckoutPaymentMethodOption = 'auto' | 'never';
252
+
253
+ export type ExpressCheckoutPaymentMethodsOption = {
254
+ amazonPay?: ExpressCheckoutPaymentMethodOption;
255
+ applePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
256
+ googlePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
257
+ link?: ExpressCheckoutPaymentMethodOption;
258
+ paypal?: ExpressCheckoutPaymentMethodOption;
259
+ };
249
260
 
250
261
  export type ExpressCheckoutWalletsOption = {
251
- applePay?: ExpressCheckoutWalletOption;
252
- googlePay?: ExpressCheckoutWalletOption;
262
+ applePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
263
+ googlePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
253
264
  };
254
265
 
255
266
  export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline';
256
267
 
257
268
  export type GooglePayButtonTheme = 'black' | 'white';
258
269
 
270
+ export type PayPalButtonTheme = 'gold' | 'blue' | 'silver' | 'white' | 'black';
271
+
259
272
  export type ButtonThemeOption = {
260
273
  applePay?: ApplePayButtonTheme;
261
274
  googlePay?: GooglePayButtonTheme;
275
+ paypal?: PayPalButtonTheme;
262
276
  };
263
277
 
264
278
  export type ApplePayButtonType =
@@ -320,6 +334,14 @@ export interface StripeExpressCheckoutElementOptions {
320
334
  paymentMethodOrder?: string[];
321
335
 
322
336
  /**
337
+ * Control payment method display in the Express Checkout Element.
338
+ */
339
+ paymentMethods?: ExpressCheckoutPaymentMethodsOption;
340
+
341
+ /**
342
+ * @deprecated
343
+ * Use `paymentMethods` instead.
344
+ *
323
345
  * Control wallets display in the Express Checkout Element.
324
346
  */
325
347
  wallets?: ExpressCheckoutWalletsOption;
@@ -245,20 +245,34 @@ export type LayoutOption = {
245
245
  overflow?: 'auto' | 'never';
246
246
  };
247
247
 
248
- export type ExpressCheckoutWalletOption = 'always' | 'auto' | 'never';
248
+ export type ExpressCheckoutPaymentMethodOptionWithAlways =
249
+ | 'always'
250
+ | ExpressCheckoutPaymentMethodOption;
251
+ export type ExpressCheckoutPaymentMethodOption = 'auto' | 'never';
252
+
253
+ export type ExpressCheckoutPaymentMethodsOption = {
254
+ amazonPay?: ExpressCheckoutPaymentMethodOption;
255
+ applePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
256
+ googlePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
257
+ link?: ExpressCheckoutPaymentMethodOption;
258
+ paypal?: ExpressCheckoutPaymentMethodOption;
259
+ };
249
260
 
250
261
  export type ExpressCheckoutWalletsOption = {
251
- applePay?: ExpressCheckoutWalletOption;
252
- googlePay?: ExpressCheckoutWalletOption;
262
+ applePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
263
+ googlePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
253
264
  };
254
265
 
255
266
  export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline';
256
267
 
257
268
  export type GooglePayButtonTheme = 'black' | 'white';
258
269
 
270
+ export type PayPalButtonTheme = 'gold' | 'blue' | 'silver' | 'white' | 'black';
271
+
259
272
  export type ButtonThemeOption = {
260
273
  applePay?: ApplePayButtonTheme;
261
274
  googlePay?: GooglePayButtonTheme;
275
+ paypal?: PayPalButtonTheme;
262
276
  };
263
277
 
264
278
  export type ApplePayButtonType =
@@ -320,6 +334,14 @@ export interface StripeExpressCheckoutElementOptions {
320
334
  paymentMethodOrder?: string[];
321
335
 
322
336
  /**
337
+ * Control payment method display in the Express Checkout Element.
338
+ */
339
+ paymentMethods?: ExpressCheckoutPaymentMethodsOption;
340
+
341
+ /**
342
+ * @deprecated
343
+ * Use `paymentMethods` instead.
344
+ *
323
345
  * Control wallets display in the Express Checkout Element.
324
346
  */
325
347
  wallets?: ExpressCheckoutWalletsOption;
@@ -270,6 +270,26 @@ export interface StripePaymentElementChangeEvent {
270
270
 
271
271
  /**
272
272
  * An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay").
273
+ * If a payment method is selected, it will be included in the object.
273
274
  */
274
- value: {type: string};
275
+ value: {
276
+ type: string;
277
+ payment_method?: {
278
+ id: string;
279
+ type: string;
280
+ billing_details: {
281
+ address: {
282
+ city: null | string;
283
+ country: null | string;
284
+ line1: null | string;
285
+ line2: null | string;
286
+ postal_code: null | string;
287
+ state: null | string;
288
+ };
289
+ name: null | string;
290
+ email: null | string;
291
+ phone: null | string;
292
+ };
293
+ };
294
+ };
275
295
  }
@@ -270,6 +270,26 @@ export interface StripePaymentElementChangeEvent {
270
270
 
271
271
  /**
272
272
  * An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay").
273
+ * If a payment method is selected, it will be included in the object.
273
274
  */
274
- value: {type: string};
275
+ value: {
276
+ type: string;
277
+ payment_method?: {
278
+ id: string;
279
+ type: string;
280
+ billing_details: {
281
+ address: {
282
+ city: null | string;
283
+ country: null | string;
284
+ line1: null | string;
285
+ line2: null | string;
286
+ postal_code: null | string;
287
+ state: null | string;
288
+ };
289
+ name: null | string;
290
+ email: null | string;
291
+ phone: null | string;
292
+ };
293
+ };
294
+ };
275
295
  }
@@ -661,6 +661,11 @@ interface BaseStripeElementsOptions {
661
661
  * Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements.
662
662
  */
663
663
  customerOptions?: CustomerOptions;
664
+
665
+ /**
666
+ * Display saved PaymentMethods and Customer information.
667
+ */
668
+ customerSessionClientSecret?: string;
664
669
  }
665
670
 
666
671
  export interface StripeElementsOptionsClientSecret
@@ -661,6 +661,11 @@ interface BaseStripeElementsOptions {
661
661
  * Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements.
662
662
  */
663
663
  customerOptions?: CustomerOptions;
664
+
665
+ /**
666
+ * Display saved PaymentMethods and Customer information.
667
+ */
668
+ customerSessionClientSecret?: string;
664
669
  }
665
670
 
666
671
  export interface StripeElementsOptionsClientSecret
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "3.5.0",
3
+ "version": "4.1.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",