From 1ce8992a9a4b3a460372798d9d85a0a7529feb13 Mon Sep 17 00:00:00 2001 From: Slava Yultyyev Date: Wed, 26 Dec 2018 17:45:09 -0800 Subject: [PATCH 1/2] [stripe] Update Accounts type definitions: add `createLoginLink()` method. --- types/stripe/index.d.ts | 21 +++++++++++++++++++++ types/stripe/stripe-tests.ts | 14 ++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index dcac6a2e19..fa54894200 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -14,6 +14,7 @@ // Troy Zarger // Ifiok Jr. // Simon Schick +// Slava Yultyyev Schick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -462,6 +463,16 @@ declare namespace Stripe { */ reason: "fraud" | "terms_of_service" | "other" ; } + + interface ILoginLink { + object: "login_link"; + created: number; + + /** + * A single-use login link for an Express account to access their Stripe dashboard. + */ + url: string; + } } namespace applicationFees { @@ -2352,6 +2363,7 @@ declare namespace Stripe { end: number; } } + namespace invoiceItems { interface InvoiceItem extends IResourceObject { /** @@ -5517,6 +5529,14 @@ declare namespace Stripe { */ listExternalAccounts(accId: string, data: accounts.ICardListOptions, options: HeaderOptions, response?: IResponseFn>): Promise>; listExternalAccounts(accId: string, data: accounts.ICardListOptions, response?: IResponseFn>): Promise>; + + /** + * Creates a single-use login link for an Express account to access their Stripe dashboard. + * You may only create login links for Express accounts connected to your platform. + * Returns a login link object if the call succeeded. + */ + createLoginLink(accId: string, response?: IResponseFn): Promise; + createLoginLink(accId: string, redirectUrl?: string, response?: IResponseFn): Promise; } class ApplicationFees extends StripeResource { @@ -7518,6 +7538,7 @@ declare namespace Stripe { */ starting_after?: string; } + interface IListOptionsCreated extends IListOptions { /** * A filter on the list based on the object created field. The value can be a string with an integer Unix timestamp, or it can diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 685f29cd77..49f52b7a38 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -725,6 +725,20 @@ stripe.accounts.retrieve("acct_17wV8KBoqMA9o2xk").then( const payouts_enabled: boolean = accounts.payouts_enabled; } ); +stripe.accounts.createLoginLink("acct_17wV8KBoqMA9o2xk").then( + (loginLink) => { + const object: string = loginLink.object; + const created: number = loginLink.created; + const url: string = loginLink.url; + } +); +stripe.accounts.createLoginLink("acct_17wV8KBoqMA9o2xk", "http://localhost:3000").then( + (loginLink) => { + const object: string = loginLink.object; + const created: number = loginLink.created; + const url: string = loginLink.url; + } +); //#endregion //#region Application Fee Refunds tests From 5d32c39e0ae260e75a691a584c08cd1213182497 Mon Sep 17 00:00:00 2001 From: Slava Yultyyev Date: Thu, 27 Dec 2018 16:15:52 -0800 Subject: [PATCH 2/2] [stripe] Update Transfers type definitions --- types/stripe/index.d.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index fa54894200..3f0fe418f4 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -4000,16 +4000,9 @@ declare namespace Stripe { destination?: string; /** - * Only return transfers for the recipient specified by this - * recipient ID. + * Only return transfers with the specified transfer group. */ - recipient?: string; - - /** - * Only return transfers that have the given status: - * pending, paid, failed, in_transit, or canceled. - */ - status: Statuses; + transfer_group?: string | null; } type SourceTypes = "alipay_account" | "bank_account" | "bitcoin_receiver" | "card";