@stripe/stripe-js 3.4.1 → 4.0.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.
@@ -403,17 +403,17 @@ export namespace PaymentMethodCreateParams {
403
403
  /**
404
404
  * Email address.
405
405
  */
406
- email?: string;
406
+ email?: string | null;
407
407
 
408
408
  /**
409
409
  * Full name.
410
410
  */
411
- name?: string;
411
+ name?: string | null;
412
412
 
413
413
  /**
414
414
  * Billing phone number (including extension).
415
415
  */
416
- phone?: string;
416
+ phone?: string | null;
417
417
  }
418
418
 
419
419
  export namespace BillingDetails {
@@ -421,32 +421,32 @@ export namespace PaymentMethodCreateParams {
421
421
  /**
422
422
  * City, district, suburb, town, or village.
423
423
  */
424
- city?: string;
424
+ city?: string | null;
425
425
 
426
426
  /**
427
427
  * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
428
428
  */
429
- country?: string;
429
+ country?: string | null;
430
430
 
431
431
  /**
432
432
  * Address line 1 (e.g., street, PO Box, or company name).
433
433
  */
434
- line1?: string;
434
+ line1?: string | null;
435
435
 
436
436
  /**
437
437
  * Address line 2 (e.g., apartment, suite, unit, or building).
438
438
  */
439
- line2?: string;
439
+ line2?: string | null;
440
440
 
441
441
  /**
442
442
  * ZIP or postal code.
443
443
  */
444
- postal_code?: string;
444
+ postal_code?: string | null;
445
445
 
446
446
  /**
447
447
  * State, county, province, or region.
448
448
  */
449
- state?: string;
449
+ state?: string | null;
450
450
  }
451
451
  }
452
452
  }
@@ -403,17 +403,17 @@ export namespace PaymentMethodCreateParams {
403
403
  /**
404
404
  * Email address.
405
405
  */
406
- email?: string;
406
+ email?: string | null;
407
407
 
408
408
  /**
409
409
  * Full name.
410
410
  */
411
- name?: string;
411
+ name?: string | null;
412
412
 
413
413
  /**
414
414
  * Billing phone number (including extension).
415
415
  */
416
- phone?: string;
416
+ phone?: string | null;
417
417
  }
418
418
 
419
419
  export namespace BillingDetails {
@@ -421,32 +421,32 @@ export namespace PaymentMethodCreateParams {
421
421
  /**
422
422
  * City, district, suburb, town, or village.
423
423
  */
424
- city?: string;
424
+ city?: string | null;
425
425
 
426
426
  /**
427
427
  * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
428
428
  */
429
- country?: string;
429
+ country?: string | null;
430
430
 
431
431
  /**
432
432
  * Address line 1 (e.g., street, PO Box, or company name).
433
433
  */
434
- line1?: string;
434
+ line1?: string | null;
435
435
 
436
436
  /**
437
437
  * Address line 2 (e.g., apartment, suite, unit, or building).
438
438
  */
439
- line2?: string;
439
+ line2?: string | null;
440
440
 
441
441
  /**
442
442
  * ZIP or postal code.
443
443
  */
444
- postal_code?: string;
444
+ postal_code?: string | null;
445
445
 
446
446
  /**
447
447
  * State, county, province, or region.
448
448
  */
449
- state?: string;
449
+ state?: string | null;
450
450
  }
451
451
  }
452
452
  }
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.0",
45
+ version: "3.5.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.0",
41
+ version: "3.5.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.0",
61
+ version: "3.5.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.0",
57
+ version: "3.5.0",
58
58
  startTime: startTime
59
59
  });
60
60
  };
@@ -221,6 +221,7 @@ export type StripeCustomCheckoutExpressCheckoutElementOptions = {
221
221
  buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme'];
222
222
  buttonType: StripeExpressCheckoutElementOptions['buttonType'];
223
223
  layout: StripeExpressCheckoutElementOptions['layout'];
224
+ paymentMethodOrder: StripeExpressCheckoutElementOptions['paymentMethodOrder'];
224
225
  };
225
226
 
226
227
  export type StripeCustomCheckoutUpdateHandler = (
@@ -221,6 +221,7 @@ export type StripeCustomCheckoutExpressCheckoutElementOptions = {
221
221
  buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme'];
222
222
  buttonType: StripeExpressCheckoutElementOptions['buttonType'];
223
223
  layout: StripeExpressCheckoutElementOptions['layout'];
224
+ paymentMethodOrder: StripeExpressCheckoutElementOptions['paymentMethodOrder'];
224
225
  };
225
226
 
226
227
  export type StripeCustomCheckoutUpdateHandler = (
@@ -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;
@@ -264,6 +264,11 @@ export interface CreatePaymentMethodKonbiniData
264
264
  };
265
265
  }
266
266
 
