@alipay/ams-checkout 0.0.1747907034-dev.3 → 0.0.1747907034-dev.5
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.
@@ -40,7 +40,6 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
40
40
|
_defineProperty(this, "status", IElementStatus.UNINIT);
|
41
41
|
_defineProperty(this, "logger", void 0);
|
42
42
|
this.status = IElementStatus.INITING;
|
43
|
-
this.logger = ServiceProvider.getInstance(this.instanceId).getService('Log');
|
44
43
|
}
|
45
44
|
_createClass(AntomSDKCore, [{
|
46
45
|
key: "getStatus",
|
@@ -86,6 +85,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
86
85
|
};
|
87
86
|
this.sdkMetaData.webAppVersion = getWebAppVersion(this.sdkMetaData);
|
88
87
|
ServiceProvider.getInstance(this.instanceId).init(options, this.sdkMetaData);
|
88
|
+
this.logger = ServiceProvider.getInstance(this.instanceId).getService('Log');
|
89
89
|
this.prepare(options, this.sdkMetaData);
|
90
90
|
}
|
91
91
|
}, {
|
@@ -213,6 +213,12 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
213
213
|
});
|
214
214
|
eventCenter.listen(EVENT.eventCallback.name, function (data) {
|
215
215
|
var _options$onEventCallb;
|
216
|
+
_this.logger.logInfo({
|
217
|
+
title: 'sdk_event_event_callback'
|
218
|
+
}, {
|
219
|
+
eventCode: JSON.stringify((data === null || data === void 0 ? void 0 : data.code) || ''),
|
220
|
+
eventMessage: JSON.stringify((data === null || data === void 0 ? void 0 : data.message) || '')
|
221
|
+
});
|
216
222
|
(_options$onEventCallb = options.onEventCallback) === null || _options$onEventCallb === void 0 || _options$onEventCallb.call(options, data);
|
217
223
|
});
|
218
224
|
eventCenter.listen(EVENT.error.name, function (data) {
|
@@ -222,7 +228,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
222
228
|
eventCenter.listen(EVENT.declareEventCallbackInfo.name, function (data) {
|
223
229
|
if (data !== null && data !== void 0 && data.popWindowEventInfo) {
|
224
230
|
_this.enablePopWindowEventCallback = data.popWindowEventInfo.enableCallback;
|
225
|
-
_this.eventLogging = data.eventLogging;
|
231
|
+
_this.eventLogging = data.popWindowEventInfo.eventLogging;
|
226
232
|
}
|
227
233
|
});
|
228
234
|
|
@@ -246,6 +252,9 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
246
252
|
}
|
247
253
|
throw new Error('paymentSession is empty');
|
248
254
|
case 2:
|
255
|
+
this.logger.logInfo({
|
256
|
+
title: 'sdk_event_createComponent'
|
257
|
+
});
|
249
258
|
this.setStatus(IElementStatus.IN_BIZ_FLOW);
|
250
259
|
paymentSession = options.paymentSession, displayInfo = options.displayInfo;
|
251
260
|
_convertPaymentSessio2 = convertPaymentSession(paymentSession), paymentSessionId = _convertPaymentSessio2.id, paymentSessionMetaData = _convertPaymentSessio2.data;
|
@@ -271,59 +280,59 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
271
280
|
// Invoke processor
|
272
281
|
productScene = (_this$paymentContext$2 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$2 === void 0 || (_this$paymentContext$2 = _this$paymentContext$2.paymentSessionConfig) === null || _this$paymentContext$2 === void 0 ? void 0 : _this$paymentContext$2.productScene;
|
273
282
|
paymentMethod = (_this$paymentContext$3 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$3 === void 0 || (_this$paymentContext$3 = _this$paymentContext$3.paymentMethodInfoView) === null || _this$paymentContext$3 === void 0 ? void 0 : _this$paymentContext$3.paymentMethodType;
|
274
|
-
_context4.prev =
|
283
|
+
_context4.prev = 15;
|
275
284
|
if (!this.productProcessors["".concat(productScene, "|").concat(paymentMethod)]) {
|
276
|
-
_context4.next =
|
285
|
+
_context4.next = 22;
|
277
286
|
break;
|
278
287
|
}
|
279
|
-
_context4.next =
|
288
|
+
_context4.next = 19;
|
280
289
|
return this.productProcessors["".concat(productScene, "|").concat(paymentMethod)].startBizFlow(this.paymentContext);
|
281
|
-
case
|
290
|
+
case 19:
|
282
291
|
this.bizFlowStartBehavior = _context4.sent;
|
283
|
-
_context4.next =
|
292
|
+
_context4.next = 26;
|
284
293
|
break;
|
285
|
-
case
|
294
|
+
case 22:
|
286
295
|
if (!this.productProcessors["".concat(productScene)]) {
|
287
|
-
_context4.next =
|
296
|
+
_context4.next = 26;
|
288
297
|
break;
|
289
298
|
}
|
290
|
-
_context4.next =
|
299
|
+
_context4.next = 25;
|
291
300
|
return this.productProcessors["".concat(productScene)].startBizFlow(this.paymentContext);
|
292
|
-
case 24:
|
293
|
-
this.bizFlowStartBehavior = _context4.sent;
|
294
301
|
case 25:
|
295
|
-
|
302
|
+
this.bizFlowStartBehavior = _context4.sent;
|
303
|
+
case 26:
|
304
|
+
_context4.next = 31;
|
296
305
|
break;
|
297
|
-
case
|
298
|
-
_context4.prev =
|
299
|
-
_context4.t0 = _context4["catch"](
|
306
|
+
case 28:
|
307
|
+
_context4.prev = 28;
|
308
|
+
_context4.t0 = _context4["catch"](15);
|
300
309
|
console.error('Invoke processor failed', _context4.t0);
|
301
|
-
case
|
310
|
+
case 31:
|
302
311
|
if (!(!this.bizFlowStartBehavior || this.bizFlowStartBehavior.behaviorType === 'NONE' || !this.bizFlowStartBehavior.payload)) {
|
303
|
-
_context4.next =
|
312
|
+
_context4.next = 33;
|
304
313
|
break;
|
305
314
|
}
|
306
315
|
return _context4.abrupt("return");
|
307
|
-
case
|
316
|
+
case 33:
|
308
317
|
if (!(this.bizFlowStartBehavior.behaviorType === 'RENDER')) {
|
309
|
-
_context4.next =
|
318
|
+
_context4.next = 36;
|
310
319
|
break;
|
311
320
|
}
|
312
321
|
this.handleBehaviorRender();
|
313
322
|
return _context4.abrupt("return");
|
314
|
-
case
|
323
|
+
case 36:
|
315
324
|
if (!(this.bizFlowStartBehavior.behaviorType === 'REDIRECT')) {
|
316
|
-
_context4.next =
|
325
|
+
_context4.next = 40;
|
317
326
|
break;
|
318
327
|
}
|
319
328
|
payload = (_this$bizFlowStartBeh = this.bizFlowStartBehavior) === null || _this$bizFlowStartBeh === void 0 ? void 0 : _this$bizFlowStartBeh.payload;
|
320
329
|
redirect(payload, this.instanceId);
|
321
330
|
return _context4.abrupt("return");
|
322
|
-
case
|
331
|
+
case 40:
|
323
332
|
case "end":
|
324
333
|
return _context4.stop();
|
325
334
|
}
|
326
|
-
}, _callee4, this, [[
|
335
|
+
}, _callee4, this, [[15, 28]]);
|
327
336
|
}));
|
328
337
|
function startBizFlow(_x7) {
|
329
338
|
return _startBizFlow.apply(this, arguments);
|
@@ -412,13 +421,14 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
412
421
|
key: "handleRemain",
|
413
422
|
value: function handleRemain() {
|
414
423
|
if (this.eventLogging && this.eventLogging.enableLogging) {
|
424
|
+
var _this$eventLogging, _this$eventLogging2, _this$eventLogging3, _this$eventLogging4;
|
415
425
|
this.logger.logInfo({
|
416
|
-
code: this.eventLogging.eventName
|
426
|
+
code: ((_this$eventLogging = this.eventLogging) === null || _this$eventLogging === void 0 ? void 0 : _this$eventLogging.eventName) || ''
|
417
427
|
}, {
|
418
428
|
eventId: EventLoggingEventId.ContinuePaying,
|
419
|
-
eventName: this.eventLogging.eventName,
|
420
|
-
eventAlias: this.eventLogging.eventAlias,
|
421
|
-
userPath: this.eventLogging.userPath
|
429
|
+
eventName: ((_this$eventLogging2 = this.eventLogging) === null || _this$eventLogging2 === void 0 ? void 0 : _this$eventLogging2.eventName) || '',
|
430
|
+
eventAlias: ((_this$eventLogging3 = this.eventLogging) === null || _this$eventLogging3 === void 0 ? void 0 : _this$eventLogging3.eventAlias) || '',
|
431
|
+
userPath: ((_this$eventLogging4 = this.eventLogging) === null || _this$eventLogging4 === void 0 ? void 0 : _this$eventLogging4.userPath) || ''
|
422
432
|
});
|
423
433
|
}
|
424
434
|
}
|
@@ -431,13 +441,14 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
431
441
|
eventCenter.emit(EVENT.closeCallback.name, {});
|
432
442
|
if (this.enablePopWindowEventCallback && !isOnCloseEvent) {
|
433
443
|
if (this.eventLogging && this.eventLogging.enableLogging) {
|
444
|
+
var _this$eventLogging5, _this$eventLogging6, _this$eventLogging7, _this$eventLogging8;
|
434
445
|
this.logger.logInfo({
|
435
|
-
code: this.eventLogging.eventName
|
446
|
+
code: ((_this$eventLogging5 = this.eventLogging) === null || _this$eventLogging5 === void 0 ? void 0 : _this$eventLogging5.eventName) || ''
|
436
447
|
}, {
|
437
448
|
eventId: source === 'behavior' ? EventLoggingEventId.OnlyClose : EventLoggingEventId.LeaveAnyWay,
|
438
|
-
eventName: this.eventLogging.eventName,
|
439
|
-
eventAlias: this.eventLogging.eventAlias,
|
440
|
-
userPath: this.eventLogging.userPath
|
449
|
+
eventName: ((_this$eventLogging6 = this.eventLogging) === null || _this$eventLogging6 === void 0 ? void 0 : _this$eventLogging6.eventName) || '',
|
450
|
+
eventAlias: ((_this$eventLogging7 = this.eventLogging) === null || _this$eventLogging7 === void 0 ? void 0 : _this$eventLogging7.eventAlias) || '',
|
451
|
+
userPath: ((_this$eventLogging8 = this.eventLogging) === null || _this$eventLogging8 === void 0 ? void 0 : _this$eventLogging8.userPath) || ''
|
441
452
|
});
|
442
453
|
}
|
443
454
|
eventCenter.emit(EVENT.eventCallback.name, {
|
@@ -475,6 +486,9 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
475
486
|
setTimeout(function () {
|
476
487
|
cleanElement();
|
477
488
|
}, 300);
|
489
|
+
this.logger.logInfo({
|
490
|
+
title: 'sdk_event_destroyComponent'
|
491
|
+
});
|
478
492
|
}
|
479
493
|
}, {
|
480
494
|
key: "getInstanceId",
|
@@ -77,10 +77,10 @@ export interface SDKMetaData {
|
|
77
77
|
greyscaleId?: number;
|
78
78
|
}
|
79
79
|
export interface EventLogging {
|
80
|
-
enableLogging
|
81
|
-
eventName
|
82
|
-
eventAlias
|
83
|
-
userPath
|
80
|
+
enableLogging?: boolean;
|
81
|
+
eventName?: string;
|
82
|
+
eventAlias?: string;
|
83
|
+
userPath?: string;
|
84
84
|
}
|
85
85
|
export interface InitContext {
|
86
86
|
initOptions: IoptionsParams;
|
@@ -184,6 +184,9 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
184
184
|
_this.eventCenter.listen('onLaunch', function (res) {
|
185
185
|
clearTimeout(t);
|
186
186
|
resolve(res);
|
187
|
+
_this.logger.logInfo({
|
188
|
+
title: 'sdk_event_webAppOnLaunch'
|
189
|
+
});
|
187
190
|
});
|
188
191
|
});
|
189
192
|
|
@@ -231,6 +234,9 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
231
234
|
event: 'renderComponent',
|
232
235
|
data: data
|
233
236
|
});
|
237
|
+
_this.logger.logInfo({
|
238
|
+
title: 'sdk_event_renderComponent'
|
239
|
+
});
|
234
240
|
}).catch(function (error) {
|
235
241
|
_this.eventCenter.emit(EVENT.destroy.name, {});
|
236
242
|
_this.eventCenter.emit(EVENT.eventCallback.name, {
|