import { IonicNativePlugin } from '@ionic-native/core'; export interface StripeCardTokenParams { /** * Card number */ number: string; /** * Expiry month */ expMonth: number; /** * Expiry year */ expYear: number; /** * CVC / CVV */ cvc?: string; /** * Cardholder name */ name?: string; /** * Address line 1 */ address_line1?: string; /** * Address line 2 */ address_line2?: string; /** * City */ address_city?: string; /** * State / Province */ address_state?: string; /** * Country */ address_country?: string; /** * Postal code / ZIP Code */ postalCode?: string; /** * 3-letter ISO code for currency */ 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; } 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 * A plugin that allows you to use Stripe's Native SDKs for Android and iOS. * * @usage * ```typescript * import { Stripe } from '@ionic-native/stripe/ngx'; * * constructor(private stripe: Stripe) { } * * ... * * this.stripe.setPublishableKey('my_publishable_key'); * * let card = { * number: '4242424242424242', * expMonth: 12, * expYear: 2020, * cvc: '220' * } * * this.stripe.createCardToken(card) * .then(token => console.log(token.id)) * .catch(error => console.error(error)); * * ``` * * @interfaces * StripeCardTokenParams */ export declare class Stripe extends IonicNativePlugin { /** * Set publishable key * @param publishableKey {string} Publishable key * @return {Promise} */ setPublishableKey(publishableKey: string): Promise; /** * Create Credit Card Token * @param params {StripeCardTokenParams} Credit card information * @return {Promise} returns a promise that resolves with the token object, or rejects with an error */ createCardToken(params: StripeCardTokenParams): Promise; /** * 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 */ createBankAccountToken(params: StripeBankAccountParams): Promise; /** * 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 */ validateCardNumber(cardNumber: string): Promise; /** * 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 */ validateCVC(cvc: string): Promise; /** * Validates an expiry date * @param expMonth {string} expiry month (0 - 11) * @param expYear {string} expiry year * @return {Promise} returns a promise that resolves if the date is valid, and rejects if it's invalid */ validateExpiryDate(expMonth: string, expYear: string): Promise; /** * Get a card type from card number * @param cardNumber {string} Card number * @return {Promise} returns a promise that resolves with the credit card type */ getCardType(cardNumber: string): Promise; }