mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
fix(stripe): fix stripe create card token (#2002)
fix stripe create card token promise
This commit is contained in:
parent
c3930c814a
commit
5b15bb9f46
@ -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
|
||||
@ -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));
|
||||
*
|
||||
* ```
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user