[@types/stripe] Add external_accounts to IAccount (#36582)

* add external_accounts to IAccountShared

* make external_accounts optional

* use $ExpectType

* remove optionality from $ExpectType
This commit is contained in:
Ethan Setnik
2019-07-08 18:52:47 -04:00
committed by Armando Aguirre
parent 60e431da4a
commit cf7dfa2e4b
2 changed files with 12 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for stripe 6.30
// Type definitions for stripe 6.31
// Project: https://github.com/stripe/stripe-node/
// Definitions by: William Johnston <https://github.com/wjohnsto>
// Peter Harris <https://github.com/codeanimal>
@@ -25,6 +25,7 @@
// Joshua Feltimo <https://github.com/opticalgenesis>
// Josiah <https://github.com/spacetag>
// Oleg Vaskevich <https://github.com/vaskevich>
// Ethan Setnik <https://github.com/esetnik>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -194,6 +195,12 @@ declare namespace Stripe {
* This field is null unless business_type is set to individual.
*/
individual?: IIndividual;
/**
* External accounts (bank accounts and debit cards) currently
* attached to this account
*/
external_accounts?: IList<cards.ICard | bankAccounts.IBankAccount>;
}
interface IAccountCreationOptions extends IAccountUpdateOptions {

View File

@@ -763,8 +763,11 @@ stripe.accounts.retrieve(
);
stripe.accounts.retrieve(
"acct_17wV8KBoqMA9o2xk").then(
(account) => {
account => {
// asynchronously called
// account should have external_accounts property
account.external_accounts; // $ExpectType IList<ICard | IBankAccount>
}
);