From 4e717bf915403478ae716b1b6025d2a4428e61af Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Thu, 26 Dec 2019 10:57:29 -0600 Subject: [PATCH] [@types/stripe] Fix IPaymentIntentListOptions (#41204) * Fix IPaymentIntentListOptions Added `customer` field and removed `expired` and `files` fields, per [Stripe API](https://stripe.com/docs/api/payment_intents/list). * Updated stripe-tests.ts Added customer field to test creation, so we can test listing with customer field set. * Fix missing semicolon in index.d.ts --- types/stripe/index.d.ts | 10 +++------- types/stripe/stripe-tests.ts | 6 ++++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 9d70a87805..ba56b9abc5 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -35,6 +35,7 @@ // Aseel Al Dallal // Collin Pham // Timon van Spronsen +// Sean Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -7590,14 +7591,9 @@ declare namespace Stripe { interface IPaymentIntentListOptions extends IListOptionsCreated { /** - * Filter links by their expiration status. By default, all links are returned. + * Only return PaymentIntents for the customer specified by this customer ID. */ - expired?: boolean; - - /** - * Only return links for the given file. - */ - file?: boolean; + customer?: string; } } diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index c505f4ac33..93c3ac9381 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -2091,6 +2091,7 @@ stripe.paymentIntents.create( amount: 2000, currency: 'eur', payment_method_types: ['card', 'ideal', 'sepa_debit'], + customer: 'cus_5rfJKDJkuxzh5Q', }, (err, intent) => {}, ); @@ -2100,6 +2101,7 @@ stripe.paymentIntents amount: 2000, currency: 'eur', payment_method_types: ['card', 'ideal', 'sepa_debit'], + customer: 'cus_5rfJKDJkuxzh5Q', }) .then(intent => {}); @@ -2107,8 +2109,8 @@ stripe.paymentIntents.list({}, (err, intent) => {}); stripe.paymentIntents.list({}).then(intent => {}); stripe.paymentIntents.list((err, intent) => {}); stripe.paymentIntents.list().then(intent => {}); -stripe.paymentIntents.list({ expired: true }, (err, intent) => {}); -stripe.paymentIntents.list({ expired: true }).then(intent => {}); +stripe.paymentIntents.list({ customer: 'cus_5rfJKDJkuxzh5Q' }, (err, intent) => {}); +stripe.paymentIntents.list({ customer: 'cus_5rfJKDJkuxzh5Q' }).then(intent => {}); stripe.paymentIntents.update( 'pi_Aabcxyz01aDfoo',