Add support for new Stripe invoice line item listing (#36740)

This commit is contained in:
Oleg Vaskevich
2019-07-09 16:19:23 -07:00
committed by Armando Aguirre
parent d46a380b47
commit bd4aef3a75
2 changed files with 40 additions and 0 deletions
+34
View File
@@ -3363,6 +3363,8 @@ declare namespace Stripe {
subscription_trial_end?: number;
}
type IInvoiceListLineItemsOptions = IListOptions;
interface IInvoiceUpcomingOptions extends IDataOptions {
/**
* The code of the coupon to apply. If a subscription or subscription_plan is provided, the invoice returned will preview updating
@@ -3417,6 +3419,9 @@ declare namespace Stripe {
subscription_trial_end?: number;
}
// TODO: update once https://stripe.com/docs/api/invoices/upcoming_invoice_lines is fixed.
type IInvoiceListUpcomingLineItemsOptions = IListOptions;
interface IPeriod {
/**
* The period start date
@@ -8542,6 +8547,20 @@ declare namespace Stripe {
retrieveLines(id: string, options: HeaderOptions, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
retrieveLines(id: string, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
/**
* When retrieving an invoice, you'll get a lines property containing the total count of line items and the first
* handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
*
* @returns Returns a list of line_item objects.
*
* @param id The id of the invoice containing the lines to be retrieved
* @param data Filtering options
*/
listLineItems(id: string, data: invoices.IInvoiceListLineItemsOptions, options: HeaderOptions, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
listLineItems(id: string, data: invoices.IInvoiceListLineItemsOptions, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
listLineItems(id: string, options: HeaderOptions, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
listLineItems(id: string, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
/**
* At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending,
* including subscription renewal charges, invoice item charges, etc. It will also show you any discount that is applicable
@@ -8561,6 +8580,21 @@ declare namespace Stripe {
retrieveUpcoming(id: string, options: HeaderOptions, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
retrieveUpcoming(id: string, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
/**
* When retrieving an upcoming invoice, you’ll get a lines property containing the total count of line
* items and the first handful of those items. There is also a URL where you can retrieve the full
* (paginated) list of line items.
*
* @returns Returns a list of line_item objects.
*
* @param id The id of the invoice containing the lines to be retrieved
* @param data Filtering options
*/
listUpcomingLineItems(data: invoices.IInvoiceListUpcomingLineItemsOptions, options: HeaderOptions, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
listUpcomingLineItems(data: invoices.IInvoiceListUpcomingLineItemsOptions, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
listUpcomingLineItems(options: HeaderOptions, response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
listUpcomingLineItems(response?: IResponseFn<IList<invoices.IInvoiceLineItem>>): IListPromise<invoices.IInvoiceLineItem>;
/**
* Until an invoice is paid, it is marked as open (closed=false). If you'd like to stop Stripe from automatically attempting
* payment on an invoice or would simply like to close the invoice out as no longer owed by the customer, you can update the
+6
View File
@@ -1258,6 +1258,9 @@ stripe.invoices.retrieveLines(
stripe.invoices.retrieveLines("in_15fvyXEe31JkLCeQH7QbgZZb", { limit: 5 }).then((lines) => {
// asynchronously called
});
stripe.invoices.listLineItems("in_15fvyXEe31JkLCeQH7QbgZZb", { limit: 5 }).then((lines) => {
lines; // $ExpectType IList<IInvoiceLineItem>
});
stripe.invoices.retrieveUpcoming(
"cus_5rfJKDJkuxzh5Q",
@@ -1279,6 +1282,9 @@ stripe.invoices.retrieveUpcoming(
stripe.invoices.retrieveUpcoming("cus_5rfJKDJkuxzh5Q").then((upcoming) => {
// asynchronously called
});
stripe.invoices.listUpcomingLineItems({ limit: 5 }).then((lines) => {
lines; // $ExpectType IList<IInvoiceLineItem>
});
stripe.invoices.update(
"in_15fvyXEe31JkLCeQH7QbgZZb",