@alipay/ams-checkout 0.0.1730706734-dev.0 → 0.0.1730878287-dev.0
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 +2 -2
- package/esm/config/index.js +5 -5
- package/esm/constant/index.d.ts +0 -6
- package/esm/constant/index.js +0 -8
- package/esm/core/bus/interface.d.ts +0 -12
- package/esm/core/bus/interface.js +2 -16
- package/esm/core/component/address.d.ts +2 -2
- package/esm/core/component/appPreloadProcessing.js +0 -2
- package/esm/core/component/ckp/index.d.ts +3 -3
- package/esm/core/component/ckp/index.js +3 -3
- package/esm/core/component/index.d.ts +5 -5
- package/esm/core/component/index.js +16 -20
- package/esm/core/drop-in/index.d.ts +2 -2
- package/esm/core/drop-in/index.js +2 -2
- package/esm/core/instance/index.d.ts +5 -5
- package/esm/core/instance/index.js +10 -11
- package/esm/index.d.ts +10 -16
- package/esm/index.js +59 -70
- package/esm/plugin/applepay/component.js +3 -3
- package/esm/plugin/applepay/service.d.ts +2 -2
- package/esm/plugin/applepay/service.js +2 -2
- package/esm/plugin/component/cashierApp.d.ts +5 -7
- package/esm/plugin/component/cashierApp.js +8 -16
- package/esm/plugin/component/channel.d.ts +4 -4
- package/esm/plugin/component/component.inline.style.d.ts +4 -4
- package/esm/plugin/component/component.inline.style.js +7 -10
- package/esm/plugin/component/component.popup.style.d.ts +6 -15
- package/esm/plugin/component/component.popup.style.js +15 -33
- package/esm/plugin/component/index.d.ts +7 -7
- package/esm/plugin/component/index.js +90 -113
- package/esm/plugin/const.js +5 -5
- package/esm/plugin/drop-in/index.d.ts +5 -5
- package/esm/plugin/drop-in/index.js +7 -7
- package/esm/plugin/payment-element/utils.d.ts +1 -1
- package/esm/plugin/payment-element/utils.js +1 -2
- package/esm/plugin/type.d.ts +4 -4
- package/esm/service/index.d.ts +0 -1
- package/esm/service/index.js +0 -2
- package/esm/types/index.d.ts +38 -240
- package/esm/types/index.js +59 -103
- package/esm/util/createIframeNode.d.ts +2 -2
- package/esm/util/createIframeNode.js +3 -3
- package/esm/util/index.d.ts +1 -1
- package/esm/util/index.js +4 -3
- package/esm/{foundation/service/security → util}/security.d.ts +2 -2
- package/esm/{foundation/service/security → util}/security.js +3 -3
- package/package.json +1 -2
- package/esm/core/bus/ability/globalData.d.ts +0 -10
- package/esm/core/bus/ability/globalData.js +0 -89
- package/esm/core/bus/ability/request.d.ts +0 -10
- package/esm/core/bus/ability/request.js +0 -151
- package/esm/core/component/element/components/address.d.ts +0 -19
- package/esm/core/component/element/components/address.js +0 -68
- package/esm/core/component/element/components/auth.d.ts +0 -17
- package/esm/core/component/element/components/auth.js +0 -59
- package/esm/core/component/element/components/payment.d.ts +0 -19
- package/esm/core/component/element/components/payment.js +0 -74
- package/esm/core/component/element/element-mock.d.ts +0 -2
- package/esm/core/component/element/element-mock.js +0 -263
- package/esm/core/component/element/index.d.ts +0 -47
- package/esm/core/component/element/index.js +0 -776
- package/esm/core/component/element/mock.d.ts +0 -3
- package/esm/core/component/element/mock.js +0 -1156
- package/esm/core/component/element/type.d.ts +0 -176
- package/esm/core/component/element/type.js +0 -34
- package/esm/core/component/element/utils.d.ts +0 -13
- package/esm/core/component/element/utils.js +0 -6
- package/esm/foundation/core/index.d.ts +0 -26
- package/esm/foundation/core/index.js +0 -301
- package/esm/foundation/index.d.ts +0 -72
- package/esm/foundation/index.js +0 -42
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -15
- package/esm/foundation/product-processor/easysafepay/deps.js +0 -9
- package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -26
- package/esm/foundation/product-processor/easysafepay/index.js +0 -536
- package/esm/foundation/service/container/index.d.ts +0 -28
- package/esm/foundation/service/container/index.js +0 -256
- package/esm/foundation/service/container/popup.d.ts +0 -17
- package/esm/foundation/service/container/popup.js +0 -103
- package/esm/foundation/service/container/utils.d.ts +0 -7
- package/esm/foundation/service/container/utils.js +0 -48
- package/esm/foundation/service/event-bus/ability/callback.d.ts +0 -9
- package/esm/foundation/service/event-bus/ability/callback.js +0 -55
- package/esm/foundation/service/event-bus/ability/globalData.d.ts +0 -10
- package/esm/foundation/service/event-bus/ability/globalData.js +0 -89
- package/esm/foundation/service/event-bus/ability/request.d.ts +0 -10
- package/esm/foundation/service/event-bus/ability/request.js +0 -151
- package/esm/foundation/service/event-bus/ability/security.d.ts +0 -12
- package/esm/foundation/service/event-bus/ability/security.js +0 -151
- package/esm/foundation/service/event-bus/ability/tracker.d.ts +0 -9
- package/esm/foundation/service/event-bus/ability/tracker.js +0 -80
- package/esm/foundation/service/event-bus/busManager.d.ts +0 -127
- package/esm/foundation/service/event-bus/busManager.js +0 -398
- package/esm/foundation/service/event-bus/index.d.ts +0 -20
- package/esm/foundation/service/event-bus/index.js +0 -88
- package/esm/foundation/service/event-center.d.ts +0 -75
- package/esm/foundation/service/event-center.js +0 -244
- package/esm/foundation/service/global-data/index.d.ts +0 -11
- package/esm/foundation/service/global-data/index.js +0 -69
- package/esm/foundation/service/index.d.ts +0 -19
- package/esm/foundation/service/index.js +0 -82
- package/esm/foundation/service/log/index.d.ts +0 -43
- package/esm/foundation/service/log/index.js +0 -235
- package/esm/foundation/service/log/types.d.ts +0 -32
- package/esm/foundation/service/log/types.js +0 -1
- package/esm/foundation/service/requester/deps.d.ts +0 -17
- package/esm/foundation/service/requester/deps.js +0 -11
- package/esm/foundation/service/requester/requester.d.ts +0 -22
- package/esm/foundation/service/requester/requester.js +0 -211
- package/esm/foundation/service/security/index.d.ts +0 -26
- package/esm/foundation/service/security/index.js +0 -216
- package/esm/foundation/types/index.d.ts +0 -4
- package/esm/foundation/types/index.js +0 -4
- package/esm/foundation/utils/gray_scale_utils.d.ts +0 -7
- package/esm/foundation/utils/gray_scale_utils.js +0 -40
- package/esm/foundation/utils/payment_context_utils.d.ts +0 -13
- package/esm/foundation/utils/payment_context_utils.js +0 -57
- package/esm/foundation/utils/redirect_utils.d.ts +0 -6
- package/esm/foundation/utils/redirect_utils.js +0 -99
- package/esm/foundation/utils/system_events.d.ts +0 -4
- package/esm/foundation/utils/system_events.js +0 -71
- package/esm/foundation/utils/web_app_url_utils.d.ts +0 -37
- package/esm/foundation/utils/web_app_url_utils.js +0 -97
- package/esm/service/element.d.ts +0 -4
- package/esm/service/element.js +0 -51
@@ -1,11 +1,11 @@
|
|
1
1
|
import type AMSCheckout from '../../core/instance';
|
2
|
-
import type {
|
3
|
-
import {
|
4
|
-
type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType:
|
2
|
+
import type { eventPayload, eventPayloadContext, IappendIframeNodesParams, IMerchantAppointParam, Iselector } from '../../types';
|
3
|
+
import { componentSignEnum, DeviceIdParameter, platformEnum, renderDisplayTypeEnum } from '../../types';
|
4
|
+
type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType: renderDisplayTypeEnum) => Promise<void>;
|
5
5
|
export default class ComponentApp {
|
6
6
|
app: null | HTMLIFrameElement;
|
7
7
|
AMSSDK: AMSCheckout;
|
8
|
-
platform:
|
8
|
+
platform: platformEnum;
|
9
9
|
_performanceData: any[];
|
10
10
|
_loadAppPromiseResolve: ((value: boolean) => void) | null;
|
11
11
|
_isInitComponent: boolean;
|
@@ -51,7 +51,7 @@ export default class ComponentApp {
|
|
51
51
|
/**
|
52
52
|
* @description render iframe content
|
53
53
|
*/
|
54
|
-
appendIframeNodes(componentSign:
|
54
|
+
appendIframeNodes(componentSign: componentSignEnum, renderParams: IappendIframeNodesParams): Promise<void>;
|
55
55
|
appendPreloadIframeNodes(componentSign: any, productSceneVersion: any): void;
|
56
56
|
private setParameterDefaultValues;
|
57
57
|
private renderInlineLoading;
|
@@ -82,7 +82,7 @@ export default class ComponentApp {
|
|
82
82
|
/**
|
83
83
|
* @description Processing messages from iframe
|
84
84
|
*/
|
85
|
-
_handleAppMessage(data:
|
85
|
+
_handleAppMessage(data: eventPayload): void;
|
86
86
|
private dismissLoadingFunc;
|
87
87
|
private handleSizeChanged;
|
88
88
|
private handleAuthUrlInfo;
|
@@ -101,7 +101,7 @@ export default class ComponentApp {
|
|
101
101
|
* @description Send message to iframe
|
102
102
|
*/
|
103
103
|
dispatchToApp(payload: {
|
104
|
-
context:
|
104
|
+
context: eventPayloadContext;
|
105
105
|
}, targetElement?: any): any;
|
106
106
|
/**
|
107
107
|
* @description Subscribe to messages from SDK
|
@@ -21,7 +21,7 @@ import { v4 as uuid } from 'uuid';
|
|
21
21
|
import { sdkVersion } from "../../config";
|
22
22
|
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, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../constant";
|
23
23
|
import { queryPaymentInfo, submitPayInfo } from "../../service";
|
24
|
-
import {
|
24
|
+
import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, RedirectType, renderDisplayTypeEnum, targetEnum } from "../../types";
|
25
25
|
import { getType, isJsonString, isPC } from "../../util";
|
26
26
|
import { isLocalMock } from "../../util/mock";
|
27
27
|
import { matchVersion } from "../../util/versionCompare";
|
@@ -54,9 +54,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
54
54
|
_defineProperty(this, "_actionQueryPromise", null);
|
55
55
|
_defineProperty(this, "_actionSubmitPromise", null);
|
56
56
|
_defineProperty(this, "_renderParams", null);
|
57
|
-
_defineProperty(this, "_componentSign",
|
57
|
+
_defineProperty(this, "_componentSign", componentSignEnum.NONE);
|
58
58
|
_defineProperty(this, "_appLocationSearch", void 0);
|
59
|
-
_defineProperty(this, "_renderDisplayType",
|
59
|
+
_defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
|
60
60
|
_defineProperty(this, "_multipleCallbackEvents", void 0);
|
61
61
|
_defineProperty(this, "_isAppWebview", void 0);
|
62
62
|
_defineProperty(this, "_merchantAppointParam", void 0);
|
@@ -70,7 +70,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
70
70
|
this.createPreloadIframeNode = function () {
|
71
71
|
return Promise.resolve();
|
72
72
|
};
|
73
|
-
this.platform = isPC() ?
|
73
|
+
this.platform = isPC() ? platformEnum.desktop : platformEnum.mobile;
|
74
74
|
this._isRetention = true;
|
75
75
|
this._appLocationSearch = '';
|
76
76
|
this._performanceData.push({
|
@@ -105,7 +105,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
105
105
|
var paymentSessionMetaData = (_this$_renderParams = this._renderParams) === null || _this$_renderParams === void 0 ? void 0 : _this$_renderParams.paymentSessionMetaData;
|
106
106
|
var paymentSessionConfig = paymentSessionMetaData.paymentSessionConfig;
|
107
107
|
this.AMSSDK.logger.setMedta({
|
108
|
-
platform: this.platform ===
|
108
|
+
platform: this.platform === platformEnum.desktop ? 'PC' : 'WAP',
|
109
109
|
// PC/WAP,
|
110
110
|
sdkVersion: sdkVersion,
|
111
111
|
webAppVersion: this._appVersion,
|
@@ -142,8 +142,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
142
142
|
var _this$_renderParams4,
|
143
143
|
_this = this;
|
144
144
|
var product = (_this$_renderParams4 = this._renderParams) === null || _this$_renderParams4 === void 0 || (_this$_renderParams4 = _this$_renderParams4.paymentSessionMetaData) === null || _this$_renderParams4 === void 0 || (_this$_renderParams4 = _this$_renderParams4.paymentSessionConfig) === null || _this$_renderParams4 === void 0 ? void 0 : _this$_renderParams4.productScene;
|
145
|
-
if (
|
146
|
-
if (
|
145
|
+
if (componentSignEnum.CASHIER_PAYMENT_APM === this._componentSign) return;
|
146
|
+
if (componentSignEnum.CASHIER_PAYMENT_BANK === this._componentSign) {
|
147
147
|
this.AMSSDK.logger.logInfo({
|
148
148
|
title: 'sdk_event_security_unneeded_scenarios'
|
149
149
|
}, {
|
@@ -268,13 +268,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
268
268
|
this._componentSign = componentSign;
|
269
269
|
if ((_renderParams = renderParams) !== null && _renderParams !== void 0 && _renderParams.selector) this._selector = renderParams.selector;
|
270
270
|
this._renderDisplayType = renderParams.renderDisplayType;
|
271
|
-
// connect element模式会存在加载多个sdk,appendAliasContainerId为true来判断,给容器inlineId添加标识,id中不能存在#需在这里提前过滤一下
|
272
|
-
var _selector = this._selector.indexOf('#') === -1 ? this._selector : this._selector.slice(1);
|
273
|
-
// 修改需当前文件搜索,这段注释appendAliasContainerId
|
274
|
-
var appendAliasContainerId = renderParams.appendAliasContainerId ? "-".concat(_selector) : '';
|
275
|
-
var inlineId = "".concat(COMPONENT_CONTAINER_ID).concat(appendAliasContainerId);
|
276
|
-
var insertedNode = this._renderDisplayType === DisplayTypeEnum.inline ? "#".concat(inlineId) : this._selector;
|
277
271
|
this._isAppWebview = renderParams.isAppWebview;
|
272
|
+
var insertedNode = this._renderDisplayType === renderDisplayTypeEnum.inline ? "#".concat(COMPONENT_CONTAINER_ID) : this._selector;
|
278
273
|
this.initLoggerMeta();
|
279
274
|
this.initSecurity();
|
280
275
|
this._performanceData.push({
|
@@ -306,14 +301,14 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
306
301
|
version: productSceneVersion,
|
307
302
|
product: this.AMSSDK.options.product
|
308
303
|
}).send();
|
309
|
-
if (
|
310
|
-
if (productScene ===
|
304
|
+
if (componentSignEnum.EASY_PAY_WALLET === this._componentSign) {
|
305
|
+
if (productScene === productSceneEnum.EASY_PAY && productSceneVersion === '1.0' && !autoDebitWithToken && requireFastSdk) {
|
311
306
|
// EASY_PAY 1.0首次支付,requireFastSdk为true,不需要接口请求
|
312
307
|
this.handleAuthUrlInfo(authUrlInfo);
|
313
308
|
return;
|
314
309
|
}
|
315
310
|
}
|
316
|
-
if (
|
311
|
+
if (componentSignEnum.AUTO_DEBIT_WALLET === this._componentSign) {
|
317
312
|
var _this$_renderParams9, _action$web, _action$wap;
|
318
313
|
var action = ((_this$_renderParams9 = this._renderParams) === null || _this$_renderParams9 === void 0 || (_this$_renderParams9 = _this$_renderParams9.paymentSessionMetaData) === null || _this$_renderParams9 === void 0 ? void 0 : _this$_renderParams9.action) || {};
|
319
314
|
var 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;
|
@@ -324,7 +319,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
324
319
|
return;
|
325
320
|
}
|
326
321
|
}
|
327
|
-
if (
|
322
|
+
if (componentSignEnum.AUTO_DEBIT_PAY_WALLET === this._componentSign) {
|
328
323
|
if (requireFastSdk === true && productSceneVersion === '1.0') {
|
329
324
|
// REDIRECT,requireFastSdk为true,不需要接口请求
|
330
325
|
this.handleAuthUrlInfo(authUrlInfo);
|
@@ -339,12 +334,12 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
339
334
|
this.dispatchToSDK(EVENT.eventCallback.name, {
|
340
335
|
code: eventCodeEnum.SDK_START_OF_LOADING
|
341
336
|
});
|
342
|
-
if (this._renderDisplayType ===
|
343
|
-
var container = createInlineBaseElement(this._selector
|
337
|
+
if (this._renderDisplayType === renderDisplayTypeEnum.inline) {
|
338
|
+
var container = createInlineBaseElement(this._selector);
|
344
339
|
if (container) this.renderInlineLoading(renderParams, container);
|
345
340
|
insertStyleSheet();
|
346
341
|
}
|
347
|
-
if (this._renderDisplayType ===
|
342
|
+
if (this._renderDisplayType === renderDisplayTypeEnum.popup) {
|
348
343
|
var _this$_renderParams10;
|
349
344
|
createBaseElement(this.platform, this.closeBtnFunc.bind(this));
|
350
345
|
createRetentionPopup(this.platform, this.hideRetentionPopupFunc.bind(this), this.retentionPopupLeaveFunc.bind(this));
|
@@ -387,7 +382,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
387
382
|
key: "setParameterDefaultValues",
|
388
383
|
value: function setParameterDefaultValues(componentSign, renderParams) {
|
389
384
|
var newParams = Object.assign({}, renderParams);
|
390
|
-
if (componentSign ===
|
385
|
+
if (componentSign === componentSignEnum.VAULTING_CARD) {
|
391
386
|
var _newParams$notRedirec;
|
392
387
|
newParams.notRedirectAfterComplete = (_newParams$notRedirec = newParams === null || newParams === void 0 ? void 0 : newParams.notRedirectAfterComplete) !== null && _newParams$notRedirec !== void 0 ? _newParams$notRedirec : true;
|
393
388
|
}
|
@@ -456,8 +451,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
456
451
|
// eslint-disable-next-line no-async-promise-executor
|
457
452
|
this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
|
458
453
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
|
459
|
-
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6
|
460
|
-
var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$
|
454
|
+
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6;
|
455
|
+
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;
|
461
456
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
462
457
|
while (1) switch (_context2.prev = _context2.next) {
|
463
458
|
case 0:
|
@@ -493,10 +488,11 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
493
488
|
success: true
|
494
489
|
}));
|
495
490
|
case 9:
|
496
|
-
if (
|
491
|
+
if (componentSignEnum.ELEMENT_PAYMENT === _this5._componentSign) {
|
497
492
|
params.paymentSessionConfig = handlePaymentSessionConfig(params.paymentSessionConfig);
|
498
493
|
}
|
499
|
-
|
494
|
+
/** 地址组件跳过接口查询 */
|
495
|
+
if (!(componentSignEnum.ELEMENT_ADDRESS === _this5._componentSign)) {
|
500
496
|
_context2.next = 12;
|
501
497
|
break;
|
502
498
|
}
|
@@ -505,31 +501,22 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
505
501
|
success: true
|
506
502
|
}));
|
507
503
|
case 12:
|
508
|
-
if (!(
|
509
|
-
_context2.next =
|
510
|
-
break;
|
511
|
-
}
|
512
|
-
return _context2.abrupt("return", resolve({
|
513
|
-
message: 'sdk no need to make query request',
|
514
|
-
success: true
|
515
|
-
}));
|
516
|
-
case 14:
|
517
|
-
if (!(ComponentSignEnum.VAULTING_CARD === _this5._componentSign)) {
|
518
|
-
_context2.next = 26;
|
504
|
+
if (!(componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
|
505
|
+
_context2.next = 24;
|
519
506
|
break;
|
520
507
|
}
|
521
508
|
if (!enableVaultingApiOptimize) {
|
522
|
-
_context2.next =
|
509
|
+
_context2.next = 24;
|
523
510
|
break;
|
524
511
|
}
|
525
512
|
if (!skipSdkQueryForm) {
|
526
|
-
_context2.next =
|
513
|
+
_context2.next = 21;
|
527
514
|
break;
|
528
515
|
}
|
529
516
|
// 优先判断 skipSdkQueryForm
|
530
517
|
ifSkip = matchVersion(skipSdkQueryForm, _this5._appVersion);
|
531
518
|
if (!ifSkip) {
|
532
|
-
_context2.next =
|
519
|
+
_context2.next = 19;
|
533
520
|
break;
|
534
521
|
}
|
535
522
|
resolve({
|
@@ -537,12 +524,12 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
537
524
|
success: true
|
538
525
|
});
|
539
526
|
return _context2.abrupt("return");
|
540
|
-
case
|
541
|
-
_context2.next =
|
527
|
+
case 19:
|
528
|
+
_context2.next = 24;
|
542
529
|
break;
|
543
|
-
case
|
530
|
+
case 21:
|
544
531
|
if (!skipSdkQuery) {
|
545
|
-
_context2.next =
|
532
|
+
_context2.next = 24;
|
546
533
|
break;
|
547
534
|
}
|
548
535
|
resolve({
|
@@ -550,10 +537,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
550
537
|
success: true
|
551
538
|
});
|
552
539
|
return _context2.abrupt("return");
|
553
|
-
case
|
554
|
-
channelBehavior = getChannelBehavior((_this5$
|
540
|
+
case 24:
|
541
|
+
channelBehavior = getChannelBehavior((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData); // Easypay TOSS 渠道无需actionQuery
|
555
542
|
if (!(channelBehavior !== null && channelBehavior !== void 0 && channelBehavior.usePaymentSessionAsQueryResult)) {
|
556
|
-
_context2.next =
|
543
|
+
_context2.next = 27;
|
557
544
|
break;
|
558
545
|
}
|
559
546
|
return _context2.abrupt("return", resolve({
|
@@ -561,79 +548,78 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
561
548
|
amountConfirmRequired: actionData === null || actionData === void 0 ? void 0 : actionData.amountConfirmRequired,
|
562
549
|
success: true
|
563
550
|
}));
|
564
|
-
case
|
565
|
-
if (!(
|
566
|
-
_context2.next =
|
551
|
+
case 27:
|
552
|
+
if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
|
553
|
+
_context2.next = 33;
|
567
554
|
break;
|
568
555
|
}
|
569
556
|
params.paymentMethodType = 'CARD';
|
570
|
-
_context2.next =
|
557
|
+
_context2.next = 31;
|
571
558
|
return _this5.getDeviceIdAndLog();
|
572
|
-
case
|
559
|
+
case 31:
|
573
560
|
envInfo.deviceId = _context2.sent;
|
574
561
|
if (window.navigator.userAgent.indexOf('miniProgram') > -1) {
|
575
562
|
envInfo.extendInfo = {
|
576
563
|
WAP_SUB_TYPE: 'WECHAT_MINI_PROGRAM'
|
577
564
|
};
|
578
565
|
}
|
579
|
-
case
|
580
|
-
if (!(
|
581
|
-
_context2.next =
|
566
|
+
case 33:
|
567
|
+
if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
|
568
|
+
_context2.next = 42;
|
582
569
|
break;
|
583
570
|
}
|
584
571
|
_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;
|
585
|
-
|
586
|
-
|
587
|
-
_context2.next = 40;
|
572
|
+
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)) {
|
573
|
+
_context2.next = 37;
|
588
574
|
break;
|
589
575
|
}
|
590
576
|
return _context2.abrupt("return", resolve({
|
591
577
|
message: 'sdk no need to make query request',
|
592
578
|
success: true
|
593
579
|
}));
|
594
|
-
case
|
595
|
-
if (!(productScene ===
|
596
|
-
_context2.next =
|
580
|
+
case 37:
|
581
|
+
if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0')) {
|
582
|
+
_context2.next = 39;
|
597
583
|
break;
|
598
584
|
}
|
599
585
|
return _context2.abrupt("return", resolve({
|
600
586
|
message: 'sdk no need to make query request',
|
601
587
|
success: true
|
602
588
|
}));
|
603
|
-
case
|
604
|
-
_context2.next =
|
589
|
+
case 39:
|
590
|
+
_context2.next = 41;
|
605
591
|
return _this5.getDeviceIdAndLog();
|
606
|
-
case
|
592
|
+
case 41:
|
607
593
|
envInfo.deviceId = _context2.sent;
|
608
|
-
case
|
609
|
-
if (!(
|
610
|
-
_context2.next =
|
594
|
+
case 42:
|
595
|
+
if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
|
596
|
+
_context2.next = 52;
|
611
597
|
break;
|
612
598
|
}
|
613
|
-
action = ((_this5$
|
599
|
+
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) || {};
|
614
600
|
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;
|
615
601
|
if (!(signType === 'SMS')) {
|
616
|
-
_context2.next =
|
602
|
+
_context2.next = 47;
|
617
603
|
break;
|
618
604
|
}
|
619
605
|
return _context2.abrupt("return", resolve({
|
620
606
|
message: 'sdk no need to make query request',
|
621
607
|
success: true
|
622
608
|
}));
|
623
|
-
case
|
609
|
+
case 47:
|
624
610
|
if (!(!signType || signType !== 'REDIRECT')) {
|
625
|
-
_context2.next =
|
611
|
+
_context2.next = 49;
|
626
612
|
break;
|
627
613
|
}
|
628
614
|
return _context2.abrupt("return", resolve({
|
629
615
|
success: false
|
630
616
|
}));
|
631
|
-
case
|
632
|
-
_context2.next =
|
617
|
+
case 49:
|
618
|
+
_context2.next = 51;
|
633
619
|
return _this5.getDeviceIdAndLog();
|
634
|
-
case
|
620
|
+
case 51:
|
635
621
|
envInfo.deviceId = _context2.sent;
|
636
|
-
case
|
622
|
+
case 52:
|
637
623
|
_this5.AMSSDK.logger.logInfo({
|
638
624
|
title: 'sdk_event_sdkQuery'
|
639
625
|
}, {
|
@@ -656,7 +642,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
656
642
|
responseBody: res
|
657
643
|
}).send();
|
658
644
|
}).catch(function (err) {
|
659
|
-
if ([
|
645
|
+
if ([componentSignEnum.CASHIER_PAYMENT_CARD, componentSignEnum.VAULTING_CARD, componentSignEnum.CASHIER_PAYMENT_APM].includes(_this5._componentSign)) {
|
660
646
|
return resolve({
|
661
647
|
success: false
|
662
648
|
});
|
@@ -672,7 +658,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
672
658
|
}).send();
|
673
659
|
reject(err);
|
674
660
|
});
|
675
|
-
case
|
661
|
+
case 54:
|
676
662
|
case "end":
|
677
663
|
return _context2.stop();
|
678
664
|
}
|
@@ -704,13 +690,13 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
704
690
|
var channelBehavior = getChannelBehavior((_this$_renderParams14 = this._renderParams) === null || _this$_renderParams14 === void 0 ? void 0 : _this$_renderParams14.paymentSessionMetaData);
|
705
691
|
// eslint-disable-next-line no-async-promise-executor
|
706
692
|
this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
|
707
|
-
var
|
693
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
|
708
694
|
var _channelBehavior$buil, _this6$_renderParams$;
|
709
|
-
var shouldSkipSubmitPayInSDK, _this6$_renderParams, _this6$_renderParams2, _this6$_renderParams3,
|
695
|
+
var shouldSkipSubmitPayInSDK, _this6$_renderParams, _this6$_renderParams2, _this6$_renderParams3, _ref10, _ref10$productSceneVe, productSceneVersion, _ref10$productScene, productScene, _ref11, _ref11$action, _ref11$action2, _ref11$action2$enable, enableSignAgreement, _ref11$action2$autoDe, autoDebitWithToken, _ref12, _ref12$paymentMethodI, _ref12$paymentMethodI2, _ref12$paymentMethodI3, paymentMethodType, isAppWebview, backScheme, extParams;
|
710
696
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
711
697
|
while (1) switch (_context3.prev = _context3.next) {
|
712
698
|
case 0:
|
713
|
-
if (!(_this6.AMSSDK.options.product ===
|
699
|
+
if (!(_this6.AMSSDK.options.product === productSceneEnum.ELEMENT_ADDRESS)) {
|
714
700
|
_context3.next = 2;
|
715
701
|
break;
|
716
702
|
}
|
@@ -724,13 +710,13 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
724
710
|
// 新逻辑走 channelBehavior判断
|
725
711
|
shouldSkipSubmitPayInSDK = !channelBehavior.submitPayInSdk;
|
726
712
|
} else {
|
727
|
-
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) ||
|
713
|
+
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;
|
728
714
|
}
|
729
|
-
if (
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
if (productScene ===
|
715
|
+
if (componentSignEnum.EASY_PAY_WALLET === _this6._componentSign) {
|
716
|
+
_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;
|
717
|
+
_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;
|
718
|
+
_ref12 = ((_this6$_renderParams3 = _this6._renderParams) === null || _this6$_renderParams3 === void 0 ? void 0 : _this6$_renderParams3.paymentSessionMetaData) || {}, _ref12$paymentMethodI = _ref12.paymentMethodInfoView, _ref12$paymentMethodI2 = _ref12$paymentMethodI === void 0 ? {} : _ref12$paymentMethodI, _ref12$paymentMethodI3 = _ref12$paymentMethodI2.paymentMethodType, paymentMethodType = _ref12$paymentMethodI3 === void 0 ? '' : _ref12$paymentMethodI3;
|
719
|
+
if (productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken) {
|
734
720
|
isAppWebview = _this6._isAppWebview || false; ///EasyPay 2.0 首次传signAgreement字段
|
735
721
|
params['signAgreement'] = enableSignAgreement;
|
736
722
|
if (paymentMethodType == 'ALIPAY_CN' && !isAppWebview) {
|
@@ -813,7 +799,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
813
799
|
}, _callee3);
|
814
800
|
}));
|
815
801
|
return function (_x3) {
|
816
|
-
return
|
802
|
+
return _ref9.apply(this, arguments);
|
817
803
|
};
|
818
804
|
}());
|
819
805
|
}
|
@@ -856,7 +842,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
856
842
|
var preloadIframe = createPreloadIframe(componentSign, productSceneVersion);
|
857
843
|
var productScene = componentSign.split(/_(?=[^_]*$)/)[0];
|
858
844
|
var _getIframeUrl = getIframeUrl({
|
859
|
-
renderDisplayType:
|
845
|
+
renderDisplayType: renderDisplayTypeEnum.popup,
|
860
846
|
componentSign: componentSign,
|
861
847
|
analytics: {
|
862
848
|
enabled: false
|
@@ -897,7 +883,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
897
883
|
value: Date.now()
|
898
884
|
});
|
899
885
|
try {
|
900
|
-
var _renderParams$payment, _renderParams$payment2, _renderParams$payment3, _renderParams$payment4
|
886
|
+
var _renderParams$payment, _renderParams$payment2, _renderParams$payment3, _renderParams$payment4;
|
901
887
|
var productSceneVersion = (renderParams === null || renderParams === void 0 || (_renderParams$payment = renderParams.paymentSessionMetaData) === null || _renderParams$payment === void 0 || (_renderParams$payment = _renderParams$payment.paymentSessionConfig) === null || _renderParams$payment === void 0 ? void 0 : _renderParams$payment.productSceneVersion) || '';
|
902
888
|
var productScene = (renderParams === null || renderParams === void 0 || (_renderParams$payment2 = renderParams.paymentSessionMetaData) === null || _renderParams$payment2 === void 0 || (_renderParams$payment2 = _renderParams$payment2.paymentSessionConfig) === null || _renderParams$payment2 === void 0 ? void 0 : _renderParams$payment2.productScene) || '';
|
903
889
|
var extendInfo = (renderParams === null || renderParams === void 0 || (_renderParams$payment3 = renderParams.paymentSessionMetaData) === null || _renderParams$payment3 === void 0 ? void 0 : _renderParams$payment3.extendInfo) || '';
|
@@ -910,8 +896,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
910
896
|
productScene: productScene,
|
911
897
|
productSceneVersion: productSceneVersion,
|
912
898
|
extendInfo: extendInfo,
|
913
|
-
mid: mid
|
914
|
-
localLink: renderParams === null || renderParams === void 0 || (_renderParams$debugPr = renderParams.debugProps) === null || _renderParams$debugPr === void 0 ? void 0 : _renderParams$debugPr.localLink // TODO Connect本地调试link
|
899
|
+
mid: mid
|
915
900
|
});
|
916
901
|
this.app = createIframe(this.AMSSDK.options.mode, this.platform);
|
917
902
|
var hostSign = ((renderParams === null || renderParams === void 0 ? void 0 : renderParams.sessionData) || '').split('&&')[1] || '';
|
@@ -927,8 +912,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
927
912
|
locale: this.AMSSDK.options.locale,
|
928
913
|
instanceId: this.AMSSDK._instanceId,
|
929
914
|
hostSign: hostSign,
|
930
|
-
mid: mid
|
931
|
-
localLink: renderParams === null || renderParams === void 0 || (_renderParams$debugPr2 = renderParams.debugProps) === null || _renderParams$debugPr2 === void 0 ? void 0 : _renderParams$debugPr2.localLink // TODO Connect本地调试link
|
915
|
+
mid: mid
|
932
916
|
}),
|
933
917
|
path = _getIframeUrl2.path,
|
934
918
|
locationSearch = _getIframeUrl2.locationSearch;
|
@@ -963,7 +947,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
963
947
|
var isJson = isJsonString(e.data);
|
964
948
|
if (isJson) {
|
965
949
|
var data = JSON.parse(e.data);
|
966
|
-
if (data.name !==
|
950
|
+
if (data.name !== messageName.APP_TO_SDK && data.name !== messageName.APP_TO_APP || data.instanceId !== this.AMSSDK._instanceId) return;
|
967
951
|
this._handleAppMessage(data);
|
968
952
|
} else {
|
969
953
|
console.warn(ERRORMESSAGE.NOT_JSON_FORMAT);
|
@@ -1335,16 +1319,12 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1335
1319
|
}, {
|
1336
1320
|
key: "handleSizeChanged",
|
1337
1321
|
value: function handleSizeChanged(data) {
|
1338
|
-
var _data$context$data4
|
1339
|
-
var
|
1340
|
-
|
1341
|
-
var appendAliasContainerId = this._renderParams.appendAliasContainerId;
|
1342
|
-
var selectorId = appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat(_selector) : COMPONENT_CONTAINER_ID;
|
1343
|
-
var cashier = document.getElementById(selectorId);
|
1344
|
-
if (((_data$context$data4 = data.context.data) === null || _data$context$data4 === void 0 ? void 0 : _data$context$data4.height) <= 1 || data.context.data.height === parseInt(cashier === null || cashier === void 0 || (_cashier$style = cashier.style) === null || _cashier$style === void 0 ? void 0 : _cashier$style.height)) return;
|
1322
|
+
var _data$context$data4;
|
1323
|
+
var cashier = document.getElementById(COMPONENT_CONTAINER_ID);
|
1324
|
+
if (((_data$context$data4 = data.context.data) === null || _data$context$data4 === void 0 ? void 0 : _data$context$data4.height) <= 1 || data.context.data.height === parseInt(cashier.style.height)) return;
|
1345
1325
|
cashier.style.height = "".concat(data.context.data.height, "px");
|
1346
1326
|
this.app.style.opacity = '1';
|
1347
|
-
if (this._renderDisplayType ===
|
1327
|
+
if (this._renderDisplayType === renderDisplayTypeEnum.popup) {
|
1348
1328
|
if (this.platform === 'desktop') {
|
1349
1329
|
if (data.context.data.width) cashier.style.width = "".concat(data.context.data.width, "px");
|
1350
1330
|
cashier.classList.add("".concat(COMPONENT_CONTAINER_ID, "-").concat(this.platform, "-animation"));
|
@@ -1369,7 +1349,6 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1369
1349
|
style.innerHTML = runkeyframes;
|
1370
1350
|
// 将style样式存放到head标签
|
1371
1351
|
document.getElementsByTagName('head')[0].appendChild(style);
|
1372
|
-
|
1373
1352
|
// size变动时动画
|
1374
1353
|
setTimeout(function () {
|
1375
1354
|
cashier.style.transition = 'height 0.28s ease-in-out';
|
@@ -1378,7 +1357,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1378
1357
|
// 关闭loading,保留蒙层
|
1379
1358
|
this.dismissLoadingFunc();
|
1380
1359
|
}
|
1381
|
-
if (this._renderDisplayType ===
|
1360
|
+
if (this._renderDisplayType === renderDisplayTypeEnum.inline) {
|
1382
1361
|
var _document$getElementB3;
|
1383
1362
|
(_document$getElementB3 = document.getElementById(LOADING_ID)) === null || _document$getElementB3 === void 0 || _document$getElementB3.remove();
|
1384
1363
|
this.app.style.height = "".concat(data.context.data.height, "px");
|
@@ -1463,13 +1442,13 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1463
1442
|
};
|
1464
1443
|
|
1465
1444
|
// 支持 target: _blank,新开tab页打开
|
1466
|
-
if (_data.target ===
|
1445
|
+
if (_data.target === targetEnum.BLANK) {
|
1467
1446
|
if (!_data.normalUrl) return failCallback(RedirectType.NormalUrl, '');
|
1468
1447
|
successCallback(RedirectType.NormalUrl, _data.normalUrl);
|
1469
1448
|
window.open(_data.normalUrl);
|
1470
1449
|
return;
|
1471
1450
|
}
|
1472
|
-
if (_data.target ===
|
1451
|
+
if (_data.target === targetEnum.REPLACE && !(_data !== null && _data !== void 0 && _data.applinkUrl) && !(_data !== null && _data !== void 0 && _data.schemeUrl)) {
|
1473
1452
|
if (!_data.normalUrl) return failCallback(RedirectType.NormalUrl, '');
|
1474
1453
|
successCallback(RedirectType.NormalUrl, _data.normalUrl);
|
1475
1454
|
window.location.replace(_data.normalUrl);
|
@@ -1521,9 +1500,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1521
1500
|
}
|
1522
1501
|
}, {
|
1523
1502
|
key: "handleDeclareInfo",
|
1524
|
-
value: function handleDeclareInfo(
|
1525
|
-
var
|
1526
|
-
closeDialogData =
|
1503
|
+
value: function handleDeclareInfo(_ref13) {
|
1504
|
+
var _ref13$closeDialogDat = _ref13.closeDialogData,
|
1505
|
+
closeDialogData = _ref13$closeDialogDat === void 0 ? {} : _ref13$closeDialogDat;
|
1527
1506
|
_handleDeclareInfo({
|
1528
1507
|
closeDialogData: closeDialogData
|
1529
1508
|
});
|
@@ -1625,7 +1604,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1625
1604
|
value: function dispatchToApp(payload) {
|
1626
1605
|
var targetElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
1627
1606
|
var data = Object.assign({}, payload, {
|
1628
|
-
name:
|
1607
|
+
name: messageName.SDK_TO_APP,
|
1629
1608
|
mode: this.AMSSDK.options.mode,
|
1630
1609
|
appId: COMPONENTPLUGINID,
|
1631
1610
|
instanceId: this.AMSSDK._instanceId
|
@@ -1669,7 +1648,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1669
1648
|
while (1) switch (_context8.prev = _context8.next) {
|
1670
1649
|
case 0:
|
1671
1650
|
_context8.prev = 0;
|
1672
|
-
isAddressElement = this.AMSSDK.options.product ===
|
1651
|
+
isAddressElement = this.AMSSDK.options.product === productSceneEnum.ELEMENT_ADDRESS;
|
1673
1652
|
if (!((!this._actionQueryPromise || !this._actionSubmitPromise) && !isAddressElement)) {
|
1674
1653
|
_context8.next = 4;
|
1675
1654
|
break;
|
@@ -1813,9 +1792,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1813
1792
|
}, {
|
1814
1793
|
key: "removeRetentionPopup",
|
1815
1794
|
value: function removeRetentionPopup(platform) {
|
1816
|
-
_removeRetentionPopup();
|
1817
|
-
// TODO check
|
1818
|
-
// removeRetentionPopup(platform, this.hideRetentionPopupFunc.bind(this), this.retentionPopupLeaveFunc.bind(this));
|
1795
|
+
_removeRetentionPopup(platform, this.hideRetentionPopupFunc.bind(this), this.retentionPopupLeaveFunc.bind(this));
|
1819
1796
|
}
|
1820
1797
|
}, {
|
1821
1798
|
key: "showRetentionPopup",
|
package/esm/plugin/const.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import { ApplePayActionEnum, PaymentActionEnum, PaypalActionEnum } from "../core/bus/interface";
|
2
|
-
import {
|
2
|
+
import { paymentMethodCategoryTypeEnum, PaypalMethodEnum, productSceneEnum, ProductSceneVersion } from "../types/index";
|
3
3
|
export var ExtendPlugin = [{
|
4
4
|
sessionMatcher: {
|
5
|
-
productScene:
|
5
|
+
productScene: productSceneEnum.CASHIER_PAYMENT,
|
6
6
|
productSceneVersion: ProductSceneVersion.V1,
|
7
|
-
paymentMethodCategoryType:
|
7
|
+
paymentMethodCategoryType: paymentMethodCategoryTypeEnum.CARD,
|
8
8
|
paymentMethodTypes: ['CARD_APPLE_PAY']
|
9
9
|
},
|
10
10
|
paymentChannelMatcher: {
|
@@ -18,9 +18,9 @@ export var ExtendPlugin = [{
|
|
18
18
|
}
|
19
19
|
}, {
|
20
20
|
sessionMatcher: {
|
21
|
-
productScene:
|
21
|
+
productScene: productSceneEnum.CASHIER_PAYMENT,
|
22
22
|
productSceneVersion: ProductSceneVersion.V1,
|
23
|
-
paymentMethodCategoryType:
|
23
|
+
paymentMethodCategoryType: paymentMethodCategoryTypeEnum.APM,
|
24
24
|
paymentMethodTypes: [PaypalMethodEnum.PAYPAL_CHECKOUT, PaypalMethodEnum.PAYPAL_PAYLATER, PaypalMethodEnum.PAYPAL_VAULT]
|
25
25
|
},
|
26
26
|
paymentChannelMatcher: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type AMSCheckout from '../../core/instance';
|
2
|
-
import type { IcreatePaymentParams,
|
2
|
+
import type { IcreatePaymentParams, eventPayload } from '../../types';
|
3
3
|
export default class CheckoutApp {
|
4
4
|
app: any;
|
5
5
|
paymentMethodsResult: any;
|
@@ -47,15 +47,15 @@ export default class CheckoutApp {
|
|
47
47
|
/**
|
48
48
|
* @description Processing messages from iframe
|
49
49
|
*/
|
50
|
-
_handleAppMessage(data:
|
50
|
+
_handleAppMessage(data: eventPayload): void;
|
51
51
|
/**
|
52
52
|
* @description Send message to SDK
|
53
53
|
*/
|
54
|
-
_dispatchToSDK(data:
|
54
|
+
_dispatchToSDK(data: eventPayload): void;
|
55
55
|
/**
|
56
56
|
* @description Send message to iframe
|
57
57
|
*/
|
58
|
-
_dispatchToApp(data:
|
58
|
+
_dispatchToApp(data: eventPayload): void;
|
59
59
|
/**
|
60
60
|
* @description Subscribe to messages from SDK
|
61
61
|
*/
|
@@ -67,5 +67,5 @@ export default class CheckoutApp {
|
|
67
67
|
/**
|
68
68
|
* @description Send the post submission processing event, and the cashier applies the consumption result
|
69
69
|
*/
|
70
|
-
_handleRequestPayment(data:
|
70
|
+
_handleRequestPayment(data: eventPayload): void;
|
71
71
|
}
|