Skip to content

Commit

Permalink
fix(stripe): fix stripe create card token (#2002)
Browse files Browse the repository at this point in the history
fix stripe create card token promise
  • Loading branch information
akshaydwivedi29 authored and ihadeed committed Sep 27, 2017
1 parent c3930c8 commit 5b15bb9
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/@ionic-native/plugins/stripe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,31 @@ export interface StripeBankAccountParams {
account_holder_type?: string;
}

export interface StripeCardTokenRes {
/**
* Card Object.
*/
card: {
brand: string,
exp_month: number,
exp_year: number,
funding: string,
last4: string
};
/**
* Token Request Date Time.
*/
created: string;
/**
* Card Token.
*/
id: string;
/**
* Source Type (card or account).
*/
type: string;
}

/**
* @name Stripe
* @description
Expand All @@ -102,7 +127,7 @@ export interface StripeBankAccountParams {
* };
*
* this.stripe.createCardToken(card)
* .then(token => console.log(token))
* .then(token => console.log(token.id))
* .catch(error => console.error(error));
*
* ```
Expand Down Expand Up @@ -131,10 +156,10 @@ export class Stripe extends IonicNativePlugin {
/**
* Create Credit Card Token
* @param params {StripeCardTokenParams} Credit card information
* @return {Promise<string>} returns a promise that resolves with the token, or rejects with an error
* @return {Promise<StripeCardTokenRes>} returns a promise that resolves with the token object, or rejects with an error
*/
@Cordova()
createCardToken(params: StripeCardTokenParams): Promise<string> { return; }
createCardToken(params: StripeCardTokenParams): Promise<StripeCardTokenRes> { return; }

/**
* Create a bank account token
Expand Down

0 comments on commit 5b15bb9

Please sign in to comment.