Added customers.ICustomerListOptions to accurately implement stripe-node (#27517)

This commit is contained in:
Troy Zarger 2018-07-24 13:15:22 -04:00 committed by Andy
parent 211986a530
commit 171ff2c377
2 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for stripe 5.0
// Type definitions for stripe 5.0.19
// Project: https://github.com/stripe/stripe-node/
// Definitions by: William Johnston <https://github.com/wjohnsto>
// Peter Harris <https://github.com/codeanimal>
@ -11,6 +11,7 @@
// Gal Talmor <https://github.com/galtalmor>
// Hunter Tunnicliff <https://github.com/htunnicliff>
// Tyler Jones <https://github.com/squirly>
// Troy Zarger <https://github.com/tzarger>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@ -1469,6 +1470,13 @@ declare namespace Stripe {
source?: sources.ISourceCreationOptionsExtended;
}
interface ICustomerListOptions extends IListOptionsCreated {
/**
* A filter on the list based on the customers email field. The value must be a string.
*/
email?: string;
}
interface ICustomerSourceCreationOptions extends IDataOptionsWithMetadata {
/**
* When adding a card to a customer, the parameter name is source. When
@ -5855,8 +5863,8 @@ declare namespace Stripe {
*
* @param data Allows you to filter the customers you want.
*/
list(data: IListOptionsCreated, options: HeaderOptions, response?: IResponseFn<IList<customers.ICustomer>>): Promise<IList<customers.ICustomer>>;
list(data: IListOptionsCreated, response?: IResponseFn<IList<customers.ICustomer>>): Promise<IList<customers.ICustomer>>;
list(data: customers.ICustomerListOptions, options: HeaderOptions, response?: IResponseFn<IList<customers.ICustomer>>): Promise<IList<customers.ICustomer>>;
list(data: customers.ICustomerListOptions, response?: IResponseFn<IList<customers.ICustomer>>): Promise<IList<customers.ICustomer>>;
list(options: HeaderOptions, response?: IResponseFn<IList<customers.ICustomer>>): Promise<IList<customers.ICustomer>>;
list(response?: IResponseFn<IList<customers.ICustomer>>): Promise<IList<customers.ICustomer>>;

View File

@ -364,6 +364,10 @@ stripe.customers.list({ limit: 3 }).then(function (customers) {
// asynchronously called
});
stripe.customers.list({ email: "test@example.com" }).then(function (customers) {
// asynchronously called
});
stripe.customers.createCard(
"cus_5rfJKDJkuxzh5Q",
{ card: "tok_15V2YhEe31JkLCeQy9iUgsJX" },