@stripe/stripe-js 4.10.0 → 5.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.
Files changed (33) hide show
  1. package/dist/api/confirmation-tokens.d.mts +0 -3
  2. package/dist/api/confirmation-tokens.d.ts +0 -3
  3. package/dist/index.js +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/pure.js +1 -1
  6. package/dist/pure.mjs +1 -1
  7. package/dist/stripe-js/checkout.d.mts +462 -126
  8. package/dist/stripe-js/checkout.d.ts +462 -126
  9. package/dist/stripe-js/elements/currency-selector.d.mts +93 -0
  10. package/dist/stripe-js/elements/currency-selector.d.ts +93 -0
  11. package/dist/stripe-js/elements/express-checkout.d.mts +3 -0
  12. package/dist/stripe-js/elements/express-checkout.d.ts +3 -0
  13. package/dist/stripe-js/elements/index.d.mts +1 -0
  14. package/dist/stripe-js/elements/index.d.ts +1 -0
  15. package/dist/stripe-js/elements/payment.d.mts +136 -0
  16. package/dist/stripe-js/elements/payment.d.ts +136 -0
  17. package/dist/stripe-js/elements-group.d.mts +37 -7
  18. package/dist/stripe-js/elements-group.d.ts +37 -7
  19. package/dist/stripe-js/embedded-checkout.d.mts +30 -0
  20. package/dist/stripe-js/embedded-checkout.d.ts +30 -0
  21. package/dist/stripe-js/hosted-checkout.d.mts +153 -0
  22. package/dist/stripe-js/hosted-checkout.d.ts +153 -0
  23. package/dist/stripe-js/index.d.mts +1 -1
  24. package/dist/stripe-js/index.d.ts +1 -1
  25. package/dist/stripe-js/payment-intents.d.mts +79 -3
  26. package/dist/stripe-js/payment-intents.d.ts +79 -3
  27. package/dist/stripe-js/setup-intents.d.mts +0 -3
  28. package/dist/stripe-js/setup-intents.d.ts +0 -3
  29. package/dist/stripe-js/stripe.d.mts +38 -8
  30. package/dist/stripe-js/stripe.d.ts +38 -8
  31. package/package.json +1 -1
  32. package/dist/stripe-js/custom-checkout.d.mts +0 -437
  33. package/dist/stripe-js/custom-checkout.d.ts +0 -437
@@ -269,6 +269,21 @@ export interface CreatePaymentMethodMobilepayData
269
269
  type: 'mobilepay';
270
270
  }
271
271
 
272
+ export interface CreatePaymentMethodMultibancoData
273
+ extends PaymentMethodCreateParams {
274
+ type: 'multibanco';
275
+
276
+ /**
277
+ * The customer's billing details.
278
+ * `email` is required.
279
+ *
280
+ * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details
281
+ */
282
+ billing_details: PaymentMethodCreateParams.BillingDetails & {
283
+ email: string;
284
+ };
285
+ }
286
+
272
287
  export interface CreatePaymentMethodOxxoData extends PaymentMethodCreateParams {
273
288
  type: 'oxxo';
274
289
 
@@ -370,6 +385,11 @@ export interface CreatePaymentMethodSofortData
370
385
  billing_details?: PaymentMethodCreateParams.BillingDetails;
371
386
  }
372
387
 
388
+ export interface CreatePaymentMethodTwintData
389
+ extends PaymentMethodCreateParams {
390
+ type: 'twint';
391
+ }
392
+
373
393
  export interface CreatePaymentMethodAuBecsDebitData
