Updated stripe.d.ts

Added bank account methods for managed accounts.
This commit is contained in:
amritk 2015-12-16 15:25:21 -08:00
parent 11322524f8
commit ea67870062

48
stripe/stripe.d.ts vendored
View File

@ -1,6 +1,6 @@
// Type definitions for stripe
// Project: https://stripe.com/
// Definitions by: Andy Hawkins <https://github.com/a904guy/,http://a904guy.com>, Eric J. Smith <https://github.com/ejsmith/>
// Definitions by: Andy Hawkins <https://github.com/a904guy/,http://a904guy.com>, Eric J. Smith <https://github.com/ejsmith/>, Amrit Kahlon <https://github.com/amritk/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface StripeStatic {
@ -11,7 +11,8 @@ interface StripeStatic {
cardType(cardNumber: string): string;
getToken(token: string, responseHandler: (status: number, response: StripeTokenResponse) => void): void;
card: StripeCardData;
createToken(data: StripeTokenData, responseHandler: (status: number, response: StripeTokenResponse) => void): void;
createToken(data: StripeTokenData, responseHandler: (status: number, response: StripeTokenResponse) => void): void;
bankAccount: StripeBankAccount;
}
interface StripeTokenData {
@ -40,7 +41,10 @@ interface StripeTokenResponse {
}
interface StripeError {
type: string;
code: string;
message: string;
param?: string;
}
interface StripeCardData {
@ -60,7 +64,45 @@ interface StripeCardData {
address_country?: string;
}
interface StripeBankAccount
{
createToken(params: StripeBankTokenParams, stripeResponseHandler: (response: StripeBankTokenResponse) => void): void;
validateRoutingNumber(routingNumber: number | string, countryCode: string): boolean;
validateAccountNumber(accountNumber: number | string, countryCode: string): boolean;
}
interface StripeBankTokenParams
{
country: string;
currency: string;
routing_number?: number | string;
account_number?: number | string;
transit_number?: number | string;
institution_number?: number | string;
bsb?: number | string;
sort_code?: string;
iban?: string;
}
interface StripeBankTokenResponse
{
id: string;
bank_account: {
country: string;
bank_name: string;
last4: number;
validated: boolean;
object: string;
};
created: number;
livemode: boolean;
type: string;
object: string;
used: boolean;
error: StripeError;
}
declare var Stripe: StripeStatic;
declare module "Stripe" {
export = StripeStatic;
export = StripeStatic;
}