UNPKG

1.92 kBTypeScriptView Raw
1export interface StripeCardTokenParams {
2 /**
3 * Card number
4 */
5 number: string;
6 /**
7 * Expiry month
8 */
9 expMonth: number;
10 /**
11 * Expiry year
12 */
13 expYear: number;
14 /**
15 * CVC / CVV
16 */
17 cvc?: string;
18 /**
19 * Cardholder name
20 */
21 name?: string;
22 /**
23 * Address line 1
24 */
25 address_line1?: string;
26 /**
27 * Address line 2
28 */
29 address_line2?: string;
30 /**
31 * City
32 */
33 address_city?: string;
34 /**
35 * State / Province
36 */
37 address_state?: string;
38 /**
39 * Country
40 */
41 address_country?: string;
42 /**
43 * Postal code / ZIP Code
44 */
45 postal_code?: string;
46 /**
47 * 3-letter ISO code for currency
48 */
49 currency?: string;
50}
51/**
52 * @name Stripe
53 * @description
54 * A plugin that allows you to use Stripe's Native SDKs for Android and iOS.
55 *
56 * @usage
57 * ```
58 * import { Stripe } from 'ionic-native';
59 *
60 * Stripe.setPublishableKey('my_publishable_key');
61 *
62 * let card = {
63 * number: '4242424242424242',
64 * expMonth: 12,
65 * expYear: 2020,
66 * cvc: '220'
67 * };
68 *
69 * Stripe.createCardToken(card)
70 * .then(token => console.log(token))
71 * .catch(error => console.error(error));
72 *
73 * ```
74 *
75 * @interfaces
76 * StripeCardTokenParams
77 */
78export declare class Stripe {
79 /**
80 * Set publishable key
81 * @param publishableKey {string} Publishable key
82 * @return {Promise<void>}
83 */
84 static setPublishableKey(publishableKey: string): Promise<void>;
85 /**
86 * Create Credit Card Token
87 * @param params {StripeCardTokenParams} Credit card information
88 * @return {Promise<string>} returns a promise that resolves with the token, or reject with an error
89 */
90 static createCardToken(params: StripeCardTokenParams): Promise<string>;
91}