UNPKG

2.44 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 CardIO
11 * @description
12 * @usage
13 * ```
14 * import { CardIO } from 'ionic-native';
15 *
16 *
17 * CardIO.canScan()
18 * .then(
19 * (res: boolean) => {
20 * if(res){
21 * let options = {
22 * requireExpiry: true,
23 * requireCCV: false,
24 * requirePostalCode: false
25 * };
26 * CardIO.scan(options);
27 * }
28 * }
29 * );
30 * ```
31 * @interfaces
32 * CardIOOptions
33 * CardIOResponse
34 */
35var CardIO = (function () {
36 function CardIO() {
37 }
38 /**
39 * Check whether card scanning is currently available. (May vary by
40 * device, OS version, network connectivity, etc.)
41 *
42 * @returns {Promise<boolean>}
43 */
44 CardIO.canScan = function () { return; };
45 /**
46 * Scan a credit card with card.io.
47 * @param {CardIOOptions} options Options for configuring the plugin
48 * @returns {Promise<any>}
49 */
50 CardIO.scan = function (options) { return; };
51 /**
52 * Retrieve the version of the card.io library. Useful when contacting support.
53 * @returns {Promise<string>}
54 */
55 CardIO.version = function () { return; };
56 __decorate([
57 plugin_1.Cordova()
58 ], CardIO, "canScan", null);
59 __decorate([
60 plugin_1.Cordova()
61 ], CardIO, "scan", null);
62 __decorate([
63 plugin_1.Cordova()
64 ], CardIO, "version", null);
65 CardIO = __decorate([
66 plugin_1.Plugin({
67 pluginName: 'CardIO',
68 plugin: 'card.io.cordova.mobilesdk',
69 pluginRef: 'CardIO',
70 repo: 'https://github.com/card-io/card.io-Cordova-Plugin',
71 platforms: ['iOS', 'Android']
72 })
73 ], CardIO);
74 return CardIO;
75}());
76exports.CardIO = CardIO;
77//# sourceMappingURL=card-io.js.map
\No newline at end of file