@alipay/ams-checkout 0.0.1733711101-dev.1 → 0.0.1733711101-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/dist/umd/ams-checkout.min.js +1 -1
- package/esm/core/bus/index.d.ts +3 -3
- package/esm/core/bus/index.js +14 -14
- package/esm/core/component/appPreloadProcessing.js +2 -2
- package/esm/core/component/ckp/index.js +6 -3
- package/esm/core/component/index.js +6 -10
- package/esm/core/instance/index.js +3 -3
- package/esm/foundation/product-processor/easysafepay/index.js +12 -12
- package/esm/foundation/service/api-bus/busManager.d.ts +3 -3
- package/esm/foundation/service/api-bus/busManager.js +14 -14
- package/esm/foundation/service/log/index.d.ts +2 -2
- package/esm/foundation/service/log/index.js +23 -8
- package/esm/foundation/service/log/keys.d.ts +13 -0
- package/esm/foundation/service/log/keys.js +103 -0
- package/esm/foundation/service/log/processor.d.ts +9 -0
- package/esm/foundation/service/log/processor.js +138 -0
- package/esm/foundation/service/log/types.d.ts +1 -1
- package/esm/foundation/service/security/index.js +6 -8
- package/esm/foundation/utils/redirect_utils.js +1 -2
- package/esm/index.js +1 -1
- package/esm/plugin/applepay/component.js +10 -8
- package/esm/plugin/applepay/index.js +10 -6
- package/esm/plugin/applepay/service.js +24 -16
- package/esm/plugin/component/cashierApp.js +3 -3
- package/esm/plugin/component/index.js +28 -24
- package/esm/plugin/paypal/index.js +1 -1
- package/esm/service/index.js +4 -2
- package/esm/util/getBackScheme.js +1 -2
- package/esm/util/index.js +4 -8
- package/esm/util/logger.d.ts +3 -3
- package/esm/util/logger.js +49 -13
- package/esm/util/spm-map.d.ts +172 -0
- package/esm/util/spm-map.js +172 -0
- package/package.json +1 -1
@@ -0,0 +1,138 @@
|
|
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
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3
|
+
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); } }
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
5
|
+
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; }
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
7
|
+
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); }
|
8
|
+
import { LogComplianceExtendKeys, KEYS } from "./keys";
|
9
|
+
export var LogComplianceProcessor = /*#__PURE__*/function () {
|
10
|
+
function LogComplianceProcessor() {
|
11
|
+
_classCallCheck(this, LogComplianceProcessor);
|
12
|
+
}
|
13
|
+
_createClass(LogComplianceProcessor, null, [{
|
14
|
+
key: "extractComplianceParams",
|
15
|
+
value: function extractComplianceParams(eventName, params, errorLogCallback) {
|
16
|
+
var _this = this;
|
17
|
+
// 触发防抖上报
|
18
|
+
logDebounceTracker.track(function () {
|
19
|
+
_this.flushAbnormalInfo(errorLogCallback);
|
20
|
+
});
|
21
|
+
// 事件名检测
|
22
|
+
var isSpmId = eventName.includes('.');
|
23
|
+
if (!isSpmId) {
|
24
|
+
// 非SPM,说明是未做映射的,需要加到埋点里面
|
25
|
+
this.reportHasAbnormalEventName(eventName);
|
26
|
+
}
|
27
|
+
var newParams = {};
|
28
|
+
// 逐个字段检查
|
29
|
+
for (var _i = 0, _Object$keys = Object.keys(params); _i < _Object$keys.length; _i++) {
|
30
|
+
var key = _Object$keys[_i];
|
31
|
+
// 如果当前字段不在合规表中,说明是未合规字段,剔除并且上报异常
|
32
|
+
if (key in LogComplianceExtendKeys.complianceExtParams) {
|
33
|
+
newParams[key] = "".concat(params[key]);
|
34
|
+
} else {
|
35
|
+
// 如果当前字段不在合规表中,说明是未合规字段,剔除并且上报异常
|
36
|
+
this.reportHasIllegalExtendInfoKey(eventName, key);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return newParams;
|
40
|
+
}
|
41
|
+
}, {
|
42
|
+
key: "reportHasAbnormalEventName",
|
43
|
+
value: function reportHasAbnormalEventName(eventName) {
|
44
|
+
this.abnormalEventNameSet.add(eventName);
|
45
|
+
}
|
46
|
+
}, {
|
47
|
+
key: "reportHasIllegalExtendInfoKey",
|
48
|
+
value: function reportHasIllegalExtendInfoKey(eventName, key) {
|
49
|
+
if (!this.nonComplianceEventKeys[eventName]) {
|
50
|
+
this.nonComplianceEventKeys[eventName] = new Set();
|
51
|
+
}
|
52
|
+
this.nonComplianceEventKeys[eventName].add(key);
|
53
|
+
}
|
54
|
+
}, {
|
55
|
+
key: "flushAbnormalInfo",
|
56
|
+
value: function flushAbnormalInfo(errorLogCallback) {
|
57
|
+
if (this.abnormalEventNameSet.size > 0) {
|
58
|
+
// 不正常的事件名按|分割
|
59
|
+
// Abnormal event use event name with divider "|"
|
60
|
+
var abnormalEventNames = Array.from(this.abnormalEventNameSet).join('|');
|
61
|
+
errorLogCallback && errorLogCallback({
|
62
|
+
title: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_NAME.spmId
|
63
|
+
}, {
|
64
|
+
eventAlias: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_NAME.alias,
|
65
|
+
errorMessage: abnormalEventNames
|
66
|
+
});
|
67
|
+
this.abnormalEventNameSet.clear();
|
68
|
+
}
|
69
|
+
// process nonComplianceEventKeys
|
70
|
+
// eg: if sdk_event_createComponent has key1,key2,key3
|
71
|
+
// sdk_event_createComponent>key1+key2+key3|otherEventName>key1+key2+key3
|
72
|
+
var nonComplianceEventKeysList = [];
|
73
|
+
if (Object.keys(this.nonComplianceEventKeys).length === 0) {
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
for (var eventName in this.nonComplianceEventKeys) {
|
77
|
+
var keys = this.nonComplianceEventKeys[eventName];
|
78
|
+
var keyStr = "".concat(eventName, ">").concat(Array.from(keys).join('+'));
|
79
|
+
nonComplianceEventKeysList.push(keyStr);
|
80
|
+
}
|
81
|
+
var nonComplianceEventKeysLogString = nonComplianceEventKeysList.join('|');
|
82
|
+
errorLogCallback && errorLogCallback({
|
83
|
+
title: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO.spmId
|
84
|
+
}, {
|
85
|
+
eventAlias: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO.alias,
|
86
|
+
errorMessage: nonComplianceEventKeysLogString
|
87
|
+
});
|
88
|
+
this.nonComplianceEventKeys = {};
|
89
|
+
}
|
90
|
+
}]);
|
91
|
+
return LogComplianceProcessor;
|
92
|
+
}();
|
93
|
+
// 记录不正常的事件名
|
94
|
+
_defineProperty(LogComplianceProcessor, "abnormalEventNameSet", new Set());
|
95
|
+
// 记录不合规的扩展字段,KEY是事件名,VALUE是非合规扩展字段列表
|
96
|
+
_defineProperty(LogComplianceProcessor, "nonComplianceEventKeys", {});
|
97
|
+
var LogDebounceTracker = /*#__PURE__*/function () {
|
98
|
+
function LogDebounceTracker() {
|
99
|
+
var debounceTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5000;
|
100
|
+
_classCallCheck(this, LogDebounceTracker);
|
101
|
+
_defineProperty(this, "timeoutId", void 0);
|
102
|
+
_defineProperty(this, "debounceTime", void 0);
|
103
|
+
this.timeoutId = null;
|
104
|
+
this.debounceTime = debounceTime;
|
105
|
+
}
|
106
|
+
_createClass(LogDebounceTracker, [{
|
107
|
+
key: "track",
|
108
|
+
value: function track(callback) {
|
109
|
+
this.debounce(callback);
|
110
|
+
}
|
111
|
+
|
112
|
+
// 防抖实现
|
113
|
+
}, {
|
114
|
+
key: "debounce",
|
115
|
+
value: function debounce(callback) {
|
116
|
+
var _this2 = this;
|
117
|
+
if (this.timeoutId) {
|
118
|
+
clearTimeout(this.timeoutId);
|
119
|
+
}
|
120
|
+
this.timeoutId = setTimeout(function () {
|
121
|
+
_this2.report(callback);
|
122
|
+
_this2.reset();
|
123
|
+
}, this.debounceTime);
|
124
|
+
}
|
125
|
+
}, {
|
126
|
+
key: "report",
|
127
|
+
value: function report(callback) {
|
128
|
+
callback && callback();
|
129
|
+
}
|
130
|
+
}, {
|
131
|
+
key: "reset",
|
132
|
+
value: function reset() {
|
133
|
+
this.timeoutId = null;
|
134
|
+
}
|
135
|
+
}]);
|
136
|
+
return LogDebounceTracker;
|
137
|
+
}();
|
138
|
+
var logDebounceTracker = new LogDebounceTracker();
|
@@ -169,8 +169,8 @@ export var SecurityService = /*#__PURE__*/function () {
|
|
169
169
|
_this2.logger.logError({
|
170
170
|
title: 'sdk_error_securitySdkInitTimeout'
|
171
171
|
}, {
|
172
|
-
|
173
|
-
|
172
|
+
productScene: _this2.productScene,
|
173
|
+
eventMessage: isPre ? 'Active initialization' : 'SDK internal initialization'
|
174
174
|
}).send();
|
175
175
|
reject();
|
176
176
|
}, timeout);
|
@@ -182,7 +182,7 @@ export var SecurityService = /*#__PURE__*/function () {
|
|
182
182
|
_this2.logger.logInfo({
|
183
183
|
title: "sdk_event_securitySdk".concat(sdkAction, "Success")
|
184
184
|
}, isPre ? {
|
185
|
-
|
185
|
+
productScene: _this2.productScene
|
186
186
|
} : undefined).send();
|
187
187
|
resolve();
|
188
188
|
}, function (msg) {
|
@@ -190,7 +190,7 @@ export var SecurityService = /*#__PURE__*/function () {
|
|
190
190
|
title: 'sdk_error_securitySdkInitFailed',
|
191
191
|
msg: msg || undefined
|
192
192
|
}, {
|
193
|
-
|
193
|
+
productScene: _this2.productScene,
|
194
194
|
sign: isPre ? 'Active initialization' : 'SDK internal initialization'
|
195
195
|
}).send();
|
196
196
|
reject();
|
@@ -215,15 +215,13 @@ export var SecurityService = /*#__PURE__*/function () {
|
|
215
215
|
this.logger.logInfo({
|
216
216
|
title: 'sdk_event_securitySdkGetTokenSuccess'
|
217
217
|
}, {
|
218
|
-
|
219
|
-
time: time
|
218
|
+
eventMessage: time
|
220
219
|
}).send();
|
221
220
|
} else {
|
222
221
|
this.logger.logInfo({
|
223
222
|
title: 'sdk_error_securitySdkGetTokenFailed'
|
224
223
|
}, {
|
225
|
-
|
226
|
-
time: time
|
224
|
+
eventMessage: time
|
227
225
|
}).send();
|
228
226
|
}
|
229
227
|
}
|
package/esm/index.js
CHANGED
@@ -98,7 +98,7 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
|
|
98
98
|
logger.logError({
|
99
99
|
title: 'performance_optimization_get_previousChannel_error'
|
100
100
|
}, {
|
101
|
-
|
101
|
+
errorMessage: error
|
102
102
|
});
|
103
103
|
}
|
104
104
|
return _super4.call(this, _options, currentChannelType);
|
@@ -82,13 +82,15 @@ var ApplePayComponent = /*#__PURE__*/function () {
|
|
82
82
|
name: 'APPLE_PAY',
|
83
83
|
title: ApplePayComponentEvent.sdk_event_applePaymentResult
|
84
84
|
}, {
|
85
|
-
|
86
|
-
|
87
|
-
success: eventCodeEnum.SDK_PAYMENT_SUCCESSFUL === (state === null || state === void 0 ? void 0 : state.code),
|
85
|
+
eventSource: 'sdk',
|
86
|
+
processResult: eventCodeEnum.SDK_PAYMENT_SUCCESSFUL === (state === null || state === void 0 ? void 0 : state.code),
|
88
87
|
code: state === null || state === void 0 ? void 0 : state.code,
|
89
|
-
|
88
|
+
extSdkError: state === null || state === void 0 || (_state$result = state.result) === null || _state$result === void 0 ? void 0 : _state$result.errorCode,
|
90
89
|
errorMessage: state === null || state === void 0 || (_state$result2 = state.result) === null || _state$result2 === void 0 ? void 0 : _state$result2.errorMessage,
|
91
|
-
|
90
|
+
eventMessage: JSON.stringify({
|
91
|
+
type: 'funnel',
|
92
|
+
recurring: this.isRecurring
|
93
|
+
})
|
92
94
|
}).send();
|
93
95
|
(_this$_options = this._options) === null || _this$_options === void 0 || _this$_options.onEventCallback(state);
|
94
96
|
}
|
@@ -118,7 +120,7 @@ var ApplePayComponent = /*#__PURE__*/function () {
|
|
118
120
|
msg: 'Abnormal paymentSessionData'
|
119
121
|
}, {
|
120
122
|
type: 'error',
|
121
|
-
|
123
|
+
eventSource: 'sdk'
|
122
124
|
}).send();
|
123
125
|
return;
|
124
126
|
}
|
@@ -259,7 +261,7 @@ var ApplePayComponent = /*#__PURE__*/function () {
|
|
259
261
|
title: 'submitPayStatus',
|
260
262
|
msg: res === null || res === void 0 ? void 0 : res.errorStatus
|
261
263
|
}, {
|
262
|
-
|
264
|
+
eventSource: 'sdk'
|
263
265
|
}).send();
|
264
266
|
if (res !== null && res !== void 0 && res.success || (res === null || res === void 0 ? void 0 : res.errorStatus) === 'U') {
|
265
267
|
return Promise.resolve(res);
|
@@ -302,7 +304,7 @@ var ApplePayComponent = /*#__PURE__*/function () {
|
|
302
304
|
msg: error
|
303
305
|
}, {
|
304
306
|
type: 'error',
|
305
|
-
|
307
|
+
eventSource: 'sdk'
|
306
308
|
}).send();
|
307
309
|
if (_this._isFinish) {
|
308
310
|
return;
|
@@ -57,10 +57,12 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
57
57
|
name: 'APPLE_PAY',
|
58
58
|
title: ApplePayComponentEvent.sdk_event_appleAvailable
|
59
59
|
}, {
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
eventSource: 'sdk',
|
61
|
+
processResult: canMakePayments,
|
62
|
+
eventMessage: JSON.stringify({
|
63
|
+
type: 'funnel',
|
64
|
+
recurring: subPaymentMethod === 'ApplePayRecurringPayment'
|
65
|
+
})
|
64
66
|
}).send();
|
65
67
|
}
|
66
68
|
}, {
|
@@ -88,8 +90,10 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
88
90
|
name: 'APPLE_PAY',
|
89
91
|
title: ApplePayComponentEvent.sdk_event_appleDestroyComponent
|
90
92
|
}, {
|
91
|
-
|
92
|
-
|
93
|
+
eventSource: 'sdk',
|
94
|
+
eventMessage: JSON.stringify({
|
95
|
+
type: 'funnel'
|
96
|
+
})
|
93
97
|
}).send();
|
94
98
|
}
|
95
99
|
}, {
|
@@ -62,10 +62,12 @@ var ApplePayService = /*#__PURE__*/function () {
|
|
62
62
|
name: 'APPLE_PAY',
|
63
63
|
title: ApplePayComponentEvent.sdk_event_appleCreateComponent
|
64
64
|
}, {
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
eventSource: 'sdk',
|
66
|
+
processResult: success,
|
67
|
+
eventMessage: JSON.stringify({
|
68
|
+
type: 'funnel',
|
69
|
+
recurring: _this.isRecurring
|
70
|
+
})
|
69
71
|
}).send();
|
70
72
|
});
|
71
73
|
_defineProperty(this, "onpaymentauthorized", function (event) {
|
@@ -98,10 +100,12 @@ var ApplePayService = /*#__PURE__*/function () {
|
|
98
100
|
name: 'APPLE_PAY',
|
99
101
|
title: ApplePayComponentEvent.sdk_event_appleSubmitToken
|
100
102
|
}, {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
103
|
+
eventSource: 'sdk',
|
104
|
+
processResult: success,
|
105
|
+
eventMessage: JSON.stringify({
|
106
|
+
type: 'funnel',
|
107
|
+
recurring: _this.isRecurring
|
108
|
+
})
|
105
109
|
}).send();
|
106
110
|
});
|
107
111
|
/**
|
@@ -122,10 +126,12 @@ var ApplePayService = /*#__PURE__*/function () {
|
|
122
126
|
name: 'APPLE_PAY',
|
123
127
|
title: ApplePayComponentEvent.sdk_event_appleCreateComponent
|
124
128
|
}, {
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
+
eventSource: 'sdk',
|
130
|
+
processResult: ApplePaySession !== null,
|
131
|
+
eventMessage: JSON.stringify({
|
132
|
+
type: 'funnel',
|
133
|
+
recurring: _this.isRecurring
|
134
|
+
})
|
129
135
|
}).send();
|
130
136
|
if (!ApplePaySession) {
|
131
137
|
_this.logError(eventCodeEnum.SDK_PAYMENT_ERROR, "ApplePaySession is only support in Safari");
|
@@ -200,10 +206,12 @@ var ApplePayService = /*#__PURE__*/function () {
|
|
200
206
|
name: 'APPLE_PAY',
|
201
207
|
title: ApplePayComponentEvent.sdk_event_appleShowPaymentSheet
|
202
208
|
}, {
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
209
|
+
eventSource: 'sdk',
|
210
|
+
processResult: true,
|
211
|
+
eventMessage: JSON.stringify({
|
212
|
+
type: 'funnel',
|
213
|
+
recurring: recurringInfo !== null
|
214
|
+
})
|
207
215
|
}).send();
|
208
216
|
});
|
209
217
|
this.logger = logger;
|
@@ -35,11 +35,11 @@ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
|
|
35
35
|
title: 'sdk_event_appUpgradeInfo'
|
36
36
|
}, {
|
37
37
|
appUpgradeVersion: appVersion,
|
38
|
-
|
38
|
+
processResult: appVersion ? true : false,
|
39
39
|
isPreload: _extendInfo ? false : true,
|
40
|
-
|
40
|
+
config: _extendInfo,
|
41
41
|
productScene: productScene,
|
42
|
-
|
42
|
+
merchantId: mid
|
43
43
|
});
|
44
44
|
}
|
45
45
|
|
@@ -110,7 +110,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
110
110
|
sdkVersion: sdkVersion,
|
111
111
|
webAppVersion: this._appVersion,
|
112
112
|
instanceId: this.AMSSDK._instanceId,
|
113
|
-
|
113
|
+
deviceId: this.AMSSDK._storageId,
|
114
114
|
// the better way to use md5 paymentSesionID
|
115
115
|
renderDisplayType: paymentSessionMetaData === null || paymentSessionMetaData === void 0 ? void 0 : paymentSessionMetaData.renderDisplayType,
|
116
116
|
merchantId: paymentSessionMetaData === null || paymentSessionMetaData === void 0 ? void 0 : paymentSessionMetaData.clientId,
|
@@ -147,7 +147,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
147
147
|
this.AMSSDK.logger.logInfo({
|
148
148
|
title: 'sdk_event_security_unneeded_scenarios'
|
149
149
|
}, {
|
150
|
-
|
150
|
+
productScene: product
|
151
151
|
});
|
152
152
|
}
|
153
153
|
var securitySDK = this.AMSSDK._getSecuritySDKByProductScene({
|
@@ -180,15 +180,13 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
180
180
|
this.AMSSDK.logger.logInfo({
|
181
181
|
title: 'sdk_event_securitySdkGetTokenSuccess'
|
182
182
|
}, {
|
183
|
-
|
184
|
-
time: time
|
183
|
+
eventMessage: time
|
185
184
|
}).send();
|
186
185
|
} else {
|
187
186
|
this.AMSSDK.logger.logInfo({
|
188
187
|
title: 'sdk_error_securitySdkGetTokenFailed'
|
189
188
|
}, {
|
190
|
-
|
191
|
-
time: time
|
189
|
+
eventMessage: time
|
192
190
|
}).send();
|
193
191
|
}
|
194
192
|
}
|
@@ -309,8 +307,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
309
307
|
this.AMSSDK.logger.logInfo({
|
310
308
|
title: 'sdk_event_createComponent'
|
311
309
|
}, {
|
312
|
-
|
313
|
-
product: this.AMSSDK.options.product
|
310
|
+
productScene: this.AMSSDK.options.product
|
314
311
|
}).send();
|
315
312
|
if (ComponentSignEnum.EASY_PAY_WALLET === this._componentSign) {
|
316
313
|
if (productScene === ProductSceneEnum.EASY_PAY && productSceneVersion === '1.0' && !autoDebitWithToken && requireFastSdk) {
|
@@ -387,7 +384,6 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
387
384
|
this.AMSSDK.logger.logInfo({
|
388
385
|
title: 'performance_optimization_preload'
|
389
386
|
}, {
|
390
|
-
componentSign: componentSign,
|
391
387
|
productSceneVersion: productSceneVersion
|
392
388
|
});
|
393
389
|
}
|
@@ -644,8 +640,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
644
640
|
_this5.AMSSDK.logger.logInfo({
|
645
641
|
title: 'sdk_event_sdkQuery'
|
646
642
|
}, {
|
647
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
648
|
-
requestBody: params
|
643
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
649
644
|
}).send();
|
650
645
|
queryPaymentInfo(params, {
|
651
646
|
env: _this5.AMSSDK.options.env.environment,
|
@@ -659,8 +654,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
659
654
|
_this5.AMSSDK.logger.logInfo({
|
660
655
|
title: 'sdk_event_sdkQueryEnd'
|
661
656
|
}, {
|
662
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
663
|
-
responseBody: res
|
657
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
664
658
|
}).send();
|
665
659
|
}).catch(function (err) {
|
666
660
|
if ([ComponentSignEnum.CASHIER_PAYMENT_CARD, ComponentSignEnum.VAULTING_CARD, ComponentSignEnum.CASHIER_PAYMENT_APM].includes(_this5._componentSign)) {
|
@@ -675,7 +669,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
675
669
|
title: 'sdk_event_sdkQuery_failed'
|
676
670
|
}, {
|
677
671
|
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig),
|
678
|
-
|
672
|
+
errorMessage: err
|
679
673
|
}).send();
|
680
674
|
reject(err);
|
681
675
|
});
|
@@ -762,8 +756,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
762
756
|
_this6.AMSSDK.logger.logInfo({
|
763
757
|
title: 'sdk_event_submitPay'
|
764
758
|
}, {
|
765
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
766
|
-
requestBody: params
|
759
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
767
760
|
}).send();
|
768
761
|
extParams = (channelBehavior === null || channelBehavior === void 0 || (_channelBehavior$buil = channelBehavior.buildSubmitPayExtParams) === null || _channelBehavior$buil === void 0 ? void 0 : _channelBehavior$buil.call(channelBehavior, {
|
769
762
|
instanceId: _this6.AMSSDK._instanceId,
|
@@ -798,16 +791,14 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
798
791
|
_this6.AMSSDK.logger.logInfo({
|
799
792
|
title: 'sdk_event_submitPayEnd'
|
800
793
|
}, {
|
801
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
802
|
-
responseBody: res
|
794
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
803
795
|
}).send();
|
804
796
|
resolve(res);
|
805
797
|
}).catch(function (err) {
|
806
798
|
_this6.AMSSDK.logger.logError({
|
807
799
|
title: 'sdk_event_submitPay_failed'
|
808
800
|
}, {
|
809
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
810
|
-
responseBody: err
|
801
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
811
802
|
}).send();
|
812
803
|
resolve({
|
813
804
|
success: false
|
@@ -883,8 +874,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
883
874
|
this.AMSSDK.logger.logError({
|
884
875
|
title: 'performance_optimization_preload_path_error'
|
885
876
|
}, {
|
886
|
-
|
887
|
-
locationSearch: locationSearch
|
877
|
+
eventMessage: path
|
888
878
|
});
|
889
879
|
}
|
890
880
|
return preloadIframe;
|
@@ -1039,7 +1029,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1039
1029
|
this.AMSSDK.logger.logError({
|
1040
1030
|
title: (_context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.title) || 'sdk_error_create_pop_up'
|
1041
1031
|
}, {
|
1042
|
-
|
1032
|
+
errorMessage: _context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.message,
|
1043
1033
|
url: pageUrl
|
1044
1034
|
});
|
1045
1035
|
this.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
@@ -1464,6 +1454,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1464
1454
|
var _data$isDestroy,
|
1465
1455
|
_data$isCallApp,
|
1466
1456
|
_data$callAppDetectSu,
|
1457
|
+
_data$isDestroy2,
|
1458
|
+
_data$isCallApp2,
|
1459
|
+
_data$callAppDetectSu2,
|
1467
1460
|
_this8 = this;
|
1468
1461
|
var fromFastSdk = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
1469
1462
|
var _data = typeof data === 'string' ? {
|
@@ -1477,9 +1470,20 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1477
1470
|
isCallApp: (_data$isCallApp = data === null || data === void 0 ? void 0 : data.isCallApp) !== null && _data$isCallApp !== void 0 ? _data$isCallApp : false,
|
1478
1471
|
callAppDetectSuccessDelay: (_data$callAppDetectSu = data === null || data === void 0 ? void 0 : data.callAppDetectSuccessDelay) !== null && _data$callAppDetectSu !== void 0 ? _data$callAppDetectSu : 2000
|
1479
1472
|
});
|
1473
|
+
var logParams = {
|
1474
|
+
applinkUrl: (data === null || data === void 0 ? void 0 : data.applinkUrl) || '',
|
1475
|
+
schemeUrl: (data === null || data === void 0 ? void 0 : data.schemeUrl) || '',
|
1476
|
+
normalUrl: (data === null || data === void 0 ? void 0 : data.normalUrl) || '',
|
1477
|
+
target: data === null || data === void 0 ? void 0 : data.target,
|
1478
|
+
isDestroy: (_data$isDestroy2 = data === null || data === void 0 ? void 0 : data.isDestroy) !== null && _data$isDestroy2 !== void 0 ? _data$isDestroy2 : true,
|
1479
|
+
isCallApp: (_data$isCallApp2 = data === null || data === void 0 ? void 0 : data.isCallApp) !== null && _data$isCallApp2 !== void 0 ? _data$isCallApp2 : false,
|
1480
|
+
callAppDetectSuccessDelay: (_data$callAppDetectSu2 = data === null || data === void 0 ? void 0 : data.callAppDetectSuccessDelay) !== null && _data$callAppDetectSu2 !== void 0 ? _data$callAppDetectSu2 : 2000
|
1481
|
+
};
|
1480
1482
|
this.AMSSDK.logger.logInfo({
|
1481
1483
|
title: 'sdk_event_call_url_start'
|
1482
|
-
},
|
1484
|
+
}, {
|
1485
|
+
redirectInfo: JSON.stringify(logParams)
|
1486
|
+
}).send();
|
1483
1487
|
var successCallback = function successCallback(type, url, durationInSeconds) {
|
1484
1488
|
_this8.dispatchToSDK(EVENT.eventCallback.name, {
|
1485
1489
|
code: eventCodeEnum.SDK_CALL_URL_SUCCESS,
|
@@ -346,7 +346,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
346
346
|
_this2.logger.logError({
|
347
347
|
title: 'button_render_failed'
|
348
348
|
}, {
|
349
|
-
|
349
|
+
errorMessage: error
|
350
350
|
});
|
351
351
|
_this2.onEventCallback({
|
352
352
|
code: eventCodeEnum.SDK_PAYMENT_FAIL,
|
package/esm/service/index.js
CHANGED
@@ -59,14 +59,16 @@ function _antomConfig() {
|
|
59
59
|
case 6:
|
60
60
|
json = _context2.sent;
|
61
61
|
logger.logInfo({
|
62
|
-
title: '
|
62
|
+
title: 'sdk_event_importantEvent',
|
63
|
+
msg: 'Successfully obtained marmot emergency configuration'
|
63
64
|
});
|
64
65
|
return _context2.abrupt("return", json);
|
65
66
|
case 11:
|
66
67
|
_context2.prev = 11;
|
67
68
|
_context2.t0 = _context2["catch"](0);
|
68
69
|
logger.logError({
|
69
|
-
title: '
|
70
|
+
title: 'event_important_error',
|
71
|
+
msg: 'Abnormal acquisition of marmot emergency configuration'
|
70
72
|
});
|
71
73
|
return _context2.abrupt("return", '{}');
|
72
74
|
case 15:
|
package/esm/util/index.js
CHANGED
@@ -280,8 +280,7 @@ function loadSDKScript(_ref, logger) {
|
|
280
280
|
logger.logInfo({
|
281
281
|
title: 'load_item_sdk_start'
|
282
282
|
}, {
|
283
|
-
|
284
|
-
attrOptions: JSON.stringify(attrOptions)
|
283
|
+
eventMessage: src
|
285
284
|
});
|
286
285
|
console.time();
|
287
286
|
var script = document.createElement('script');
|
@@ -294,8 +293,7 @@ function loadSDKScript(_ref, logger) {
|
|
294
293
|
logger.logInfo({
|
295
294
|
title: 'load_item_sdk_end'
|
296
295
|
}, {
|
297
|
-
|
298
|
-
attrOptions: JSON.stringify(attrOptions)
|
296
|
+
eventMessage: src
|
299
297
|
});
|
300
298
|
console.timeEnd();
|
301
299
|
clearTimeout(timer);
|
@@ -308,8 +306,7 @@ function loadSDKScript(_ref, logger) {
|
|
308
306
|
logger.logError({
|
309
307
|
title: 'load_item_sdk_error'
|
310
308
|
}, {
|
311
|
-
|
312
|
-
attrOptions: JSON.stringify(attrOptions)
|
309
|
+
eventMessage: src
|
313
310
|
});
|
314
311
|
clearTimeout(timer);
|
315
312
|
console.error('The script ' + src + ' is not accessible.');
|
@@ -319,8 +316,7 @@ function loadSDKScript(_ref, logger) {
|
|
319
316
|
_this2.logger.logError({
|
320
317
|
title: 'load_item_sdk_timeout'
|
321
318
|
}, {
|
322
|
-
|
323
|
-
attrOptions: JSON.stringify(attrOptions)
|
319
|
+
eventMessage: src
|
324
320
|
});
|
325
321
|
reject(false);
|
326
322
|
}, timeOut * 1000);
|
package/esm/util/logger.d.ts
CHANGED
@@ -13,10 +13,10 @@ export interface LogMetaData {
|
|
13
13
|
platform?: string;
|
14
14
|
sdkVersion?: string;
|
15
15
|
webAppVersion?: string;
|
16
|
-
|
16
|
+
firstLogTime?: number;
|
17
17
|
fsDuration?: number;
|
18
18
|
instanceId?: string;
|
19
|
-
|
19
|
+
deviceId?: string;
|
20
20
|
renderDisplayType?: string;
|
21
21
|
merchantId?: string;
|
22
22
|
productScene?: string;
|
@@ -49,7 +49,7 @@ export declare class Logger {
|
|
49
49
|
static setInstance(instance: Logger): Logger;
|
50
50
|
static getInstance(): Logger;
|
51
51
|
setMedta(mdata: LogMetaData): void;
|
52
|
-
logError(error: LogPayload, extra?: Extra): Logger;
|
52
|
+
logError(error: LogPayload, extra?: Extra, enableExtractCompliance?: boolean): Logger;
|
53
53
|
logInfo(info: LogPayload, extra?: Extra): Logger;
|
54
54
|
reportRPC(rpcData: LogPayload, extra?: Extra): Logger;
|
55
55
|
reportLogs(): void;
|