@alipay/ams-checkout 1.23.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 +10 -10
- package/esm/constant/index.d.ts +9 -5
- package/esm/constant/index.js +12 -78
- package/esm/core/component/ckp/index.js +6 -5
- package/esm/core/component/element/components/address.d.ts +19 -0
- package/esm/core/component/element/components/address.js +68 -0
- package/esm/core/component/element/components/auth.d.ts +17 -0
- package/esm/core/component/element/components/auth.js +60 -0
- package/esm/core/component/element/components/payment.d.ts +19 -0
- package/esm/core/component/element/components/payment.js +74 -0
- package/esm/core/component/element/index.d.ts +47 -0
- package/esm/core/component/element/index.js +816 -0
- package/esm/core/component/element/mock.d.ts +4 -0
- package/esm/core/component/element/mock.js +491 -0
- package/esm/core/component/element/type.d.ts +190 -0
- package/esm/core/component/element/type.js +35 -0
- package/esm/core/component/element/utils.d.ts +13 -0
- package/esm/core/component/element/utils.js +6 -0
- package/esm/core/component/index.d.ts +4 -4
- package/esm/core/component/index.js +14 -14
- package/esm/core/drop-in/index.js +2 -2
- package/esm/core/instance/index.js +9 -9
- package/esm/foundation/core/index.d.ts +26 -0
- package/esm/foundation/core/index.js +366 -0
- package/esm/foundation/index.d.ts +75 -0
- package/esm/foundation/index.js +42 -0
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +18 -0
- package/esm/foundation/product-processor/easysafepay/deps.js +12 -0
- package/esm/foundation/product-processor/easysafepay/index.d.ts +26 -0
- package/esm/foundation/product-processor/easysafepay/index.js +463 -0
- package/esm/foundation/service/api-bus/ability/callback.d.ts +9 -0
- package/esm/foundation/service/api-bus/ability/callback.js +55 -0
- package/esm/foundation/service/api-bus/ability/globalData.d.ts +10 -0
- package/esm/foundation/service/api-bus/ability/globalData.js +89 -0
- package/esm/foundation/service/api-bus/ability/request.d.ts +10 -0
- package/esm/foundation/service/api-bus/ability/request.js +151 -0
- package/esm/foundation/service/api-bus/ability/security.d.ts +12 -0
- package/esm/foundation/service/api-bus/ability/security.js +161 -0
- package/esm/foundation/service/api-bus/ability/tracker.d.ts +9 -0
- package/esm/foundation/service/api-bus/ability/tracker.js +80 -0
- package/esm/foundation/service/api-bus/busManager.d.ts +127 -0
- package/esm/foundation/service/api-bus/busManager.js +398 -0
- package/esm/foundation/service/api-bus/index.d.ts +20 -0
- package/esm/foundation/service/api-bus/index.js +88 -0
- 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 +30 -0
- package/esm/foundation/service/container/index.js +298 -0
- package/esm/foundation/service/container/popup.d.ts +17 -0
- package/esm/foundation/service/container/popup.js +103 -0
- package/esm/foundation/service/container/utils.d.ts +7 -0
- package/esm/foundation/service/container/utils.js +48 -0
- package/esm/foundation/service/event-center.d.ts +76 -0
- package/esm/foundation/service/event-center.js +243 -0
- package/esm/foundation/service/global-data/index.d.ts +11 -0
- package/esm/foundation/service/global-data/index.js +68 -0
- package/esm/foundation/service/index.d.ts +19 -0
- package/esm/foundation/service/index.js +82 -0
- package/esm/foundation/service/log/index.d.ts +43 -0
- package/esm/foundation/service/log/index.js +235 -0
- package/esm/foundation/service/log/types.d.ts +32 -0
- package/esm/foundation/service/log/types.js +1 -0
- package/esm/foundation/service/requester/deps.d.ts +17 -0
- package/esm/foundation/service/requester/deps.js +11 -0
- package/esm/foundation/service/requester/requester.d.ts +22 -0
- package/esm/foundation/service/requester/requester.js +214 -0
- package/esm/foundation/service/security/index.d.ts +28 -0
- package/esm/foundation/service/security/index.js +286 -0
- package/esm/foundation/service/security/security.d.ts +33 -0
- package/esm/foundation/service/security/security.js +182 -0
- package/esm/foundation/utils/gray_scale_utils.d.ts +7 -0
- package/esm/foundation/utils/gray_scale_utils.js +40 -0
- package/esm/foundation/utils/payment_context_utils.d.ts +13 -0
- package/esm/foundation/utils/payment_context_utils.js +57 -0
- 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 +11 -0
- package/esm/foundation/utils/redirect_utils.js +263 -0
- package/esm/foundation/utils/system_events.d.ts +4 -0
- package/esm/foundation/utils/system_events.js +66 -0
- package/esm/foundation/utils/web_app_url_utils.d.ts +46 -0
- package/esm/foundation/utils/web_app_url_utils.js +112 -0
- package/esm/index.d.ts +12 -6
- package/esm/index.js +75 -64
- 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 +7 -5
- package/esm/plugin/component/cashierApp.js +15 -8
- 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 +10 -8
- package/esm/plugin/component/component.popup.style.d.ts +6 -6
- package/esm/plugin/component/component.popup.style.js +6 -6
- package/esm/plugin/component/index.d.ts +8 -7
- package/esm/plugin/component/index.js +160 -103
- 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/type.d.ts +3 -3
- package/esm/service/element.d.ts +4 -0
- package/esm/service/element.js +51 -0
- package/esm/service/index.d.ts +1 -0
- package/esm/service/index.js +2 -0
- package/esm/types/index.d.ts +247 -39
- package/esm/types/index.js +109 -59
- package/esm/util/createIframeNode.d.ts +2 -2
- package/esm/util/createIframeNode.js +3 -3
- package/esm/util/getBackScheme.js +95 -3
- package/esm/util/security.d.ts +2 -2
- package/esm/util/security.js +2 -2
- package/package.json +2 -1
- 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/types/index.js
CHANGED
@@ -6,56 +6,57 @@
|
|
6
6
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
7
|
*/
|
8
8
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
9
|
+
export * from "../core/component/element/type";
|
9
10
|
|
10
11
|
/**
|
11
12
|
* SDK options
|
12
13
|
*/
|
13
14
|
|
14
|
-
export var
|
15
|
-
|
16
|
-
|
17
|
-
return
|
15
|
+
export var DisplayTypeEnum = /*#__PURE__*/function (DisplayTypeEnum) {
|
16
|
+
DisplayTypeEnum["popup"] = "popup";
|
17
|
+
DisplayTypeEnum["inline"] = "inline";
|
18
|
+
return DisplayTypeEnum;
|
18
19
|
}({});
|
19
20
|
export var ComponentSignEnumV2 = /*#__PURE__*/function (ComponentSignEnumV2) {
|
20
21
|
ComponentSignEnumV2["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
21
22
|
ComponentSignEnumV2["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
22
23
|
return ComponentSignEnumV2;
|
23
24
|
}({});
|
24
|
-
export var
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
return
|
38
|
-
}({});
|
39
|
-
export var
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
return
|
51
|
-
}({});
|
52
|
-
export var
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
return
|
25
|
+
export var ComponentSignEnum = /*#__PURE__*/function (ComponentSignEnum) {
|
26
|
+
ComponentSignEnum["EASY_PAY_WALLET"] = "EASY_PAY_WALLET";
|
27
|
+
ComponentSignEnum["EASY_PAY_APM"] = "EASY_PAY_APM";
|
28
|
+
ComponentSignEnum["CASHIER_PAYMENT_CARD"] = "CASHIER_PAYMENT_CARD";
|
29
|
+
ComponentSignEnum["CASHIER_PAYMENT_BANK"] = "CASHIER_PAYMENT_BANK";
|
30
|
+
ComponentSignEnum["CASHIER_PAYMENT_APM"] = "CASHIER_PAYMENT_APM";
|
31
|
+
ComponentSignEnum["AUTO_DEBIT_WALLET"] = "AUTO_DEBIT_WALLET";
|
32
|
+
ComponentSignEnum["AUTO_DEBIT_PAY_WALLET"] = "AUTO_DEBIT_PAY_WALLET";
|
33
|
+
ComponentSignEnum["NONE"] = "NONE";
|
34
|
+
ComponentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
|
35
|
+
ComponentSignEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
|
36
|
+
ComponentSignEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
37
|
+
ComponentSignEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
38
|
+
return ComponentSignEnum;
|
39
|
+
}({});
|
40
|
+
export var ProductSceneEnum = /*#__PURE__*/function (ProductSceneEnum) {
|
41
|
+
ProductSceneEnum["EASY_PAY"] = "EASY_PAY";
|
42
|
+
ProductSceneEnum["CASHIER_PAYMENT"] = "CASHIER_PAYMENT";
|
43
|
+
ProductSceneEnum["AUTO_DEBIT"] = "AUTO_DEBIT";
|
44
|
+
ProductSceneEnum["AUTO_DEBIT_PAY"] = "AUTO_DEBIT_PAY";
|
45
|
+
ProductSceneEnum["VAULTING"] = "VAULTING";
|
46
|
+
ProductSceneEnum["FLASH_BUY"] = "FLASH_BUY";
|
47
|
+
ProductSceneEnum["CARD_APPLE_PAY"] = "CARD_APPLE_PAY";
|
48
|
+
ProductSceneEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT";
|
49
|
+
ProductSceneEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS";
|
50
|
+
ProductSceneEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
|
51
|
+
return ProductSceneEnum;
|
52
|
+
}({});
|
53
|
+
export var PaymentMethodCategoryTypeEnum = /*#__PURE__*/function (PaymentMethodCategoryTypeEnum) {
|
54
|
+
PaymentMethodCategoryTypeEnum["CARD"] = "CARD";
|
55
|
+
PaymentMethodCategoryTypeEnum["WALLET"] = "WALLET";
|
56
|
+
PaymentMethodCategoryTypeEnum["BANK"] = "BANK";
|
57
|
+
PaymentMethodCategoryTypeEnum["APM"] = "APM";
|
58
|
+
PaymentMethodCategoryTypeEnum["ALL"] = "ALL";
|
59
|
+
return PaymentMethodCategoryTypeEnum;
|
59
60
|
}({});
|
60
61
|
|
61
62
|
/** 表单地址数据 */
|
@@ -88,11 +89,11 @@ export var networkModeEnum = /*#__PURE__*/function (networkModeEnum) {
|
|
88
89
|
networkModeEnum["session"] = "session";
|
89
90
|
return networkModeEnum;
|
90
91
|
}({});
|
91
|
-
export var
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
return
|
92
|
+
export var EnvironmentEnum = /*#__PURE__*/function (EnvironmentEnum) {
|
93
|
+
EnvironmentEnum["sandbox"] = "sandbox";
|
94
|
+
EnvironmentEnum["prod"] = "prod";
|
95
|
+
EnvironmentEnum["light_sandbox"] = "light_sandbox";
|
96
|
+
return EnvironmentEnum;
|
96
97
|
}({});
|
97
98
|
export var osTypeEnum = /*#__PURE__*/function (osTypeEnum) {
|
98
99
|
osTypeEnum["IOS"] = "IOS";
|
@@ -107,10 +108,10 @@ export var terminalTypeEnum = /*#__PURE__*/function (terminalTypeEnum) {
|
|
107
108
|
terminalTypeEnum["MINI_APP"] = "MINI_APP";
|
108
109
|
return terminalTypeEnum;
|
109
110
|
}({});
|
110
|
-
export var
|
111
|
-
|
112
|
-
|
113
|
-
return
|
111
|
+
export var PlatformEnum = /*#__PURE__*/function (PlatformEnum) {
|
112
|
+
PlatformEnum["desktop"] = "desktop";
|
113
|
+
PlatformEnum["mobile"] = "mobile";
|
114
|
+
return PlatformEnum;
|
114
115
|
}({});
|
115
116
|
|
116
117
|
/**
|
@@ -129,17 +130,17 @@ export var platformEnum = /*#__PURE__*/function (platformEnum) {
|
|
129
130
|
* @description Create an event handler, In pop-up layer mode, the user clicks the semi floating layer close button and is called.
|
130
131
|
*/
|
131
132
|
|
132
|
-
export var
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
return
|
137
|
-
}({});
|
138
|
-
export var
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
return
|
133
|
+
export var MessageName = /*#__PURE__*/function (MessageName) {
|
134
|
+
MessageName["SDK_TO_APP"] = "SDK_TO_APP";
|
135
|
+
MessageName["APP_TO_SDK"] = "APP_TO_SDK";
|
136
|
+
MessageName["APP_TO_APP"] = "APP_TO_APP";
|
137
|
+
return MessageName;
|
138
|
+
}({});
|
139
|
+
export var TargetEnum = /*#__PURE__*/function (TargetEnum) {
|
140
|
+
TargetEnum["BLANK"] = "_blank";
|
141
|
+
TargetEnum["SELF"] = "_self";
|
142
|
+
TargetEnum["REPLACE"] = "_replace";
|
143
|
+
return TargetEnum;
|
143
144
|
}({});
|
144
145
|
export var errorEnum = /*#__PURE__*/function (errorEnum) {
|
145
146
|
errorEnum["PARAMS"] = "PARAMS";
|
@@ -208,4 +209,53 @@ export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
|
|
208
209
|
ProductSceneVersion["V1"] = "1.0";
|
209
210
|
ProductSceneVersion["V2"] = "2.0";
|
210
211
|
return ProductSceneVersion;
|
212
|
+
}({});
|
213
|
+
export var AccountStatusEnum = /*#__PURE__*/function (AccountStatusEnum) {
|
214
|
+
AccountStatusEnum["EFFECTIVE"] = "EFFECTIVE";
|
215
|
+
AccountStatusEnum["UNREGISTERED"] = "UNREGISTERED";
|
216
|
+
return AccountStatusEnum;
|
217
|
+
}({});
|
218
|
+
|
219
|
+
// element 接口start
|
220
|
+
|
221
|
+
export var InterActionTypeEnum = /*#__PURE__*/function (InterActionTypeEnum) {
|
222
|
+
InterActionTypeEnum["COLLECT_REDIRECT"] = "COLLECT_REDIRECT";
|
223
|
+
InterActionTypeEnum["SHOW_CODE"] = "SHOW_CODE";
|
224
|
+
InterActionTypeEnum["COLLECT_SHOW_CODE"] = "COLLECT_SHOW_CODE";
|
225
|
+
InterActionTypeEnum["REDIRECT"] = "REDIRECT";
|
226
|
+
return InterActionTypeEnum;
|
227
|
+
}({});
|
228
|
+
// element 接口end
|
229
|
+
|
230
|
+
export var ElementPaymentMethod = /*#__PURE__*/function (ElementPaymentMethod) {
|
231
|
+
ElementPaymentMethod["CONTAINER_ELEMENT"] = "CONTAINER_ELEMENT";
|
232
|
+
ElementPaymentMethod["AUTH_ELEMENT"] = "AUTH_ELEMENT";
|
233
|
+
ElementPaymentMethod["ADDRESS_ELEMENT"] = "ADDRESS_ELEMENT";
|
234
|
+
ElementPaymentMethod["PAYMENT_ELEMENT"] = "PAYMENT_ELEMENT";
|
235
|
+
return ElementPaymentMethod;
|
236
|
+
}({});
|
237
|
+
export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
|
238
|
+
ElementPaymentEvent["INITIAL_DATA_READY"] = "initialDataReady";
|
239
|
+
ElementPaymentEvent["CAPTURE_ASSET"] = "onCaptureAsset";
|
240
|
+
ElementPaymentEvent["SIGN_OUT"] = "onSignout";
|
241
|
+
ElementPaymentEvent["BLUR"] = "onBlur";
|
242
|
+
ElementPaymentEvent["VALIDATE"] = "validate";
|
243
|
+
ElementPaymentEvent["SUBMIT_RISK"] = "onSubmitRisk";
|
244
|
+
ElementPaymentEvent["AFTER_SUBMIT"] = "onAfterSubmit";
|
245
|
+
ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
|
246
|
+
ElementPaymentEvent["LAUNCH"] = "onLaunch";
|
247
|
+
ElementPaymentEvent["CALLBACK"] = "callback";
|
248
|
+
ElementPaymentEvent["LOG"] = "log";
|
249
|
+
return ElementPaymentEvent;
|
250
|
+
}({});
|
251
|
+
export var ConnectErrorCode = /*#__PURE__*/function (ConnectErrorCode) {
|
252
|
+
ConnectErrorCode["RISK_REJECT"] = "RISK_REJECT";
|
253
|
+
ConnectErrorCode["USER_AUTH_VERIFICATION_FAILED"] = "USER_AUTH_VERIFICATION_FAILED";
|
254
|
+
ConnectErrorCode["USER_NOT_EXISTS"] = "USER_NOT_EXISTS";
|
255
|
+
return ConnectErrorCode;
|
256
|
+
}({});
|
257
|
+
export var RiskSdkInfoEnum = /*#__PURE__*/function (RiskSdkInfoEnum) {
|
258
|
+
RiskSdkInfoEnum["NEED"] = "need";
|
259
|
+
RiskSdkInfoEnum["NO_NEED"] = "noneed";
|
260
|
+
return RiskSdkInfoEnum;
|
211
261
|
}({});
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Iselector,
|
1
|
+
import { Iselector, DisplayTypeEnum } from '../types';
|
2
2
|
/**
|
3
3
|
* @description context中需要包含app节点,用于插入selector中
|
4
4
|
*/
|
5
|
-
export declare const createIframeNode: (context: any, selector: Iselector, renderDisplayType:
|
5
|
+
export declare const createIframeNode: (context: any, selector: Iselector, renderDisplayType: DisplayTypeEnum) => Promise<void>;
|
6
6
|
export declare const createPreloadIframeNode: (virtualPreloadIframe: any) => void;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
8
8
|
import { getType } from '.';
|
9
9
|
import { ERRORMESSAGE, EVENT } from "../constant";
|
10
|
-
import {
|
10
|
+
import { MessageName, DisplayTypeEnum } from "../types";
|
11
11
|
/**
|
12
12
|
* @description context中需要包含app节点,用于插入selector中
|
13
13
|
*/
|
@@ -24,7 +24,7 @@ export var createIframeNode = function createIframeNode(context, selector, rende
|
|
24
24
|
};
|
25
25
|
reject(error);
|
26
26
|
context._dispatchToSDK({
|
27
|
-
name:
|
27
|
+
name: MessageName.APP_TO_SDK,
|
28
28
|
instanceId: context.AMSSDK._instanceId,
|
29
29
|
context: {
|
30
30
|
event: EVENT.error.name,
|
@@ -33,7 +33,7 @@ export var createIframeNode = function createIframeNode(context, selector, rende
|
|
33
33
|
});
|
34
34
|
return;
|
35
35
|
}
|
36
|
-
if (renderDisplayType ===
|
36
|
+
if (renderDisplayType === DisplayTypeEnum.popup) dorpinDom.innerHTML = '';
|
37
37
|
if (context.app) {
|
38
38
|
dorpinDom.appendChild(context.app);
|
39
39
|
}
|
@@ -1,12 +1,88 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
var UA_MATCH_RULES = [{
|
2
|
+
matchRule: 'AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$',
|
3
|
+
iosScheme: 'https',
|
4
|
+
andScheme: ''
|
5
|
+
}, {
|
6
|
+
matchRule: 'HeyTapBrowser',
|
7
|
+
iosScheme: '',
|
8
|
+
andScheme: ''
|
9
|
+
}, {
|
10
|
+
matchRule: 'HuaweiBrowser',
|
11
|
+
iosScheme: '',
|
12
|
+
andScheme: ''
|
13
|
+
}, {
|
14
|
+
matchRule: 'Kwai',
|
15
|
+
iosScheme: 'kwai',
|
16
|
+
andScheme: ''
|
17
|
+
}, {
|
18
|
+
matchRule: 'MQQBrowser',
|
19
|
+
iosScheme: 'mttbrowser',
|
20
|
+
andScheme: ''
|
21
|
+
}, {
|
22
|
+
matchRule: 'MicroMessenger',
|
23
|
+
iosScheme: '',
|
24
|
+
andScheme: ''
|
25
|
+
}, {
|
26
|
+
matchRule: 'MiuiBrowser',
|
27
|
+
iosScheme: '',
|
28
|
+
andScheme: ''
|
29
|
+
}, {
|
30
|
+
matchRule: 'Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$',
|
31
|
+
iosScheme: 'googlechrome',
|
32
|
+
andScheme: ''
|
33
|
+
}, {
|
34
|
+
matchRule: 'Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$',
|
35
|
+
iosScheme: 'googlechrome',
|
36
|
+
andScheme: ''
|
37
|
+
}, {
|
38
|
+
matchRule: 'NewsArticle',
|
39
|
+
iosScheme: 'snssdk141',
|
40
|
+
andScheme: ''
|
41
|
+
}, {
|
42
|
+
matchRule: 'UCBrowser',
|
43
|
+
iosScheme: 'ucbrowser',
|
44
|
+
andScheme: ''
|
45
|
+
}, {
|
46
|
+
matchRule: 'VideoArticle',
|
47
|
+
iosScheme: 'snssdk32',
|
48
|
+
andScheme: ''
|
49
|
+
}, {
|
50
|
+
matchRule: 'VivoBrowser',
|
51
|
+
iosScheme: '',
|
52
|
+
andScheme: ''
|
53
|
+
}, {
|
54
|
+
matchRule: 'ZhongAnWebView',
|
55
|
+
iosScheme: 'zaapp',
|
56
|
+
andScheme: ''
|
57
|
+
}, {
|
58
|
+
matchRule: 'aweme',
|
59
|
+
iosScheme: 'snssdk1128',
|
60
|
+
andScheme: ''
|
61
|
+
}, {
|
62
|
+
matchRule: 'aweme_lite',
|
63
|
+
iosScheme: 'snssdk2329',
|
64
|
+
andScheme: ''
|
65
|
+
}, {
|
66
|
+
matchRule: 'com.xs.fm',
|
67
|
+
iosScheme: 'novelfm3040',
|
68
|
+
andScheme: ''
|
69
|
+
}, {
|
70
|
+
matchRule: 'netdisk',
|
71
|
+
iosScheme: '',
|
72
|
+
andScheme: ''
|
73
|
+
}, {
|
74
|
+
matchRule: 'qqnews',
|
75
|
+
iosScheme: 'qqnews',
|
76
|
+
andScheme: ''
|
77
|
+
}];
|
78
|
+
|
3
79
|
/**
|
4
80
|
* 通过配置规则检测 UA 和获得回跳 scheme
|
5
81
|
*/
|
6
82
|
export function getBackScheme(mockUa, logger) {
|
7
83
|
var ua = mockUa || window.navigator.userAgent || '';
|
8
84
|
// 获取规则
|
9
|
-
var uaMatchedRule =
|
85
|
+
var uaMatchedRule = UA_MATCH_RULES;
|
10
86
|
var matchedRule;
|
11
87
|
var matched = null;
|
12
88
|
for (var i = 0; i < uaMatchedRule.length; i++) {
|
@@ -39,4 +115,20 @@ function logBackScheme(logger, userAgent, scheme) {
|
|
39
115
|
backScheme: scheme
|
40
116
|
});
|
41
117
|
}
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* 当前运行环境是否 Android
|
122
|
+
*/
|
123
|
+
function isAndroid(mockUA) {
|
124
|
+
var ua = (mockUA || navigator.userAgent).toLowerCase();
|
125
|
+
return /android|adr|linux/.test(ua);
|
126
|
+
}
|
127
|
+
|
128
|
+
/**
|
129
|
+
* 当前运行环境是否 IOS
|
130
|
+
*/
|
131
|
+
function isIOS(mockUA) {
|
132
|
+
var ua = (mockUA || navigator.userAgent).toLowerCase();
|
133
|
+
return /iphone|ipad|ipod|ios|macintosh/.test(ua);
|
42
134
|
}
|
package/esm/util/security.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { IsecurityConfig,
|
2
|
-
export declare const getSecurityConfigStorageKey: (scene:
|
1
|
+
import { IsecurityConfig, ProductSceneEnum, DeviceIdParameter } from '../types';
|
2
|
+
export declare const getSecurityConfigStorageKey: (scene: ProductSceneEnum) => string;
|
3
3
|
export declare enum SecurityRegionEnum {
|
4
4
|
SG = "SG",
|
5
5
|
US = "US",
|
package/esm/util/security.js
CHANGED
@@ -8,7 +8,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
8
8
|
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; }
|
9
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
10
10
|
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); }
|
11
|
-
import {
|
11
|
+
import { ProductSceneEnum } from "../types";
|
12
12
|
import APDID from "./jshield-apdid/apdid-core.umd.min";
|
13
13
|
export var getSecurityConfigStorageKey = function getSecurityConfigStorageKey(scene) {
|
14
14
|
return "AMSSDK_SECURITY_CONFIG_".concat(scene);
|
@@ -24,7 +24,7 @@ export var securityHost = {
|
|
24
24
|
US: 'https://open-na-global.alipay.com/api/open/risk_client',
|
25
25
|
DE: 'https://open-de-global.alipay.com/api/open/risk_client'
|
26
26
|
};
|
27
|
-
export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},
|
27
|
+
export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ProductSceneEnum.CASHIER_PAYMENT, 'Acquirer'), ProductSceneEnum.AUTO_DEBIT, 'Acquirer'), ProductSceneEnum.VAULTING, 'Acquirer'), ProductSceneEnum.CARD_APPLE_PAY, 'Acquirer'), "EASYPAY", 'EasyPay'), ProductSceneEnum.EASY_PAY, 'EasyPay'), ProductSceneEnum.FLASH_BUY, 'OneAccount'), ProductSceneEnum.ELEMENT_PAYMENT, 'Acquirer');
|
28
28
|
export var getSecurityHost = function getSecurityHost(region) {
|
29
29
|
return securityHost[region] || securityHost[SecurityRegionEnum.SG];
|
30
30
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@alipay/ams-checkout",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.25.0",
|
4
4
|
"description": "",
|
5
5
|
"author": "",
|
6
6
|
"main": "esm/index.js",
|
@@ -15,6 +15,7 @@
|
|
15
15
|
],
|
16
16
|
"scripts": {
|
17
17
|
"build": "father build",
|
18
|
+
"build:w": "father dev",
|
18
19
|
"dev": "father dev",
|
19
20
|
"ci": "npm run lint",
|
20
21
|
"cov": "jest --coverage",
|
package/esm/util/ua/index.d.ts
DELETED
package/esm/util/ua/index.js
DELETED
package/esm/util/ua/isAndroid.js
DELETED
package/esm/util/ua/isIOS.d.ts
DELETED