stripe 8.194.0 → 8.198.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/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 8.198.0 - 2022-01-19
4
+ * [#1331](https://github.com/stripe/stripe-node/pull/1331) API Updates
5
+ * Change type of `Charge.status` from `string` to `enum('failed'|'pending'|'succeeded')`
6
+ * Add support for `bacs_debit` and `eps` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
7
+ * Add support for `image_url_png` and `image_url_svg` on `PaymentIntent.next_action.wechat_pay_display_qr_code`
8
+
9
+ ## 8.197.0 - 2022-01-13
10
+ * [#1329](https://github.com/stripe/stripe-node/pull/1329) API Updates
11
+ * Add support for `paid_out_of_band` on `Invoice`
12
+
13
+ ## 8.196.0 - 2022-01-12
14
+ * [#1328](https://github.com/stripe/stripe-node/pull/1328) API Updates
15
+ * Add support for `customer_creation` on `CheckoutSessionCreateParams` and `Checkout.Session`
16
+ * Add support for `fpx` and `grabpay` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
17
+ * [#1315](https://github.com/stripe/stripe-node/pull/1315) API Updates
18
+ * Add support for `mandate_options` on `SubscriptionCreateParams.payment_settings.payment_method_options.card`, `SubscriptionUpdateParams.payment_settings.payment_method_options.card`, and `Subscription.payment_settings.payment_method_options.card`
19
+ * [#1327](https://github.com/stripe/stripe-node/pull/1327) Remove DOM type references.
20
+ * [#1325](https://github.com/stripe/stripe-node/pull/1325) Add comment documenting makeRequest#headers type.
21
+
22
+ ## 8.195.0 - 2021-12-22
23
+ * [#1314](https://github.com/stripe/stripe-node/pull/1314) API Updates
24
+ * Add support for `au_becs_debit` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
25
+ * Change type of `PaymentIntent.processing.type` from `string` to `literal('card')`. This is not considered a breaking change as the field was added in the same release.
26
+ * [#1313](https://github.com/stripe/stripe-node/pull/1313) API Updates
27
+ * Add support for new values `en-FR`, `es-US`, and `fr-FR` on enums `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`
28
+ * Add support for `boleto` on `SetupAttempt.payment_method_details`
29
+
30
+ * [#1312](https://github.com/stripe/stripe-node/pull/1312) API Updates
31
+ * Add support for `processing` on `PaymentIntent`
32
+
3
33
  ## 8.194.0 - 2021-12-15
4
34
  * [#1309](https://github.com/stripe/stripe-node/pull/1309) API Updates
5
35
  * Add support for new resource `PaymentIntentTypeSpecificPaymentMethodOptionsClient`
package/VERSION CHANGED
@@ -1 +1 @@
1
- 8.194.0
1
+ 8.198.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "8.194.0",
3
+ "version": "8.198.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -442,7 +442,7 @@ declare module 'stripe' {
442
442
 
443
443
  interface Product {
444
444
  /**
445
- * The list of prices IDs that a subscription can be updated to.
445
+ * The list of price IDs for the product that a subscription can be updated to.
446
446
  */
447
447
  prices: Array<string>;
448
448
 
@@ -678,7 +678,7 @@ declare module 'stripe' {
678
678
 
679
679
  interface Product {
680
680
  /**
681
- * The list of prices IDs that a subscription can be updated to.
681
+ * The list of price IDs for the product that a subscription can be updated to.
682
682
  */
683
683
  prices: Array<string>;
684
684
 
@@ -230,7 +230,7 @@ declare module 'stripe' {
230
230
  /**
231
231
  * The status of the payment is either `succeeded`, `pending`, or `failed`.
232
232
  */
233
- status: string;
233
+ status: Charge.Status;
234
234
 
235
235
  /**
236
236
  * ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter).
@@ -1419,7 +1419,7 @@ declare module 'stripe' {
1419
1419
 
1420
1420
  /**
1421
1421
  * Preferred language of the Klarna authorization page that the customer is redirected to.
1422
- * Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `fr-FR`, or `en-FR`
1422
+ * Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, or `en-FR`
1423
1423
  */
1424
1424
  preferred_locale: string | null;
1425
1425
  }
@@ -1641,6 +1641,8 @@ declare module 'stripe' {
1641
1641
  tracking_number?: string | null;
1642
1642
  }
1643
1643
 
1644
+ type Status = 'failed' | 'pending' | 'succeeded';
1645
+
1644
1646
  interface TransferData {
1645
1647
  /**
1646
1648
  * The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account.
@@ -81,6 +81,11 @@ declare module 'stripe' {
81
81
  */
82
82
  customer: string | Stripe.Customer | Stripe.DeletedCustomer | null;
83
83
 
84
+ /**
85
+ * Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
86
+ */
87
+ customer_creation: Session.CustomerCreation | null;
88
+
84
89
  /**
85
90
  * The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in `payment` or `subscription` mode.
86
91
  */
@@ -289,6 +294,8 @@ declare module 'stripe' {
289
294
  promotions: 'auto' | null;
290
295
  }
291
296
 
297
+ type CustomerCreation = 'always' | 'if_required';
298
+
292
299
  interface CustomerDetails {
293
300
  /**
294
301
  * The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry.
@@ -914,7 +921,7 @@ declare module 'stripe' {
914
921
  * ID of an existing Customer, if one exists. In `payment` mode, the customer's most recent card
915
922
  * payment method will be used to prefill the email, name, card details, and billing address
916
923
  * on the Checkout page. In `subscription` mode, the customer's [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method)
917
- * will be used if it's a card, and otherwise the most recent card will be used. A valid billing address is required for Checkout to prefill the customer's card details.
924
+ * will be used if it's a card, and otherwise the most recent card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details.
918
925
  *
919
926
  * If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout.
920
927
  * If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer.
@@ -925,6 +932,18 @@ declare module 'stripe' {
925
932
  */
926
933
  customer?: string;
927
934
 
935
+ /**
936
+ * Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation.
937
+ *
938
+ * When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout
939
+ * with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details).
940
+ *
941
+ * Sessions that do not create Customers will instead create [Guest Customers](https://support.stripe.com/questions/guest-customer-faq) in the Dashboard.
942
+ *
943
+ * Can only be set in `payment` and `setup` mode.
944
+ */
945
+ customer_creation?: SessionCreateParams.CustomerCreation;
946
+
928
947
  /**
929
948
  * If provided, this value will be used when the Customer object is created.
930
949
  * If not provided, customers will be asked to enter their email address.
@@ -1089,6 +1108,8 @@ declare module 'stripe' {
1089
1108
  promotions?: 'auto';
1090
1109
  }
1091
1110
 
1111
+ type CustomerCreation = 'always' | 'if_required';
1112
+
1092
1113
  interface CustomerUpdate {
1093
1114
  /**
1094
1115
  * Describes whether Checkout saves the billing address onto `customer.address`.
@@ -1383,9 +1404,12 @@ declare module 'stripe' {
1383
1404
  * customer that their payment details will be saved and used for future
1384
1405
  * payments.
1385
1406
  *
1386
- * For both values, Checkout will attach the payment method to either the
1387
- * provided Customer for the session, or a new Customer created by Checkout
1388
- * if one has not been provided.
1407
+ * If a Customer has been provided or Checkout creates a new Customer,
1408
+ * Checkout will attach the payment method to the Customer.
1409
+ *
1410
+ * If Checkout does not create a Customer, the payment method is not attached
1411
+ * to a Customer. To reuse the payment method, you can retrieve it from the
1412
+ * Checkout Session's PaymentIntent.
1389
1413
  *
1390
1414
  * When processing card payments, Checkout also uses `setup_future_usage`
1391
1415
  * to dynamically optimize your payment flow and comply with regional
@@ -183,7 +183,7 @@ declare module 'stripe' {
183
183
  customer_details?: InvoiceLineItemListUpcomingParams.CustomerDetails;
184
184
 
185
185
  /**
186
- * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead.
186
+ * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead.
187
187
  */
188
188
  discounts?: Stripe.Emptyable<
189
189
  Array<InvoiceLineItemListUpcomingParams.Discount>
@@ -239,6 +239,11 @@ declare module 'stripe' {
239
239
  */
240
240
  paid: boolean;
241
241
 
242
+ /**
243
+ * Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
244
+ */
245
+ paid_out_of_band: boolean;
246
+
242
247
  /**
243
248
  * The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent.
244
249
  */
@@ -1341,7 +1346,7 @@ declare module 'stripe' {
1341
1346
 
1342
1347
  interface InvoiceFinalizeInvoiceParams {
1343
1348
  /**
1344
- * Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/billing/invoices/overview#auto-advance) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action.
1349
+ * Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/invoicing/automatic-charging) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action.
1345
1350
  */
1346
1351
  auto_advance?: boolean;
1347
1352
 
@@ -1414,7 +1419,7 @@ declare module 'stripe' {
1414
1419
  customer_details?: InvoiceRetrieveUpcomingParams.CustomerDetails;
1415
1420
 
1416
1421
  /**
1417
- * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead.
1422
+ * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead.
1418
1423
  */
1419
1424
  discounts?: Stripe.Emptyable<
1420
1425
  Array<InvoiceRetrieveUpcomingParams.Discount>
@@ -1109,7 +1109,7 @@ declare module 'stripe' {
1109
1109
  billing: CardholderCreateParams.Billing;
1110
1110
 
1111
1111
  /**
1112
- * The cardholder's name. This will be printed on cards issued to them.
1112
+ * The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters.
1113
1113
  */
1114
1114
  name: string;
1115
1115
 
@@ -146,6 +146,11 @@ declare module 'stripe' {
146
146
  */
147
147
  payment_method_types: Array<string>;
148
148
 
149
+ /**
150
+ * If present, this property tells you about the processing state of the payment.
151
+ */
152
+ processing: PaymentIntent.Processing | null;
153
+
149
154
  /**
150
155
  * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
151
156
  */
@@ -457,6 +462,16 @@ declare module 'stripe' {
457
462
  * The base64 image data for a pre-generated QR code
458
463
  */
459
464
  image_data_url: string;
465
+
466
+ /**
467
+ * The image_url_png string used to render QR code, can be used as <img src="…" />
468
+ */
469
+ image_url_png: string;
470
+
471
+ /**
472
+ * The image_url_svg string used to render QR code, can be used as <img src="…" />
473
+ */
474
+ image_url_svg: string;
460
475
  }
461
476
 
462
477
  interface WechatPayRedirectToAndroidApp {
@@ -511,6 +526,10 @@ declare module 'stripe' {
511
526
 
512
527
  alipay?: PaymentMethodOptions.Alipay;
513
528
 
529
+ au_becs_debit?: PaymentMethodOptions.AuBecsDebit;
530
+
531
+ bacs_debit?: PaymentMethodOptions.BacsDebit;
532
+
514
533
  bancontact?: PaymentMethodOptions.Bancontact;
515
534
 
516
535
  boleto?: PaymentMethodOptions.Boleto;
@@ -519,8 +538,14 @@ declare module 'stripe' {
519
538
 
520
539
  card_present?: PaymentMethodOptions.CardPresent;
521
540
 
541
+ eps?: PaymentMethodOptions.Eps;
542
+
543
+ fpx?: PaymentMethodOptions.Fpx;
544
+
522
545
  giropay?: PaymentMethodOptions.Giropay;
523
546
 
547
+ grabpay?: PaymentMethodOptions.Grabpay;
548
+
524
549
  ideal?: PaymentMethodOptions.Ideal;
525
550
 
526
551
  interac_present?: PaymentMethodOptions.InteracPresent;
@@ -590,6 +615,10 @@ declare module 'stripe' {
590
615
 
591
616
  interface Alipay {}
592
617
 
618
+ interface AuBecsDebit {}
619
+
620
+ interface BacsDebit {}
621
+
593
622
  interface Bancontact {
594
623
  /**
595
624
  * Preferred language of the Bancontact authorization page that the customer is redirected to.
@@ -711,8 +740,14 @@ declare module 'stripe' {
711
740
 
712
741
  interface CardPresent {}
713
742
 
743
+ interface Eps {}
744
+
745
+ interface Fpx {}
746
+
714
747
  interface Giropay {}
715
748
 
749
+ interface Grabpay {}
750
+
716
751
  interface Ideal {}
717
752
 
718
753
  interface InteracPresent {}
@@ -776,6 +811,19 @@ declare module 'stripe' {
776
811
  }
777
812
  }
778
813
 
814
+ interface Processing {
815
+ card?: Processing.Card;
816
+
817
+ /**
818
+ * Type of the payment method for which payment is in `processing` state, one of `card`.
819
+ */
820
+ type: 'card';
821
+ }
822
+
823
+ namespace Processing {
824
+ interface Card {}
825
+ }
826
+
779
827
  type SetupFutureUsage = 'off_session' | 'on_session';
780
828
 
781
829
  interface Shipping {
@@ -1471,6 +1519,16 @@ declare module 'stripe' {
1471
1519
  */
1472
1520
  alipay?: Stripe.Emptyable<PaymentMethodOptions.Alipay>;
1473
1521
 
1522
+ /**
1523
+ * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
1524
+ */
1525
+ au_becs_debit?: Stripe.Emptyable<PaymentMethodOptions.AuBecsDebit>;
1526
+
1527
+ /**
1528
+ * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
1529
+ */
1530
+ bacs_debit?: Stripe.Emptyable<PaymentMethodOptions.BacsDebit>;
1531
+
1474
1532
  /**
1475
1533
  * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
1476
1534
  */
@@ -1491,11 +1549,26 @@ declare module 'stripe' {
1491
1549
  */
1492
1550
  card_present?: Stripe.Emptyable<PaymentMethodOptions.CardPresent>;
1493
1551
 
1552
+ /**
1553
+ * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
1554
+ */
1555
+ eps?: Stripe.Emptyable<PaymentMethodOptions.Eps>;
1556
+
1557
+ /**
1558
+ * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
1559
+ */
1560
+ fpx?: Stripe.Emptyable<PaymentMethodOptions.Fpx>;
1561
+
1494
1562
  /**
1495
1563
  * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
1496
1564
  */
1497
1565
  giropay?: Stripe.Emptyable<PaymentMethodOptions.Giropay>;
1498
1566
 
1567
+ /**
1568
+ * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
1569
+ */
1570
+ grabpay?: Stripe.Emptyable<PaymentMethodOptions.Grabpay>;
1571
+
1499
1572
  /**
1500
1573
  * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
1501
1574
  */
@@ -1594,6 +1667,10 @@ declare module 'stripe' {
1594
1667
 
1595
1668
  interface Alipay {}
1596
1669
 
1670
+ interface AuBecsDebit {}
1671
+
1672
+ interface BacsDebit {}
1673
+
1597
1674
  interface Bancontact {
1598
1675
  /**
1599
1676
  * Preferred language of the Bancontact authorization page that the customer is redirected to.
@@ -1709,8 +1786,14 @@ declare module 'stripe' {
1709
1786
 
1710
1787
  interface CardPresent {}
1711
1788
 
1789
+ interface Eps {}
1790
+
1791
+ interface Fpx {}
1792
+
1712
1793
  interface Giropay {}
1713
1794
 
1795
+ interface Grabpay {}
1796
+
1714
1797
  interface Ideal {}
1715
1798
 
1716
1799
  interface InteracPresent {}
@@ -1733,6 +1816,7 @@ declare module 'stripe' {
1733
1816
  | 'en-DK'
1734
1817
  | 'en-ES'
1735
1818
  | 'en-FI'
1819
+ | 'en-FR'
1736
1820
  | 'en-GB'
1737
1821
  | 'en-IE'
1738
1822
  | 'en-IT'
@@ -1741,8 +1825,10 @@ declare module 'stripe' {
1741
1825
  | 'en-SE'
1742
1826
  | 'en-US'
1743
1827
  | 'es-ES'
1828
+ | 'es-US'
1744
1829
  | 'fi-FI'
1745
1830
  | 'fr-BE'
1831
+ | 'fr-FR'
1746
1832
  | 'it-IT'
1747
1833
  | 'nb-NO'
1748
1834
  | 'nl-BE'
@@ -2412,6 +2498,16 @@ declare module 'stripe' {
2412
2498
  */
2413
2499
  alipay?: Stripe.Emptyable<PaymentMethodOptions.Alipay>;
2414
2500
 
2501
+ /**
2502
+ * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
2503
+ */
2504
+ au_becs_debit?: Stripe.Emptyable<PaymentMethodOptions.AuBecsDebit>;
2505
+
2506
+ /**
2507
+ * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
2508
+ */
2509
+ bacs_debit?: Stripe.Emptyable<PaymentMethodOptions.BacsDebit>;
2510
+
2415
2511
  /**
2416
2512
  * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
2417
2513
  */
@@ -2432,11 +2528,26 @@ declare module 'stripe' {
2432
2528
  */
2433
2529
  card_present?: Stripe.Emptyable<PaymentMethodOptions.CardPresent>;
2434
2530
 
2531
+ /**
2532
+ * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
2533
+ */
2534
+ eps?: Stripe.Emptyable<PaymentMethodOptions.Eps>;
2535
+
2536
+ /**
2537
+ * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
2538
+ */
2539
+ fpx?: Stripe.Emptyable<PaymentMethodOptions.Fpx>;
2540
+
2435
2541
  /**
2436
2542
  * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
2437
2543
  */
2438
2544
  giropay?: Stripe.Emptyable<PaymentMethodOptions.Giropay>;
2439
2545
 
2546
+ /**
2547
+ * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
2548
+ */
2549
+ grabpay?: Stripe.Emptyable<PaymentMethodOptions.Grabpay>;
2550
+
2440
2551
  /**
2441
2552
  * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
2442
2553
  */
@@ -2535,6 +2646,10 @@ declare module 'stripe' {
2535
2646
 
2536
2647
  interface Alipay {}
2537
2648
 
2649
+ interface AuBecsDebit {}
2650
+
2651
+ interface BacsDebit {}
2652
+
2538
2653
  interface Bancontact {
2539
2654
  /**
2540
2655
  * Preferred language of the Bancontact authorization page that the customer is redirected to.
@@ -2650,8 +2765,14 @@ declare module 'stripe' {
2650
2765
 
2651
2766
  interface CardPresent {}
2652
2767
 
2768
+ interface Eps {}
2769
+
2770
+ interface Fpx {}
2771
+
2653
2772
  interface Giropay {}
2654
2773
 
2774
+ interface Grabpay {}
2775
+
2655
2776
  interface Ideal {}
2656
2777
 
2657
2778
  interface InteracPresent {}
@@ -2674,6 +2795,7 @@ declare module 'stripe' {
2674
2795
  | 'en-DK'
2675
2796
  | 'en-ES'
2676
2797
  | 'en-FI'
2798
+ | 'en-FR'
2677
2799
  | 'en-GB'
2678
2800
  | 'en-IE'
2679
2801
  | 'en-IT'
@@ -2682,8 +2804,10 @@ declare module 'stripe' {
2682
2804
  | 'en-SE'
2683
2805
  | 'en-US'
2684
2806
  | 'es-ES'
2807
+ | 'es-US'
2685
2808
  | 'fi-FI'
2686
2809
  | 'fr-BE'
2810
+ | 'fr-FR'
2687
2811
  | 'it-IT'
2688
2812
  | 'nb-NO'
2689
2813
  | 'nl-BE'
@@ -3467,6 +3591,16 @@ declare module 'stripe' {
3467
3591
  */
3468
3592
  alipay?: Stripe.Emptyable<PaymentMethodOptions.Alipay>;
3469
3593
 
3594
+ /**
3595
+ * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options.
3596
+ */
3597
+ au_becs_debit?: Stripe.Emptyable<PaymentMethodOptions.AuBecsDebit>;
3598
+
3599
+ /**
3600
+ * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options.
3601
+ */
3602
+ bacs_debit?: Stripe.Emptyable<PaymentMethodOptions.BacsDebit>;
3603
+
3470
3604
  /**
3471
3605
  * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
3472
3606
  */
@@ -3487,11 +3621,26 @@ declare module 'stripe' {
3487
3621
  */
3488
3622
  card_present?: Stripe.Emptyable<PaymentMethodOptions.CardPresent>;
3489
3623
 
3624
+ /**
3625
+ * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
3626
+ */
3627
+ eps?: Stripe.Emptyable<PaymentMethodOptions.Eps>;
3628
+
3629
+ /**
3630
+ * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
3631
+ */
3632
+ fpx?: Stripe.Emptyable<PaymentMethodOptions.Fpx>;
3633
+
3490
3634
  /**
3491
3635
  * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
3492
3636
  */
3493
3637
  giropay?: Stripe.Emptyable<PaymentMethodOptions.Giropay>;
3494
3638
 
3639
+ /**
3640
+ * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
3641
+ */
3642
+ grabpay?: Stripe.Emptyable<PaymentMethodOptions.Grabpay>;
3643
+
3495
3644
  /**
3496
3645
  * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
3497
3646
  */
@@ -3590,6 +3739,10 @@ declare module 'stripe' {
3590
3739
 
3591
3740
  interface Alipay {}
3592
3741
 
3742
+ interface AuBecsDebit {}
3743
+
3744
+ interface BacsDebit {}
3745
+
3593
3746
  interface Bancontact {
3594
3747
  /**
3595
3748
  * Preferred language of the Bancontact authorization page that the customer is redirected to.
@@ -3705,8 +3858,14 @@ declare module 'stripe' {
3705
3858
 
3706
3859
  interface CardPresent {}
3707
3860
 
3861
+ interface Eps {}
3862
+
3863
+ interface Fpx {}
3864
+
3708
3865
  interface Giropay {}
3709
3866
 
3867
+ interface Grabpay {}
3868
+
3710
3869
  interface Ideal {}
3711
3870
 
3712
3871
  interface InteracPresent {}
@@ -3729,6 +3888,7 @@ declare module 'stripe' {
3729
3888
  | 'en-DK'
3730
3889
  | 'en-ES'
3731
3890
  | 'en-FI'
3891
+ | 'en-FR'
3732
3892
  | 'en-GB'
3733
3893
  | 'en-IE'
3734
3894
  | 'en-IT'
@@ -3737,8 +3897,10 @@ declare module 'stripe' {
3737
3897
  | 'en-SE'
3738
3898
  | 'en-US'
3739
3899
  | 'es-ES'
3900
+ | 'es-US'
3740
3901
  | 'fi-FI'
3741
3902
  | 'fr-BE'
3903
+ | 'fr-FR'
3742
3904
  | 'it-IT'
3743
3905
  | 'nb-NO'
3744
3906
  | 'nl-BE'
@@ -1213,7 +1213,7 @@ declare module 'stripe' {
1213
1213
  type: PaymentMethodListParams.Type;
1214
1214
 
1215
1215
  /**
1216
- * The ID of the customer whose PaymentMethods will be retrieved.
1216
+ * The ID of the customer whose PaymentMethods will be retrieved. If not provided, the response list will be empty.
1217
1217
  */
1218
1218
  customer?: string;
1219
1219
 
@@ -79,6 +79,8 @@ declare module 'stripe' {
79
79
 
80
80
  bancontact?: PaymentMethodDetails.Bancontact;
81
81
 
82
+ boleto?: PaymentMethodDetails.Boleto;
83
+
82
84
  card?: PaymentMethodDetails.Card;
83
85
 
84
86
  card_present?: PaymentMethodDetails.CardPresent;
@@ -150,6 +152,8 @@ declare module 'stripe' {
150
152
  type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl';
151
153
  }
152
154
 
155
+ interface Boleto {}
156
+
153
157
  interface Card {
154
158
  /**
155
159
  * Populated if this authorization used 3D Secure authentication.
@@ -297,6 +297,8 @@ declare module 'stripe' {
297
297
  }
298
298
 
299
299
  interface Card {
300
+ mandate_options?: Card.MandateOptions;
301
+
300
302
  /**
301
303
  * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
302
304
  */
@@ -304,6 +306,27 @@ declare module 'stripe' {
304
306
  }
305
307
 
306
308
  namespace Card {
309
+ interface MandateOptions {
310
+ /**
311
+ * Amount to be charged for future payments.
312
+ */
313
+ amount: number | null;
314
+
315
+ /**
316
+ * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
317
+ */
318
+ amount_type: MandateOptions.AmountType | null;
319
+
320
+ /**
321
+ * A description of the mandate or subscription that is meant to be displayed to the customer.
322
+ */
323
+ description: string | null;
324
+ }
325
+
326
+ namespace MandateOptions {
327
+ type AmountType = 'fixed' | 'maximum';
328
+ }
329
+
307
330
  type RequestThreeDSecure = 'any' | 'automatic';
308
331
  }
309
332
  }
@@ -798,6 +821,11 @@ declare module 'stripe' {
798
821
  }
799
822
 
800
823
  interface Card {
824
+ /**
825
+ * Configuration options for setting up an eMandate for cards issued in India.
826
+ */
827
+ mandate_options?: Card.MandateOptions;
828
+
801
829
  /**
802
830
  * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
803
831
  */
@@ -805,6 +833,27 @@ declare module 'stripe' {
805
833
  }
806
834
 
807
835
  namespace Card {
836
+ interface MandateOptions {
837
+ /**
838
+ * Amount to be charged for future payments.
839
+ */
840
+ amount?: number;
841
+
842
+ /**
843
+ * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
844
+ */
845
+ amount_type?: MandateOptions.AmountType;
846
+
847
+ /**
848
+ * A description of the mandate or subscription that is meant to be displayed to the customer.
849
+ */
850
+ description?: string;
851
+ }
852
+
853
+ namespace MandateOptions {
854
+ type AmountType = 'fixed' | 'maximum';
855
+ }
856
+
808
857
  type RequestThreeDSecure = 'any' | 'automatic';
809
858
  }
810
859
  }
@@ -1304,6 +1353,11 @@ declare module 'stripe' {
1304
1353
  }
1305
1354
 
1306
1355
  interface Card {
1356
+ /**
1357
+ * Configuration options for setting up an eMandate for cards issued in India.
1358
+ */
1359
+ mandate_options?: Card.MandateOptions;
1360
+
1307
1361
  /**
1308
1362
  * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
1309
1363
  */
@@ -1311,6 +1365,27 @@ declare module 'stripe' {
1311
1365
  }
1312
1366
 
1313
1367
  namespace Card {
1368
+ interface MandateOptions {
1369
+ /**
1370
+ * Amount to be charged for future payments.
1371
+ */
1372
+ amount?: number;
1373
+
1374
+ /**
1375
+ * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
1376
+ */
1377
+ amount_type?: MandateOptions.AmountType;
1378
+
1379
+ /**
1380
+ * A description of the mandate or subscription that is meant to be displayed to the customer.
1381
+ */
1382
+ description?: string;
1383
+ }
1384
+
1385
+ namespace MandateOptions {
1386
+ type AmountType = 'fixed' | 'maximum';
1387
+ }
1388
+
1314
1389
  type RequestThreeDSecure = 'any' | 'automatic';
1315
1390
  }
1316
1391
  }
@@ -47,7 +47,13 @@ declare module 'stripe' {
47
47
  * defaults to the `crypto.subtle` object in the global scope.
48
48
  */
49
49
  export const createSubtleCryptoProvider: (
50
- subtleCrypto?: WindowOrWorkerGlobalScope['crypto']['subtle']
50
+ /**
51
+ * The SubtleCrypto type cannot be specified without pulling in DOM types.
52
+ * This corresponds to WindowOrWorkerGlobalScope['crypto']['subtle'] for
53
+ * applications which pull in DOM types.
54
+ */
55
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
+ subtleCrypto?: any
51
57
  ) => CryptoProvider;
52
58
  }
53
59
  }
@@ -1,5 +1,4 @@
1
1
  /// <reference types="node" />
2
- /// <reference lib="dom" />
3
2
 
4
3
  import {IncomingMessage} from 'http';
5
4
  declare module 'stripe' {
@@ -19,6 +18,11 @@ declare module 'stripe' {
19
18
  port: string | number,
20
19
  path: string,
21
20
  method: 'GET' | 'POST' | 'PUT' | 'DELETE',
21
+ // object is used here as this is implementation-specific. This is
22
+ // generally {[key: string]: string}, but various underlying clients
23
+ // support other types as well. As examples:
24
+ // - Node supports {[key: string]: string | number | string[]}.
25
+ // - Fetch supports a Headers object.
22
26
  headers: object,
23
27
  requestData: string | null,
24
28
  protocol: Stripe.HttpProtocol,
@@ -71,11 +75,24 @@ declare module 'stripe' {
71
75
  * passed, will default to the default `fetch` function in the global scope.
72
76
  */
73
77
  export const createFetchHttpClient: (
74
- fetchFn?: WindowOrWorkerGlobalScope['fetch']
78
+ /** When specified, interface should match the Web Fetch API function. */
79
+ fetchFn?: Function
75
80
  ) => HttpClient<
76
81
  HttpClientResponse<
77
- ReturnType<WindowOrWorkerGlobalScope['fetch']>,
78
- ReadableStream<Uint8Array>
82
+ /**
83
+ * The response type cannot be specified without pulling in DOM types.
84
+ * This corresponds to ReturnType<WindowOrWorkerGlobalScope['fetch']>
85
+ * for applications which pull in DOM types.
86
+ */
87
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
+ any,
89
+ /**
90
+ * The stream type cannot be specified without pulling in DOM types.
91
+ * This corresponds to ReadableStream<Uint8Array> for applications which
92
+ * pull in DOM types.
93
+ */
94
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
+ any
79
96
  >
80
97
  >;
81
98
  }
@@ -228,7 +228,7 @@ async (): Promise<void> => {
228
228
 
229
229
  // Test FetchHttpClient request processing.
230
230
  async (): Promise<void> => {
231
- const client = Stripe.createFetchHttpClient(window.fetch);
231
+ const client = Stripe.createFetchHttpClient();
232
232
 
233
233
  const response = await client.makeRequest(
234
234
  'api.stripe.com',
@@ -244,7 +244,7 @@ async (): Promise<void> => {
244
244
  80000
245
245
  );
246
246
 
247
- const stream: ReadableStream = response.toStream(() => {
247
+ const stream = response.toStream(() => {
248
248
  return;
249
249
  });
250
250