@alipay/ams-checkout 0.0.1758783821-dev.1 → 0.0.1758783821-dev.13
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/README.md +17 -1
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/component/popupWindow.style.d.ts +1 -0
- package/esm/component/popupWindow.style.js +5 -2
- package/esm/config/index.d.ts +1 -0
- package/esm/config/index.js +2 -1
- package/esm/config/request.js +14 -2
- package/esm/constant/index.d.ts +33 -12
- package/esm/constant/index.js +43 -18
- package/esm/core/component/element/EventCenter/index.d.ts +3 -1
- package/esm/core/component/element/EventCenter/index.js +48 -11
- package/esm/core/component/element/elementContainerService/containerService.d.ts +1 -0
- package/esm/core/component/element/elementContainerService/containerService.js +5 -0
- package/esm/core/component/element/elementController/index.d.ts +3 -8
- package/esm/core/component/element/elementController/index.js +152 -66
- package/esm/core/component/element/elementProcessor/addressProcessor.js +2 -3
- package/esm/core/component/element/elementProcessor/authProcessor.js +2 -3
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +2 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +36 -6
- package/esm/core/component/element/index.d.ts +3 -10
- package/esm/core/component/element/index.js +4 -1
- package/esm/core/component/element/mock.js +1 -0
- package/esm/core/component/element/type.d.ts +26 -6
- package/esm/core/component/element/type.js +18 -0
- package/esm/core/component/element/util.d.ts +6 -3
- package/esm/core/component/element/util.js +15 -2
- package/esm/foundation/core/index.js +28 -8
- package/esm/foundation/index.d.ts +1 -0
- package/esm/foundation/product-processor/easysafepay/index.js +4 -2
- package/esm/foundation/product-processor/element/index.js +1 -0
- package/esm/foundation/service/log/keys.js +2 -0
- package/esm/foundation/utils/payment_context_utils.js +1 -0
- package/esm/index.js +2 -1
- package/esm/plugin/component/cashierApp.d.ts +2 -0
- package/esm/plugin/component/cashierApp.js +2 -2
- package/esm/plugin/component/channel.js +20 -5
- package/esm/plugin/component/component.popup.style.d.ts +1 -0
- package/esm/plugin/component/component.popup.style.js +1 -1
- package/esm/plugin/component/index.d.ts +1 -0
- package/esm/plugin/component/index.js +9 -5
- package/esm/types/index.d.ts +18 -2
- package/esm/types/index.js +2 -1
- package/esm/util/index.js +4 -1
- package/esm/util/spm-map.d.ts +22 -2
- package/esm/util/spm-map.js +13 -1
- package/package.json +12 -7
- package/esm/core/component/oldElement/components/address.d.ts +0 -19
- package/esm/core/component/oldElement/components/address.js +0 -68
- package/esm/core/component/oldElement/components/auth.d.ts +0 -17
- package/esm/core/component/oldElement/components/auth.js +0 -60
- package/esm/core/component/oldElement/components/payment.d.ts +0 -19
- package/esm/core/component/oldElement/components/payment.js +0 -74
- package/esm/core/component/oldElement/index.d.ts +0 -59
- package/esm/core/component/oldElement/index.js +0 -956
- package/esm/core/component/oldElement/mock.d.ts +0 -6
- package/esm/core/component/oldElement/mock.js +0 -567
- package/esm/core/component/oldElement/type.d.ts +0 -354
- package/esm/core/component/oldElement/type.js +0 -81
- package/esm/core/component/oldElement/utils.d.ts +0 -13
- package/esm/core/component/oldElement/utils.js +0 -6
|
@@ -10,6 +10,7 @@ type CreateModalProps = {
|
|
|
10
10
|
onCloseOnLoading: () => void;
|
|
11
11
|
textDirection: 'ltr' | 'rtl';
|
|
12
12
|
};
|
|
13
|
+
export declare const getCurrentTheme: (curTheme?: string) => any;
|
|
13
14
|
export declare const createCustomSheet: (curTheme?: 'dark' | 'light') => void;
|
|
14
15
|
export declare const renderPopupLoading: (container: HTMLDivElement, curTheme: 'dark' | 'light') => void;
|
|
15
16
|
export declare const removePopupLoading: (isShowMockup?: boolean) => void;
|
|
@@ -2,7 +2,7 @@ import { AMSPOPUP_PREFIX, ANIMATION_TIME, MOCKUP_ID, POPUPLOADING_ID } from "../
|
|
|
2
2
|
import { getDesignFontSize } from "../util";
|
|
3
3
|
// CSS样式字符串
|
|
4
4
|
var modalStyles = "\n .".concat(AMSPOPUP_PREFIX, "modal {\n /* \u6DFB\u52A0\u5F39\u7A97\u6837\u5F0F */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* \u8BBE\u7F6E\u5F39\u7A97\u7684\u5C42\u7EA7\u4E3A 9999 */\n overflow: hidden;\n }\n .").concat(AMSPOPUP_PREFIX, "modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* \u8BBE\u7F6E\u5F39\u7A97\u7684\u5C42\u7EA7\u4E3A 9999 */\n overflow: hidden;\n }\n\n .").concat(AMSPOPUP_PREFIX, "overlay {\n /* \u6DFB\u52A0\u8499\u5C42\u6837\u5F0F */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(AMSPOPUP_PREFIX, "fadeIn {\n /* \u6DFB\u52A0\u6DE1\u5165\u52A8\u753B */\n animation: fadeIn ").concat(ANIMATION_TIME, "ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(AMSPOPUP_PREFIX, "fadeOut {\n /* \u6DFB\u52A0\u6DE1\u51FA\u52A8\u753B */\n animation: fadeOut ").concat(ANIMATION_TIME, "ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(AMSPOPUP_PREFIX, "-drawer-enter {\n animation: slideIn ").concat(ANIMATION_TIME, "ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* \u6ED1\u5165\u65F6\u5728\u89C6\u53E3\u5E95\u90E8\u5916 */\n opacity: 0; /* \u521D\u59CB\u900F\u660E\u5EA6\u4E3A 0 */\n }\n to {\n transform: translateY(0); /* \u6ED1\u5165\u7ED3\u675F\u65F6\u5728\u539F\u4F4D\u7F6E */\n opacity: 1; /* \u7ED3\u675F\u65F6\u900F\u660E\u5EA6\u4E3A 1 */\n }\n }\n\n /* \u62BD\u5C49\u4ECE\u5E95\u90E8\u6ED1\u51FA */\n .").concat(AMSPOPUP_PREFIX, "-drawer-exit {\n animation: slideOut ").concat(ANIMATION_TIME, "ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* \u6ED1\u51FA\u65F6\u4ECE\u5F53\u524D\u4F4D\u7F6E\u5F00\u59CB */\n opacity: 1; /* \u521D\u59CB\u900F\u660E\u5EA6\u4E3A 1 */\n }\n to {\n transform: translateY(100%); /* \u6ED1\u51FA\u7ED3\u675F\u65F6\u5728\u89C6\u53E3\u5E95\u90E8\u5916 */\n opacity: 0; /* \u7ED3\u675F\u65F6\u900F\u660E\u5EA6\u4E3A 0 */\n }\n }\n\n /* \u5B9A\u4E49\u6DE1\u5165\u52A8\u753B */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* \u5B9A\u4E49\u6DE1\u51FA\u52A8\u753B */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n");
|
|
5
|
-
var getCurrentTheme = function getCurrentTheme() {
|
|
5
|
+
export var getCurrentTheme = function getCurrentTheme() {
|
|
6
6
|
var curTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
7
7
|
var theme = {
|
|
8
8
|
night: 'dark',
|
|
@@ -73,6 +73,7 @@ export function createCloseIcon(_ref) {
|
|
|
73
73
|
closeIcon.onclick = onClose;
|
|
74
74
|
return closeIcon;
|
|
75
75
|
}
|
|
76
|
+
// TODO 这里固定?
|
|
76
77
|
var modalDevice = 'desktop';
|
|
77
78
|
// 插入弹窗
|
|
78
79
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -149,7 +150,9 @@ export var destroyModal = function destroyModal() {
|
|
|
149
150
|
if (!overlay) {
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
|
-
var modal =
|
|
153
|
+
var modal =
|
|
154
|
+
//TODO modalDevice固定'desktop'?
|
|
155
|
+
modalDevice === 'desktop' ? document.querySelector(".".concat(AMSPOPUP_PREFIX, "modal")) : document.querySelector(".".concat(AMSPOPUP_PREFIX, "modal-mobile"));
|
|
153
156
|
overlay.classList.remove("".concat(AMSPOPUP_PREFIX, "fadeIn"));
|
|
154
157
|
overlay.classList.add("".concat(AMSPOPUP_PREFIX, "fadeOut"));
|
|
155
158
|
if (modalDevice === 'desktop') {
|
package/esm/config/index.d.ts
CHANGED
|
@@ -13,3 +13,4 @@ export declare const AMSCashierPaymentAppVersion = "1.45.0";
|
|
|
13
13
|
export declare const AMSVaultingAppVersion = "1.45.0";
|
|
14
14
|
export declare const AMSPaymentElementAppVersion = "1.45.0";
|
|
15
15
|
export declare const ADDRESSElementAppVersion = "1.45.0";
|
|
16
|
+
export declare const AUTHElementAppVersion = "1.45.0";
|
package/esm/config/index.js
CHANGED
|
@@ -42,4 +42,5 @@ export var AMSEasyPayAppVersion = '1.45.0'; // easypay
|
|
|
42
42
|
export var AMSCashierPaymentAppVersion = '1.45.0'; // 收银台(卡、apm)
|
|
43
43
|
export var AMSVaultingAppVersion = '1.45.0'; // 绑卡
|
|
44
44
|
export var AMSPaymentElementAppVersion = '1.45.0'; // payment element
|
|
45
|
-
export var ADDRESSElementAppVersion = '1.45.0'; // address element
|
|
45
|
+
export var ADDRESSElementAppVersion = '1.45.0'; // address element
|
|
46
|
+
export var AUTHElementAppVersion = '1.45.0'; // auth element
|
package/esm/config/request.js
CHANGED
|
@@ -27,12 +27,24 @@ export var hostSignMap = function hostSignMap(hostSign, env) {
|
|
|
27
27
|
var map = {
|
|
28
28
|
SG: 'https://imgs-sea-global.alipay.com/mgw.htm',
|
|
29
29
|
US: 'https://imgs-na-global.alipay.com/mgw.htm',
|
|
30
|
-
DE: 'https://imgs-de-global.alipay.com/mgw.htm'
|
|
30
|
+
DE: 'https://imgs-de-global.alipay.com/mgw.htm',
|
|
31
|
+
// QK 和 ID 机房未经过验证
|
|
32
|
+
QK: 'https://imgs-qk.alipay.com/mgw.htm',
|
|
33
|
+
// https://imgs-qk.alipay.com/mgw.htm
|
|
34
|
+
ID: 'https://imgs-id.alipay.com/mgw.htm',
|
|
35
|
+
// https://imgs-id.alipay.com/mgw.htm
|
|
36
|
+
SA: 'https://imgs-sa.alipay.com/mgw.htm' // https://imgs-sa.alipay.com/mgw.htm
|
|
31
37
|
};
|
|
32
38
|
var preMap = {
|
|
33
39
|
SG: 'https://imgs-sea-pre.alipay.com/mgw.htm',
|
|
34
40
|
US: 'https://imgs-pre.alipay.com/mgw.htm',
|
|
35
|
-
DE: 'https://imgs-de-pre.alipay.com/mgw.htm'
|
|
41
|
+
DE: 'https://imgs-de-pre.alipay.com/mgw.htm',
|
|
42
|
+
// QK 和 ID 机房未经过验证
|
|
43
|
+
QK: 'https://iopengw-qkgz99p.alipay.com/mgw.htm',
|
|
44
|
+
// https://iopengw-qkgz99p.alipay.com/mgw.htm
|
|
45
|
+
ID: 'https://imgs-id-pre.alipay.com/mgw.htm',
|
|
46
|
+
// https://imgs-id-pre.alipay.com/mgw.htm
|
|
47
|
+
SA: 'https://imgs-sa-pre.alipay.com/mgw.htm' // https://imgs-sa-pre.alipay.com/mgw.htm
|
|
36
48
|
};
|
|
37
49
|
if (env === 'prod' || env === 'sandbox' || env === 'light_sandbox') {
|
|
38
50
|
return map[hostSign || 'SG'];
|
package/esm/constant/index.d.ts
CHANGED
|
@@ -77,6 +77,14 @@ export declare const ERRORMESSAGE: {
|
|
|
77
77
|
code: eventCodeEnum;
|
|
78
78
|
message: string;
|
|
79
79
|
};
|
|
80
|
+
LOAD_APP_TIME_OUT: {
|
|
81
|
+
code: eventCodeEnum;
|
|
82
|
+
message: string;
|
|
83
|
+
};
|
|
84
|
+
CONTAINER_NOT_EXIST: {
|
|
85
|
+
code: eventCodeEnum;
|
|
86
|
+
message: string;
|
|
87
|
+
};
|
|
80
88
|
};
|
|
81
89
|
SDK_SUBMIT_ERROR: {
|
|
82
90
|
code: eventCodeEnum;
|
|
@@ -90,11 +98,8 @@ export declare const ERRORMESSAGE: {
|
|
|
90
98
|
code: string;
|
|
91
99
|
message: string;
|
|
92
100
|
};
|
|
93
|
-
CONTAINER_NOT_LOADED: {
|
|
94
|
-
code: string;
|
|
95
|
-
message: string;
|
|
96
|
-
};
|
|
97
101
|
INITALIZE_TIMEOUT: {
|
|
102
|
+
code: string;
|
|
98
103
|
API: {
|
|
99
104
|
code: string;
|
|
100
105
|
message: string;
|
|
@@ -105,14 +110,6 @@ export declare const ERRORMESSAGE: {
|
|
|
105
110
|
};
|
|
106
111
|
};
|
|
107
112
|
ERR_DATA_STRUCT_UNRECOGNIZED: {
|
|
108
|
-
code: string;
|
|
109
|
-
status: string;
|
|
110
|
-
};
|
|
111
|
-
INQUIRY_PAYMENT_SESSION_FAILED: {
|
|
112
|
-
code: string;
|
|
113
|
-
message: string;
|
|
114
|
-
};
|
|
115
|
-
UNKNOWN_EXCEPTION: {
|
|
116
113
|
code: string;
|
|
117
114
|
message: string;
|
|
118
115
|
};
|
|
@@ -318,3 +315,27 @@ export declare const TIME_DELAY_SEND_HEART_BEAT = 1000;
|
|
|
318
315
|
export declare const closeImg = "https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg";
|
|
319
316
|
export declare const closeImgLight = "https://cdn.marmot-cloud.com/storage/2025/05/24/50891cd3-7a4a-47c0-b550-2e2ce6187c31.svg";
|
|
320
317
|
export declare const LOADINGIMG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACEBAMAAACjap6UAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAITgAACE4AUWWMWAAAAAqUExURUdwTKe3zKGxyK27z7K/05ytxLbD1bvH2Jaowb/K28DL3JCjvYueucDL2xLcxpgAAAAOdFJOUwCKoHRft0w5zCgY4fYKKSYvdQAABvtJREFUaN6lmt+LG1UUx6fddbcZHOgkpWutBTPbVBEfNp1xS6uF2oQURUGnBBbqw7YdsooV2ipZ06c+uBBZCistDRMUqgV1gnnwJ4HMg2jBh+Qh1bW1A/lfPOfcO9lkNz/m3j3dh2XT+eznfM+dmTvTKsroUovpeGotbyetlXuKTH17vFxeKq9R5fOJG8KAR6+Uy2vlJag8ALDmxSDa2TLWEhos5UPKnEA7sy8yALNYyod1/mpUwiYpQB9MYy1sJZWybwgRgLGGDLRAhg1ftn0qIqHBkijzefBO7HwKRN6cTJguNxoho38gjGHb7y5PTHJpvdyLgsaap3UBSdjISKWMCZlqzzTBosGj4CMJC+LEmh8/20+b62jRM+EGjIAQsLDnxhH+IQduUS7P50p1RQk85zgRwCIPhJTx9pjz6gIev84k1o59tfVJ7HIKw0iRRio5upX3GaGBjPMbg5/FjnOAYRvGC6MIU83mOkGAcHLnx7cxC8O2ETNqsofhcIgT2xja7WOmYRsp4+hwwt9NKErz1xG/ZJYRsE4PXRIX0GAdwxi5AGfjNrYCiGRnyMf/kgRgGmNm9ihl8DoyVAKOxzxfGrdy7vOZGPM7NfaiBDI+G38KXDK4yMKOj16lNiDKCVc3Nc47OTpkTRCjeWTi9SRMY3voHzZZ/TL5inKJAPHtS1TlhMZyhIszk4hvm+t/HPF5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BINK312SdeJEDvWNlrWwme6L/SgqAarVWjaihZYEAUfS/4dVIwouqsZkFBjQysGcOPA/DiKahZqky5wZ/ShIRNUACB5IdfFOtQRSIiKIRy/La9ncDzLPqetUI4+B9vLG9P48sXG/iEp1lgGx2xzMMt3DdSQN1eBvndsbMCJ47oZW7WSdHiCGvXTBMtHDHtvI4yy1yQ4IHDbfquuMZMcfJMYmPhn3sIQE13JGTVaEJsHCGS6CGy6o0ykN1CrkcWjjDJVDDIwm34g69McUKSIDjnSHj4PNiEpWKWyoNWelewXEoCuhj5EPpEzeEVFa3L3X1bgHaKOQcjOOD0YFXqYtSCRkDEPW7ApbjMJExZ5LasyCIW8M9mBZ4FQLkHB7G2MfzJ3Q8eKyGtVIsFlcKvBwayfh/ldW8Ck4Va7USEorFAkEoi1zu3KQrEu+Ca6wwi54GpFmYeC6ruLRAgffCLVgv2EchwkuGgGVZWe15bElAL5FeUwSUBR1f5AQUESCQR2mVh1FkjfAkohJgLj1GEVtZIRFACP0fCm/AgmdREnzYqIRhFHkvq+J77MBFQpEPpCQOYPcntwIWeK6Mu0P9D9pzJq4u5hj+AAAAAElFTkSuQmCC";
|
|
318
|
+
/**
|
|
319
|
+
* @description Promise回调code映射
|
|
320
|
+
*/
|
|
321
|
+
export declare const PROMISE_CALLBACK_CODE: {
|
|
322
|
+
SUCCESS: {
|
|
323
|
+
code: string;
|
|
324
|
+
};
|
|
325
|
+
UNKNOWN_EXCEPTION: {
|
|
326
|
+
code: string;
|
|
327
|
+
message: string;
|
|
328
|
+
};
|
|
329
|
+
REPEAT_REQ_REJECT: {
|
|
330
|
+
code: string;
|
|
331
|
+
message: string;
|
|
332
|
+
};
|
|
333
|
+
PROCESS_FAIL: {
|
|
334
|
+
code: string;
|
|
335
|
+
message: string;
|
|
336
|
+
};
|
|
337
|
+
INQUIRY_PAYMENT_SESSION_FAILED: {
|
|
338
|
+
code: string;
|
|
339
|
+
message: string;
|
|
340
|
+
};
|
|
341
|
+
};
|
package/esm/constant/index.js
CHANGED
|
@@ -76,6 +76,14 @@ export var ERRORMESSAGE = {
|
|
|
76
76
|
CALL_APP_URL_ERROR: {
|
|
77
77
|
code: eventCodeEnum.SDK_LAUNCH_PAYMENT_APP_ERROR,
|
|
78
78
|
message: 'Failed to launch app'
|
|
79
|
+
},
|
|
80
|
+
LOAD_APP_TIME_OUT: {
|
|
81
|
+
code: eventCodeEnum.SDK_LAUNCH_PAYMENT_APP_ERROR,
|
|
82
|
+
message: 'Load app time out'
|
|
83
|
+
},
|
|
84
|
+
CONTAINER_NOT_EXIST: {
|
|
85
|
+
code: eventCodeEnum.SDK_LAUNCH_PAYMENT_APP_ERROR,
|
|
86
|
+
message: 'Container service does not exist'
|
|
79
87
|
}
|
|
80
88
|
},
|
|
81
89
|
SDK_SUBMIT_ERROR: {
|
|
@@ -84,37 +92,26 @@ export var ERRORMESSAGE = {
|
|
|
84
92
|
},
|
|
85
93
|
PARAM_INVALID: {
|
|
86
94
|
code: 'PARAM_INVALID',
|
|
87
|
-
message: '
|
|
95
|
+
message: 'An error occurred. The transaction cannot be initiated.'
|
|
88
96
|
},
|
|
89
97
|
UI_STATE_ERROR: {
|
|
90
98
|
code: 'UI_STATE_ERROR',
|
|
91
|
-
message: '
|
|
92
|
-
},
|
|
93
|
-
CONTAINER_NOT_LOADED: {
|
|
94
|
-
code: 'CONTAINER_NOT_LOADED',
|
|
95
|
-
message: '请求异常,交易无法发起。'
|
|
99
|
+
message: 'An error occurred. The transaction cannot be initiated.'
|
|
96
100
|
},
|
|
97
101
|
INITALIZE_TIMEOUT: {
|
|
102
|
+
code: 'INITALIZE_TIMEOUT',
|
|
98
103
|
API: {
|
|
99
104
|
code: 'INITALIZE_API_TIMEOUT',
|
|
100
|
-
message: '
|
|
105
|
+
message: 'An error occurred. The transaction cannot be initiated.'
|
|
101
106
|
},
|
|
102
107
|
WEB: {
|
|
103
108
|
code: 'INITALIZE_WEB_TIMEOUT',
|
|
104
|
-
message: '
|
|
109
|
+
message: 'An error occurred; the transaction cannot be initiated.'
|
|
105
110
|
}
|
|
106
111
|
},
|
|
107
112
|
ERR_DATA_STRUCT_UNRECOGNIZED: {
|
|
108
113
|
code: 'ERR_DATA_STRUCT_UNRECOGNIZED',
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
INQUIRY_PAYMENT_SESSION_FAILED: {
|
|
112
|
-
code: 'INQUIRY_PAYMENT_SESSION_FAILED',
|
|
113
|
-
message: '订单状态异常。请检查付款情况并联系商户'
|
|
114
|
-
},
|
|
115
|
-
UNKNOWN_EXCEPTION: {
|
|
116
|
-
code: 'UNKNOWN_EXCEPTION',
|
|
117
|
-
message: '未知异常。请检查付款情况并联系商户'
|
|
114
|
+
message: 'An error occurred. The transaction cannot be initiated.'
|
|
118
115
|
},
|
|
119
116
|
/**
|
|
120
117
|
@deprecated 已废弃 请使用SDK_LAUNCH_PAYMENT_APP_ERROR
|
|
@@ -127,6 +124,9 @@ export var ERRORMESSAGE = {
|
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
126
|
};
|
|
127
|
+
|
|
128
|
+
// as const satisfies Record<string, ErrorMessage>;
|
|
129
|
+
|
|
130
130
|
export var BASEPLUGINID = 'CHECKOUT';
|
|
131
131
|
export var COMPONENTPLUGINID = 'COMPONENT';
|
|
132
132
|
export var EVENT = {
|
|
@@ -322,4 +322,29 @@ export var TIMEOUT_WEB_APP_HEART_BEAT = 6000;
|
|
|
322
322
|
export var TIME_DELAY_SEND_HEART_BEAT = 1000;
|
|
323
323
|
export var closeImg = 'https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg';
|
|
324
324
|
export var closeImgLight = 'https://cdn.marmot-cloud.com/storage/2025/05/24/50891cd3-7a4a-47c0-b550-2e2ce6187c31.svg';
|
|
325
|
-
export var LOADINGIMG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACEBAMAAACjap6UAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7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8pwmwiKe9d16HRhSM4XC90ZavYsQ2YGcDi3qdYlrVjhTRQu6AVRH/FTPWGymkGe9XpdAQJoZQNBxQYAQ4U5uZzLgsagwi1oQ1ITzzJAFexes1RBSE+wkZlkQRYZtTDS0qIsiNqELgPBdBRxfr9UEw7idNSEMi//igDHEVoVFFovhKQfHQwltU2aylgUTCV84ajViCHVyxwSGZfWe6ALGEOkjQwSrs4UQ7WSTEU5sXX8YQkDjE7DIZDJ921UCeNGXRgwBINK312SdeJEDvWNlrWwme6L/SgqAarVWjaihZYEAUfS/4dVIwouqsZkFBjQysGcOPA/DiKahZqky5wZ/ShIRNUACB5IdfFOtQRSIiKIRy/La9ncDzLPqetUI4+B9vLG9P48sXG/iEp1lgGx2xzMMt3DdSQN1eBvndsbMCJ47oZW7WSdHiCGvXTBMtHDHtvI4yy1yQ4IHDbfquuMZMcfJMYmPhn3sIQE13JGTVaEJsHCGS6CGy6o0ykN1CrkcWjjDJVDDIwm34g69McUKSIDjnSHj4PNiEpWKWyoNWelewXEoCuhj5EPpEzeEVFa3L3X1bgHaKOQcjOOD0YFXqYtSCRkDEPW7ApbjMJExZ5LasyCIW8M9mBZ4FQLkHB7G2MfzJ3Q8eKyGtVIsFlcKvBwayfh/ldW8Ck4Va7USEorFAkEoi1zu3KQrEu+Ca6wwi54GpFmYeC6ruLRAgffCLVgv2EchwkuGgGVZWe15bElAL5FeUwSUBR1f5AQUESCQR2mVh1FkjfAkohJgLj1GEVtZIRFACP0fCm/AgmdREnzYqIRhFHkvq+J77MBFQpEPpCQOYPcntwIWeK6Mu0P9D9pzJq4u5hj+AAAAAElFTkSuQmCC';
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @description Promise回调code映射
|
|
329
|
+
*/
|
|
330
|
+
export var PROMISE_CALLBACK_CODE = {
|
|
331
|
+
SUCCESS: {
|
|
332
|
+
code: 'SUCCESS'
|
|
333
|
+
},
|
|
334
|
+
UNKNOWN_EXCEPTION: {
|
|
335
|
+
code: 'UNKNOWN_EXCEPTION',
|
|
336
|
+
message: 'Unknown exception. Please check the payment status and contact the merchant.'
|
|
337
|
+
},
|
|
338
|
+
REPEAT_REQ_REJECT: {
|
|
339
|
+
code: 'REPEAT_REQ_REJECT',
|
|
340
|
+
message: 'The order status is abnormal. Please check the payment status and contact the merchant.'
|
|
341
|
+
},
|
|
342
|
+
PROCESS_FAIL: {
|
|
343
|
+
code: 'PROCESS_FAIL',
|
|
344
|
+
message: 'Unknown exception. Please check the payment status and contact the merchant.'
|
|
345
|
+
},
|
|
346
|
+
INQUIRY_PAYMENT_SESSION_FAILED: {
|
|
347
|
+
code: 'INQUIRY_PAYMENT_SESSION_FAILED',
|
|
348
|
+
message: 'The order status is abnormal. Please check the payment status and contact the merchant.'
|
|
349
|
+
}
|
|
350
|
+
};
|
|
@@ -13,7 +13,7 @@ export declare class EventCenter {
|
|
|
13
13
|
* @param {string} functionName 函数名称
|
|
14
14
|
* @returns {string} 返回事件起始ID
|
|
15
15
|
*/
|
|
16
|
-
registerEvent(functionName: string): string;
|
|
16
|
+
registerEvent(functionName: string, sessionData?: string): string;
|
|
17
17
|
/**
|
|
18
18
|
* 结束事件
|
|
19
19
|
* @param startId 事件起始ID
|
|
@@ -25,5 +25,7 @@ export declare class EventCenter {
|
|
|
25
25
|
private sendHeartbeat;
|
|
26
26
|
private sendLog;
|
|
27
27
|
private buildId;
|
|
28
|
+
private getEventName;
|
|
28
29
|
private buildIdFromStart;
|
|
30
|
+
private getEventNameFromStart;
|
|
29
31
|
}
|
|
@@ -13,7 +13,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
13
13
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
14
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
15
15
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
import {
|
|
16
|
+
import { getType } from "../../../../util";
|
|
17
|
+
import { EXPOSURE_API_EVENT } from "../type";
|
|
18
|
+
import { safeStringify } from "../util";
|
|
17
19
|
export var EventCenter = /*#__PURE__*/function () {
|
|
18
20
|
// 日志服务实例
|
|
19
21
|
|
|
@@ -39,17 +41,19 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
|
39
41
|
*/
|
|
40
42
|
_createClass(EventCenter, [{
|
|
41
43
|
key: "registerEvent",
|
|
42
|
-
value: function registerEvent(functionName) {
|
|
44
|
+
value: function registerEvent(functionName, sessionData) {
|
|
43
45
|
// 构建事件起始ID
|
|
44
46
|
var startId = this.buildId(functionName, 'start');
|
|
47
|
+
var type = this.getEventName(functionName, 'start');
|
|
45
48
|
// 将当前时间戳设置为活动事件的起始时间
|
|
46
49
|
this.activeEvents.set(startId, Date.now());
|
|
47
50
|
|
|
48
51
|
// 启动心跳检测
|
|
49
52
|
this.startHeartbeat();
|
|
50
53
|
// 发送日志,记录事件起始信息
|
|
51
|
-
this.sendLog(
|
|
52
|
-
eventName: startId
|
|
54
|
+
this.sendLog(type, {
|
|
55
|
+
eventName: startId,
|
|
56
|
+
sessionData: sessionData
|
|
53
57
|
});
|
|
54
58
|
return startId;
|
|
55
59
|
}
|
|
@@ -68,15 +72,19 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
|
68
72
|
var startTime = this.activeEvents.get(startId);
|
|
69
73
|
// 从活动事件中删除该起始ID
|
|
70
74
|
this.activeEvents.delete(startId);
|
|
75
|
+
var type = this.getEventNameFromStart(startId, 'end');
|
|
71
76
|
|
|
72
77
|
// 发送日志,记录事件结束信息
|
|
73
|
-
this.sendLog(
|
|
78
|
+
this.sendLog(type, _objectSpread({
|
|
74
79
|
eventName: this.buildIdFromStart(startId, 'end'),
|
|
75
80
|
startTime: startTime,
|
|
76
81
|
endTime: Date.now()
|
|
77
|
-
}, extra
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
}, extra || {}));
|
|
83
|
+
if (extra && getType(extra) !== 'object') {
|
|
84
|
+
this.sendLog('data_error', {
|
|
85
|
+
msg: safeStringify(extra)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
80
88
|
|
|
81
89
|
// 如果活动事件数量为0,则停止心跳
|
|
82
90
|
if (this.activeEvents.size === 0) this.stopHeartbeat();
|
|
@@ -113,15 +121,30 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
|
113
121
|
startTime: startTime
|
|
114
122
|
};
|
|
115
123
|
});
|
|
116
|
-
this.sendLog('
|
|
117
|
-
actionNames:
|
|
124
|
+
this.sendLog('heart_beat', {
|
|
125
|
+
actionNames: safeStringify(actionNames)
|
|
118
126
|
});
|
|
119
127
|
}
|
|
120
128
|
}, {
|
|
121
129
|
key: "sendLog",
|
|
122
130
|
value: function sendLog(type, payload) {
|
|
131
|
+
/**
|
|
132
|
+
*当前使用以下事件映射,目前没有遗漏
|
|
133
|
+
* mount_start
|
|
134
|
+
* mount_end
|
|
135
|
+
* submitPayment_start
|
|
136
|
+
* submitPayment_end
|
|
137
|
+
* validateFields_start
|
|
138
|
+
* validateFields_end
|
|
139
|
+
* destroy_start
|
|
140
|
+
* destroy_end
|
|
141
|
+
*/
|
|
142
|
+
//TODO: 后续需要移除映射,在执行入口埋点
|
|
143
|
+
var titleMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(EXPOSURE_API_EVENT.MOUNT, "_start"), 'sdk_event_mount'), "".concat(EXPOSURE_API_EVENT.MOUNT, "_end"), 'sdk_event_mount_end'), "".concat(EXPOSURE_API_EVENT.SUBMITPAYMENT, "_start"), 'sdk_event_submitPay'), "".concat(EXPOSURE_API_EVENT.SUBMITPAYMENT, "_end"), 'sdk_event_payment_end'), "".concat(EXPOSURE_API_EVENT.VALIDATAFIELDS, "_start"), 'sdk_event_validateFields'), "".concat(EXPOSURE_API_EVENT.VALIDATAFIELDS, "_end"), 'sdk_event_validateFields_end'), "".concat(EXPOSURE_API_EVENT.DESTORY, "_start"), 'sdk_event_apiOnDestroy'), "".concat(EXPOSURE_API_EVENT.DESTORY, "_end"), 'sdk_event_apiOnDestroy_end'), "heart_beat", 'sdk_element_handleHeartBeat'), "data_error", 'sdk_element_callback_error');
|
|
144
|
+
var title = titleMap[type];
|
|
145
|
+
if (!title) return;
|
|
123
146
|
this.logger.logInfo({
|
|
124
|
-
title:
|
|
147
|
+
title: title
|
|
125
148
|
}, _objectSpread({
|
|
126
149
|
actionName: type
|
|
127
150
|
}, payload));
|
|
@@ -131,11 +154,25 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
|
131
154
|
value: function buildId(fn, suffix) {
|
|
132
155
|
return "".concat(fn, "_").concat(++this.uniqueId, "_").concat(suffix);
|
|
133
156
|
}
|
|
157
|
+
|
|
158
|
+
// 通过fn生成埋点事件名,fn=mount,如mount_start
|
|
159
|
+
}, {
|
|
160
|
+
key: "getEventName",
|
|
161
|
+
value: function getEventName(fn, suffix) {
|
|
162
|
+
return "".concat(fn, "_").concat(suffix);
|
|
163
|
+
}
|
|
134
164
|
}, {
|
|
135
165
|
key: "buildIdFromStart",
|
|
136
166
|
value: function buildIdFromStart(startId, suffix) {
|
|
137
167
|
return startId.replace(/_start$/, "_".concat(suffix));
|
|
138
168
|
}
|
|
169
|
+
|
|
170
|
+
// 通过startId生成埋点事件名,如mount_1_start --> mount_end,和生成规则一一对应
|
|
171
|
+
}, {
|
|
172
|
+
key: "getEventNameFromStart",
|
|
173
|
+
value: function getEventNameFromStart(startId, suffix) {
|
|
174
|
+
return startId.replace(/_.+_/i, '_').replace(/_start$/, "_".concat(suffix));
|
|
175
|
+
}
|
|
139
176
|
}]);
|
|
140
177
|
return EventCenter;
|
|
141
178
|
}();
|
|
@@ -119,6 +119,11 @@ export var ContainerController = /*#__PURE__*/function () {
|
|
|
119
119
|
value: function getContainerService() {
|
|
120
120
|
return this.containerService;
|
|
121
121
|
}
|
|
122
|
+
}, {
|
|
123
|
+
key: "getInstanceId",
|
|
124
|
+
value: function getInstanceId() {
|
|
125
|
+
return this.instanceId;
|
|
126
|
+
}
|
|
122
127
|
}]);
|
|
123
128
|
return ContainerController;
|
|
124
129
|
}();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddressMountOptions, IElementOptions,
|
|
1
|
+
import { AddressMountOptions, ICommonApiResponse, IElementOptions, IPaymentApiResponse, LinkAuthMountOptions, PaymentMountOptions } from '../type';
|
|
2
2
|
declare class ElementController {
|
|
3
3
|
private options;
|
|
4
4
|
private elementContainer;
|
|
@@ -23,7 +23,7 @@ declare class ElementController {
|
|
|
23
23
|
private setInitTimeout;
|
|
24
24
|
private initializeAndMountProcessor;
|
|
25
25
|
private handleStartBizFlowError;
|
|
26
|
-
mount(renderOptions: LinkAuthMountOptions | AddressMountOptions | PaymentMountOptions, sdkSelector: string):
|
|
26
|
+
mount(renderOptions: LinkAuthMountOptions | AddressMountOptions | PaymentMountOptions, sdkSelector: string): Promise<ICommonApiResponse>;
|
|
27
27
|
private onValidateFunc;
|
|
28
28
|
private onValidateAndSubmitPay;
|
|
29
29
|
/**
|
|
@@ -33,12 +33,7 @@ declare class ElementController {
|
|
|
33
33
|
validateFields(): Promise<{
|
|
34
34
|
isValid: boolean;
|
|
35
35
|
}>;
|
|
36
|
-
submitPayment(): Promise<
|
|
37
|
-
error: {
|
|
38
|
-
code: string;
|
|
39
|
-
message: string;
|
|
40
|
-
};
|
|
41
|
-
}>;
|
|
36
|
+
submitPayment(): Promise<IPaymentApiResponse>;
|
|
42
37
|
private changeLoading;
|
|
43
38
|
private addEventListener;
|
|
44
39
|
private sendRequestAndWaitWebLaunch;
|