@alipay/ams-checkout 0.0.1764233546-dev.0 → 0.0.1764260153-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ams-checkout.js +1 -0
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/component/popupWindow.style.js +3 -2
- package/esm/config/index.d.ts +8 -8
- package/esm/config/index.js +8 -8
- package/esm/constant/auto-debit.d.ts +12 -0
- package/esm/constant/auto-debit.js +15 -0
- package/esm/constant/element.d.ts +26 -0
- package/esm/constant/element.js +30 -0
- package/esm/constant/index.d.ts +3 -0
- package/esm/constant/index.js +3 -0
- package/esm/core/component/element/elementController/index.js +1 -1
- package/esm/core/component/element/elementProcessor/addressProcessor.js +2 -3
- package/esm/core/component/element/elementProcessor/authProcessor.js +2 -3
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +1 -1
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +30 -28
- package/esm/core/component/element/type.d.ts +3 -0
- package/esm/foundation/core/index.js +27 -0
- package/esm/foundation/service/container/index.d.ts +1 -0
- package/esm/foundation/service/container/index.js +33 -2
- package/esm/foundation/utils/web_app_url_utils.d.ts +0 -2
- package/esm/foundation/utils/web_app_url_utils.js +10 -15
- package/esm/index.d.ts +3 -52
- package/esm/index.js +5 -341
- package/esm/loader/Proxy.d.ts +5 -0
- package/esm/loader/Proxy.js +364 -0
- package/esm/loader/constant.d.ts +36 -0
- package/esm/loader/constant.js +36 -0
- package/esm/loader/index.d.ts +20 -0
- package/esm/loader/index.js +23 -0
- package/esm/loader/utils/common.d.ts +13 -0
- package/esm/loader/utils/common.js +63 -0
- package/esm/loader/utils/debugger.d.ts +7 -0
- package/esm/loader/utils/debugger.js +15 -0
- package/esm/loader/utils/loadSDK.d.ts +8 -0
- package/esm/loader/utils/loadSDK.js +92 -0
- package/esm/loader/utils/logger.d.ts +10 -0
- package/esm/loader/utils/logger.js +59 -0
- package/esm/loader/utils/proxyPerformance.d.ts +20 -0
- package/esm/loader/utils/proxyPerformance.js +66 -0
- package/esm/main.d.ts +45 -0
- package/esm/main.js +329 -0
- package/esm/plugin/component/cashierApp.js +7 -4
- package/esm/plugin/component/popupWindow.style.js +4 -3
- package/esm/util/integrationType.d.ts +21 -0
- package/esm/util/integrationType.js +48 -0
- package/esm/util/logger.d.ts +2 -0
- package/esm/util/logger.js +1 -1
- package/esm/util/versionCompare.d.ts +1 -1
- package/package.json +7 -1
package/esm/index.js
CHANGED
|
@@ -1,343 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
19
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
-
/**
|
|
24
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
|
25
|
-
*
|
|
26
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
27
|
-
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
|
28
|
-
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
|
29
|
-
*/
|
|
30
|
-
import { ADDRESSElementAppVersion, AMSCashierPaymentAppVersion, AMSCheckoutAppVersion, AMSPaymentElementAppVersion, AMSVaultingAppVersion } from "./config/index";
|
|
31
|
-
import { AddressComponent } from "./core/component/address";
|
|
32
|
-
import { ElementComponent } from "./core/component/element";
|
|
33
|
-
// import { ElementComponent } from './core/component/oldElement';
|
|
34
|
-
import { AMSComponent } from "./core/component/index";
|
|
35
|
-
import PreloadHelper from "./foundation/utils/preload_helper";
|
|
36
|
-
import { ComponentSignEnum, DisplayTypeEnum, eventCodeEnum, PaymentMethodCategoryTypeEnum } from "./types";
|
|
37
|
-
import { ProductSceneEnum } from "./types/index";
|
|
38
|
-
import { LogConfig, Logger } from "./util/logger";
|
|
39
|
-
var logger = new Logger(LogConfig, true);
|
|
40
|
-
export { AMSCheckoutPage } from "./core/component/ckp";
|
|
1
|
+
import { AMSCheckout } from "./main";
|
|
2
|
+
import { injectAntomSDKIntegrationType } from "./util/integrationType";
|
|
3
|
+
injectAntomSDKIntegrationType('NPM');
|
|
4
|
+
export { AMSEasyPayWrapper as AMSEasyPay, AMSElementWrapper as AMSElement } from "./loader/index";
|
|
5
|
+
export { AddressElement, AMSAutoDebit, AMSAutoDebitPay, AMSCashierPayment, AMSCheckout, AMSCheckoutPage, AMSVaulting, AntomElement } from "./main";
|
|
41
6
|
export * from "./types";
|
|
42
|
-
import { EVENT } from "./constant";
|
|
43
|
-
import { AntomSDKCore } from "./foundation/core";
|
|
44
|
-
import { AutoDebitProcessor } from "./foundation/product-processor/autoDebit";
|
|
45
|
-
import { EasySafePayProcessor } from "./foundation/product-processor/easysafepay";
|
|
46
|
-
export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
|
|
47
|
-
_inherits(AMSCheckout, _AMSComponent);
|
|
48
|
-
var _super = _createSuper(AMSCheckout);
|
|
49
|
-
function AMSCheckout(_options, channelType) {
|
|
50
|
-
var _this;
|
|
51
|
-
var productSceneVersion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '1.0';
|
|
52
|
-
_classCallCheck(this, AMSCheckout);
|
|
53
|
-
_this = _super.call(this, _objectSpread({
|
|
54
|
-
appVersion: AMSCheckoutAppVersion
|
|
55
|
-
}, _options));
|
|
56
|
-
_this.preloadComponent(channelType, productSceneVersion);
|
|
57
|
-
return _this;
|
|
58
|
-
}
|
|
59
|
-
return _createClass(AMSCheckout);
|
|
60
|
-
}(AMSComponent);
|
|
61
|
-
export var AMSAutoDebitPay = /*#__PURE__*/function (_AMSCheckout) {
|
|
62
|
-
_inherits(AMSAutoDebitPay, _AMSCheckout);
|
|
63
|
-
var _super2 = _createSuper(AMSAutoDebitPay);
|
|
64
|
-
function AMSAutoDebitPay(options) {
|
|
65
|
-
_classCallCheck(this, AMSAutoDebitPay);
|
|
66
|
-
var _options = Object.assign({}, options, {
|
|
67
|
-
product: ProductSceneEnum.AUTO_DEBIT_PAY
|
|
68
|
-
});
|
|
69
|
-
return _super2.call(this, _options, [ComponentSignEnum.AUTO_DEBIT_PAY_WALLET]);
|
|
70
|
-
}
|
|
71
|
-
_createClass(AMSAutoDebitPay, null, [{
|
|
72
|
-
key: "preload",
|
|
73
|
-
value: function preload() {
|
|
74
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
75
|
-
securityRegion: 'SG',
|
|
76
|
-
environment: 'prod'
|
|
77
|
-
};
|
|
78
|
-
PreloadHelper.preloadWebApp(ProductSceneEnum.AUTO_DEBIT_PAY, PaymentMethodCategoryTypeEnum.WALLET, options.environment);
|
|
79
|
-
PreloadHelper.preloadSecuritySDK(ProductSceneEnum.AUTO_DEBIT_PAY, options.securityRegion);
|
|
80
|
-
}
|
|
81
|
-
}]);
|
|
82
|
-
return AMSAutoDebitPay;
|
|
83
|
-
}(AMSCheckout);
|
|
84
|
-
export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout2) {
|
|
85
|
-
_inherits(AMSCashierPayment, _AMSCheckout2);
|
|
86
|
-
var _super3 = _createSuper(AMSCashierPayment);
|
|
87
|
-
function AMSCashierPayment(options) {
|
|
88
|
-
_classCallCheck(this, AMSCashierPayment);
|
|
89
|
-
var _options = Object.assign({}, options, {
|
|
90
|
-
product: ProductSceneEnum.CASHIER_PAYMENT,
|
|
91
|
-
appVersion: AMSCashierPaymentAppVersion
|
|
92
|
-
});
|
|
93
|
-
var currentChannelType;
|
|
94
|
-
try {
|
|
95
|
-
var previousChannelStr = localStorage.getItem('antom_checkout_previousChannel');
|
|
96
|
-
var previousChannel = JSON.parse(previousChannelStr) || {};
|
|
97
|
-
var _ref = previousChannel || {},
|
|
98
|
-
_ref$channelType = _ref.channelType,
|
|
99
|
-
channelType = _ref$channelType === void 0 ? '' : _ref$channelType;
|
|
100
|
-
if ([ComponentSignEnum.CASHIER_PAYMENT_CARD, ComponentSignEnum.CASHIER_PAYMENT_APM, ComponentSignEnum.CASHIER_PAYMENT_BANK].includes(channelType)) {
|
|
101
|
-
currentChannelType = [channelType];
|
|
102
|
-
} else {
|
|
103
|
-
currentChannelType = [ComponentSignEnum.CASHIER_PAYMENT_CARD, ComponentSignEnum.CASHIER_PAYMENT_APM];
|
|
104
|
-
}
|
|
105
|
-
} catch (error) {
|
|
106
|
-
logger.logError({
|
|
107
|
-
title: 'performance_optimization_get_previousChannel_error'
|
|
108
|
-
}, {
|
|
109
|
-
errorMessage: error
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
return _super3.call(this, _options, currentChannelType);
|
|
113
|
-
}
|
|
114
|
-
_createClass(AMSCashierPayment, [{
|
|
115
|
-
key: "validateFields",
|
|
116
|
-
value:
|
|
117
|
-
/**
|
|
118
|
-
* Form validation function
|
|
119
|
-
* If the form is currently displayed:
|
|
120
|
-
* - Successful validation: isValid is true
|
|
121
|
-
* - Failed validation: isValid is false, and error messages are displayed on the form page
|
|
122
|
-
* If not on the form display page, isValid returns false
|
|
123
|
-
* @returns {Promise<ValidationResult>} Returns a Promise containing the validation result
|
|
124
|
-
*/
|
|
125
|
-
function validateFields() {
|
|
126
|
-
return this._validateFields();
|
|
127
|
-
}
|
|
128
|
-
}], [{
|
|
129
|
-
key: "preload",
|
|
130
|
-
value: function preload() {
|
|
131
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
132
|
-
securityRegion: 'SG',
|
|
133
|
-
environment: 'prod'
|
|
134
|
-
};
|
|
135
|
-
try {
|
|
136
|
-
var channelTypes;
|
|
137
|
-
var previousChannelStr = localStorage.getItem('antom_checkout_previousChannel');
|
|
138
|
-
var previousChannel = JSON.parse(previousChannelStr) || {};
|
|
139
|
-
var _ref2 = previousChannel || {},
|
|
140
|
-
_ref2$channelType = _ref2.channelType,
|
|
141
|
-
channelType = _ref2$channelType === void 0 ? '' : _ref2$channelType;
|
|
142
|
-
if (ComponentSignEnum.CASHIER_PAYMENT_CARD === channelType) {
|
|
143
|
-
channelTypes = [PaymentMethodCategoryTypeEnum.CARD];
|
|
144
|
-
} else if (ComponentSignEnum.CASHIER_PAYMENT_APM === channelType) {
|
|
145
|
-
channelTypes = [PaymentMethodCategoryTypeEnum.APM];
|
|
146
|
-
} else if (ComponentSignEnum.CASHIER_PAYMENT_BANK === channelType) {
|
|
147
|
-
channelTypes = [PaymentMethodCategoryTypeEnum.BANK];
|
|
148
|
-
} else {
|
|
149
|
-
channelTypes = [PaymentMethodCategoryTypeEnum.CARD, PaymentMethodCategoryTypeEnum.APM];
|
|
150
|
-
}
|
|
151
|
-
var _iterator = _createForOfIteratorHelper(channelTypes),
|
|
152
|
-
_step;
|
|
153
|
-
try {
|
|
154
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
155
|
-
var _channelType = _step.value;
|
|
156
|
-
PreloadHelper.preloadWebApp(ProductSceneEnum.CASHIER_PAYMENT, _channelType, options.environment);
|
|
157
|
-
}
|
|
158
|
-
} catch (err) {
|
|
159
|
-
_iterator.e(err);
|
|
160
|
-
} finally {
|
|
161
|
-
_iterator.f();
|
|
162
|
-
}
|
|
163
|
-
} catch (error) {
|
|
164
|
-
console.error('[web-sdk] preload web app error', error);
|
|
165
|
-
}
|
|
166
|
-
PreloadHelper.preloadSecuritySDK(ProductSceneEnum.CASHIER_PAYMENT, options.securityRegion);
|
|
167
|
-
}
|
|
168
|
-
}]);
|
|
169
|
-
return AMSCashierPayment;
|
|
170
|
-
}(AMSCheckout);
|
|
171
|
-
export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout3) {
|
|
172
|
-
_inherits(AMSVaulting, _AMSCheckout3);
|
|
173
|
-
var _super4 = _createSuper(AMSVaulting);
|
|
174
|
-
function AMSVaulting(options) {
|
|
175
|
-
_classCallCheck(this, AMSVaulting);
|
|
176
|
-
var _options = Object.assign({}, options, {
|
|
177
|
-
product: ProductSceneEnum.VAULTING,
|
|
178
|
-
appVersion: AMSVaultingAppVersion
|
|
179
|
-
});
|
|
180
|
-
return _super4.call(this, _options, [ComponentSignEnum.CASHIER_PAYMENT_CARD]);
|
|
181
|
-
}
|
|
182
|
-
_createClass(AMSVaulting, null, [{
|
|
183
|
-
key: "preload",
|
|
184
|
-
value: function preload() {
|
|
185
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
186
|
-
securityRegion: 'SG',
|
|
187
|
-
environment: 'prod'
|
|
188
|
-
};
|
|
189
|
-
PreloadHelper.preloadWebApp(ProductSceneEnum.CASHIER_PAYMENT, PaymentMethodCategoryTypeEnum.CARD, options.environment);
|
|
190
|
-
PreloadHelper.preloadSecuritySDK(ProductSceneEnum.VAULTING, options.securityRegion);
|
|
191
|
-
}
|
|
192
|
-
}]);
|
|
193
|
-
return AMSVaulting;
|
|
194
|
-
}(AMSCheckout);
|
|
195
|
-
export var AntomElement = /*#__PURE__*/function (_AMSCheckout4) {
|
|
196
|
-
_inherits(AntomElement, _AMSCheckout4);
|
|
197
|
-
var _super5 = _createSuper(AntomElement);
|
|
198
|
-
function AntomElement(options) {
|
|
199
|
-
_classCallCheck(this, AntomElement);
|
|
200
|
-
var _options = Object.assign({}, options, {
|
|
201
|
-
product: ProductSceneEnum.ELEMENT_PAYMENT,
|
|
202
|
-
appVersion: AMSPaymentElementAppVersion
|
|
203
|
-
});
|
|
204
|
-
return _super5.call(this, _options, [ComponentSignEnum.ELEMENT_PAYMENT]);
|
|
205
|
-
}
|
|
206
|
-
return _createClass(AntomElement);
|
|
207
|
-
}(AMSCheckout);
|
|
208
|
-
export var AddressElement = /*#__PURE__*/function (_AddressComponent) {
|
|
209
|
-
_inherits(AddressElement, _AddressComponent);
|
|
210
|
-
var _super6 = _createSuper(AddressElement);
|
|
211
|
-
function AddressElement(options) {
|
|
212
|
-
_classCallCheck(this, AddressElement);
|
|
213
|
-
var _options = Object.assign({}, options, {
|
|
214
|
-
product: ProductSceneEnum.ELEMENT_ADDRESS,
|
|
215
|
-
appVersion: ADDRESSElementAppVersion
|
|
216
|
-
});
|
|
217
|
-
return _super6.call(this, _options);
|
|
218
|
-
}
|
|
219
|
-
return _createClass(AddressElement);
|
|
220
|
-
}(AddressComponent);
|
|
221
|
-
export var AMSElement = /*#__PURE__*/function (_ElementComponent) {
|
|
222
|
-
_inherits(AMSElement, _ElementComponent);
|
|
223
|
-
var _super7 = _createSuper(AMSElement);
|
|
224
|
-
function AMSElement(options) {
|
|
225
|
-
_classCallCheck(this, AMSElement);
|
|
226
|
-
var _options = Object.assign({}, options, {
|
|
227
|
-
product: ProductSceneEnum.ELEMENT_PAYMENT,
|
|
228
|
-
environment: options.environment
|
|
229
|
-
});
|
|
230
|
-
return _super7.call(this, _options);
|
|
231
|
-
}
|
|
232
|
-
return _createClass(AMSElement);
|
|
233
|
-
}(ElementComponent);
|
|
234
|
-
export var AMSEasyPay = /*#__PURE__*/function () {
|
|
235
|
-
function AMSEasyPay(options) {
|
|
236
|
-
_classCallCheck(this, AMSEasyPay);
|
|
237
|
-
_defineProperty(this, "core", void 0);
|
|
238
|
-
this.core = new AntomSDKCore();
|
|
239
|
-
this.core.registerProcessor(ProductSceneEnum.EASY_PAY, '', new EasySafePayProcessor());
|
|
240
|
-
this.core.init(options, ProductSceneEnum.EASY_PAY);
|
|
241
|
-
}
|
|
242
|
-
_createClass(AMSEasyPay, [{
|
|
243
|
-
key: "createComponent",
|
|
244
|
-
value: function createComponent(params) {
|
|
245
|
-
this.core.startBizFlow({
|
|
246
|
-
submitPayRequestExtra: {
|
|
247
|
-
notRedirectAfterComplete: params.notRedirectAfterComplete,
|
|
248
|
-
merchantAppointParam: params.merchantAppointParam
|
|
249
|
-
},
|
|
250
|
-
paymentSession: params.sessionData || params.paymentSessionData,
|
|
251
|
-
displayInfo: {
|
|
252
|
-
type: DisplayTypeEnum.popup
|
|
253
|
-
},
|
|
254
|
-
isAppWebview: params.isAppWebview,
|
|
255
|
-
isNativeAppWebview: params.isNativeAppWebview
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}, {
|
|
259
|
-
key: "unmount",
|
|
260
|
-
value: function unmount() {
|
|
261
|
-
this.core.destroy();
|
|
262
|
-
}
|
|
263
|
-
}], [{
|
|
264
|
-
key: "preload",
|
|
265
|
-
value: function preload() {
|
|
266
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
267
|
-
securityRegion: 'SG',
|
|
268
|
-
environment: 'prod'
|
|
269
|
-
};
|
|
270
|
-
PreloadHelper.preloadWebApp(ProductSceneEnum.EASY_PAY, PaymentMethodCategoryTypeEnum.WALLET, options.environment, true);
|
|
271
|
-
}
|
|
272
|
-
}]);
|
|
273
|
-
return AMSEasyPay;
|
|
274
|
-
}();
|
|
275
|
-
export var AMSAutoDebit = /*#__PURE__*/function () {
|
|
276
|
-
function AMSAutoDebit(options) {
|
|
277
|
-
_classCallCheck(this, AMSAutoDebit);
|
|
278
|
-
_defineProperty(this, "core", void 0);
|
|
279
|
-
this.core = new AntomSDKCore();
|
|
280
|
-
this.core.registerProcessor(ProductSceneEnum.AUTO_DEBIT, '', new AutoDebitProcessor());
|
|
281
|
-
this.core.init(options, ProductSceneEnum.AUTO_DEBIT);
|
|
282
|
-
}
|
|
283
|
-
_createClass(AMSAutoDebit, [{
|
|
284
|
-
key: "createComponent",
|
|
285
|
-
value: function () {
|
|
286
|
-
var _createComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
287
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
288
|
-
while (1) switch (_context.prev = _context.next) {
|
|
289
|
-
case 0:
|
|
290
|
-
_context.prev = 0;
|
|
291
|
-
_context.next = 3;
|
|
292
|
-
return this.core.startBizFlow({
|
|
293
|
-
submitPayRequestExtra: {
|
|
294
|
-
notRedirectAfterComplete: params.notRedirectAfterComplete,
|
|
295
|
-
merchantAppointParam: params.merchantAppointParam
|
|
296
|
-
},
|
|
297
|
-
paymentSession: params.sessionData || params.paymentSessionData,
|
|
298
|
-
displayInfo: {
|
|
299
|
-
type: DisplayTypeEnum.popup
|
|
300
|
-
},
|
|
301
|
-
isAppWebview: params.isAppWebview
|
|
302
|
-
});
|
|
303
|
-
case 3:
|
|
304
|
-
_context.next = 9;
|
|
305
|
-
break;
|
|
306
|
-
case 5:
|
|
307
|
-
_context.prev = 5;
|
|
308
|
-
_context.t0 = _context["catch"](0);
|
|
309
|
-
this.core.getServiceProvider().getService('EventCenter').emit(EVENT.eventCallback.name, {
|
|
310
|
-
code: eventCodeEnum.SDK_CREATEPAYMENT_PARAMETER_ERROR,
|
|
311
|
-
message: (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || 'Initialization parameter exception.'
|
|
312
|
-
});
|
|
313
|
-
this.core.destroy();
|
|
314
|
-
case 9:
|
|
315
|
-
case "end":
|
|
316
|
-
return _context.stop();
|
|
317
|
-
}
|
|
318
|
-
}, _callee, this, [[0, 5]]);
|
|
319
|
-
}));
|
|
320
|
-
function createComponent(_x) {
|
|
321
|
-
return _createComponent.apply(this, arguments);
|
|
322
|
-
}
|
|
323
|
-
return createComponent;
|
|
324
|
-
}()
|
|
325
|
-
}, {
|
|
326
|
-
key: "unmount",
|
|
327
|
-
value: function unmount() {
|
|
328
|
-
this.core.destroy();
|
|
329
|
-
}
|
|
330
|
-
}], [{
|
|
331
|
-
key: "preload",
|
|
332
|
-
value: function preload() {
|
|
333
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
334
|
-
securityRegion: 'SG',
|
|
335
|
-
environment: 'prod'
|
|
336
|
-
};
|
|
337
|
-
PreloadHelper.preloadWebApp(ProductSceneEnum.AUTO_DEBIT, PaymentMethodCategoryTypeEnum.WALLET, options.environment);
|
|
338
|
-
PreloadHelper.preloadSecuritySDK(ProductSceneEnum.AUTO_DEBIT, options.securityRegion);
|
|
339
|
-
}
|
|
340
|
-
}]);
|
|
341
|
-
return AMSAutoDebit;
|
|
342
|
-
}();
|
|
343
7
|
export default AMSCheckout;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AMSCashierPayment, AMSEasyPay, AMSElement } from '../main';
|
|
2
|
+
import { EConstructorName } from './constant';
|
|
3
|
+
export declare function createBaseProxy<T>(constructorName: EConstructorName.AMSCashierPayment): typeof AMSCashierPayment;
|
|
4
|
+
export declare function createBaseProxy<T>(constructorName: EConstructorName.AMSEasyPay): typeof AMSEasyPay;
|
|
5
|
+
export declare function createBaseProxy<T>(constructorName: EConstructorName.AMSElement): typeof AMSElement;
|