mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
[stripe] Add type signature for retrieveUpcoming invoices (#37164)
* Add type signature for data options only * Remove subscription items * Remove subscription items * Update expected * Update contrib
This commit is contained in:
committed by
Jesse Trinity
parent
a7d9a0a0de
commit
353d16e1ce
Vendored
+2
@@ -28,6 +28,7 @@
|
||||
// Dylan Aspden <https://github.com/dhaspden>
|
||||
// Ethan Setnik <https://github.com/esetnik>
|
||||
// Pavel Ivanov <https://github.com/schfkt>
|
||||
// Chris Zieba <https://github.com/ChrisZieba>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -9162,6 +9163,7 @@ declare namespace Stripe {
|
||||
* @param data Filtering options
|
||||
*/
|
||||
retrieveUpcoming(data: invoices.IInvoiceUpcomingOptions, options: HeaderOptions, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
|
||||
retrieveUpcoming(data: invoices.IInvoiceUpcomingOptions, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
|
||||
retrieveUpcoming(id: string, data: invoices.IInvoiceUpcomingOptions, options: HeaderOptions, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
|
||||
retrieveUpcoming(id: string, data: invoices.IInvoiceUpcomingOptions, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
|
||||
retrieveUpcoming(id: string, options: HeaderOptions, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
|
||||
|
||||
@@ -1329,6 +1329,19 @@ stripe.invoices.retrieveUpcoming(
|
||||
stripe.invoices.retrieveUpcoming("cus_5rfJKDJkuxzh5Q").then((upcoming) => {
|
||||
// asynchronously called
|
||||
});
|
||||
stripe.subscriptions.create({ items: [{ plan: 'platypi-dev' }], customer: 'cus_5rfJKDJkuxzh5Q' }).then(subscription => {
|
||||
// asynchronously called
|
||||
|
||||
stripe.invoices
|
||||
.retrieveUpcoming({
|
||||
customer: 'cus_5rfJKDJkuxzh5Q',
|
||||
subscription: subscription.id,
|
||||
})
|
||||
.then(invoices => {
|
||||
invoices; // $ExpectType IInvoice
|
||||
});
|
||||
});
|
||||
|
||||
stripe.invoices.listUpcomingLineItems({ limit: 5 }).then((lines) => {
|
||||
lines; // $ExpectType IList<IInvoiceLineItem>
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user