From 5b347bb02c7681890305cfc7e229f156ab45eba2 Mon Sep 17 00:00:00 2001 From: Shmuel Lamm Date: Thu, 5 Sep 2019 14:18:27 -0400 Subject: [PATCH] [@types/stripe] Add 'invoice' as an invoice item list option (#37994) * add invoice and pending as invoice list options * add tests * fix merge conflicts * rename var --- types/stripe/index.d.ts | 5 +++++ types/stripe/stripe-tests.ts | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 69f0eec27a..1298598c53 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -4279,6 +4279,11 @@ declare namespace Stripe { */ customer?: string; + /** + * Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed. + */ + invoice?: string; + /** * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. */ diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index dba624c4bf..e6aac23ec6 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1489,6 +1489,29 @@ stripe.invoices.sendInvoice('in_15fvyXEe31JkLCeQH7QbgZZb').then(invoice => { //#region Invoice Items tests // ################################################################################## +stripe.invoiceItems.list( + { + customer: 'cus_5rfJKDJkuxzh5Q', + invoice: 'in_15fvyXEe31JkLCeQH7QbgZZb', + pending: true, + limit: 3, + }, + (err, invoiceItems) => { + // asynchronously called + } +); + +stripe.invoiceItems + .list({ + customer: 'cus_5rfJKDJkuxzh5Q', + invoice: 'in_15fvyXEe31JkLCeQH7QbgZZb', + pending: true, + limit: 3, + }) + .then(invoiceItems => { + // asynchronously called + }); + //#endregion //#region Payment Intents test