267
+ export interface CreatePaymentMethodMobilepayData
268
+ extends PaymentMethodCreateParams {
269
+ type: 'mobilepay';
270
+ }
271
+
267
272
  export interface CreatePaymentMethodOxxoData extends PaymentMethodCreateParams {
268
273
  type: 'oxxo';
269
274
 
@@ -1040,6 +1045,37 @@ export interface ConfirmKonbiniPaymentOptions {
1040
1045
  handleActions?: boolean;
1041
1046
  }
1042
1047
 
1048
+ /**
1049
+ * Data to be sent with a `stripe.confirmMobilepayPayment` request.
1050
+ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
1051
+ */
1052
+ export interface ConfirmMobilepayPaymentData
1053
+ extends PaymentIntentConfirmParams {
1054
+ /**
1055
+ * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods).
1056
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created.
1057
+ *
1058
+ * @recommended
1059
+ */
1060
+ payment_method?: string | Omit<CreatePaymentMethodMobilepayData, 'type'>;
1061
+
1062
+ /**
1063
+ * The url your customer will be directed to after they complete authentication.
1064
+ */
1065
+ return_url?: string;
1066
+ }
1067
+
1068
+ /**
1069
+ * An options object to control the behavior of `stripe.confirmMobilepayPayment`.
1070
+ */
1071
+ export interface ConfirmMobilepayPaymentOptions {
1072
+ /**
1073
+ * Set this to `false` if you want to [manually handle the redirect](https://docs.stripe.com/payments/mobilepay/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api#web-confirm-payment-intent).
1074
+ * Default is `true`.
1075
+ */
1076
+ handleActions?: boolean;
1077
+ }
1078
+
1043
1079
  /**
1044
1080
  * Data to be sent with a `stripe.confirmOxxoPayment` request.
1045
1081
  * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
@@ -264,6 +264,11 @@ export interface CreatePaymentMethodKonbiniData
264
264
  };
265
265
  }
266
266
 
267
+ export interface CreatePaymentMethodMobilepayData
268
+ extends PaymentMethodCreateParams {
269
+ type: 'mobilepay';
270
+ }
271
+
267
272
  export interface CreatePaymentMethodOxxoData extends PaymentMethodCreateParams {
268
273
  type: 'oxxo';
269
274
 
@@ -1040,6 +1045,37 @@ export interface ConfirmKonbiniPaymentOptions {
1040
1045
  handleActions?: boolean;
1041
1046
  }
1042
1047
 
1048
+ /**
1049
+ * Data to be sent with a `stripe.confirmMobilepayPayment` request.
1050
+ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
1051
+ */
1052
+ export interface ConfirmMobilepayPaymentData
1053
+ extends PaymentIntentConfirmParams {
1054
+ /**
1055
+ * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods).
1056
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created.
1057
+ *
1058
+ * @recommended
1059
+ */
1060
+ payment_method?: string | Omit<CreatePaymentMethodMobilepayData, 'type'>;
1061
+
1062
+ /**
1063
+ * The url your customer will be directed to after they complete authentication.
1064
+ */
1065
+ return_url?: string;
1066
+ }
1067
+
1068
+ /**
1069
+ * An options object to control the behavior of `stripe.confirmMobilepayPayment`.
1070
+ */
1071
+ export interface ConfirmMobilepayPaymentOptions {
1072
+ /**
1073
+ * Set this to `false` if you want to [manually handle the redirect](https://docs.stripe.com/payments/mobilepay/accept-a-payment?web-or-mobile=web&payments-ui-type=direct-api#web-confirm-payment-intent).
1074
+ * Default is `true`.
1075
+ */
1076
+ handleActions?: boolean;
1077
+ }
1078
+
1043
1079
  /**
1044
1080
  * Data to be sent with a `stripe.confirmOxxoPayment` request.
1045
1081
  * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
@@ -420,6 +420,23 @@ export interface Stripe {
420
420
  options?: paymentIntents.ConfirmKonbiniPaymentOptions
421
421
  ): Promise<PaymentIntentResult>;
422
422
 
423
+ /**
424
+ * Use `stripe.confirmMobilepayPayment` in the [Mobilepay Payments](https://docs.stripe.com/payments/mobilepay) with Payment Methods flow when the customer submits your payment form.
425
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
426
+ * Refer to our [integration guide](https://docs.stripe.com/payments/mobilepay) for more details.
427
+ *
428
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
429
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
430
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
431
+ *
432
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_mobilepay_payment
433
+ */
434
+ confirmMobilepayPayment(
435
+ clientSecret: string,
436
+ data?: paymentIntents.ConfirmMobilepayPaymentData,
437
+ options?: paymentIntents.ConfirmMobilepayPaymentOptions
438
+ ): Promise<PaymentIntentResult>;
439
+
423
440
  /**
424
441
  * Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form.
425
442
  * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
@@ -420,6 +420,23 @@ export interface Stripe {
420
420
  options?: paymentIntents.ConfirmKonbiniPaymentOptions
421
421
  ): Promise<PaymentIntentResult>;
422
422
 
423
+ /**
424
+ * Use `stripe.confirmMobilepayPayment` in the [Mobilepay Payments](https://docs.stripe.com/payments/mobilepay) with Payment Methods flow when the customer submits your payment form.
425
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
426
+ * Refer to our [integration guide](https://docs.stripe.com/payments/mobilepay) for more details.
427
+ *
428
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
429
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
430
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
431
+ *
432
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_mobilepay_payment
433
+ */
434
+ confirmMobilepayPayment(
435
+ clientSecret: string,
436
+ data?: paymentIntents.ConfirmMobilepayPaymentData,
437
+ options?: paymentIntents.ConfirmMobilepayPaymentOptions
438
+ ): Promise<PaymentIntentResult>;
439
+
423
440
  /**
424
441
  * Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form.
425
442
  * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "3.4.1",
3
+ "version": "4.0.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",