From 8eb8a46af9eafbf6f5df807ec0d87fc91297c8c7 Mon Sep 17 00:00:00 2001 From: jonbretman Date: Mon, 21 May 2018 08:58:01 +0100 Subject: [PATCH] fix(stripe): listSource should be listSources --- types/stripe/index.d.ts | 14 +++++++------- types/stripe/stripe-tests.ts | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 418525d38f..991d4a618a 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -4460,7 +4460,7 @@ declare namespace Stripe { billing?: SubscriptionBilling; /** - * Number of days a customer has to pay invoices generated by this subscription. + * Number of days a customer has to pay invoices generated by this subscription. * Only valid for subscriptions where billing=send_invoice. */ days_until_due?: number; @@ -5753,8 +5753,8 @@ declare namespace Stripe { * @param customerId The ID of the customer whose cards will be retrieved * @param data Filtering options */ - listSource(customerId: string, data: customers.ICardSourceListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; - listSource(customerId: string, data: customers.ICardSourceListOptions, response?: IResponseFn>): Promise>; + listSources(customerId: string, data: customers.ICardSourceListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; + listSources(customerId: string, data: customers.ICardSourceListOptions, response?: IResponseFn>): Promise>; /** * You can see a list of the bank accounts belonging to a customer or recipient. Note that the 10 most recent * bank accounts are always available by default on the customer or recipient object. If you need more than @@ -5768,8 +5768,8 @@ declare namespace Stripe { * @param customerId The ID of the customer whose cards will be retrieved * @param data Filtering options */ - listSource(customerId: string, data: customers.IBankAccountSourceListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; - listSource(customerId: string, data: customers.IBankAccountSourceListOptions, response?: IResponseFn>): Promise>; + listSources(customerId: string, data: customers.IBankAccountSourceListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; + listSources(customerId: string, data: customers.IBankAccountSourceListOptions, response?: IResponseFn>): Promise>; /** * By default, you can see the 10 most recent cards/bank accounts stored on a customer or recipient directly on the customer or recipient object, but @@ -7104,10 +7104,10 @@ declare namespace Stripe { * Many objects contain the ID of a related object in their response properties. For example, a Charge may have an associated Customer ID. * Those objects can be expanded inline with the expand request parameter. Objects that can be expanded are noted in this documentation. * This parameter is available on all API requests, and applies to the response of that request only. - * + * * You can nest expand requests with the dot property. For example, requesting invoice.customer on a charge will expand the invoice property * into a full Invoice object, and will then expand the customer property on that invoice into a full Customer object. - * + * * You can expand multiple objects at once by identifying multiple items in the expand array. */ expand?: string[]; diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index e56a454108..91cfa0f50c 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -495,6 +495,25 @@ stripe.customers.listCards('cu_15fvyVEe31JkLCeQvr155iqc').then(function (cards) // asynchronously called }); +stripe.customers.listSources('cu_15fvyVEe31JkLCeQvr155iqc', null, function (err, cards) { + // asynchronously called +}); +stripe.customers.listSources('cu_15fvyVEe31JkLCeQvr155iqc', null).then(function (cards) { + // asynchronously called +}); +stripe.customers.listSources('cu_15fvyVEe31JkLCeQvr155iqc', { + object: "card", + limit: 100 +}).then(function (cards) { + // asynchronously called +}); +stripe.customers.listSources('cu_15fvyVEe31JkLCeQvr155iqc', { + object: "bank_account", + limit: 100 +}).then(function (cards) { + // asynchronously called +}); + stripe.customers.retrieveSubscription( "cus_5rfJKDJkuxzh5Q", "sub_5rfJxnBLGSwsYp",