@alipay/ams-checkout 1.24.0 → 1.25.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/component/channel.d.ts +19 -0
- package/esm/component/channel.js +87 -0
- package/esm/component/component.inline.style.d.ts +10 -0
- package/esm/component/component.inline.style.js +121 -0
- package/esm/component/component.popup.style.d.ts +23 -0
- package/esm/component/component.popup.style.js +190 -0
- package/esm/component/popupWindow.style.d.ts +11 -0
- package/esm/component/popupWindow.style.js +121 -0
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +3 -5
- package/esm/constant/index.js +4 -78
- 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/element/components/address.js +1 -1
- package/esm/core/component/element/components/auth.d.ts +1 -1
- package/esm/core/component/element/components/payment.js +1 -1
- package/esm/core/component/element/index.js +19 -19
- package/esm/core/component/element/type.d.ts +6 -0
- package/esm/core/component/index.d.ts +2 -2
- package/esm/core/component/index.js +2 -6
- package/esm/core/drop-in/index.d.ts +2 -2
- package/esm/core/instance/index.d.ts +5 -5
- package/esm/core/instance/index.js +1 -2
- package/esm/foundation/core/index.d.ts +5 -5
- package/esm/foundation/core/index.js +117 -52
- package/esm/foundation/index.d.ts +10 -7
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +8 -5
- package/esm/foundation/product-processor/easysafepay/deps.js +5 -2
- package/esm/foundation/product-processor/easysafepay/index.d.ts +6 -6
- package/esm/foundation/product-processor/easysafepay/index.js +192 -265
- package/esm/foundation/service/{event-bus → api-bus}/ability/callback.js +1 -1
- package/esm/foundation/service/{event-bus → api-bus}/ability/globalData.d.ts +1 -1
- package/esm/{core/bus → foundation/service/api-bus}/ability/globalData.js +2 -2
- package/esm/{core/bus → foundation/service/api-bus}/ability/request.d.ts +1 -1
- package/esm/{core/bus → foundation/service/api-bus}/ability/request.js +2 -2
- package/esm/foundation/service/{event-bus → api-bus}/ability/security.js +29 -19
- package/esm/foundation/service/{event-bus → api-bus}/ability/tracker.js +1 -1
- package/esm/foundation/service/{event-bus → api-bus}/busManager.js +1 -1
- package/esm/foundation/service/{event-bus → api-bus}/index.d.ts +2 -2
- package/esm/foundation/service/api-bus/interface.d.ts +48 -0
- package/esm/foundation/service/api-bus/interface.js +54 -0
- package/esm/foundation/service/container/index.d.ts +4 -2
- package/esm/foundation/service/container/index.js +47 -5
- package/esm/foundation/service/container/popup.js +1 -1
- package/esm/foundation/service/event-center.d.ts +6 -5
- package/esm/foundation/service/event-center.js +16 -17
- package/esm/foundation/service/global-data/index.d.ts +2 -2
- package/esm/foundation/service/global-data/index.js +4 -5
- package/esm/foundation/service/index.d.ts +2 -2
- package/esm/foundation/service/index.js +1 -1
- package/esm/foundation/service/log/index.d.ts +2 -2
- package/esm/foundation/service/log/index.js +1 -1
- package/esm/foundation/service/requester/deps.d.ts +1 -1
- package/esm/foundation/service/requester/requester.d.ts +2 -2
- package/esm/foundation/service/requester/requester.js +14 -11
- package/esm/foundation/service/security/index.d.ts +11 -9
- package/esm/foundation/service/security/index.js +114 -44
- package/esm/foundation/utils/payment_product_utils.d.ts +13 -0
- package/esm/foundation/utils/payment_product_utils.js +38 -0
- package/esm/foundation/utils/redirect_utils.d.ts +5 -0
- package/esm/foundation/utils/redirect_utils.js +209 -45
- package/esm/foundation/utils/system_events.js +0 -5
- package/esm/foundation/utils/web_app_url_utils.d.ts +11 -2
- package/esm/foundation/utils/web_app_url_utils.js +18 -3
- package/esm/index.d.ts +12 -12
- package/esm/index.js +31 -31
- package/esm/plugin/component/cashierApp.d.ts +3 -3
- package/esm/plugin/component/cashierApp.js +9 -10
- package/esm/plugin/component/component.inline.style.d.ts +1 -1
- package/esm/plugin/component/component.inline.style.js +2 -3
- package/esm/plugin/component/component.popup.style.d.ts +1 -10
- package/esm/plugin/component/component.popup.style.js +10 -28
- package/esm/plugin/component/index.d.ts +1 -1
- package/esm/plugin/component/index.js +64 -62
- 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 +1 -1
- package/esm/types/index.d.ts +17 -11
- package/esm/types/index.js +7 -1
- package/esm/util/getBackScheme.js +95 -3
- package/esm/util/index.d.ts +1 -1
- package/esm/util/index.js +4 -3
- package/esm/util/security.d.ts +33 -0
- package/esm/{foundation/service/event-bus/ability/request.js → util/security.js} +153 -122
- package/package.json +1 -1
- package/esm/core/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/types/index.d.ts +0 -4
- package/esm/foundation/types/index.js +0 -4
- 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
- /package/esm/foundation/service/{event-bus → api-bus}/ability/callback.d.ts +0 -0
- /package/esm/foundation/service/{event-bus → api-bus}/ability/security.d.ts +0 -0
- /package/esm/foundation/service/{event-bus → api-bus}/ability/tracker.d.ts +0 -0
- /package/esm/foundation/service/{event-bus → api-bus}/busManager.d.ts +0 -0
- /package/esm/foundation/service/{event-bus → api-bus}/index.js +0 -0
@@ -18,7 +18,7 @@ export var inlineComponentAddCss = function inlineComponentAddCss() {
|
|
18
18
|
document.head.appendChild(style);
|
19
19
|
};
|
20
20
|
/**
|
21
|
-
* @description
|
21
|
+
* @description ComponentSignEnum.ELEMENT_PAYMENT特殊处理
|
22
22
|
* @param {Options['type']} type
|
23
23
|
*/
|
24
24
|
var renderElementPayment = function renderElementPayment(type) {
|
@@ -101,8 +101,7 @@ export var addInlineLoading = function addInlineLoading(_selector, platform, opt
|
|
101
101
|
} else {
|
102
102
|
loading.innerHTML = renderElementPayment(options === null || options === void 0 ? void 0 : options.type);
|
103
103
|
}
|
104
|
-
} else if (platform === PlatformEnum.desktop) loading.innerHTML = "<svg class=\"".concat(INLINE_IMG_CLASSNAME, " ").concat(INLINE_IMG_CLASSNAME, "-").concat(platform, "\" width=\"740\" height=\"360\" viewBox=\"0 0 740 360\" fill=\"none\" xmlns=\"\">\n <rect width=\"740\" height=\"360\" rx=\"12\" fill=\"#F6F6F6\"/>\n <rect opacity=\"0.7\" x=\"44\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"94\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"144\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z\" fill=\"#E1E6ED\"/>\n </g>\n </svg>");
|
105
|
-
if (platform === PlatformEnum.mobile) loading.innerHTML = "<svg class=\"".concat(INLINE_IMG_CLASSNAME, " ").concat(INLINE_IMG_CLASSNAME, "-").concat(platform, "\" width=\"358\" height=\"186\" viewBox=\"0 0 358 186\" fill=\"none\" xmlns=\"\">\n <g clip-path=\"url(#clip0_2543_91192)\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n <g clip-path=\"url(#clip1_2543_91192)\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n <rect width=\"358\" height=\"40\" fill=\"white\"/>\n <rect opacity=\"0.7\" x=\"4\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"54\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"104\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <g clip-path=\"url(#clip2_2543_91192)\">\n <rect width=\"358\" height=\"120\" transform=\"translate(0 66)\" fill=\"white\"/>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z\" fill=\"#E1E6ED\"/>\n </g>\n <g clip-path=\"url(#clip3_2543_91192)\">\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z\" fill=\"#E1E6ED\"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id=\"clip0_2543_91192\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n </clipPath>\n <clipPath id=\"clip1_2543_91192\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n </clipPath>\n <clipPath id=\"clip2_2543_91192\">\n <rect width=\"358\" height=\"120\" fill=\"white\" transform=\"translate(0 66)\"/>\n </clipPath>\n <clipPath id=\"clip3_2543_91192\">\n <rect width=\"358\" height=\"92\" fill=\"white\" transform=\"translate(0 94)\"/>\n </clipPath>\n </defs>\n </svg>\n ");
|
104
|
+
} else if (platform === PlatformEnum.desktop) loading.innerHTML = "<svg class=\"".concat(INLINE_IMG_CLASSNAME, " ").concat(INLINE_IMG_CLASSNAME, "-").concat(platform, "\" width=\"740\" height=\"360\" viewBox=\"0 0 740 360\" fill=\"none\" xmlns=\"\">\n <rect width=\"740\" height=\"360\" rx=\"12\" fill=\"#F6F6F6\"/>\n <rect opacity=\"0.7\" x=\"44\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"94\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"144\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z\" fill=\"#E1E6ED\"/>\n </g>\n </svg>");else if (platform === PlatformEnum.mobile) loading.innerHTML = "<svg class=\"".concat(INLINE_IMG_CLASSNAME, " ").concat(INLINE_IMG_CLASSNAME, "-").concat(platform, "\" width=\"358\" height=\"186\" viewBox=\"0 0 358 186\" fill=\"none\" xmlns=\"\">\n <g clip-path=\"url(#clip0_2543_91192)\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n <g clip-path=\"url(#clip1_2543_91192)\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n <rect width=\"358\" height=\"40\" fill=\"white\"/>\n <rect opacity=\"0.7\" x=\"4\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"54\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"104\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <g clip-path=\"url(#clip2_2543_91192)\">\n <rect width=\"358\" height=\"120\" transform=\"translate(0 66)\" fill=\"white\"/>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z\" fill=\"#E1E6ED\"/>\n </g>\n <g clip-path=\"url(#clip3_2543_91192)\">\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z\" fill=\"#E1E6ED\"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id=\"clip0_2543_91192\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n </clipPath>\n <clipPath id=\"clip1_2543_91192\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n </clipPath>\n <clipPath id=\"clip2_2543_91192\">\n <rect width=\"358\" height=\"120\" fill=\"white\" transform=\"translate(0 66)\"/>\n </clipPath>\n <clipPath id=\"clip3_2543_91192\">\n <rect width=\"358\" height=\"92\" fill=\"white\" transform=\"translate(0 94)\"/>\n </clipPath>\n </defs>\n </svg>\n ");
|
106
105
|
if (_selector) _selector.appendChild(loading);
|
107
106
|
var loadingDom = document.getElementById(LOADING_ID);
|
108
107
|
amsSetSize(null, loadingDom);
|
@@ -2,22 +2,13 @@ import { PlatformEnum } from '../../types';
|
|
2
2
|
export declare const componentAddCSS: () => void;
|
3
3
|
export declare const createBaseElement: (platform: PlatformEnum, closeBtnFunc: () => void) => HTMLDivElement;
|
4
4
|
export declare const createCloseBtn: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
|
5
|
-
/**
|
6
|
-
* 弹出离开挽留弹窗
|
7
|
-
* @param platform
|
8
|
-
* @param remainBtnFunc
|
9
|
-
* @param leaveBtnFunc
|
10
|
-
*/
|
11
5
|
export declare const createRetentionPopup: (platform: PlatformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
12
6
|
export declare const hideRetentionPopup: () => void;
|
13
|
-
export declare const
|
14
|
-
export declare const removeRetentionPopup: () => void;
|
7
|
+
export declare const removeRetentionPopup: (platform: PlatformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
15
8
|
export declare const createMockup: (options: {
|
16
9
|
platform: PlatformEnum;
|
17
10
|
onClickOutside: () => void;
|
18
11
|
}) => void;
|
19
|
-
export declare const hideMockup: () => void;
|
20
|
-
export declare const cleanMockup: () => void;
|
21
12
|
export declare const addPopupLoading: () => void;
|
22
13
|
export declare const handleDeclareInfo: ({ closeDialogData }: {
|
23
14
|
closeDialogData: any;
|
@@ -47,13 +47,6 @@ export var createCloseBtn = function createCloseBtn(platform, closeBtnFunc) {
|
|
47
47
|
});
|
48
48
|
if (container) container.appendChild(closeBlock);
|
49
49
|
};
|
50
|
-
|
51
|
-
/**
|
52
|
-
* 弹出离开挽留弹窗
|
53
|
-
* @param platform
|
54
|
-
* @param remainBtnFunc
|
55
|
-
* @param leaveBtnFunc
|
56
|
-
*/
|
57
50
|
export var createRetentionPopup = function createRetentionPopup(platform, remainBtnFunc, leaveBtnFunc) {
|
58
51
|
var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
|
59
52
|
// retention popup
|
@@ -83,17 +76,17 @@ export var hideRetentionPopup = function hideRetentionPopup() {
|
|
83
76
|
}, ANIMATION_TIME);
|
84
77
|
}
|
85
78
|
};
|
86
|
-
export var
|
87
|
-
var retentionPopup = document.getElementById(COMPONENT_RETENTION_ID);
|
88
|
-
var container = document.getElementById(COMPONENT_CONTAINER_ID);
|
89
|
-
if (retentionPopup) {
|
90
|
-
container === null || container === void 0 || container.classList.add("".concat(COMPONENT_CONTAINER_ID, "-opacity"));
|
91
|
-
retentionPopup.classList.remove("".concat(COMPONENT_RETENTION_ID, "-hidden"));
|
92
|
-
retentionPopup.classList.add("".concat(COMPONENT_RETENTION_ID, "-show"));
|
93
|
-
}
|
94
|
-
};
|
95
|
-
export var removeRetentionPopup = function removeRetentionPopup() {
|
79
|
+
export var removeRetentionPopup = function removeRetentionPopup(platform, remainBtnFunc, leaveBtnFunc) {
|
96
80
|
var _document$getElementB;
|
81
|
+
var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
|
82
|
+
var remainBtn = document.getElementById("".concat(COMPONENT_RETENTION_ID, "-remain"));
|
83
|
+
if (remainBtn) {
|
84
|
+
remainBtn.removeEventListener(clickEventName, remainBtnFunc);
|
85
|
+
}
|
86
|
+
var leaveBtn = document.getElementById("".concat(COMPONENT_RETENTION_ID, "-leave"));
|
87
|
+
if (leaveBtn) {
|
88
|
+
leaveBtn.removeEventListener(clickEventName, leaveBtnFunc);
|
89
|
+
}
|
97
90
|
(_document$getElementB = document.getElementById(COMPONENT_RETENTION_ID)) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
98
91
|
};
|
99
92
|
export var createMockup = function createMockup(options) {
|
@@ -117,17 +110,6 @@ export var createMockup = function createMockup(options) {
|
|
117
110
|
});
|
118
111
|
body.appendChild(mockup);
|
119
112
|
};
|
120
|
-
export var hideMockup = function hideMockup() {
|
121
|
-
var mockup = document.getElementById(MOCKUP_ID);
|
122
|
-
mockup === null || mockup === void 0 || mockup.classList.add("".concat(MOCKUP_ID, "-hidden"));
|
123
|
-
};
|
124
|
-
export var cleanMockup = function cleanMockup() {
|
125
|
-
// mockup
|
126
|
-
var body = document.getElementsByTagName('body')[0];
|
127
|
-
body.style.overflow = 'auto';
|
128
|
-
var mockup = document.getElementById(MOCKUP_ID);
|
129
|
-
mockup === null || mockup === void 0 || mockup.remove();
|
130
|
-
};
|
131
113
|
export var addPopupLoading = function addPopupLoading() {
|
132
114
|
var loading = document.createElement('div');
|
133
115
|
loading === null || loading === void 0 || loading.classList.add(LOADING_ID);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type AMSCheckout from '../../core/instance';
|
2
2
|
import type { EventPayload, EventPayloadContext, IappendIframeNodesParams, IMerchantAppointParam, Iselector } from '../../types';
|
3
|
-
import { ComponentSignEnum, DeviceIdParameter,
|
3
|
+
import { ComponentSignEnum, DeviceIdParameter, PlatformEnum, DisplayTypeEnum } from '../../types';
|
4
4
|
type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType: DisplayTypeEnum) => Promise<void>;
|
5
5
|
export default class ComponentApp {
|
6
6
|
app: null | HTMLIFrameElement;
|
@@ -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 { ComponentSignEnum,
|
24
|
+
import { ComponentSignEnum, eventCodeEnum, MessageName, PlatformEnum, ProductSceneEnum, RedirectType, DisplayTypeEnum, 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";
|
@@ -252,6 +252,12 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
252
252
|
key: "appendIframeNodes",
|
253
253
|
value: function appendIframeNodes(componentSign, renderParams) {
|
254
254
|
var _renderParams,
|
255
|
+
_renderParams2,
|
256
|
+
_this$_selector,
|
257
|
+
_this$_selector$index,
|
258
|
+
_this$_selector2,
|
259
|
+
_this$_selector2$slic,
|
260
|
+
_renderParams3,
|
255
261
|
_this$_renderParams5,
|
256
262
|
_this$_renderParams6,
|
257
263
|
_this$_renderParams7,
|
@@ -267,13 +273,13 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
267
273
|
this._renderParams = renderParams;
|
268
274
|
this._componentSign = componentSign;
|
269
275
|
if ((_renderParams = renderParams) !== null && _renderParams !== void 0 && _renderParams.selector) this._selector = renderParams.selector;
|
270
|
-
this._renderDisplayType = renderParams.renderDisplayType;
|
276
|
+
this._renderDisplayType = (_renderParams2 = renderParams) === null || _renderParams2 === void 0 ? void 0 : _renderParams2.renderDisplayType;
|
271
277
|
// connect element模式会存在加载多个sdk,appendAliasContainerId为true来判断,给容器inlineId添加标识,id中不能存在#需在这里提前过滤一下
|
272
|
-
var _selector = this._selector.indexOf('#') === -1 ? this._selector : this._selector.slice(1);
|
278
|
+
var _selector = (this === null || this === void 0 || (_this$_selector = this._selector) === null || _this$_selector === void 0 || (_this$_selector$index = _this$_selector.indexOf) === null || _this$_selector$index === void 0 ? void 0 : _this$_selector$index.call(_this$_selector, '#')) === -1 ? this === null || this === void 0 ? void 0 : this._selector : this === null || this === void 0 || (_this$_selector2 = this._selector) === null || _this$_selector2 === void 0 || (_this$_selector2$slic = _this$_selector2.slice) === null || _this$_selector2$slic === void 0 ? void 0 : _this$_selector2$slic.call(_this$_selector2, 1);
|
273
279
|
// 修改需当前文件搜索,这段注释appendAliasContainerId
|
274
|
-
var appendAliasContainerId = renderParams.appendAliasContainerId ? "-".concat(_selector) : '';
|
280
|
+
var appendAliasContainerId = (_renderParams3 = renderParams) !== null && _renderParams3 !== void 0 && _renderParams3.appendAliasContainerId ? "-".concat(_selector) : '';
|
275
281
|
var inlineId = "".concat(COMPONENT_CONTAINER_ID).concat(appendAliasContainerId);
|
276
|
-
var insertedNode = this._renderDisplayType === DisplayTypeEnum.inline ? "#".concat(inlineId) : this._selector;
|
282
|
+
var insertedNode = (this === null || this === void 0 ? void 0 : this._renderDisplayType) === DisplayTypeEnum.inline ? "#".concat(inlineId) : this === null || this === void 0 ? void 0 : this._selector;
|
277
283
|
this._isAppWebview = renderParams.isAppWebview;
|
278
284
|
this.initLoggerMeta();
|
279
285
|
this.initSecurity();
|
@@ -457,7 +463,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
457
463
|
this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
|
458
464
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
|
459
465
|
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6, _this5$_renderParams7;
|
460
|
-
var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams8,
|
466
|
+
var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams8, _ref8, _ref8$productSceneVer, productSceneVersion, _ref8$productScene, productScene, _this5$_renderParams9, _action$web2, _action$wap2, action, signType;
|
461
467
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
462
468
|
while (1) switch (_context2.prev = _context2.next) {
|
463
469
|
case 0:
|
@@ -578,62 +584,61 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
578
584
|
}
|
579
585
|
case 35:
|
580
586
|
if (!(ComponentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
|
581
|
-
_context2.next =
|
587
|
+
_context2.next = 44;
|
582
588
|
break;
|
583
589
|
}
|
584
590
|
_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;
|
591
|
+
if (!((_this5$_renderParams8 = _this5._renderParams) !== null && _this5$_renderParams8 !== void 0 && (_this5$_renderParams8 = _this5$_renderParams8.paymentSessionMetaData) !== null && _this5$_renderParams8 !== void 0 && (_this5$_renderParams8 = _this5$_renderParams8.action) !== null && _this5$_renderParams8 !== void 0 && _this5$_renderParams8.skipSdkQuery && enableEasypayApiOptimize)) {
|
592
|
+
_context2.next = 39;
|
588
593
|
break;
|
589
594
|
}
|
590
595
|
return _context2.abrupt("return", resolve({
|
591
596
|
message: 'sdk no need to make query request',
|
592
597
|
success: true
|
593
598
|
}));
|
594
|
-
case
|
599
|
+
case 39:
|
595
600
|
if (!(productScene === ProductSceneEnum.EASY_PAY && productSceneVersion === '2.0')) {
|
596
|
-
_context2.next =
|
601
|
+
_context2.next = 41;
|
597
602
|
break;
|
598
603
|
}
|
599
604
|
return _context2.abrupt("return", resolve({
|
600
605
|
message: 'sdk no need to make query request',
|
601
606
|
success: true
|
602
607
|
}));
|
603
|
-
case
|
604
|
-
_context2.next =
|
608
|
+
case 41:
|
609
|
+
_context2.next = 43;
|
605
610
|
return _this5.getDeviceIdAndLog();
|
606
|
-
case
|
611
|
+
case 43:
|
607
612
|
envInfo.deviceId = _context2.sent;
|
608
|
-
case
|
613
|
+
case 44:
|
609
614
|
if (!(ComponentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
|
610
|
-
_context2.next =
|
615
|
+
_context2.next = 54;
|
611
616
|
break;
|
612
617
|
}
|
613
|
-
action = ((_this5$
|
618
|
+
action = ((_this5$_renderParams9 = _this5._renderParams) === null || _this5$_renderParams9 === void 0 || (_this5$_renderParams9 = _this5$_renderParams9.paymentSessionMetaData) === null || _this5$_renderParams9 === void 0 ? void 0 : _this5$_renderParams9.action) || {};
|
614
619
|
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
620
|
if (!(signType === 'SMS')) {
|
616
|
-
_context2.next =
|
621
|
+
_context2.next = 49;
|
617
622
|
break;
|
618
623
|
}
|
619
624
|
return _context2.abrupt("return", resolve({
|
620
625
|
message: 'sdk no need to make query request',
|
621
626
|
success: true
|
622
627
|
}));
|
623
|
-
case
|
628
|
+
case 49:
|
624
629
|
if (!(!signType || signType !== 'REDIRECT')) {
|
625
|
-
_context2.next =
|
630
|
+
_context2.next = 51;
|
626
631
|
break;
|
627
632
|
}
|
628
633
|
return _context2.abrupt("return", resolve({
|
629
634
|
success: false
|
630
635
|
}));
|
631
|
-
case
|
632
|
-
_context2.next =
|
636
|
+
case 51:
|
637
|
+
_context2.next = 53;
|
633
638
|
return _this5.getDeviceIdAndLog();
|
634
|
-
case
|
639
|
+
case 53:
|
635
640
|
envInfo.deviceId = _context2.sent;
|
636
|
-
case
|
641
|
+
case 54:
|
637
642
|
_this5.AMSSDK.logger.logInfo({
|
638
643
|
title: 'sdk_event_sdkQuery'
|
639
644
|
}, {
|
@@ -672,7 +677,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
672
677
|
}).send();
|
673
678
|
reject(err);
|
674
679
|
});
|
675
|
-
case
|
680
|
+
case 56:
|
676
681
|
case "end":
|
677
682
|
return _context2.stop();
|
678
683
|
}
|
@@ -704,9 +709,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
704
709
|
var channelBehavior = getChannelBehavior((_this$_renderParams14 = this._renderParams) === null || _this$_renderParams14 === void 0 ? void 0 : _this$_renderParams14.paymentSessionMetaData);
|
705
710
|
// eslint-disable-next-line no-async-promise-executor
|
706
711
|
this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
|
707
|
-
var
|
712
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
|
708
713
|
var _channelBehavior$buil, _this6$_renderParams$;
|
709
|
-
var shouldSkipSubmitPayInSDK, _this6$_renderParams, _this6$_renderParams2, _this6$_renderParams3,
|
714
|
+
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
715
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
711
716
|
while (1) switch (_context3.prev = _context3.next) {
|
712
717
|
case 0:
|
@@ -727,9 +732,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
727
732
|
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
733
|
}
|
729
734
|
if (ComponentSignEnum.EASY_PAY_WALLET === _this6._componentSign) {
|
730
|
-
|
731
|
-
|
732
|
-
|
735
|
+
_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;
|
736
|
+
_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;
|
737
|
+
_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;
|
733
738
|
if (productScene === ProductSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken) {
|
734
739
|
isAppWebview = _this6._isAppWebview || false; ///EasyPay 2.0 首次传signAgreement字段
|
735
740
|
params['signAgreement'] = enableSignAgreement;
|
@@ -813,7 +818,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
813
818
|
}, _callee3);
|
814
819
|
}));
|
815
820
|
return function (_x3) {
|
816
|
-
return
|
821
|
+
return _ref9.apply(this, arguments);
|
817
822
|
};
|
818
823
|
}());
|
819
824
|
}
|
@@ -897,7 +902,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
897
902
|
value: Date.now()
|
898
903
|
});
|
899
904
|
try {
|
900
|
-
var _renderParams$payment, _renderParams$payment2, _renderParams$payment3, _renderParams$payment4, _renderParams$
|
905
|
+
var _renderParams$payment, _renderParams$payment2, _renderParams$payment3, _renderParams$payment4, _renderParams$element, _renderParams$element2;
|
901
906
|
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
907
|
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
908
|
var extendInfo = (renderParams === null || renderParams === void 0 || (_renderParams$payment3 = renderParams.paymentSessionMetaData) === null || _renderParams$payment3 === void 0 ? void 0 : _renderParams$payment3.extendInfo) || '';
|
@@ -911,7 +916,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
911
916
|
productSceneVersion: productSceneVersion,
|
912
917
|
extendInfo: extendInfo,
|
913
918
|
mid: mid,
|
914
|
-
|
919
|
+
elementLink: renderParams === null || renderParams === void 0 || (_renderParams$element = renderParams.elementProps) === null || _renderParams$element === void 0 ? void 0 : _renderParams$element.elementLink // TODO Connect本地调试link
|
915
920
|
});
|
916
921
|
this.app = createIframe(this.AMSSDK.options.mode, this.platform);
|
917
922
|
var hostSign = ((renderParams === null || renderParams === void 0 ? void 0 : renderParams.sessionData) || '').split('&&')[1] || '';
|
@@ -928,7 +933,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
928
933
|
instanceId: this.AMSSDK._instanceId,
|
929
934
|
hostSign: hostSign,
|
930
935
|
mid: mid,
|
931
|
-
|
936
|
+
elementLink: renderParams === null || renderParams === void 0 || (_renderParams$element2 = renderParams.elementProps) === null || _renderParams$element2 === void 0 ? void 0 : _renderParams$element2.elementLink // TODO Connect本地调试link
|
932
937
|
}),
|
933
938
|
path = _getIframeUrl2.path,
|
934
939
|
locationSearch = _getIframeUrl2.locationSearch;
|
@@ -1363,10 +1368,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1363
1368
|
}, {
|
1364
1369
|
key: "handleSizeChanged",
|
1365
1370
|
value: function handleSizeChanged(data) {
|
1366
|
-
var _this$
|
1367
|
-
var _selector = ((_this$
|
1371
|
+
var _this$_renderParams15, _this$_renderParams16, _this$_renderParams17, _this$_renderParams18, _this$_renderParams19, _this$_renderParams20, _data$context$data4, _cashier$style;
|
1372
|
+
var _selector = (this === null || this === void 0 || (_this$_renderParams15 = this._renderParams) === null || _this$_renderParams15 === void 0 || (_this$_renderParams15 = _this$_renderParams15.selector) === null || _this$_renderParams15 === void 0 || (_this$_renderParams16 = _this$_renderParams15.indexOf) === null || _this$_renderParams16 === void 0 ? void 0 : _this$_renderParams16.call(_this$_renderParams15, '#')) === -1 ? this === null || this === void 0 || (_this$_renderParams17 = this._renderParams) === null || _this$_renderParams17 === void 0 ? void 0 : _this$_renderParams17.selector : this === null || this === void 0 || (_this$_renderParams18 = this._renderParams) === null || _this$_renderParams18 === void 0 || (_this$_renderParams18 = _this$_renderParams18.selector) === null || _this$_renderParams18 === void 0 || (_this$_renderParams19 = _this$_renderParams18.slice) === null || _this$_renderParams19 === void 0 ? void 0 : _this$_renderParams19.call(_this$_renderParams18, 1);
|
1368
1373
|
// 修改需当前文件搜索,这段注释appendAliasContainerId
|
1369
|
-
var appendAliasContainerId = this._renderParams.appendAliasContainerId;
|
1374
|
+
var appendAliasContainerId = this === null || this === void 0 || (_this$_renderParams20 = this._renderParams) === null || _this$_renderParams20 === void 0 ? void 0 : _this$_renderParams20.appendAliasContainerId;
|
1370
1375
|
var selectorId = appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat(_selector) : COMPONENT_CONTAINER_ID;
|
1371
1376
|
var cashier = document.getElementById(selectorId);
|
1372
1377
|
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;
|
@@ -1397,7 +1402,6 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1397
1402
|
style.innerHTML = runkeyframes;
|
1398
1403
|
// 将style样式存放到head标签
|
1399
1404
|
document.getElementsByTagName('head')[0].appendChild(style);
|
1400
|
-
|
1401
1405
|
// size变动时动画
|
1402
1406
|
setTimeout(function () {
|
1403
1407
|
cashier.style.transition = 'height 0.28s ease-in-out';
|
@@ -1549,9 +1553,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1549
1553
|
}
|
1550
1554
|
}, {
|
1551
1555
|
key: "handleDeclareInfo",
|
1552
|
-
value: function handleDeclareInfo(
|
1553
|
-
var
|
1554
|
-
closeDialogData =
|
1556
|
+
value: function handleDeclareInfo(_ref13) {
|
1557
|
+
var _ref13$closeDialogDat = _ref13.closeDialogData,
|
1558
|
+
closeDialogData = _ref13$closeDialogDat === void 0 ? {} : _ref13$closeDialogDat;
|
1555
1559
|
_handleDeclareInfo({
|
1556
1560
|
closeDialogData: closeDialogData
|
1557
1561
|
});
|
@@ -1692,7 +1696,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1692
1696
|
key: "sendRenderEvent",
|
1693
1697
|
value: (function () {
|
1694
1698
|
var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
1695
|
-
var _this$
|
1699
|
+
var _this$_renderParams21, _this$_renderParams22, _this$_renderParams23, _this$_renderParams24, _this$_renderParams25, _this$_renderParams26, _this$_renderParams27, _this$_renderParams28, _this$_renderParams29, _this$AMSSDK$logger, _this$_renderParams30, _this$_renderParams31, _this$_renderParams32, _this$AMSSDK, _this$_renderParams33, isAddressElement, res, submitRes;
|
1696
1700
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
1697
1701
|
while (1) switch (_context8.prev = _context8.next) {
|
1698
1702
|
case 0:
|
@@ -1722,34 +1726,34 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1722
1726
|
data: {
|
1723
1727
|
queryResult: res,
|
1724
1728
|
submitResult: submitRes,
|
1725
|
-
sessionResult: (_this$
|
1726
|
-
paymentSessionData: (_this$
|
1729
|
+
sessionResult: (_this$_renderParams21 = this._renderParams) === null || _this$_renderParams21 === void 0 ? void 0 : _this$_renderParams21.paymentSessionMetaData,
|
1730
|
+
paymentSessionData: (_this$_renderParams22 = this._renderParams) === null || _this$_renderParams22 === void 0 ? void 0 : _this$_renderParams22.sessionData,
|
1727
1731
|
heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
|
1728
|
-
renderDisplayType: (_this$
|
1729
|
-
appearance: (_this$
|
1730
|
-
notRedirectAfterComplete: ((_this$
|
1732
|
+
renderDisplayType: (_this$_renderParams23 = this._renderParams) === null || _this$_renderParams23 === void 0 ? void 0 : _this$_renderParams23.renderDisplayType,
|
1733
|
+
appearance: (_this$_renderParams24 = this._renderParams) === null || _this$_renderParams24 === void 0 ? void 0 : _this$_renderParams24.appearance,
|
1734
|
+
notRedirectAfterComplete: ((_this$_renderParams25 = this._renderParams) === null || _this$_renderParams25 === void 0 ? void 0 : _this$_renderParams25.notRedirectAfterComplete) === true,
|
1731
1735
|
isAppWebview: this._isAppWebview,
|
1732
1736
|
merchantAppointParam: this._merchantAppointParam,
|
1733
1737
|
allowSubmitPayCallAhead: this._allowSubmitPayCallAhead,
|
1734
1738
|
/** 地址组件集成的参数 */
|
1735
|
-
configParams: (_this$
|
1736
|
-
prefillValue: (_this$
|
1737
|
-
componentSession: (_this$
|
1739
|
+
configParams: (_this$_renderParams26 = this._renderParams) === null || _this$_renderParams26 === void 0 ? void 0 : _this$_renderParams26.configParams,
|
1740
|
+
prefillValue: (_this$_renderParams27 = this._renderParams) === null || _this$_renderParams27 === void 0 ? void 0 : _this$_renderParams27.prefillValue,
|
1741
|
+
componentSession: (_this$_renderParams28 = this._renderParams) === null || _this$_renderParams28 === void 0 ? void 0 : _this$_renderParams28.componentSession,
|
1738
1742
|
envInfo: {
|
1739
1743
|
screenHeight: screen.height,
|
1740
1744
|
screenWidth: screen.width
|
1741
1745
|
},
|
1742
1746
|
logMetaData: _objectSpread(_objectSpread({
|
1743
|
-
trackId: (_this$
|
1747
|
+
trackId: (_this$_renderParams29 = this._renderParams) === null || _this$_renderParams29 === void 0 ? void 0 : _this$_renderParams29.sessionData,
|
1744
1748
|
platform: this.platform,
|
1745
1749
|
firstLogTime: (_this$AMSSDK$logger = this.AMSSDK.logger) === null || _this$AMSSDK$logger === void 0 ? void 0 : _this$AMSSDK$logger.getComponentStartTime()
|
1746
|
-
}, ((_this$
|
1747
|
-
renderDisplayType: (_this$
|
1750
|
+
}, ((_this$_renderParams30 = this._renderParams) === null || _this$_renderParams30 === void 0 || (_this$_renderParams30 = _this$_renderParams30.paymentSessionMetaData) === null || _this$_renderParams30 === void 0 ? void 0 : _this$_renderParams30.paymentSessionConfig) || {}), {}, {
|
1751
|
+
renderDisplayType: (_this$_renderParams31 = this._renderParams) === null || _this$_renderParams31 === void 0 ? void 0 : _this$_renderParams31.renderDisplayType,
|
1748
1752
|
sdkVersion: this._appVersion,
|
1749
|
-
merchantId: (_this$
|
1753
|
+
merchantId: (_this$_renderParams32 = this._renderParams) === null || _this$_renderParams32 === void 0 || (_this$_renderParams32 = _this$_renderParams32.paymentSessionMetaData) === null || _this$_renderParams32 === void 0 ? void 0 : _this$_renderParams32.clientId,
|
1750
1754
|
instanceId: (_this$AMSSDK = this.AMSSDK) === null || _this$AMSSDK === void 0 ? void 0 : _this$AMSSDK._instanceId,
|
1751
1755
|
performanceData: this._performanceData,
|
1752
|
-
paymentMethodType: (_this$
|
1756
|
+
paymentMethodType: (_this$_renderParams33 = this._renderParams) === null || _this$_renderParams33 === void 0 || (_this$_renderParams33 = _this$_renderParams33.paymentSessionMetaData) === null || _this$_renderParams33 === void 0 || (_this$_renderParams33 = _this$_renderParams33.paymentMethodInfoView) === null || _this$_renderParams33 === void 0 ? void 0 : _this$_renderParams33.paymentMethodType
|
1753
1757
|
})
|
1754
1758
|
}
|
1755
1759
|
}
|
@@ -1809,10 +1813,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1809
1813
|
}, {
|
1810
1814
|
key: "hideComponentAnimation",
|
1811
1815
|
value: function hideComponentAnimation() {
|
1812
|
-
var _this$
|
1816
|
+
var _this$_renderParams34, _this$_renderParams35, _this$_renderParams36, _this$_renderParams37, _this$_renderParams38, _this$_renderParams39, _container$style;
|
1813
1817
|
// 修改需当前文件搜索,这段注释appendAliasContainerId
|
1814
|
-
var _selector = ((_this$
|
1815
|
-
var appendAliasContainerId = this._renderParams.appendAliasContainerId ? "-".concat(_selector) : '';
|
1818
|
+
var _selector = (this === null || this === void 0 || (_this$_renderParams34 = this._renderParams) === null || _this$_renderParams34 === void 0 || (_this$_renderParams34 = _this$_renderParams34.selector) === null || _this$_renderParams34 === void 0 || (_this$_renderParams35 = _this$_renderParams34.indexOf) === null || _this$_renderParams35 === void 0 ? void 0 : _this$_renderParams35.call(_this$_renderParams34, '#')) === -1 ? this === null || this === void 0 || (_this$_renderParams36 = this._renderParams) === null || _this$_renderParams36 === void 0 ? void 0 : _this$_renderParams36.selector : this === null || this === void 0 || (_this$_renderParams37 = this._renderParams) === null || _this$_renderParams37 === void 0 || (_this$_renderParams37 = _this$_renderParams37.selector) === null || _this$_renderParams37 === void 0 || (_this$_renderParams38 = _this$_renderParams37.slice) === null || _this$_renderParams38 === void 0 ? void 0 : _this$_renderParams38.call(_this$_renderParams37, 1);
|
1819
|
+
var appendAliasContainerId = this !== null && this !== void 0 && (_this$_renderParams39 = this._renderParams) !== null && _this$_renderParams39 !== void 0 && _this$_renderParams39.appendAliasContainerId ? "-".concat(_selector) : '';
|
1816
1820
|
var inlineId = "".concat(COMPONENT_CONTAINER_ID).concat(appendAliasContainerId);
|
1817
1821
|
var container = document.getElementById(inlineId);
|
1818
1822
|
if (this.app && container) this.app.style.height = container === null || container === void 0 || (_container$style = container.style) === null || _container$style === void 0 ? void 0 : _container$style.height;
|
@@ -1845,9 +1849,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1845
1849
|
}, {
|
1846
1850
|
key: "removeRetentionPopup",
|
1847
1851
|
value: function removeRetentionPopup(platform) {
|
1848
|
-
_removeRetentionPopup();
|
1849
|
-
// TODO check
|
1850
|
-
// removeRetentionPopup(platform, this.hideRetentionPopupFunc.bind(this), this.retentionPopupLeaveFunc.bind(this));
|
1852
|
+
_removeRetentionPopup(platform, this.hideRetentionPopupFunc.bind(this), this.retentionPopupLeaveFunc.bind(this));
|
1851
1853
|
}
|
1852
1854
|
}, {
|
1853
1855
|
key: "showRetentionPopup",
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import type { IpaymentSessionConfig } from '../../types';
|
2
|
-
export declare const handlePaymentSessionConfig: (config: IpaymentSessionConfig) => Pick<IpaymentSessionConfig, 'productScene' | 'productSceneVersion'
|
2
|
+
export declare const handlePaymentSessionConfig: (config: IpaymentSessionConfig) => Pick<IpaymentSessionConfig, 'productScene' | 'productSceneVersion'>;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
export var handlePaymentSessionConfig = function handlePaymentSessionConfig(config) {
|
2
2
|
return {
|
3
3
|
productScene: config === null || config === void 0 ? void 0 : config.productScene,
|
4
|
-
productSceneVersion: config === null || config === void 0 ? void 0 : config.productSceneVersion
|
5
|
-
paymentMethodCategoryType: config === null || config === void 0 ? void 0 : config.paymentMethodCategoryType
|
4
|
+
productSceneVersion: config === null || config === void 0 ? void 0 : config.productSceneVersion
|
6
5
|
};
|
7
6
|
};
|
package/esm/plugin/type.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BusSubscriber } from
|
1
|
+
import { BusSubscriber } from 'src/core/bus';
|
2
2
|
import { PaymentMethodCategoryTypeEnum, ProductSceneEnum, ProductSceneVersion } from '../types';
|
3
3
|
export type IExtendPlugin = IExtendPluginItem[];
|
4
4
|
export interface ComponentActionNamesType {
|
package/esm/types/index.d.ts
CHANGED
@@ -20,7 +20,7 @@ interface AddressValueResult {
|
|
20
20
|
/**
|
21
21
|
* SDK options
|
22
22
|
*/
|
23
|
-
export interface
|
23
|
+
export interface IoptionsParams {
|
24
24
|
environment?: string;
|
25
25
|
locale?: string;
|
26
26
|
onError?: callOnError;
|
@@ -30,15 +30,15 @@ export interface IOptionsParams {
|
|
30
30
|
onEventCallback?: callOnEventCallback;
|
31
31
|
onClose?: callOnClose;
|
32
32
|
onChange?: onChange;
|
33
|
-
networkMode?: string;
|
34
|
-
mode?: string;
|
35
33
|
analytics?: {
|
36
34
|
enabled: boolean;
|
37
35
|
};
|
38
|
-
product?: string;
|
39
36
|
onBeforeSubmit?: callOnBeforeSubmit;
|
37
|
+
product?: string;
|
38
|
+
networkMode?: string;
|
39
|
+
mode?: string;
|
40
40
|
}
|
41
|
-
export interface IApplePayOptionsParams extends Pick<
|
41
|
+
export interface IApplePayOptionsParams extends Pick<IoptionsParams, 'locale' | 'environment' | 'onEventCallback' | 'analytics'> {
|
42
42
|
}
|
43
43
|
export type Iselector = string;
|
44
44
|
export declare enum DisplayTypeEnum {
|
@@ -68,6 +68,7 @@ export declare enum ComponentSignEnum {
|
|
68
68
|
'AUTO_DEBIT_PAY_WALLET' = "AUTO_DEBIT_PAY_WALLET",
|
69
69
|
'NONE' = "NONE",
|
70
70
|
'VAULTING_CARD' = "VAULTING_CARD",
|
71
|
+
'CHECKOUT_PAYMENT' = "CHECKOUT_PAYMENT",
|
71
72
|
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT_ALL",
|
72
73
|
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL"
|
73
74
|
}
|
@@ -100,8 +101,8 @@ export interface DeviceIdParameter {
|
|
100
101
|
export interface IcreateComponent {
|
101
102
|
sessionData: string;
|
102
103
|
paymentSessionData?: string;
|
103
|
-
|
104
|
-
|
104
|
+
elementProps?: {
|
105
|
+
elementLink: string;
|
105
106
|
};
|
106
107
|
appendAliasContainerId?: boolean;
|
107
108
|
notRedirectAfterComplete?: boolean;
|
@@ -118,9 +119,6 @@ export interface IappendIframeNodesParams extends IcreateComponent {
|
|
118
119
|
renderDisplayType: DisplayTypeEnum;
|
119
120
|
selector?: Iselector;
|
120
121
|
paypalConfiguration?: IPaypalConfiguration;
|
121
|
-
connectFactor?: {
|
122
|
-
enableConnect: boolean;
|
123
|
-
};
|
124
122
|
/** 将address-element参数定义合入原参数定义 */
|
125
123
|
configParams?: {
|
126
124
|
hideFields?: string[];
|
@@ -205,7 +203,7 @@ export interface Isubmit {
|
|
205
203
|
}
|
206
204
|
export interface IpaymentSessionConfig {
|
207
205
|
productScene: ProductSceneEnum;
|
208
|
-
paymentMethodCategoryType
|
206
|
+
paymentMethodCategoryType?: PaymentMethodCategoryTypeEnum;
|
209
207
|
productSceneVersion: string;
|
210
208
|
}
|
211
209
|
export interface IpaymentSecurityConfig {
|
@@ -236,6 +234,8 @@ export interface PaymentSessionActionData {
|
|
236
234
|
enableSignAgreement?: boolean;
|
237
235
|
skipSdkQuery: boolean;
|
238
236
|
requireFastSdk: boolean;
|
237
|
+
nonCompliant?: boolean;
|
238
|
+
nonInitSecuritySDK?: boolean;
|
239
239
|
skipSdkQueryForm?: {
|
240
240
|
value: boolean;
|
241
241
|
version: string;
|
@@ -250,6 +250,7 @@ export interface IPaymentSessionMetaData {
|
|
250
250
|
moneyView?: any;
|
251
251
|
extendInfo?: string;
|
252
252
|
paymentMethodInfoView?: any;
|
253
|
+
paymentView?: any;
|
253
254
|
action?: PaymentSessionActionData;
|
254
255
|
authUrlInfo?: {
|
255
256
|
appIdentifier?: string;
|
@@ -604,6 +605,7 @@ export interface CashierSubmitPayResult {
|
|
604
605
|
normalUrl?: string;
|
605
606
|
errorStatus?: string;
|
606
607
|
message?: string;
|
608
|
+
traceId?: string;
|
607
609
|
}
|
608
610
|
export declare enum eventCodeEnum {
|
609
611
|
SDK_START_OF_LOADING = "SDK_START_OF_LOADING",
|
@@ -863,3 +865,7 @@ export interface IoptionsAddressParams {
|
|
863
865
|
};
|
864
866
|
product?: string;
|
865
867
|
}
|
868
|
+
export declare enum RiskSdkInfoEnum {
|
869
|
+
NEED = "need",
|
870
|
+
NO_NEED = "noneed"
|
871
|
+
}
|
package/esm/types/index.js
CHANGED
@@ -32,10 +32,11 @@ export var ComponentSignEnum = /*#__PURE__*/function (ComponentSignEnum) {
|
|
32
32
|
ComponentSignEnum["AUTO_DEBIT_PAY_WALLET"] = "AUTO_DEBIT_PAY_WALLET";
|
33
33
|
ComponentSignEnum["NONE"] = "NONE";
|
34
34
|
ComponentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
|
35
|
+
ComponentSignEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
|
35
36
|
ComponentSignEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
36
37
|
ComponentSignEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
37
38
|
return ComponentSignEnum;
|
38
|
-
}({});
|
39
|
+
}({});
|
39
40
|
export var ProductSceneEnum = /*#__PURE__*/function (ProductSceneEnum) {
|
40
41
|
ProductSceneEnum["EASY_PAY"] = "EASY_PAY";
|
41
42
|
ProductSceneEnum["CASHIER_PAYMENT"] = "CASHIER_PAYMENT";
|
@@ -252,4 +253,9 @@ export var ConnectErrorCode = /*#__PURE__*/function (ConnectErrorCode) {
|
|
252
253
|
ConnectErrorCode["USER_AUTH_VERIFICATION_FAILED"] = "USER_AUTH_VERIFICATION_FAILED";
|
253
254
|
ConnectErrorCode["USER_NOT_EXISTS"] = "USER_NOT_EXISTS";
|
254
255
|
return ConnectErrorCode;
|
256
|
+
}({});
|
257
|
+
export var RiskSdkInfoEnum = /*#__PURE__*/function (RiskSdkInfoEnum) {
|
258
|
+
RiskSdkInfoEnum["NEED"] = "need";
|
259
|
+
RiskSdkInfoEnum["NO_NEED"] = "noneed";
|
260
|
+
return RiskSdkInfoEnum;
|
255
261
|
}({});
|