UNPKG

2.28 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name Stripe
11 * @description
12 * A plugin that allows you to use Stripe's Native SDKs for Android and iOS.
13 *
14 * @usage
15 * ```
16 * import { Stripe } from 'ionic-native';
17 *
18 * Stripe.setPublishableKey('my_publishable_key');
19 *
20 * let card = {
21 * number: '4242424242424242',
22 * expMonth: 12,
23 * expYear: 2020,
24 * cvc: '220'
25 * };
26 *
27 * Stripe.createCardToken(card)
28 * .then(token => console.log(token))
29 * .catch(error => console.error(error));
30 *
31 * ```
32 *
33 * @interfaces
34 * StripeCardTokenParams
35 */
36var Stripe = (function () {
37 function Stripe() {
38 }
39 /**
40 * Set publishable key
41 * @param publishableKey {string} Publishable key
42 * @return {Promise<void>}
43 */
44 Stripe.setPublishableKey = function (publishableKey) { return; };
45 /**
46 * Create Credit Card Token
47 * @param params {StripeCardTokenParams} Credit card information
48 * @return {Promise<string>} returns a promise that resolves with the token, or reject with an error
49 */
50 Stripe.createCardToken = function (params) { return; };
51 __decorate([
52 plugin_1.Cordova()
53 ], Stripe, "setPublishableKey", null);
54 __decorate([
55 plugin_1.Cordova()
56 ], Stripe, "createCardToken", null);
57 Stripe = __decorate([
58 plugin_1.Plugin({
59 pluginName: 'Stripe',
60 plugin: 'cordova-plugin-stripe',
61 pluginRef: 'cordova.plugins.stripe',
62 repo: 'https://github.com/zyramedia/cordova-plugin-stripe'
63 })
64 ], Stripe);
65 return Stripe;
66}());
67exports.Stripe = Stripe;
68//# sourceMappingURL=stripe.js.map
\No newline at end of file