@alipay/ams-checkout 0.0.1724942009-dev.5 → 0.0.1725951289-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/config/index.d.ts +11 -0
- package/esm/config/index.js +20 -1
- package/esm/constant/index.d.ts +8 -5
- package/esm/constant/index.js +9 -78
- package/esm/core/component/address.d.ts +8 -0
- package/esm/core/component/address.js +72 -0
- package/esm/core/component/index.d.ts +5 -2
- package/esm/core/component/index.js +70 -55
- package/esm/core/instance/index.d.ts +0 -1
- package/esm/core/instance/index.js +9 -5
- package/esm/index.d.ts +8 -8
- package/esm/index.js +44 -8
- package/esm/plugin/applepay/component.js +1 -1
- package/esm/plugin/component/cashierApp.d.ts +3 -3
- package/esm/plugin/component/cashierApp.js +33 -3
- package/esm/plugin/component/channel.d.ts +2 -1
- package/esm/plugin/component/channel.js +38 -1
- package/esm/plugin/component/component.inline.style.d.ts +8 -9
- package/esm/plugin/component/component.inline.style.js +87 -6
- package/esm/plugin/component/component.popup.style.d.ts +1 -0
- package/esm/plugin/component/component.popup.style.js +3 -0
- package/esm/plugin/component/index.d.ts +3 -2
- package/esm/plugin/component/index.js +170 -156
- package/esm/plugin/component/popupWindow.style.d.ts +5 -2
- package/esm/plugin/component/popupWindow.style.js +70 -14
- package/esm/plugin/payment-element/utils.d.ts +2 -0
- package/esm/plugin/payment-element/utils.js +6 -0
- package/esm/plugin/paypal/index.js +1 -0
- package/esm/plugin/type.d.ts +1 -0
- package/esm/types/index.d.ts +92 -5
- package/esm/types/index.js +14 -0
- package/esm/util/security.d.ts +1 -0
- package/esm/util/security.js +1 -1
- package/package.json +1 -1
- package/esm/util/getBackScheme.d.ts +0 -5
- package/esm/util/getBackScheme.js +0 -42
- package/esm/util/ua/index.d.ts +0 -2
- package/esm/util/ua/index.js +0 -2
- package/esm/util/ua/isAndroid.d.ts +0 -4
- package/esm/util/ua/isAndroid.js +0 -7
- package/esm/util/ua/isIOS.d.ts +0 -4
- package/esm/util/ua/isIOS.js +0 -7
@@ -25,15 +25,15 @@ import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSce
|
|
25
25
|
import { getType, isJsonString, isPC } from "../../util";
|
26
26
|
import { isLocalMock } from "../../util/mock";
|
27
27
|
import { matchVersion } from "../../util/versionCompare";
|
28
|
-
import {
|
28
|
+
import { handlePaymentSessionConfig } from "../payment-element/utils";
|
29
29
|
import { createIframe, createPreloadIframe, getAppDomain, getIframeUrl } from "./cashierApp";
|
30
|
-
import { getChannelBehavior } from "./channel";
|
30
|
+
import { getChannelBehavior, handleGooglePay } from "./channel";
|
31
31
|
import { addInlineLoading, createInlineBaseElement } from "./component.inline.style";
|
32
|
-
import { addPopupLoading, createBaseElement, createMockup, createRetentionPopup, handleDeclareInfo as _handleDeclareInfo, hideRetentionPopup, removeRetentionPopup as _removeRetentionPopup } from "./component.popup.style";
|
33
|
-
import { createModal, destroyModal, insertStyleSheet } from "./popupWindow.style";
|
32
|
+
import { addPopupLoading, createBaseElement, createMockup, createRetentionPopup, handleDeclareInfo as _handleDeclareInfo, hideRetentionPopup, removeRetentionPopup as _removeRetentionPopup, slideInAndOutKeyframes } from "./component.popup.style";
|
33
|
+
import { createModal, destroyModal, insertStyleSheet, removePopupLoading } from "./popupWindow.style";
|
34
34
|
window.changingPageHeight = window.innerHeight;
|
35
35
|
var ComponentApp = /*#__PURE__*/function () {
|
36
|
-
function ComponentApp() {
|
36
|
+
function ComponentApp(componentOption) {
|
37
37
|
_classCallCheck(this, ComponentApp);
|
38
38
|
_defineProperty(this, "app", void 0);
|
39
39
|
_defineProperty(this, "AMSSDK", void 0);
|
@@ -57,10 +57,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
57
57
|
_defineProperty(this, "_appLocationSearch", void 0);
|
58
58
|
_defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
|
59
59
|
_defineProperty(this, "_multipleCallbackEvents", void 0);
|
60
|
-
_defineProperty(this, "_isAppWebview", void 0);
|
61
60
|
_defineProperty(this, "_merchantAppointParam", void 0);
|
62
61
|
_defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
|
63
|
-
this._appVersion =
|
62
|
+
this._appVersion = componentOption.appVersion;
|
64
63
|
this._isInitComponent = false;
|
65
64
|
this._selector = "#".concat(COMPONENT_SECTION_ID);
|
66
65
|
this.createIframeNode = function () {
|
@@ -261,13 +260,12 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
261
260
|
return Promise.reject(ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
|
262
261
|
}
|
263
262
|
renderParams = this.setParameterDefaultValues(componentSign, renderParams);
|
263
|
+
this._merchantAppointParam = renderParams.merchantAppointParam;
|
264
264
|
this._isInitComponent = true;
|
265
265
|
this._renderParams = renderParams;
|
266
266
|
this._componentSign = componentSign;
|
267
267
|
if ((_renderParams = renderParams) !== null && _renderParams !== void 0 && _renderParams.selector) this._selector = renderParams.selector;
|
268
268
|
this._renderDisplayType = renderParams.renderDisplayType;
|
269
|
-
this._isAppWebview = renderParams.isAppWebview;
|
270
|
-
this._merchantAppointParam = renderParams.merchantAppointParam;
|
271
269
|
var insertedNode = this._renderDisplayType === renderDisplayTypeEnum.inline ? "#".concat(COMPONENT_CONTAINER_ID) : this._selector;
|
272
270
|
this.initLoggerMeta();
|
273
271
|
this.initSecurity();
|
@@ -390,10 +388,22 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
390
388
|
}, {
|
391
389
|
key: "renderInlineLoading",
|
392
390
|
value: function renderInlineLoading(renderParams, selector) {
|
393
|
-
var _renderParams$appeara;
|
391
|
+
var _renderParams$appeara, _this$_renderParams11;
|
394
392
|
var showLoading = renderParams === null || renderParams === void 0 || (_renderParams$appeara = renderParams.appearance) === null || _renderParams$appeara === void 0 ? void 0 : _renderParams$appeara.showLoading;
|
395
393
|
showLoading = typeof showLoading === 'boolean' ? showLoading : true;
|
396
|
-
|
394
|
+
var extendInfo = renderParams.paymentSessionMetaData.extendInfo;
|
395
|
+
var isExpressCheckout = false;
|
396
|
+
try {
|
397
|
+
// expressCheckout可能出现string(false) JSON.parse再转一次
|
398
|
+
isExpressCheckout = JSON.parse(JSON.parse(extendInfo).expressCheckout);
|
399
|
+
} catch (error) {
|
400
|
+
// 遇到JSON解析错误,默认false
|
401
|
+
}
|
402
|
+
if (showLoading) addInlineLoading(selector, this.platform, {
|
403
|
+
componentSign: this._componentSign,
|
404
|
+
type: (_this$_renderParams11 = this._renderParams) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.appearance) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.layout) === null || _this$_renderParams11 === void 0 ? void 0 : _this$_renderParams11.type,
|
405
|
+
isExpressCheckout: isExpressCheckout
|
406
|
+
});
|
397
407
|
}
|
398
408
|
}, {
|
399
409
|
key: "renderPopupLoading",
|
@@ -430,9 +440,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
430
440
|
}, {
|
431
441
|
key: "createActionQueryPromise",
|
432
442
|
value: function createActionQueryPromise() {
|
433
|
-
var
|
434
|
-
_this5 = this;
|
435
|
-
var paymentMethodType = (_this$_renderParams11 = this._renderParams) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.paymentSessionMetaData) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.paymentMethodInfoView) === null || _this$_renderParams11 === void 0 ? void 0 : _this$_renderParams11.paymentMethodType;
|
443
|
+
var _this5 = this;
|
436
444
|
this._performanceData.push({
|
437
445
|
key: 'sdk_action_query_start',
|
438
446
|
value: Date.now()
|
@@ -441,7 +449,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
441
449
|
this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
|
442
450
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
|
443
451
|
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6;
|
444
|
-
var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams7,
|
452
|
+
var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams7, _ref8, _ref8$productSceneVer, productSceneVersion, _ref8$productScene, productScene, _this5$_renderParams8, _action$web2, _action$wap2, action, signType;
|
445
453
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
446
454
|
while (1) switch (_context2.prev = _context2.next) {
|
447
455
|
case 0:
|
@@ -477,22 +485,35 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
477
485
|
success: true
|
478
486
|
}));
|
479
487
|
case 9:
|
488
|
+
if (componentSignEnum.ELEMENT_PAYMENT === _this5._componentSign) {
|
489
|
+
params.paymentSessionConfig = handlePaymentSessionConfig(params.paymentSessionConfig);
|
490
|
+
}
|
491
|
+
/** 地址组件跳过接口查询 */
|
492
|
+
if (!(componentSignEnum.ELEMENT_ADDRESS === _this5._componentSign)) {
|
493
|
+
_context2.next = 12;
|
494
|
+
break;
|
495
|
+
}
|
496
|
+
return _context2.abrupt("return", resolve({
|
497
|
+
message: 'sdk no need to make query request',
|
498
|
+
success: true
|
499
|
+
}));
|
500
|
+
case 12:
|
480
501
|
if (!(componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
|
481
|
-
_context2.next =
|
502
|
+
_context2.next = 24;
|
482
503
|
break;
|
483
504
|
}
|
484
505
|
if (!enableVaultingApiOptimize) {
|
485
|
-
_context2.next =
|
506
|
+
_context2.next = 24;
|
486
507
|
break;
|
487
508
|
}
|
488
509
|
if (!skipSdkQueryForm) {
|
489
|
-
_context2.next =
|
510
|
+
_context2.next = 21;
|
490
511
|
break;
|
491
512
|
}
|
492
513
|
// 优先判断 skipSdkQueryForm
|
493
514
|
ifSkip = matchVersion(skipSdkQueryForm, _this5._appVersion);
|
494
515
|
if (!ifSkip) {
|
495
|
-
_context2.next =
|
516
|
+
_context2.next = 19;
|
496
517
|
break;
|
497
518
|
}
|
498
519
|
resolve({
|
@@ -500,12 +521,12 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
500
521
|
success: true
|
501
522
|
});
|
502
523
|
return _context2.abrupt("return");
|
503
|
-
case
|
504
|
-
_context2.next =
|
524
|
+
case 19:
|
525
|
+
_context2.next = 24;
|
505
526
|
break;
|
506
|
-
case
|
527
|
+
case 21:
|
507
528
|
if (!skipSdkQuery) {
|
508
|
-
_context2.next =
|
529
|
+
_context2.next = 24;
|
509
530
|
break;
|
510
531
|
}
|
511
532
|
resolve({
|
@@ -513,10 +534,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
513
534
|
success: true
|
514
535
|
});
|
515
536
|
return _context2.abrupt("return");
|
516
|
-
case
|
537
|
+
case 24:
|
517
538
|
channelBehavior = getChannelBehavior((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData); // Easypay TOSS 渠道无需actionQuery
|
518
539
|
if (!(channelBehavior !== null && channelBehavior !== void 0 && channelBehavior.usePaymentSessionAsQueryResult)) {
|
519
|
-
_context2.next =
|
540
|
+
_context2.next = 27;
|
520
541
|
break;
|
521
542
|
}
|
522
543
|
return _context2.abrupt("return", resolve({
|
@@ -524,79 +545,78 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
524
545
|
amountConfirmRequired: actionData === null || actionData === void 0 ? void 0 : actionData.amountConfirmRequired,
|
525
546
|
success: true
|
526
547
|
}));
|
527
|
-
case
|
548
|
+
case 27:
|
528
549
|
if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
|
529
|
-
_context2.next =
|
550
|
+
_context2.next = 33;
|
530
551
|
break;
|
531
552
|
}
|
532
553
|
params.paymentMethodType = 'CARD';
|
533
|
-
_context2.next =
|
554
|
+
_context2.next = 31;
|
534
555
|
return _this5.getDeviceIdAndLog();
|
535
|
-
case
|
556
|
+
case 31:
|
536
557
|
envInfo.deviceId = _context2.sent;
|
537
558
|
if (window.navigator.userAgent.indexOf('miniProgram') > -1) {
|
538
559
|
envInfo.extendInfo = {
|
539
560
|
WAP_SUB_TYPE: 'WECHAT_MINI_PROGRAM'
|
540
561
|
};
|
541
562
|
}
|
542
|
-
case
|
563
|
+
case 33:
|
543
564
|
if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
|
544
|
-
_context2.next =
|
565
|
+
_context2.next = 42;
|
545
566
|
break;
|
546
567
|
}
|
547
568
|
_ref8 = params.paymentSessionConfig || {}, _ref8$productSceneVer = _ref8.productSceneVersion, productSceneVersion = _ref8$productSceneVer === void 0 ? '' : _ref8$productSceneVer, _ref8$productScene = _ref8.productScene, productScene = _ref8$productScene === void 0 ? '' : _ref8$productScene;
|
548
|
-
|
549
|
-
|
550
|
-
_context2.next = 35;
|
569
|
+
if (!((_this5$_renderParams7 = _this5._renderParams) !== null && _this5$_renderParams7 !== void 0 && (_this5$_renderParams7 = _this5$_renderParams7.paymentSessionMetaData) !== null && _this5$_renderParams7 !== void 0 && (_this5$_renderParams7 = _this5$_renderParams7.action) !== null && _this5$_renderParams7 !== void 0 && _this5$_renderParams7.skipSdkQuery && enableEasypayApiOptimize)) {
|
570
|
+
_context2.next = 37;
|
551
571
|
break;
|
552
572
|
}
|
553
573
|
return _context2.abrupt("return", resolve({
|
554
574
|
message: 'sdk no need to make query request',
|
555
575
|
success: true
|
556
576
|
}));
|
557
|
-
case
|
577
|
+
case 37:
|
558
578
|
if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0')) {
|
559
|
-
_context2.next =
|
579
|
+
_context2.next = 39;
|
560
580
|
break;
|
561
581
|
}
|
562
582
|
return _context2.abrupt("return", resolve({
|
563
583
|
message: 'sdk no need to make query request',
|
564
584
|
success: true
|
565
585
|
}));
|
566
|
-
case 37:
|
567
|
-
_context2.next = 39;
|
568
|
-
return _this5.getDeviceIdAndLog();
|
569
586
|
case 39:
|
587
|
+
_context2.next = 41;
|
588
|
+
return _this5.getDeviceIdAndLog();
|
589
|
+
case 41:
|
570
590
|
envInfo.deviceId = _context2.sent;
|
571
|
-
case
|
591
|
+
case 42:
|
572
592
|
if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
|
573
|
-
_context2.next =
|
593
|
+
_context2.next = 52;
|
574
594
|
break;
|
575
595
|
}
|
576
|
-
action = ((_this5$
|
596
|
+
action = ((_this5$_renderParams8 = _this5._renderParams) === null || _this5$_renderParams8 === void 0 || (_this5$_renderParams8 = _this5$_renderParams8.paymentSessionMetaData) === null || _this5$_renderParams8 === void 0 ? void 0 : _this5$_renderParams8.action) || {};
|
577
597
|
signType = isPC() ? action === null || action === void 0 || (_action$web2 = action.web) === null || _action$web2 === void 0 ? void 0 : _action$web2.signType : action === null || action === void 0 || (_action$wap2 = action.wap) === null || _action$wap2 === void 0 ? void 0 : _action$wap2.signType;
|
578
598
|
if (!(signType === 'SMS')) {
|
579
|
-
_context2.next =
|
599
|
+
_context2.next = 47;
|
580
600
|
break;
|
581
601
|
}
|
582
602
|
return _context2.abrupt("return", resolve({
|
583
603
|
message: 'sdk no need to make query request',
|
584
604
|
success: true
|
585
605
|
}));
|
586
|
-
case
|
606
|
+
case 47:
|
587
607
|
if (!(!signType || signType !== 'REDIRECT')) {
|
588
|
-
_context2.next =
|
608
|
+
_context2.next = 49;
|
589
609
|
break;
|
590
610
|
}
|
591
611
|
return _context2.abrupt("return", resolve({
|
592
612
|
success: false
|
593
613
|
}));
|
594
|
-
case 47:
|
595
|
-
_context2.next = 49;
|
596
|
-
return _this5.getDeviceIdAndLog();
|
597
614
|
case 49:
|
615
|
+
_context2.next = 51;
|
616
|
+
return _this5.getDeviceIdAndLog();
|
617
|
+
case 51:
|
598
618
|
envInfo.deviceId = _context2.sent;
|
599
|
-
case
|
619
|
+
case 52:
|
600
620
|
_this5.AMSSDK.logger.logInfo({
|
601
621
|
title: 'sdk_event_sdkQuery'
|
602
622
|
}, {
|
@@ -635,7 +655,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
635
655
|
}).send();
|
636
656
|
reject(err);
|
637
657
|
});
|
638
|
-
case
|
658
|
+
case 54:
|
639
659
|
case "end":
|
640
660
|
return _context2.stop();
|
641
661
|
}
|
@@ -667,12 +687,21 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
667
687
|
var channelBehavior = getChannelBehavior((_this$_renderParams14 = this._renderParams) === null || _this$_renderParams14 === void 0 ? void 0 : _this$_renderParams14.paymentSessionMetaData);
|
668
688
|
// eslint-disable-next-line no-async-promise-executor
|
669
689
|
this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
|
670
|
-
var
|
690
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
|
671
691
|
var _channelBehavior$buil, _this6$_renderParams$;
|
672
|
-
var shouldSkipSubmitPayInSDK, _this6$_renderParams, _this6$_renderParams2,
|
692
|
+
var shouldSkipSubmitPayInSDK, _this6$_renderParams, _this6$_renderParams2, _ref10, _ref10$productSceneVe, productSceneVersion, _ref10$productScene, productScene, _ref11, _ref11$action, _ref11$action2, _ref11$action2$enable, enableSignAgreement, _ref11$action2$autoDe, autoDebitWithToken, extParams;
|
673
693
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
674
694
|
while (1) switch (_context3.prev = _context3.next) {
|
675
695
|
case 0:
|
696
|
+
if (!(_this6.AMSSDK.options.product === productSceneEnum.ELEMENT_ADDRESS)) {
|
697
|
+
_context3.next = 2;
|
698
|
+
break;
|
699
|
+
}
|
700
|
+
return _context3.abrupt("return", resolve({
|
701
|
+
message: 'sdk no need to make submitPay request',
|
702
|
+
success: true
|
703
|
+
}));
|
704
|
+
case 2:
|
676
705
|
shouldSkipSubmitPayInSDK = false;
|
677
706
|
if (channelBehavior) {
|
678
707
|
// 新逻辑走 channelBehavior判断
|
@@ -681,31 +710,24 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
681
710
|
shouldSkipSubmitPayInSDK = !((_this6$_renderParams = _this6._renderParams) !== null && _this6$_renderParams !== void 0 && (_this6$_renderParams = _this6$_renderParams.paymentSessionMetaData) !== null && _this6$_renderParams !== void 0 && (_this6$_renderParams = _this6$_renderParams.action) !== null && _this6$_renderParams !== void 0 && _this6$_renderParams.skipSdkQuery) || componentSignEnum.EASY_PAY_WALLET !== _this6._componentSign;
|
682
711
|
}
|
683
712
|
if (componentSignEnum.EASY_PAY_WALLET === _this6._componentSign) {
|
684
|
-
|
685
|
-
|
686
|
-
_ref13 = ((_this6$_renderParams3 = _this6._renderParams) === null || _this6$_renderParams3 === void 0 ? void 0 : _this6$_renderParams3.paymentSessionMetaData) || {}, _ref13$paymentMethodI = _ref13.paymentMethodInfoView, _ref13$paymentMethodI2 = _ref13$paymentMethodI === void 0 ? {} : _ref13$paymentMethodI, _ref13$paymentMethodI3 = _ref13$paymentMethodI2.paymentMethodType, paymentMethodType = _ref13$paymentMethodI3 === void 0 ? '' : _ref13$paymentMethodI3;
|
713
|
+
_ref10 = params.paymentSessionConfig || {}, _ref10$productSceneVe = _ref10.productSceneVersion, productSceneVersion = _ref10$productSceneVe === void 0 ? '' : _ref10$productSceneVe, _ref10$productScene = _ref10.productScene, productScene = _ref10$productScene === void 0 ? '' : _ref10$productScene;
|
714
|
+
_ref11 = ((_this6$_renderParams2 = _this6._renderParams) === null || _this6$_renderParams2 === void 0 ? void 0 : _this6$_renderParams2.paymentSessionMetaData) || {}, _ref11$action = _ref11.action, _ref11$action2 = _ref11$action === void 0 ? {} : _ref11$action, _ref11$action2$enable = _ref11$action2.enableSignAgreement, enableSignAgreement = _ref11$action2$enable === void 0 ? false : _ref11$action2$enable, _ref11$action2$autoDe = _ref11$action2.autoDebitWithToken, autoDebitWithToken = _ref11$action2$autoDe === void 0 ? false : _ref11$action2$autoDe;
|
687
715
|
if (productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken) {
|
688
|
-
|
716
|
+
///EasyPay 2.0 首次传signAgreement字段
|
689
717
|
params['signAgreement'] = enableSignAgreement;
|
690
|
-
if (paymentMethodType == 'ALIPAY_CN' && !isAppWebview) {
|
691
|
-
backScheme = getBackScheme(undefined, _this6.AMSSDK.logger);
|
692
|
-
if (backScheme && backScheme !== 'https') {
|
693
|
-
params['h5FromApp'] = encodeURIComponent(backScheme);
|
694
|
-
}
|
695
|
-
}
|
696
718
|
}
|
697
719
|
}
|
698
720
|
// 带上标记告知WebCheckOut SDK已发送submitpay请求
|
699
721
|
_this6._allowSubmitPayCallAhead = !shouldSkipSubmitPayInSDK;
|
700
722
|
if (!shouldSkipSubmitPayInSDK) {
|
701
|
-
_context3.next =
|
723
|
+
_context3.next = 8;
|
702
724
|
break;
|
703
725
|
}
|
704
726
|
return _context3.abrupt("return", resolve({
|
705
727
|
message: 'sdk no need to make submitPay request',
|
706
728
|
success: true
|
707
729
|
}));
|
708
|
-
case
|
730
|
+
case 8:
|
709
731
|
_this6.AMSSDK.logger.logInfo({
|
710
732
|
title: 'sdk_event_submitPay'
|
711
733
|
}, {
|
@@ -724,9 +746,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
724
746
|
_context3.t0 = submitPayInfo;
|
725
747
|
_context3.t1 = params;
|
726
748
|
_context3.t2 = _this6.AMSSDK.options.env.environment;
|
727
|
-
_context3.next =
|
749
|
+
_context3.next = 16;
|
728
750
|
return _this6.getDeviceIdAndLog();
|
729
|
-
case
|
751
|
+
case 16:
|
730
752
|
_context3.t3 = _context3.sent;
|
731
753
|
_context3.t4 = {
|
732
754
|
deviceId: _context3.t3
|
@@ -760,14 +782,14 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
760
782
|
success: false
|
761
783
|
});
|
762
784
|
});
|
763
|
-
case
|
785
|
+
case 21:
|
764
786
|
case "end":
|
765
787
|
return _context3.stop();
|
766
788
|
}
|
767
789
|
}, _callee3);
|
768
790
|
}));
|
769
791
|
return function (_x3) {
|
770
|
-
return
|
792
|
+
return _ref9.apply(this, arguments);
|
771
793
|
};
|
772
794
|
}());
|
773
795
|
}
|
@@ -808,19 +830,17 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
808
830
|
value: function createPreloadApp(componentSign) {
|
809
831
|
var productSceneVersion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '1.0';
|
810
832
|
var preloadIframe = createPreloadIframe(componentSign, productSceneVersion);
|
833
|
+
var productScene = componentSign.split(/_(?=[^_]*$)/)[0];
|
811
834
|
var _getIframeUrl = getIframeUrl({
|
812
835
|
renderDisplayType: renderDisplayTypeEnum.popup,
|
813
836
|
componentSign: componentSign,
|
814
837
|
analytics: {
|
815
838
|
enabled: false
|
816
839
|
},
|
817
|
-
productScene:
|
840
|
+
productScene: productScene,
|
818
841
|
productSceneVersion: productSceneVersion,
|
819
842
|
environment: this.AMSSDK.options.env.environment,
|
820
|
-
// TODO 确定一下这个参数是干啥的
|
821
843
|
appVersion: this._appVersion,
|
822
|
-
extendInfo: '',
|
823
|
-
locale: '',
|
824
844
|
instanceId: '',
|
825
845
|
isPreload: 'true',
|
826
846
|
mid: ''
|
@@ -944,7 +964,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
944
964
|
key: "createDialog",
|
945
965
|
value: function () {
|
946
966
|
var _createDialog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
|
947
|
-
var pageUrl, isLoad, timeout, logTimeout;
|
967
|
+
var pageUrl, _data$device, isLoad, timeout, logTimeout;
|
948
968
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
949
969
|
while (1) switch (_context4.prev = _context4.next) {
|
950
970
|
case 0:
|
@@ -954,8 +974,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
954
974
|
_context4.next = 5;
|
955
975
|
return createModal({
|
956
976
|
widthPadding: data === null || data === void 0 ? void 0 : data.widthPadding,
|
957
|
-
|
958
|
-
|
977
|
+
device: (_data$device = data === null || data === void 0 ? void 0 : data.device) !== null && _data$device !== void 0 ? _data$device : this.platform,
|
978
|
+
loadingConfig: data === null || data === void 0 ? void 0 : data.loadingConfig,
|
959
979
|
url: pageUrl
|
960
980
|
});
|
961
981
|
case 5:
|
@@ -974,6 +994,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
974
994
|
}, POPUP_LOADTIME_LOG_LIMIT);
|
975
995
|
this.popupApp.onload = function () {
|
976
996
|
isLoad = true;
|
997
|
+
removePopupLoading();
|
977
998
|
clearTimeout(timeout);
|
978
999
|
clearTimeout(logTimeout);
|
979
1000
|
};
|
@@ -1123,6 +1144,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1123
1144
|
}, {
|
1124
1145
|
key: "_handleAppMessage",
|
1125
1146
|
value: function _handleAppMessage(data) {
|
1147
|
+
var _data$context2,
|
1148
|
+
_this7 = this;
|
1126
1149
|
var eventKeyMap = Object.keys(EVENT).map(function (key) {
|
1127
1150
|
return EVENT[key].name;
|
1128
1151
|
});
|
@@ -1247,6 +1270,26 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1247
1270
|
title: 'sdk_event_event_callback'
|
1248
1271
|
}).send();
|
1249
1272
|
}
|
1273
|
+
if ((data === null || data === void 0 || (_data$context2 = data.context) === null || _data$context2 === void 0 ? void 0 : _data$context2.event) === EVENT.getGooglePayToken.name) {
|
1274
|
+
handleGooglePay(data).then(function (res) {
|
1275
|
+
_this7.dispatchToApp({
|
1276
|
+
context: {
|
1277
|
+
event: 'getGooglePayToken',
|
1278
|
+
data: _objectSpread({}, res)
|
1279
|
+
}
|
1280
|
+
});
|
1281
|
+
}).catch(function (err) {
|
1282
|
+
_this7.dispatchToApp({
|
1283
|
+
context: {
|
1284
|
+
event: 'getGooglePayToken',
|
1285
|
+
data: {
|
1286
|
+
err: err
|
1287
|
+
}
|
1288
|
+
}
|
1289
|
+
});
|
1290
|
+
});
|
1291
|
+
return;
|
1292
|
+
}
|
1250
1293
|
|
1251
1294
|
// The plug-in communicates with the sdk after processing
|
1252
1295
|
this.dispatchToSDK(data.context.event, data.context.data, data.context.eventCallbackId);
|
@@ -1285,9 +1328,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1285
1328
|
|
1286
1329
|
// 此style用于弹窗出现和高度变化时动画,动画不同,属性不同
|
1287
1330
|
this.app.style.height = parseInt(this.app.style.height) > 0 ? '100%' : "".concat(data.context.data.height, "px");
|
1288
|
-
|
1289
1331
|
// 弹出和弹入动画
|
1290
|
-
var runkeyframes =
|
1332
|
+
var runkeyframes = slideInAndOutKeyframes(COMPONENT_CONTAINER_ID, data.context.data.height);
|
1291
1333
|
// 创建style标签
|
1292
1334
|
var style = document.createElement('style');
|
1293
1335
|
style.id = animationStyleId;
|
@@ -1297,7 +1339,6 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1297
1339
|
style.innerHTML = runkeyframes;
|
1298
1340
|
// 将style样式存放到head标签
|
1299
1341
|
document.getElementsByTagName('head')[0].appendChild(style);
|
1300
|
-
|
1301
1342
|
// size变动时动画
|
1302
1343
|
setTimeout(function () {
|
1303
1344
|
cashier.style.transition = 'height 0.28s ease-in-out';
|
@@ -1335,9 +1376,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1335
1376
|
key: "handleRedirect",
|
1336
1377
|
value: function handleRedirect(data) {
|
1337
1378
|
var _data$isDestroy,
|
1338
|
-
|
1339
|
-
_data$callAppDetectSu,
|
1340
|
-
_this7 = this;
|
1379
|
+
_this8 = this;
|
1341
1380
|
var fromFastSdk = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
1342
1381
|
var _data = typeof data === 'string' ? {
|
1343
1382
|
normalUrl: data
|
@@ -1346,48 +1385,38 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1346
1385
|
schemeUrl: (data === null || data === void 0 ? void 0 : data.schemeUrl) || '',
|
1347
1386
|
normalUrl: (data === null || data === void 0 ? void 0 : data.normalUrl) || '',
|
1348
1387
|
target: data === null || data === void 0 ? void 0 : data.target,
|
1349
|
-
isDestroy: (_data$isDestroy = data === null || data === void 0 ? void 0 : data.isDestroy) !== null && _data$isDestroy !== void 0 ? _data$isDestroy : true
|
1350
|
-
isCallApp: (_data$isCallApp = data === null || data === void 0 ? void 0 : data.isCallApp) !== null && _data$isCallApp !== void 0 ? _data$isCallApp : false,
|
1351
|
-
callAppDetectSuccessDelay: (_data$callAppDetectSu = data === null || data === void 0 ? void 0 : data.callAppDetectSuccessDelay) !== null && _data$callAppDetectSu !== void 0 ? _data$callAppDetectSu : 2000
|
1388
|
+
isDestroy: (_data$isDestroy = data === null || data === void 0 ? void 0 : data.isDestroy) !== null && _data$isDestroy !== void 0 ? _data$isDestroy : true
|
1352
1389
|
});
|
1353
1390
|
this.AMSSDK.logger.logInfo({
|
1354
1391
|
title: 'sdk_event_call_url_start'
|
1355
1392
|
}, _objectSpread({}, data)).send();
|
1356
|
-
var successCallback = function successCallback(type, url
|
1357
|
-
|
1393
|
+
var successCallback = function successCallback(type, url) {
|
1394
|
+
_this8.dispatchToSDK(EVENT.eventCallback.name, {
|
1358
1395
|
code: eventCodeEnum.SDK_CALL_URL_SUCCESS,
|
1359
1396
|
message: "Successfully opened the app,".concat(type, ": ").concat(url)
|
1360
1397
|
});
|
1361
|
-
|
1398
|
+
_this8.AMSSDK.logger.logInfo({
|
1399
|
+
title: 'sdk_event_call_url_success'
|
1400
|
+
}, {
|
1362
1401
|
redirectInfo: JSON.stringify(_data),
|
1363
1402
|
openType: type,
|
1364
1403
|
url: url,
|
1365
1404
|
fromFastSdk: fromFastSdk
|
1366
|
-
};
|
1367
|
-
if (durationInSeconds) {
|
1368
|
-
extra['durationInSeconds'] = durationInSeconds;
|
1369
|
-
}
|
1370
|
-
_this7.AMSSDK.logger.logInfo({
|
1371
|
-
title: 'sdk_event_call_url_success'
|
1372
|
-
}, extra).send();
|
1405
|
+
}).send();
|
1373
1406
|
};
|
1374
|
-
var failCallback = function failCallback(type, url
|
1375
|
-
|
1407
|
+
var failCallback = function failCallback(type, url) {
|
1408
|
+
_this8.dispatchToSDK(EVENT.eventCallback.name, {
|
1376
1409
|
code: eventCodeEnum.SDK_CALL_URL_ERROR,
|
1377
1410
|
message: "Failed to open app,applinkUrl: ".concat(_data === null || _data === void 0 ? void 0 : _data.applinkUrl, " schemeUrl: ").concat(_data === null || _data === void 0 ? void 0 : _data.schemeUrl, " normalUrl: ").concat(_data === null || _data === void 0 ? void 0 : _data.normalUrl)
|
1378
1411
|
});
|
1379
|
-
|
1412
|
+
_this8.AMSSDK.logger.logInfo({
|
1413
|
+
title: 'sdk_error_call_url_failed'
|
1414
|
+
}, {
|
1380
1415
|
redirectInfo: JSON.stringify(_data),
|
1381
1416
|
openType: type,
|
1382
1417
|
url: url,
|
1383
1418
|
fromFastSdk: fromFastSdk
|
1384
|
-
};
|
1385
|
-
if (durationInSeconds) {
|
1386
|
-
extra['durationInSeconds'] = durationInSeconds;
|
1387
|
-
}
|
1388
|
-
_this7.AMSSDK.logger.logInfo({
|
1389
|
-
title: 'sdk_error_call_url_failed'
|
1390
|
-
}, extra).send();
|
1419
|
+
}).send();
|
1391
1420
|
};
|
1392
1421
|
|
1393
1422
|
// 支持 target: _blank,新开tab页打开
|
@@ -1405,40 +1434,20 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1405
1434
|
}
|
1406
1435
|
// 销毁iframe和全局loading
|
1407
1436
|
if (_data !== null && _data !== void 0 && _data.isDestroy) this.cleanContainer();
|
1408
|
-
// 唤端
|
1409
|
-
if (_data !== null && _data !== void 0 && _data.isCallApp && _data !== null && _data !== void 0 && _data.schemeUrl) {
|
1410
|
-
var startCallAppTime = new Date();
|
1411
|
-
var detectSuccessDelay = typeof (data === null || data === void 0 ? void 0 : data.callAppDetectSuccessDelay) === 'number' ? data.callAppDetectSuccessDelay : 5000;
|
1412
|
-
this.AMSSDK._redirect({
|
1413
|
-
schemeUrl: _data === null || _data === void 0 ? void 0 : _data.schemeUrl,
|
1414
|
-
callAppJudgeTime: detectSuccessDelay
|
1415
|
-
}).then(function () {
|
1416
|
-
var endCallAppTime = new Date();
|
1417
|
-
var durationInMilliseconds = endCallAppTime.getTime() - startCallAppTime.getTime();
|
1418
|
-
var durationInSeconds = durationInMilliseconds / 1000;
|
1419
|
-
successCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl, durationInSeconds);
|
1420
|
-
}).catch(function () {
|
1421
|
-
var endCallAppTime = new Date();
|
1422
|
-
var durationInMilliseconds = endCallAppTime.getTime() - startCallAppTime.getTime();
|
1423
|
-
var durationInSeconds = durationInMilliseconds / 1000;
|
1424
|
-
failCallback(RedirectType.SchemeUrl, _data.schemeUrl, durationInSeconds);
|
1425
|
-
});
|
1426
|
-
return;
|
1427
|
-
}
|
1428
1437
|
this.AMSSDK._redirect({
|
1429
1438
|
applinkUrl: _data === null || _data === void 0 ? void 0 : _data.applinkUrl
|
1430
1439
|
}).then(function () {
|
1431
1440
|
successCallback(RedirectType.ApplinkUrl, _data === null || _data === void 0 ? void 0 : _data.applinkUrl);
|
1432
1441
|
}).catch(function () {
|
1433
1442
|
if (_data !== null && _data !== void 0 && _data.applinkUrl) failCallback(RedirectType.ApplinkUrl, _data === null || _data === void 0 ? void 0 : _data.applinkUrl);
|
1434
|
-
return
|
1443
|
+
return _this8.AMSSDK._redirect({
|
1435
1444
|
schemeUrl: _data === null || _data === void 0 ? void 0 : _data.schemeUrl
|
1436
1445
|
});
|
1437
1446
|
}).then(function () {
|
1438
1447
|
successCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
|
1439
1448
|
}).catch(function () {
|
1440
1449
|
if (_data !== null && _data !== void 0 && _data.schemeUrl) failCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
|
1441
|
-
return
|
1450
|
+
return _this8.AMSSDK._redirect({
|
1442
1451
|
normalUrl: _data === null || _data === void 0 ? void 0 : _data.normalUrl
|
1443
1452
|
});
|
1444
1453
|
}).then(function () {
|
@@ -1449,9 +1458,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1449
1458
|
}
|
1450
1459
|
}, {
|
1451
1460
|
key: "handleDeclareInfo",
|
1452
|
-
value: function handleDeclareInfo(
|
1453
|
-
var
|
1454
|
-
closeDialogData =
|
1461
|
+
value: function handleDeclareInfo(_ref12) {
|
1462
|
+
var _ref12$closeDialogDat = _ref12.closeDialogData,
|
1463
|
+
closeDialogData = _ref12$closeDialogDat === void 0 ? {} : _ref12$closeDialogDat;
|
1455
1464
|
_handleDeclareInfo({
|
1456
1465
|
closeDialogData: closeDialogData
|
1457
1466
|
});
|
@@ -1477,12 +1486,12 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1477
1486
|
}, {
|
1478
1487
|
key: "handleAppHeartBeat",
|
1479
1488
|
value: function handleAppHeartBeat() {
|
1480
|
-
var
|
1489
|
+
var _this9 = this;
|
1481
1490
|
try {
|
1482
1491
|
if (!this._webAppHeartBeatTimeoutFn) {
|
1483
1492
|
this._webAppHeartBeatTimeoutFn = function () {
|
1484
|
-
if (
|
1485
|
-
|
1493
|
+
if (_this9.isAppAttached()) {
|
1494
|
+
_this9.AMSSDK.logger.logError({
|
1486
1495
|
title: 'sdk_error_appHeartBeatTimeout'
|
1487
1496
|
});
|
1488
1497
|
}
|
@@ -1496,8 +1505,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1496
1505
|
window._webAppHeartBeatTimeoutId = setTimeout(this._webAppHeartBeatTimeoutFn, TIMEOUT_WEB_APP_HEART_BEAT);
|
1497
1506
|
}
|
1498
1507
|
setTimeout(function () {
|
1499
|
-
if (
|
1500
|
-
|
1508
|
+
if (_this9.isAppAttached()) {
|
1509
|
+
_this9.dispatchToApp({
|
1501
1510
|
context: {
|
1502
1511
|
event: 'sdkHeartBeat',
|
1503
1512
|
data: {}
|
@@ -1592,24 +1601,25 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1592
1601
|
key: "sendRenderEvent",
|
1593
1602
|
value: (function () {
|
1594
1603
|
var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
1595
|
-
var _this$_renderParams15, _this$_renderParams16, _this$_renderParams17, _this$_renderParams18, _this$_renderParams19, _this$_renderParams20, _this$AMSSDK$logger, _this$
|
1604
|
+
var _this$_renderParams15, _this$_renderParams16, _this$_renderParams17, _this$_renderParams18, _this$_renderParams19, _this$_renderParams20, _this$_renderParams21, _this$_renderParams22, _this$_renderParams23, _this$AMSSDK$logger, _this$_renderParams24, _this$_renderParams25, _this$_renderParams26, _this$AMSSDK, _this$_renderParams27, isAddressElement, res, submitRes;
|
1596
1605
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
1597
1606
|
while (1) switch (_context8.prev = _context8.next) {
|
1598
1607
|
case 0:
|
1599
1608
|
_context8.prev = 0;
|
1600
|
-
|
1601
|
-
|
1609
|
+
isAddressElement = this.AMSSDK.options.product === productSceneEnum.ELEMENT_ADDRESS;
|
1610
|
+
if (!((!this._actionQueryPromise || !this._actionSubmitPromise) && !isAddressElement)) {
|
1611
|
+
_context8.next = 4;
|
1602
1612
|
break;
|
1603
1613
|
}
|
1604
1614
|
return _context8.abrupt("return");
|
1605
|
-
case
|
1606
|
-
_context8.next =
|
1615
|
+
case 4:
|
1616
|
+
_context8.next = 6;
|
1607
1617
|
return this._actionQueryPromise;
|
1608
|
-
case
|
1618
|
+
case 6:
|
1609
1619
|
res = _context8.sent;
|
1610
|
-
_context8.next =
|
1620
|
+
_context8.next = 9;
|
1611
1621
|
return this._actionSubmitPromise;
|
1612
|
-
case
|
1622
|
+
case 9:
|
1613
1623
|
submitRes = _context8.sent;
|
1614
1624
|
this._performanceData.push({
|
1615
1625
|
key: 'sdk_render_component',
|
@@ -1627,24 +1637,27 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1627
1637
|
renderDisplayType: (_this$_renderParams17 = this._renderParams) === null || _this$_renderParams17 === void 0 ? void 0 : _this$_renderParams17.renderDisplayType,
|
1628
1638
|
appearance: (_this$_renderParams18 = this._renderParams) === null || _this$_renderParams18 === void 0 ? void 0 : _this$_renderParams18.appearance,
|
1629
1639
|
notRedirectAfterComplete: ((_this$_renderParams19 = this._renderParams) === null || _this$_renderParams19 === void 0 ? void 0 : _this$_renderParams19.notRedirectAfterComplete) === true,
|
1630
|
-
isAppWebview: this._isAppWebview,
|
1631
1640
|
merchantAppointParam: this._merchantAppointParam,
|
1632
1641
|
allowSubmitPayCallAhead: this._allowSubmitPayCallAhead,
|
1642
|
+
/** 地址组件集成的参数 */
|
1643
|
+
configParams: (_this$_renderParams20 = this._renderParams) === null || _this$_renderParams20 === void 0 ? void 0 : _this$_renderParams20.configParams,
|
1644
|
+
prefillValue: (_this$_renderParams21 = this._renderParams) === null || _this$_renderParams21 === void 0 ? void 0 : _this$_renderParams21.prefillValue,
|
1645
|
+
componentSession: (_this$_renderParams22 = this._renderParams) === null || _this$_renderParams22 === void 0 ? void 0 : _this$_renderParams22.componentSession,
|
1633
1646
|
envInfo: {
|
1634
1647
|
screenHeight: screen.height,
|
1635
1648
|
screenWidth: screen.width
|
1636
1649
|
},
|
1637
1650
|
logMetaData: _objectSpread(_objectSpread({
|
1638
|
-
trackId: (_this$
|
1651
|
+
trackId: (_this$_renderParams23 = this._renderParams) === null || _this$_renderParams23 === void 0 ? void 0 : _this$_renderParams23.sessionData,
|
1639
1652
|
platform: this.platform,
|
1640
1653
|
firstLogTime: (_this$AMSSDK$logger = this.AMSSDK.logger) === null || _this$AMSSDK$logger === void 0 ? void 0 : _this$AMSSDK$logger.getComponentStartTime()
|
1641
|
-
}, ((_this$
|
1642
|
-
renderDisplayType: (_this$
|
1654
|
+
}, ((_this$_renderParams24 = this._renderParams) === null || _this$_renderParams24 === void 0 || (_this$_renderParams24 = _this$_renderParams24.paymentSessionMetaData) === null || _this$_renderParams24 === void 0 ? void 0 : _this$_renderParams24.paymentSessionConfig) || {}), {}, {
|
1655
|
+
renderDisplayType: (_this$_renderParams25 = this._renderParams) === null || _this$_renderParams25 === void 0 ? void 0 : _this$_renderParams25.renderDisplayType,
|
1643
1656
|
sdkVersion: this._appVersion,
|
1644
|
-
merchantId: (_this$
|
1657
|
+
merchantId: (_this$_renderParams26 = this._renderParams) === null || _this$_renderParams26 === void 0 || (_this$_renderParams26 = _this$_renderParams26.paymentSessionMetaData) === null || _this$_renderParams26 === void 0 ? void 0 : _this$_renderParams26.clientId,
|
1645
1658
|
instanceId: (_this$AMSSDK = this.AMSSDK) === null || _this$AMSSDK === void 0 ? void 0 : _this$AMSSDK._instanceId,
|
1646
1659
|
performanceData: this._performanceData,
|
1647
|
-
paymentMethodType: (_this$
|
1660
|
+
paymentMethodType: (_this$_renderParams27 = this._renderParams) === null || _this$_renderParams27 === void 0 || (_this$_renderParams27 = _this$_renderParams27.paymentSessionMetaData) === null || _this$_renderParams27 === void 0 || (_this$_renderParams27 = _this$_renderParams27.paymentMethodInfoView) === null || _this$_renderParams27 === void 0 ? void 0 : _this$_renderParams27.paymentMethodType
|
1648
1661
|
})
|
1649
1662
|
}
|
1650
1663
|
}
|
@@ -1661,16 +1674,16 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1661
1674
|
}
|
1662
1675
|
});
|
1663
1676
|
// eslint-disable-next-line no-empty
|
1664
|
-
_context8.next =
|
1677
|
+
_context8.next = 18;
|
1665
1678
|
break;
|
1666
|
-
case
|
1667
|
-
_context8.prev =
|
1679
|
+
case 16:
|
1680
|
+
_context8.prev = 16;
|
1668
1681
|
_context8.t0 = _context8["catch"](0);
|
1669
|
-
case
|
1682
|
+
case 18:
|
1670
1683
|
case "end":
|
1671
1684
|
return _context8.stop();
|
1672
1685
|
}
|
1673
|
-
}, _callee8, this, [[0,
|
1686
|
+
}, _callee8, this, [[0, 16]]);
|
1674
1687
|
}));
|
1675
1688
|
function sendRenderEvent() {
|
1676
1689
|
return _sendRenderEvent.apply(this, arguments);
|
@@ -1685,7 +1698,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1685
1698
|
key: "cleanContainer",
|
1686
1699
|
value: function cleanContainer() {
|
1687
1700
|
var _document$getElementB4,
|
1688
|
-
|
1701
|
+
_this10 = this;
|
1689
1702
|
var immediately = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
1690
1703
|
(_document$getElementB4 = document.getElementById(LOADING_ID)) === null || _document$getElementB4 === void 0 || _document$getElementB4.remove();
|
1691
1704
|
this.hideComponentAnimation();
|
@@ -1697,15 +1710,16 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1697
1710
|
this.app = null;
|
1698
1711
|
if (immediately) this.cleanElement();else {
|
1699
1712
|
setTimeout(function () {
|
1700
|
-
|
1713
|
+
_this10.cleanElement();
|
1701
1714
|
}, 300);
|
1702
1715
|
}
|
1703
1716
|
}
|
1704
1717
|
}, {
|
1705
1718
|
key: "hideComponentAnimation",
|
1706
1719
|
value: function hideComponentAnimation() {
|
1720
|
+
var _container$style;
|
1707
1721
|
var container = document.getElementById(COMPONENT_CONTAINER_ID);
|
1708
|
-
if (this.app) this.app.style.height = container.style.height;
|
1722
|
+
if (this.app) this.app.style.height = container === null || container === void 0 || (_container$style = container.style) === null || _container$style === void 0 ? void 0 : _container$style.height;
|
1709
1723
|
if (container) {
|
1710
1724
|
// size变化动画取消
|
1711
1725
|
container.style.transition = '';
|