@alipay/ams-checkout 1.7.0 → 1.7.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/dist/umd/ams-checkout.min.js +1 -1
- package/esm/constant/index.d.ts +2 -4
- package/esm/constant/index.js +3 -5
- package/esm/core/component/index.js +15 -2
- package/esm/core/instance/index.js +3 -3
- package/esm/index.js +2 -2
- package/esm/plugin/component/cashierApp.js +3 -4
- package/esm/plugin/component/index.js +129 -69
- package/esm/plugin/component/popupWindow.style.d.ts +1 -1
- package/esm/plugin/component/popupWindow.style.js +32 -23
- package/esm/plugin/drop-in/index.js +2 -2
- package/esm/request/index.js +5 -5
- package/esm/service/index.js +2 -2
- package/esm/util/index.js +2 -2
- package/esm/util/logger.js +5 -2
- package/esm/util/security.js +4 -5
- package/package.json +1 -1
package/esm/constant/index.d.ts
CHANGED
@@ -55,9 +55,6 @@ export declare const ERRORMESSAGE: {
|
|
55
55
|
CREATEPAYMENT_PARAMETER_ERROR: {
|
56
56
|
code: eventCodeEnum;
|
57
57
|
};
|
58
|
-
CONFIRMPAYMENT_PARAMETER_ERROR: {
|
59
|
-
code: string;
|
60
|
-
};
|
61
58
|
CREATECOMPONENT_ERROR: {
|
62
59
|
code: eventCodeEnum;
|
63
60
|
message: string;
|
@@ -140,7 +137,7 @@ export declare const EVENT: {
|
|
140
137
|
dismissLoading: {
|
141
138
|
name: string;
|
142
139
|
};
|
143
|
-
|
140
|
+
popupWindow: {
|
144
141
|
name: string;
|
145
142
|
};
|
146
143
|
popWindow: {
|
@@ -180,6 +177,7 @@ export declare const INLINE_BASE_STYLE_ID = "ams-inline-component-style";
|
|
180
177
|
export declare const INLINE_IMG_CLASSNAME = "inline-loading";
|
181
178
|
export declare const AMSPOPUP_PREFIX = "ams-popup";
|
182
179
|
export declare const LOADTIME_LIMIT = 15000;
|
180
|
+
export declare const POPUP_LOADTIME_LOG_LIMIT = 3000;
|
183
181
|
export declare const ANIMATION_TIME = 300;
|
184
182
|
export declare const closeImg = "https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg";
|
185
183
|
export declare const LOADINGIMG = "data:image/png;base64,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";
|
package/esm/constant/index.js
CHANGED
@@ -55,9 +55,6 @@ export var ERRORMESSAGE = {
|
|
55
55
|
CREATEPAYMENT_PARAMETER_ERROR: {
|
56
56
|
code: eventCodeEnum.SDK_CREATEPAYMENT_PARAMETER_ERROR
|
57
57
|
},
|
58
|
-
CONFIRMPAYMENT_PARAMETER_ERROR: {
|
59
|
-
code: 'SDK_CONFIRMPAYMENT_PARAMETER_ERROR'
|
60
|
-
},
|
61
58
|
CREATECOMPONENT_ERROR: {
|
62
59
|
code: eventCodeEnum.SDK_CREATECOMPONENT_ERROR,
|
63
60
|
message: 'Failed to create component',
|
@@ -140,8 +137,8 @@ export var EVENT = {
|
|
140
137
|
dismissLoading: {
|
141
138
|
name: 'dismissLoading'
|
142
139
|
},
|
143
|
-
|
144
|
-
name: '
|
140
|
+
popupWindow: {
|
141
|
+
name: 'popupWindow'
|
145
142
|
},
|
146
143
|
popWindow: {
|
147
144
|
name: 'popWindow'
|
@@ -180,6 +177,7 @@ export var INLINE_BASE_STYLE_ID = 'ams-inline-component-style';
|
|
180
177
|
export var INLINE_IMG_CLASSNAME = 'inline-loading';
|
181
178
|
export var AMSPOPUP_PREFIX = 'ams-popup';
|
182
179
|
export var LOADTIME_LIMIT = 15000;
|
180
|
+
export var POPUP_LOADTIME_LOG_LIMIT = 3000;
|
183
181
|
export var ANIMATION_TIME = 300;
|
184
182
|
export var closeImg = 'https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg';
|
185
183
|
export var LOADINGIMG = 'data:image/png;base64,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';
|
@@ -10,8 +10,8 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
10
10
|
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; } }
|
11
11
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
12
12
|
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; }
|
13
|
-
function _toPropertyKey(
|
14
|
-
function _toPrimitive(
|
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
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
16
16
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
17
17
|
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); }
|
@@ -138,6 +138,9 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
138
138
|
key: "pluginAppendIframe",
|
139
139
|
value: function pluginAppendIframe(appendParams) {
|
140
140
|
try {
|
141
|
+
this.logger.logInfo({
|
142
|
+
title: 'sdk_event_createComponent'
|
143
|
+
}).send();
|
141
144
|
return this._componentApp.appendIframeNodes(appendParams.componentSign, appendParams.iframeNodesParams);
|
142
145
|
} catch (error) {
|
143
146
|
return Promise.reject(error);
|
@@ -157,6 +160,11 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
157
160
|
}).then(function (_params) {
|
158
161
|
return handleParams(_params);
|
159
162
|
}).catch(function (error) {
|
163
|
+
_this2.logger.logError({
|
164
|
+
title: 'sdk_error_parameter'
|
165
|
+
}, {
|
166
|
+
params: JSON.stringify(params)
|
167
|
+
}).send();
|
160
168
|
_this2._eventCenter.emit(EVENT.error.name, error);
|
161
169
|
return Promise.reject(error);
|
162
170
|
}).then(function (appendParams) {
|
@@ -179,6 +187,11 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
179
187
|
}).then(function (_params) {
|
180
188
|
return handleParams(_params);
|
181
189
|
}).catch(function (error) {
|
190
|
+
_this3.logger.logError({
|
191
|
+
title: 'sdk_error_parameter'
|
192
|
+
}, {
|
193
|
+
params: JSON.stringify(params)
|
194
|
+
}).send();
|
182
195
|
_this3._eventCenter.emit(EVENT.error.name, error);
|
183
196
|
return Promise.reject(error);
|
184
197
|
}).then(function (appendParams) {
|
@@ -6,8 +6,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
6
6
|
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); } }
|
7
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
8
8
|
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; }
|
9
|
-
function _toPropertyKey(
|
10
|
-
function _toPrimitive(
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
10
|
+
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); }
|
11
11
|
/**
|
12
12
|
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
13
13
|
*
|
@@ -192,7 +192,7 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
192
192
|
securitySdk.initSecurity(successCallback, failCallback);
|
193
193
|
return securitySdk;
|
194
194
|
} catch (error) {
|
195
|
-
failCallback && failCallback(
|
195
|
+
failCallback && failCallback(error === null || error === void 0 ? void 0 : error.toString());
|
196
196
|
}
|
197
197
|
}
|
198
198
|
/**
|
package/esm/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
2
|
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); } }
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
4
|
-
function _toPropertyKey(
|
5
|
-
function _toPrimitive(
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
5
|
+
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); }
|
6
6
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7
7
|
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); }
|
8
8
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
2
|
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; }
|
3
|
-
function _toPropertyKey(
|
4
|
-
function _toPrimitive(
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
4
|
+
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); }
|
5
5
|
/**
|
6
6
|
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
7
7
|
*
|
@@ -21,8 +21,7 @@ var getAppVersion = function getAppVersion(_extendInfo) {
|
|
21
21
|
}
|
22
22
|
};
|
23
23
|
var getFinalProductSceneVersion = function getFinalProductSceneVersion(componentSign, productSceneVersion) {
|
24
|
-
var
|
25
|
-
var signSupportMap = (_signSupportMap = {}, _defineProperty(_signSupportMap, componentSignEnum.NONE, ['']), _defineProperty(_signSupportMap, componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), _defineProperty(_signSupportMap, componentSignEnum.VAULTING_CARD, ['1.0']), _signSupportMap);
|
24
|
+
var signSupportMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentSignEnum.NONE, ['']), componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), componentSignEnum.VAULTING_CARD, ['1.0']);
|
26
25
|
var supportProductSceneVersion = signSupportMap[componentSign];
|
27
26
|
// 从左到右,从旧到新
|
28
27
|
var isSupport = supportProductSceneVersion.find(function (it) {
|
@@ -6,8 +6,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
6
6
|
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); } }
|
7
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
8
8
|
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; }
|
9
|
-
function _toPropertyKey(
|
10
|
-
function _toPrimitive(
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
10
|
+
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); }
|
11
11
|
/**
|
12
12
|
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
13
13
|
* 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:
|
@@ -15,7 +15,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
15
15
|
* 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.
|
16
16
|
*/
|
17
17
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
18
|
-
import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID } from "../../constant";
|
18
|
+
import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID, POPUP_LOADTIME_LOG_LIMIT } from "../../constant";
|
19
19
|
import { queryPaymentInfo, submitPayInfo } from "../../service";
|
20
20
|
import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, RedirectType, renderDisplayTypeEnum, targetEnum } from "../../types";
|
21
21
|
import { getType, isJsonString, isPC } from "../../util";
|
@@ -48,7 +48,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
48
48
|
_defineProperty(this, "_appLocationSearch", void 0);
|
49
49
|
_defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
|
50
50
|
_defineProperty(this, "_multipleCallbackEvents", void 0);
|
51
|
-
this._appVersion = '1.7.
|
51
|
+
this._appVersion = '1.7.1';
|
52
52
|
this._isInitComponent = false;
|
53
53
|
this._selector = "#".concat(COMPONENT_SECTION_ID);
|
54
54
|
this.createIframeNode = function () {
|
@@ -364,7 +364,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
364
364
|
}));
|
365
365
|
case 4:
|
366
366
|
if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
|
367
|
-
_context2.next =
|
367
|
+
_context2.next = 10;
|
368
368
|
break;
|
369
369
|
}
|
370
370
|
params.paymentMethodType = 'CARD';
|
@@ -372,55 +372,60 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
372
372
|
return _this5.getDeviceIdAndLog();
|
373
373
|
case 8:
|
374
374
|
envInfo.deviceId = _context2.sent;
|
375
|
-
|
375
|
+
if (window.navigator.userAgent.indexOf('miniProgram') > -1) {
|
376
|
+
envInfo.extendInfo = {
|
377
|
+
WAP_SUB_TYPE: 'WECHAT_MINI_PROGRAM'
|
378
|
+
};
|
379
|
+
}
|
380
|
+
case 10:
|
376
381
|
if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
|
377
|
-
_context2.next =
|
382
|
+
_context2.next = 18;
|
378
383
|
break;
|
379
384
|
}
|
380
385
|
_ref3 = params.paymentSessionConfig || {}, _ref3$productSceneVer = _ref3.productSceneVersion, productSceneVersion = _ref3$productSceneVer === void 0 ? '' : _ref3$productSceneVer, _ref3$productScene = _ref3.productScene, productScene = _ref3$productScene === void 0 ? '' : _ref3$productScene;
|
381
386
|
_ref4 = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.paymentSessionMetaData) || {}, _ref4$action = _ref4.action, _ref4$action2 = _ref4$action === void 0 ? {} : _ref4$action, _ref4$action2$autoDeb = _ref4$action2.autoDebitWithToken, autoDebitWithToken = _ref4$action2$autoDeb === void 0 ? false : _ref4$action2$autoDeb;
|
382
387
|
if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken)) {
|
383
|
-
_context2.next =
|
388
|
+
_context2.next = 15;
|
384
389
|
break;
|
385
390
|
}
|
386
391
|
return _context2.abrupt("return", resolve({
|
387
392
|
message: 'sdk no need to make query request',
|
388
393
|
success: true
|
389
394
|
}));
|
390
|
-
case
|
391
|
-
_context2.next =
|
395
|
+
case 15:
|
396
|
+
_context2.next = 17;
|
392
397
|
return _this5.getDeviceIdAndLog();
|
393
|
-
case 16:
|
394
|
-
envInfo.deviceId = _context2.sent;
|
395
398
|
case 17:
|
399
|
+
envInfo.deviceId = _context2.sent;
|
400
|
+
case 18:
|
396
401
|
if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
|
397
|
-
_context2.next =
|
402
|
+
_context2.next = 28;
|
398
403
|
break;
|
399
404
|
}
|
400
405
|
action = ((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 || (_this5$_renderParams6 = _this5$_renderParams6.paymentSessionMetaData) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.action) || {};
|
401
406
|
signType = isPC() ? action === null || action === void 0 || (_action$web = action.web) === null || _action$web === void 0 ? void 0 : _action$web.signType : action === null || action === void 0 || (_action$wap = action.wap) === null || _action$wap === void 0 ? void 0 : _action$wap.signType;
|
402
407
|
if (!(signType === 'SMS')) {
|
403
|
-
_context2.next =
|
408
|
+
_context2.next = 23;
|
404
409
|
break;
|
405
410
|
}
|
406
411
|
return _context2.abrupt("return", resolve({
|
407
412
|
message: 'sdk no need to make query request',
|
408
413
|
success: true
|
409
414
|
}));
|
410
|
-
case
|
415
|
+
case 23:
|
411
416
|
if (!(!signType || signType !== 'REDIRECT')) {
|
412
|
-
_context2.next =
|
417
|
+
_context2.next = 25;
|
413
418
|
break;
|
414
419
|
}
|
415
420
|
return _context2.abrupt("return", resolve({
|
416
421
|
success: false
|
417
422
|
}));
|
418
|
-
case
|
419
|
-
_context2.next =
|
423
|
+
case 25:
|
424
|
+
_context2.next = 27;
|
420
425
|
return _this5.getDeviceIdAndLog();
|
421
|
-
case 26:
|
422
|
-
envInfo.deviceId = _context2.sent;
|
423
426
|
case 27:
|
427
|
+
envInfo.deviceId = _context2.sent;
|
428
|
+
case 28:
|
424
429
|
_this5.AMSSDK.logger.logInfo({
|
425
430
|
title: 'sdk_event_sdkQuery'
|
426
431
|
}, {
|
@@ -456,7 +461,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
456
461
|
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
457
462
|
}).send();
|
458
463
|
});
|
459
|
-
case
|
464
|
+
case 30:
|
460
465
|
case "end":
|
461
466
|
return _context2.stop();
|
462
467
|
}
|
@@ -630,6 +635,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
630
635
|
// Subscribe to messages from iframe
|
631
636
|
this.addEventListener();
|
632
637
|
} catch (error) {
|
638
|
+
this.AMSSDK.logger.logError({
|
639
|
+
title: 'sdk_error_created_app_failed'
|
640
|
+
}).send();
|
633
641
|
this.dispatchToSDK(EVENT.error.name, Object.assign({}, ERRORMESSAGE.SDK_COMPATIBILITY_ISSUES.FAILED_TO_CREATE_IFRAME, {
|
634
642
|
stack: error
|
635
643
|
}));
|
@@ -667,31 +675,80 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
667
675
|
}
|
668
676
|
}, {
|
669
677
|
key: "createDialog",
|
670
|
-
value: function
|
671
|
-
var
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
678
|
+
value: function () {
|
679
|
+
var _createDialog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
|
680
|
+
var pageUrl, isLoad, timeout, logTimeout;
|
681
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
682
|
+
while (1) switch (_context4.prev = _context4.next) {
|
683
|
+
case 0:
|
684
|
+
pageUrl = data.url.includes('?') ? "".concat(data.url, "&").concat(this._appLocationSearch) : "".concat(data.url, "?").concat(this._appLocationSearch);
|
685
|
+
_context4.prev = 1;
|
686
|
+
isLoad = false;
|
687
|
+
_context4.next = 5;
|
688
|
+
return createModal({
|
689
|
+
widthPadding: data === null || data === void 0 ? void 0 : data.widthPadding,
|
690
|
+
heightPadding: data === null || data === void 0 ? void 0 : data.heightPadding,
|
691
|
+
device: this.platform,
|
692
|
+
url: pageUrl
|
693
|
+
});
|
694
|
+
case 5:
|
695
|
+
this.popupApp = _context4.sent;
|
696
|
+
timeout = setTimeout(function () {
|
697
|
+
if (isLoad) return;
|
698
|
+
throw {
|
699
|
+
title: 'sdk_error_create_pop_up'
|
700
|
+
};
|
701
|
+
}, LOADTIME_LIMIT);
|
702
|
+
logTimeout = setTimeout(function () {
|
703
|
+
if (isLoad) return;
|
704
|
+
throw {
|
705
|
+
title: 'sdk_error_pop_up_time_out'
|
706
|
+
};
|
707
|
+
}, POPUP_LOADTIME_LOG_LIMIT);
|
708
|
+
this.popupApp.onload = function () {
|
709
|
+
isLoad = true;
|
710
|
+
clearTimeout(timeout);
|
711
|
+
clearTimeout(logTimeout);
|
712
|
+
};
|
713
|
+
_context4.next = 15;
|
714
|
+
break;
|
715
|
+
case 11:
|
716
|
+
_context4.prev = 11;
|
717
|
+
_context4.t0 = _context4["catch"](1);
|
718
|
+
this.AMSSDK.logger.logError({
|
719
|
+
title: (_context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.title) || 'sdk_error_create_pop_up'
|
720
|
+
}, {
|
721
|
+
message: _context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.message,
|
722
|
+
url: pageUrl
|
723
|
+
});
|
724
|
+
this.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
725
|
+
case 15:
|
726
|
+
case "end":
|
727
|
+
return _context4.stop();
|
728
|
+
}
|
729
|
+
}, _callee4, this, [[1, 11]]);
|
730
|
+
}));
|
731
|
+
function createDialog(_x4) {
|
732
|
+
return _createDialog.apply(this, arguments);
|
733
|
+
}
|
734
|
+
return createDialog;
|
735
|
+
}()
|
679
736
|
}, {
|
680
737
|
key: "getDeviceIdAndCallback",
|
681
738
|
value: function () {
|
682
|
-
var _getDeviceIdAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
739
|
+
var _getDeviceIdAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventContext) {
|
683
740
|
var deviceId;
|
684
|
-
return _regeneratorRuntime().wrap(function
|
685
|
-
while (1) switch (
|
741
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
742
|
+
while (1) switch (_context5.prev = _context5.next) {
|
686
743
|
case 0:
|
687
744
|
if (!(eventContext !== null && eventContext !== void 0 && eventContext.eventCallbackId)) {
|
688
|
-
|
745
|
+
_context5.next = 5;
|
689
746
|
break;
|
690
747
|
}
|
691
|
-
|
748
|
+
_context5.next = 3;
|
692
749
|
return this.getDeviceIdAndLog(eventContext === null || eventContext === void 0 ? void 0 : eventContext.data, true);
|
693
750
|
case 3:
|
694
|
-
deviceId =
|
751
|
+
deviceId = _context5.sent;
|
695
752
|
this.dispatchToApp({
|
696
753
|
context: {
|
697
754
|
event: 'appEventCallback',
|
@@ -703,11 +760,11 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
703
760
|
});
|
704
761
|
case 5:
|
705
762
|
case "end":
|
706
|
-
return
|
763
|
+
return _context5.stop();
|
707
764
|
}
|
708
|
-
},
|
765
|
+
}, _callee5, this);
|
709
766
|
}));
|
710
|
-
function getDeviceIdAndCallback(
|
767
|
+
function getDeviceIdAndCallback(_x5) {
|
711
768
|
return _getDeviceIdAndCallback.apply(this, arguments);
|
712
769
|
}
|
713
770
|
return getDeviceIdAndCallback;
|
@@ -715,9 +772,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
715
772
|
}, {
|
716
773
|
key: "getUserAgentAndCallback",
|
717
774
|
value: function () {
|
718
|
-
var _getUserAgentAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
719
|
-
return _regeneratorRuntime().wrap(function
|
720
|
-
while (1) switch (
|
775
|
+
var _getUserAgentAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(eventContext) {
|
776
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
777
|
+
while (1) switch (_context6.prev = _context6.next) {
|
721
778
|
case 0:
|
722
779
|
if (eventContext !== null && eventContext !== void 0 && eventContext.eventCallbackId) {
|
723
780
|
try {
|
@@ -730,15 +787,17 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
730
787
|
}
|
731
788
|
}
|
732
789
|
});
|
733
|
-
} catch (error) {
|
790
|
+
} catch (error) {
|
791
|
+
/* empty */
|
792
|
+
}
|
734
793
|
}
|
735
794
|
case 1:
|
736
795
|
case "end":
|
737
|
-
return
|
796
|
+
return _context6.stop();
|
738
797
|
}
|
739
|
-
},
|
798
|
+
}, _callee6, this);
|
740
799
|
}));
|
741
|
-
function getUserAgentAndCallback(
|
800
|
+
function getUserAgentAndCallback(_x6) {
|
742
801
|
return _getUserAgentAndCallback.apply(this, arguments);
|
743
802
|
}
|
744
803
|
return getUserAgentAndCallback;
|
@@ -746,10 +805,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
746
805
|
}, {
|
747
806
|
key: "returnDataAndCallback",
|
748
807
|
value: function () {
|
749
|
-
var _returnDataAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
808
|
+
var _returnDataAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(eventContext) {
|
750
809
|
var _eventContext$data, targetData;
|
751
|
-
return _regeneratorRuntime().wrap(function
|
752
|
-
while (1) switch (
|
810
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
811
|
+
while (1) switch (_context7.prev = _context7.next) {
|
753
812
|
case 0:
|
754
813
|
if (eventContext !== null && eventContext !== void 0 && eventContext.eventCallbackId) {
|
755
814
|
targetData = this._globalData.get((_eventContext$data = eventContext.data) === null || _eventContext$data === void 0 ? void 0 : _eventContext$data.dataKey);
|
@@ -763,11 +822,11 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
763
822
|
}
|
764
823
|
case 1:
|
765
824
|
case "end":
|
766
|
-
return
|
825
|
+
return _context7.stop();
|
767
826
|
}
|
768
|
-
},
|
827
|
+
}, _callee7, this);
|
769
828
|
}));
|
770
|
-
function returnDataAndCallback(
|
829
|
+
function returnDataAndCallback(_x7) {
|
771
830
|
return _returnDataAndCallback.apply(this, arguments);
|
772
831
|
}
|
773
832
|
return returnDataAndCallback;
|
@@ -824,7 +883,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
824
883
|
this._globalData.set((_data$context$data = data.context.data) === null || _data$context$data === void 0 ? void 0 : _data$context$data.dataKey, (_data$context$data2 = data.context.data) === null || _data$context$data2 === void 0 ? void 0 : _data$context$data2.data);
|
825
884
|
return;
|
826
885
|
}
|
827
|
-
if (data.context.event === EVENT.
|
886
|
+
if (data.context.event === EVENT.popupWindow.name) {
|
828
887
|
var _data$context;
|
829
888
|
this.createDialog((_data$context = data.context) === null || _data$context === void 0 ? void 0 : _data$context.data);
|
830
889
|
return;
|
@@ -1123,27 +1182,27 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1123
1182
|
*/
|
1124
1183
|
}, {
|
1125
1184
|
key: "sendRenderEvent",
|
1126
|
-
value: function () {
|
1127
|
-
var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
1185
|
+
value: (function () {
|
1186
|
+
var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
1128
1187
|
var _this$_renderParams6, _this$_renderParams7, _this$_renderParams8, _this$_renderParams9, _this$_renderParams10, res, submitRes;
|
1129
|
-
return _regeneratorRuntime().wrap(function
|
1130
|
-
while (1) switch (
|
1188
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
1189
|
+
while (1) switch (_context8.prev = _context8.next) {
|
1131
1190
|
case 0:
|
1132
|
-
|
1191
|
+
_context8.prev = 0;
|
1133
1192
|
if (!(!this._actionQueryPromise || !this._actionSubmitPromise)) {
|
1134
|
-
|
1193
|
+
_context8.next = 3;
|
1135
1194
|
break;
|
1136
1195
|
}
|
1137
|
-
return
|
1196
|
+
return _context8.abrupt("return");
|
1138
1197
|
case 3:
|
1139
|
-
|
1198
|
+
_context8.next = 5;
|
1140
1199
|
return this._actionQueryPromise;
|
1141
1200
|
case 5:
|
1142
|
-
res =
|
1143
|
-
|
1201
|
+
res = _context8.sent;
|
1202
|
+
_context8.next = 8;
|
1144
1203
|
return this._actionSubmitPromise;
|
1145
1204
|
case 8:
|
1146
|
-
submitRes =
|
1205
|
+
submitRes = _context8.sent;
|
1147
1206
|
this._performanceData.push({
|
1148
1207
|
key: 'sdk_render_component',
|
1149
1208
|
value: Date.now()
|
@@ -1176,16 +1235,16 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1176
1235
|
}
|
1177
1236
|
});
|
1178
1237
|
// eslint-disable-next-line no-empty
|
1179
|
-
|
1238
|
+
_context8.next = 16;
|
1180
1239
|
break;
|
1181
1240
|
case 14:
|
1182
|
-
|
1183
|
-
|
1241
|
+
_context8.prev = 14;
|
1242
|
+
_context8.t0 = _context8["catch"](0);
|
1184
1243
|
case 16:
|
1185
1244
|
case "end":
|
1186
|
-
return
|
1245
|
+
return _context8.stop();
|
1187
1246
|
}
|
1188
|
-
},
|
1247
|
+
}, _callee8, this, [[0, 14]]);
|
1189
1248
|
}));
|
1190
1249
|
function sendRenderEvent() {
|
1191
1250
|
return _sendRenderEvent.apply(this, arguments);
|
@@ -1195,6 +1254,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1195
1254
|
/**
|
1196
1255
|
* @description close cashier
|
1197
1256
|
*/
|
1257
|
+
)
|
1198
1258
|
}, {
|
1199
1259
|
key: "cleanContainer",
|
1200
1260
|
value: function cleanContainer() {
|
@@ -16,29 +16,38 @@ export var createModal = function createModal(_ref) {
|
|
16
16
|
url = _ref.url,
|
17
17
|
widthPadding = _ref.widthPadding,
|
18
18
|
heightPadding = _ref.heightPadding;
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
19
|
+
return new Promise(function (resolve, reject) {
|
20
|
+
try {
|
21
|
+
var overlay = document.createElement('div');
|
22
|
+
overlay.classList.add("".concat(AMSPOPUP_PREFIX, "overlay"), "".concat(AMSPOPUP_PREFIX, "fadeIn"));
|
23
|
+
var modal = document.createElement('div');
|
24
|
+
modal.classList.add("".concat(AMSPOPUP_PREFIX, "modal"), "".concat(AMSPOPUP_PREFIX, "fadeIn"));
|
25
|
+
if (device === 'desktop') {
|
26
|
+
modal.style.width = '600px';
|
27
|
+
modal.style.height = '464px';
|
28
|
+
modal.style.borderRadius = '12px';
|
29
|
+
} else {
|
30
|
+
modal.style.width = "calc(100% - ".concat(2 * widthPadding, "px)");
|
31
|
+
modal.style.height = "calc(100% - ".concat(2 * heightPadding, "px)");
|
32
|
+
modal.style.borderRadius = '8px';
|
33
|
+
}
|
34
|
+
var iframe = document.createElement('iframe');
|
35
|
+
iframe.src = url; // 替换为实际的 URL 地址
|
36
|
+
iframe.style.border = 'none';
|
37
|
+
iframe.style.width = '100%';
|
38
|
+
iframe.style.height = '100%';
|
39
|
+
modal.appendChild(iframe);
|
40
|
+
var body = document.getElementsByTagName('body')[0];
|
41
|
+
body.appendChild(overlay);
|
42
|
+
body.appendChild(modal);
|
43
|
+
resolve(iframe);
|
44
|
+
} catch (error) {
|
45
|
+
reject({
|
46
|
+
title: 'sdk_error_create_pop_up',
|
47
|
+
message: error === null || error === void 0 ? void 0 : error.toString()
|
48
|
+
});
|
49
|
+
}
|
50
|
+
});
|
42
51
|
};
|
43
52
|
|
44
53
|
// 销毁弹窗
|