374
394
  extends PaymentMethodCreateParams {
375
395
  /**
@@ -1076,6 +1096,36 @@ export interface ConfirmMobilepayPaymentOptions {
1076
1096
  handleActions?: boolean;
1077
1097
  }
1078
1098
 
1099
+ /**
1100
+ * Data to be sent with a `stripe.confirmMultibancoPayment` request.
1101
+ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
1102
+ */
1103
+ export interface ConfirmMultibancoPaymentData
1104
+ extends PaymentIntentConfirmParams {
1105
+ /**
1106
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
1107
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
1108
+ *
1109
+ * @recommended
1110
+ */
1111
+ payment_method?: string | Omit<CreatePaymentMethodMultibancoData, 'type'>;
1112
+
1113
+ /**
1114
+ * The url your customer will be directed to after they complete authentication.
1115
+ *
1116
+ * @recommended
1117
+ */
1118
+ return_url?: string;
1119
+ }
1120
+
1121
+ export interface ConfirmMultibancoPaymentOptions {
1122
+ /**
1123
+ * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/sofort/accept-a-payment?platform=web#handle-redirect).
1124
+ * Default is `true`.
1125
+ */
1126
+ handleActions?: boolean;
1127
+ }
1128
+
1079
1129
  /**
1080
1130
  * Data to be sent with a `stripe.confirmOxxoPayment` request.
1081
1131
  * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
@@ -1278,6 +1328,35 @@ export interface ConfirmSofortPaymentOptions {
1278
1328
  handleActions?: boolean;
1279
1329
  }
1280
1330
 
1331
+ /**
1332
+ * Data to be sent with a `stripe.confirmTwintPayment` request.
1333
+ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
1334
+ */
1335
+ export interface ConfirmTwintPaymentData extends PaymentIntentConfirmParams {
1336
+ /**
1337
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
1338
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
1339
+ *
1340
+ * @recommended
1341
+ */
1342
+ payment_method?: string | Omit<CreatePaymentMethodTwintData, 'type'>;
1343
+
1344
+ /**
1345
+ * The url your customer will be directed to after they complete authentication.
1346
+ *
1347
+ * @recommended
1348
+ */
1349
+ return_url?: string;
1350
+ }
1351
+
1352
+ export interface ConfirmTwintPaymentOptions {
1353
+ /**
1354
+ * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/sofort/accept-a-payment?platform=web#handle-redirect).
1355
+ * Default is `true`.
1356
+ */
1357
+ handleActions?: boolean;
1358
+ }
1359
+
1281
1360
  /**
1282
1361
  * Data to be sent with a `stripe.confirmWechatPayPayment` request.
1283
1362
  * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
@@ -1460,9 +1539,6 @@ export interface ConfirmPaymentData extends PaymentIntentConfirmParams {
1460
1539
  billing_details?: PaymentMethodCreateParams.BillingDetails;
1461
1540
 
1462
1541
  /**
1463
- * Requires beta access:
1464
- * Contact [Stripe support](https://support.stripe.com/) for more information.
1465
- *
1466
1542
  * Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature
1467
1543
  */
1468
1544
  allow_redisplay?: 'always' | 'limited' | 'unspecified';
@@ -42,9 +42,6 @@ export interface ConfirmSetupData extends SetupIntentConfirmParams {
42
42
  billing_details?: PaymentMethodCreateParams.BillingDetails;
43
43
 
44
44
  /**
45
- * Requires beta access:
46
- * Contact [Stripe support](https://support.stripe.com/) for more information.
47
- *
48
45
  * Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature
49
46
  */
50
47
  allow_redisplay?: 'always' | 'limited' | 'unspecified';
@@ -42,9 +42,6 @@ export interface ConfirmSetupData extends SetupIntentConfirmParams {
42
42
  billing_details?: PaymentMethodCreateParams.BillingDetails;
43
43
 
44
44
  /**
45
- * Requires beta access:
46
- * Contact [Stripe support](https://support.stripe.com/) for more information.
47
- *
48
45
  * Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature
49
46
  */
50
47
  allow_redisplay?: 'always' | 'limited' | 'unspecified';
@@ -13,13 +13,10 @@ import {
13
13
  StripeElementsOptionsClientSecret,
14
14
  StripeElementsOptionsMode,
15
15
  } from './elements-group';
16
- import {CheckoutLocale, RedirectToCheckoutOptions} from './checkout';
16
+ import {CheckoutLocale, RedirectToCheckoutOptions} from './hosted-checkout';
17
17
  import {PaymentRequestOptions, PaymentRequest} from './payment-request';
18
18
  import {StripeElement, StripeElementLocale} from './elements-group';
19
- import {
20
- StripeCustomCheckoutOptions,
21
- StripeCustomCheckout,
22
- } from './custom-checkout';
19
+ import {StripeCheckoutOptions, StripeCheckout} from './checkout';
23
20
  import {
24
21
  StripeEmbeddedCheckoutOptions,
25
22
  StripeEmbeddedCheckout,
@@ -437,6 +434,24 @@ export interface Stripe {
437
434
  options?: paymentIntents.ConfirmMobilepayPaymentOptions
438
435
  ): Promise<PaymentIntentResult>;
439
436
 
437
+ /**
438
+ * Use `stripe.confirmMultibancoPayment` in the [Multibanco Payment](https://stripe.com/docs/payments/multibanco) with Payment Methods flow when the customer submits your payment form.
439
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
440
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
441
+ * Refer to our [integration guide](https://stripe.com/docs/payments/multibanco) for more details.
442
+ *
443
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
444
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
445
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
446
+ *
447
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_multibanco_payment
448
+ */
449
+ confirmMultibancoPayment(
450
+ clientSecret: string,
451
+ data?: paymentIntents.ConfirmMultibancoPaymentData,
452
+ options?: paymentIntents.ConfirmMultibancoPaymentOptions
453
+ ): Promise<PaymentIntentResult>;
454
+
440
455
  /**
441
456
  * Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form.
442
457
  * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
@@ -579,6 +594,23 @@ export interface Stripe {
579
594
  options?: paymentIntents.ConfirmSofortPaymentOptions
580
595
  ): Promise<PaymentIntentResult>;
581
596
 
597
+ /**
598
+ * Use `stripe.confirmTwintPayment` in the [TWINT Payments with Payment Methods](https://stripe.com/docs/payments/twint) flow when the customer submits your payment form.
599
+ * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
600
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
601
+ *
602
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
603
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
604
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
605
+ *
606
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_twint_payment
607
+ */
608
+ confirmTwintPayment(
609
+ clientSecret: string,
610
+ data?: paymentIntents.ConfirmTwintPaymentData,
611
+ options?: paymentIntents.ConfirmTwintPaymentOptions
612
+ ): Promise<PaymentIntentResult>;
613
+
582
614
  /**
583
615
  * Requires beta access:
584
616
  * Contact [Stripe support](https://support.stripe.com/) for more information.
@@ -1233,9 +1265,7 @@ export interface Stripe {
1233
1265
  * Requires beta access:
1234
1266
  * Contact [Stripe support](https://support.stripe.com/) for more information.
1235
1267
  */
1236
- initCustomCheckout(
1237
- options: StripeCustomCheckoutOptions
1238
- ): Promise<StripeCustomCheckout>;
1268
+ initCheckout(options: StripeCheckoutOptions): Promise<StripeCheckout>;
1239
1269
 
1240
1270
  /**
1241
1271
  * Use `stripe.initEmbeddedCheckout` to initialize an embedded Checkout instance
@@ -13,13 +13,10 @@ import {
13
13
  StripeElementsOptionsClientSecret,
14
14
  StripeElementsOptionsMode,
15
15
  } from './elements-group';
16
- import {CheckoutLocale, RedirectToCheckoutOptions} from './checkout';
16
+ import {CheckoutLocale, RedirectToCheckoutOptions} from './hosted-checkout';
17
17
  import {PaymentRequestOptions, PaymentRequest} from './payment-request';
18
18
  import {StripeElement, StripeElementLocale} from './elements-group';
19
- import {
20
- StripeCustomCheckoutOptions,
21
- StripeCustomCheckout,
22
- } from './custom-checkout';
19
+ import {StripeCheckoutOptions, StripeCheckout} from './checkout';
23
20
  import {
24
21
  StripeEmbeddedCheckoutOptions,
25
22
  StripeEmbeddedCheckout,
@@ -437,6 +434,24 @@ export interface Stripe {
437
434
  options?: paymentIntents.ConfirmMobilepayPaymentOptions
438
435
  ): Promise<PaymentIntentResult>;
439
436
 
437
+ /**
438
+ * Use `stripe.confirmMultibancoPayment` in the [Multibanco Payment](https://stripe.com/docs/payments/multibanco) with Payment Methods flow when the customer submits your payment form.
439
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
440
+ * Note that there are some additional requirements to this flow that are not covered in this reference.
441
+ * Refer to our [integration guide](https://stripe.com/docs/payments/multibanco) for more details.
442
+ *
443
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
444
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
445
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
446
+ *
447
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_multibanco_payment
448
+ */
449
+ confirmMultibancoPayment(
450
+ clientSecret: string,
451
+ data?: paymentIntents.ConfirmMultibancoPaymentData,
452
+ options?: paymentIntents.ConfirmMultibancoPaymentOptions
453
+ ): Promise<PaymentIntentResult>;
454
+
440
455
  /**
441
456
  * Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form.
442
457
  * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
@@ -579,6 +594,23 @@ export interface Stripe {
579
594
  options?: paymentIntents.ConfirmSofortPaymentOptions
580
595
  ): Promise<PaymentIntentResult>;
581
596
 
597
+ /**
598
+ * Use `stripe.confirmTwintPayment` in the [TWINT Payments with Payment Methods](https://stripe.com/docs/payments/twint) flow when the customer submits your payment form.
599
+ * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
600
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
601
+ *
602
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
603
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you.
604
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
605
+ *
606
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_twint_payment
607
+ */
608
+ confirmTwintPayment(
609
+ clientSecret: string,
610
+ data?: paymentIntents.ConfirmTwintPaymentData,
611
+ options?: paymentIntents.ConfirmTwintPaymentOptions
612
+ ): Promise<PaymentIntentResult>;
613
+
582
614
  /**
583
615
  * Requires beta access:
584
616
  * Contact [Stripe support](https://support.stripe.com/) for more information.
@@ -1233,9 +1265,7 @@ export interface Stripe {
1233
1265
  * Requires beta access:
1234
1266
  * Contact [Stripe support](https://support.stripe.com/) for more information.
1235
1267
  */
1236
- initCustomCheckout(
1237
- options: StripeCustomCheckoutOptions
1238
- ): Promise<StripeCustomCheckout>;
1268
+ initCheckout(options: StripeCheckoutOptions): Promise<StripeCheckout>;
1239
1269
 
1240
1270
  /**
1241
1271
  * Use `stripe.initEmbeddedCheckout` to initialize an embedded Checkout instance
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "4.10.0",
3
+ "version": "5.0.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",