UNPKG

2.23 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 Alipay
11 * @description
12 * This plugin is used for Alipay APP support. Integrated with the latest SDK.
13 *
14 * Requires Cordova plugin: `cordova-alipay-base`. For more info, please see the [Alipay plugin docs](https://github.com/xueron/cordova-alipay-base).
15 *
16 * @usage
17 * ```
18 * import { Alipay } from 'ionic-native';
19 *
20 * // Should get from server side with sign.
21 * let alipayOrder = {
22 ...
23 * };
24 *
25 * Alipay.pay(alipayOrder)
26 * .then(result => {
27 * console.log(result); // Success
28 * })
29 * .catch(error => {
30 * console.log(error); // Failed
31 * });
32 *
33 * ```
34 *
35 * @interfaces
36 * AlipayOrder
37 */
38var Alipay = (function () {
39 function Alipay() {
40 }
41 /**
42 * Open Alipay to perform App pay
43 * @param order { AlipayOrder } alipay options
44 * @returns {Promise<any>} Returns a Promise that resolves with the success return, or rejects with an error.
45 */
46 Alipay.pay = function (order) { return; };
47 __decorate([
48 plugin_1.Cordova()
49 ], Alipay, "pay", null);
50 Alipay = __decorate([
51 plugin_1.Plugin({
52 pluginName: 'Alipay',
53 plugin: 'cordova-alipay-base',
54 pluginRef: 'Alipay.Base',
55 repo: 'https://github.com/xueron/cordova-alipay-base',
56 platforms: ['Android', 'iOS'],
57 install: 'ionic plugin add https://github.com/xueron/cordova-alipay-base --variable APP_ID=your_app_id'
58 })
59 ], Alipay);
60 return Alipay;
61}());
62exports.Alipay = Alipay;
63//# sourceMappingURL=alipay.js.map
\No newline at end of file