From dd8888c3699ce8f2b3b55f063ffca30db9ac0ec8 Mon Sep 17 00:00:00 2001 From: Ibby Date: Fri, 17 Mar 2017 17:21:55 -0400 Subject: [PATCH] feat(stripe): add new methods --- src/@ionic-native/plugins/stripe/index.ts | 70 ++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/stripe/index.ts b/src/@ionic-native/plugins/stripe/index.ts index 1aec9d420..d90c3b41d 100644 --- a/src/@ionic-native/plugins/stripe/index.ts +++ b/src/@ionic-native/plugins/stripe/index.ts @@ -52,6 +52,33 @@ export interface StripeCardTokenParams { currency?: string; } +export interface StripeBankAccountParams { + /** + * Routing number. + */ + routing_number: string; + /** + * Account number. + */ + account_number: string; + /** + * Currency code. Example: `USD`. + */ + currency: string; + /** + * Country code. Example: `US`. + */ + country: string; + /** + * Account holder name. + */ + account_holder_name?: string; + /** + * Account holder type. This can be `individual` or `company`. + */ + account_holder_type?: string; +} + /** * @name Stripe * @description @@ -103,9 +130,50 @@ export class Stripe { /** * Create Credit Card Token * @param params {StripeCardTokenParams} Credit card information - * @return {Promise} returns a promise that resolves with the token, or reject with an error + * @return {Promise} returns a promise that resolves with the token, or rejects with an error */ @Cordova() createCardToken(params: StripeCardTokenParams): Promise { return; } + /** + * Create a bank account token + * @param params {StripeBankAccountParams} Bank account information + * @return {Promise} returns a promise that resolves with the token, or rejects with an error + */ + @Cordova() + createBankAccountToken(params: StripeBankAccountParams): Promise { return; } + + /** + * Validates a credit card number + * @param cardNumber {string} Credit card number + * @return {Promise} returns a promise that resolves if the number is valid, and rejects if it's invalid + */ + @Cordova() + validateCardNumber(cardNumber: string): Promise { return; } + + /** + * Validates a CVC number + * @param cvc {string} CVC number + * @return {Promise} returns a promise that resolves if the number is valid, and rejects if it's invalid + */ + @Cordova() + validateCVC(cvc: string): Promise { return; } + + /** + * Validates an expiry date + * @param expMonth {string} expiry month + * @param expYear {string} expiry year + * @return {Promise} returns a promise that resolves if the date is valid, and rejects if it's invalid + */ + @Cordova() + validateExpiryDate(expMonth: string, expYear: string): Promise { return; } + + /** + * Get a card type from card number + * @param cardNumber {string} Card number + * @return {Promise} returns a promise that resolves with the credit card type + */ + @Cordova() + getCardType(cardNumber: string): Promise { return; } + }