@alipay/ams-checkout 0.0.1730107332-dev.4 → 0.0.1730441340-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +6 -7
- package/esm/constant/index.js +80 -11
- package/esm/{foundation/service/api-bus → core/bus}/ability/callback.d.ts +2 -2
- package/esm/{foundation/service/api-bus → core/bus}/ability/callback.js +1 -1
- package/esm/{foundation/service/api-bus → core/bus}/ability/security.d.ts +4 -6
- package/esm/{foundation/service/api-bus → core/bus}/ability/security.js +35 -92
- package/esm/{foundation/service/api-bus → core/bus}/ability/tracker.d.ts +4 -4
- package/esm/{foundation/service/api-bus → core/bus}/ability/tracker.js +3 -6
- package/esm/{foundation/service/api-bus/busManager.d.ts → core/bus/index.d.ts} +15 -17
- package/esm/{foundation/service/api-bus/busManager.js → core/bus/index.js} +35 -67
- package/esm/{foundation/service/api-bus → core/bus}/interface.d.ts +0 -12
- package/esm/{foundation/service/api-bus → core/bus}/interface.js +2 -16
- package/esm/core/component/address.d.ts +8 -0
- package/esm/{foundation/service/api-bus/ability/globalData.js → core/component/address.js} +58 -75
- package/esm/core/component/appPreloadProcessing.d.ts +1 -0
- package/esm/{foundation/service/container/popup.js → core/component/appPreloadProcessing.js} +83 -97
- package/esm/core/component/ckp/index.d.ts +27 -0
- package/esm/core/component/ckp/index.js +166 -0
- package/esm/core/component/index.d.ts +51 -0
- package/esm/core/component/index.js +531 -0
- package/esm/core/drop-in/index.d.ts +22 -0
- package/esm/core/drop-in/index.js +104 -0
- package/esm/core/instance/index.d.ts +89 -0
- package/esm/core/instance/index.js +499 -0
- package/esm/index.d.ts +28 -5
- package/esm/index.js +158 -29
- package/esm/plugin/applepay/component.d.ts +50 -0
- package/esm/plugin/applepay/component.js +339 -0
- package/esm/plugin/applepay/index.d.ts +17 -0
- package/esm/plugin/applepay/index.js +117 -0
- package/esm/plugin/applepay/interface.d.ts +161 -0
- package/esm/plugin/applepay/interface.js +69 -0
- package/esm/plugin/applepay/service.d.ts +54 -0
- package/esm/plugin/applepay/service.js +289 -0
- package/esm/plugin/component/cashierApp.d.ts +34 -0
- package/esm/plugin/component/cashierApp.js +237 -0
- package/esm/{component → plugin/component}/channel.d.ts +4 -3
- package/esm/{component → plugin/component}/channel.js +37 -1
- package/esm/plugin/component/component.inline.style.d.ts +10 -0
- package/esm/{component → plugin/component}/component.inline.style.js +9 -11
- package/esm/{component → plugin/component}/component.popup.style.d.ts +6 -15
- package/esm/{component → plugin/component}/component.popup.style.js +18 -36
- package/esm/plugin/component/index.d.ts +126 -0
- package/esm/plugin/component/index.js +1839 -0
- package/esm/{component → plugin/component}/popupWindow.style.js +2 -2
- package/esm/plugin/const.d.ts +2 -0
- package/esm/plugin/const.js +33 -0
- package/esm/plugin/drop-in/index.d.ts +71 -0
- package/esm/plugin/drop-in/index.js +324 -0
- package/esm/plugin/payment-element/utils.d.ts +2 -0
- package/esm/plugin/payment-element/utils.js +6 -0
- package/esm/plugin/paypal/index.d.ts +20 -0
- package/esm/plugin/paypal/index.js +390 -0
- package/esm/plugin/type.d.ts +34 -0
- package/esm/plugin/utils.d.ts +6 -0
- package/esm/plugin/utils.js +21 -0
- package/esm/types/index.d.ts +55 -61
- package/esm/types/index.js +62 -63
- package/esm/util/createIframeNode.d.ts +6 -0
- package/esm/util/createIframeNode.js +48 -0
- package/esm/util/getBackScheme.d.ts +2 -2
- package/esm/util/getBackScheme.js +2 -94
- package/esm/util/index.d.ts +11 -1
- package/esm/util/index.js +84 -3
- package/esm/util/intl-callapp/es/index.js +0 -1
- package/esm/{foundation/service/security → util}/security.d.ts +2 -2
- package/esm/{foundation/service/security → util}/security.js +3 -3
- package/esm/util/ua/index.d.ts +2 -0
- package/esm/util/ua/index.js +2 -0
- package/esm/util/ua/isAndroid.d.ts +4 -0
- package/esm/util/ua/isAndroid.js +7 -0
- package/esm/util/ua/isIOS.d.ts +4 -0
- package/esm/util/ua/isIOS.js +7 -0
- package/package.json +2 -2
- package/esm/component/component.inline.style.d.ts +0 -10
- package/esm/foundation/core/index.d.ts +0 -26
- package/esm/foundation/core/index.js +0 -364
- package/esm/foundation/index.d.ts +0 -74
- package/esm/foundation/index.js +0 -42
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -18
- package/esm/foundation/product-processor/easysafepay/deps.js +0 -12
- package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -27
- package/esm/foundation/product-processor/easysafepay/index.js +0 -596
- package/esm/foundation/service/api-bus/ability/globalData.d.ts +0 -10
- package/esm/foundation/service/api-bus/ability/request.d.ts +0 -10
- package/esm/foundation/service/api-bus/ability/request.js +0 -151
- package/esm/foundation/service/api-bus/index.d.ts +0 -20
- package/esm/foundation/service/api-bus/index.js +0 -88
- package/esm/foundation/service/container/index.d.ts +0 -28
- package/esm/foundation/service/container/index.js +0 -256
- package/esm/foundation/service/container/popup.d.ts +0 -17
- package/esm/foundation/service/container/utils.d.ts +0 -7
- package/esm/foundation/service/container/utils.js +0 -48
- package/esm/foundation/service/event-center.d.ts +0 -74
- package/esm/foundation/service/event-center.js +0 -213
- package/esm/foundation/service/global-data/index.d.ts +0 -11
- package/esm/foundation/service/global-data/index.js +0 -68
- package/esm/foundation/service/index.d.ts +0 -19
- package/esm/foundation/service/index.js +0 -82
- package/esm/foundation/service/log/index.d.ts +0 -43
- package/esm/foundation/service/log/index.js +0 -235
- package/esm/foundation/service/log/types.d.ts +0 -32
- package/esm/foundation/service/requester/deps.d.ts +0 -17
- package/esm/foundation/service/requester/deps.js +0 -11
- package/esm/foundation/service/requester/requester.d.ts +0 -22
- package/esm/foundation/service/requester/requester.js +0 -214
- package/esm/foundation/service/security/index.d.ts +0 -28
- package/esm/foundation/service/security/index.js +0 -285
- package/esm/foundation/types/index.d.ts +0 -4
- package/esm/foundation/types/index.js +0 -4
- package/esm/foundation/utils/gray_scale_utils.d.ts +0 -7
- package/esm/foundation/utils/gray_scale_utils.js +0 -40
- package/esm/foundation/utils/payment_context_utils.d.ts +0 -13
- package/esm/foundation/utils/payment_context_utils.js +0 -57
- package/esm/foundation/utils/payment_product_utils.d.ts +0 -13
- package/esm/foundation/utils/payment_product_utils.js +0 -38
- package/esm/foundation/utils/redirect_utils.d.ts +0 -6
- package/esm/foundation/utils/redirect_utils.js +0 -115
- package/esm/foundation/utils/system_events.d.ts +0 -4
- package/esm/foundation/utils/system_events.js +0 -71
- package/esm/foundation/utils/web_app_url_utils.d.ts +0 -46
- package/esm/foundation/utils/web_app_url_utils.js +0 -112
- /package/esm/{component → plugin/component}/popupWindow.style.d.ts +0 -0
- /package/esm/{foundation/service/log/types.js → plugin/type.js} +0 -0
package/esm/types/index.d.ts
CHANGED
@@ -19,7 +19,7 @@ interface AddressValueResult {
|
|
19
19
|
/**
|
20
20
|
* SDK options
|
21
21
|
*/
|
22
|
-
export interface
|
22
|
+
export interface IoptionsParams {
|
23
23
|
environment?: string;
|
24
24
|
locale?: string;
|
25
25
|
onError?: callOnError;
|
@@ -37,10 +37,10 @@ export interface IOptionsParams {
|
|
37
37
|
product?: string;
|
38
38
|
onBeforeSubmit?: callOnBeforeSubmit;
|
39
39
|
}
|
40
|
-
export interface IApplePayOptionsParams extends Pick<
|
40
|
+
export interface IApplePayOptionsParams extends Pick<IoptionsParams, 'locale' | 'environment' | 'onEventCallback' | 'analytics'> {
|
41
41
|
}
|
42
42
|
export type Iselector = string;
|
43
|
-
export declare enum
|
43
|
+
export declare enum renderDisplayTypeEnum {
|
44
44
|
'popup' = "popup",
|
45
45
|
'inline' = "inline"
|
46
46
|
}
|
@@ -57,7 +57,7 @@ export declare enum ComponentSignEnumV2 {
|
|
57
57
|
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT_ALL",
|
58
58
|
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL"
|
59
59
|
}
|
60
|
-
export declare enum
|
60
|
+
export declare enum componentSignEnum {
|
61
61
|
'EASY_PAY_WALLET' = "EASY_PAY_WALLET",
|
62
62
|
'EASY_PAY_APM' = "EASY_PAY_APM",
|
63
63
|
'CASHIER_PAYMENT_CARD' = "CASHIER_PAYMENT_CARD",
|
@@ -68,9 +68,10 @@ export declare enum ComponentSignEnum {
|
|
68
68
|
'NONE' = "NONE",
|
69
69
|
'VAULTING_CARD' = "VAULTING_CARD",
|
70
70
|
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT_ALL",
|
71
|
-
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL"
|
71
|
+
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL",
|
72
|
+
'CHECKOUT_PAYMENT' = "CHECKOUT_PAYMENT"
|
72
73
|
}
|
73
|
-
export declare enum
|
74
|
+
export declare enum productSceneEnum {
|
74
75
|
'EASY_PAY' = "EASY_PAY",
|
75
76
|
'CASHIER_PAYMENT' = "CASHIER_PAYMENT",
|
76
77
|
'AUTO_DEBIT' = "AUTO_DEBIT",
|
@@ -82,7 +83,7 @@ export declare enum ProductSceneEnum {
|
|
82
83
|
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS",
|
83
84
|
'CHECKOUT_PAYMENT' = "CHECKOUT_PAYMENT"
|
84
85
|
}
|
85
|
-
export declare enum
|
86
|
+
export declare enum paymentMethodCategoryTypeEnum {
|
86
87
|
'CARD' = "CARD",
|
87
88
|
'WALLET' = "WALLET",
|
88
89
|
'BANK' = "BANK",
|
@@ -91,8 +92,8 @@ export declare enum PaymentMethodCategoryTypeEnum {
|
|
91
92
|
}
|
92
93
|
export interface DeviceIdParameter {
|
93
94
|
scene?: string;
|
94
|
-
productScene?:
|
95
|
-
paymentMethodCategoryType?:
|
95
|
+
productScene?: productSceneEnum;
|
96
|
+
paymentMethodCategoryType?: paymentMethodCategoryTypeEnum;
|
96
97
|
tokenCollectTime?: string;
|
97
98
|
dataPollingInterval?: string;
|
98
99
|
}
|
@@ -105,9 +106,24 @@ export interface IcreateComponent {
|
|
105
106
|
themeType?: string;
|
106
107
|
accentColor?: string;
|
107
108
|
};
|
108
|
-
merchantAppointParam?: IMerchantAppointParam;
|
109
109
|
isAppWebview?: boolean;
|
110
|
+
merchantAppointParam?: IMerchantAppointParam;
|
111
|
+
}
|
112
|
+
export interface IappendIframeNodesParams extends IcreateComponent {
|
113
|
+
paymentSessionMetaData: IpaymentSessionMetaData;
|
114
|
+
renderDisplayType: renderDisplayTypeEnum;
|
115
|
+
selector?: Iselector;
|
116
|
+
paypalConfiguration?: IPaypalConfiguration;
|
117
|
+
/** 将address-element参数定义合入原参数定义 */
|
118
|
+
configParams?: {
|
119
|
+
hideFields?: string[];
|
120
|
+
addressAutoSuggestDisabled?: addressAutoSuggestDisabledType;
|
121
|
+
};
|
122
|
+
prefillValue?: AddressItem[];
|
123
|
+
componentSession?: string;
|
124
|
+
loca?: string;
|
110
125
|
}
|
126
|
+
/** 表单地址数据 */
|
111
127
|
export interface AddressItem {
|
112
128
|
shippingName: {
|
113
129
|
firstName: string;
|
@@ -150,6 +166,7 @@ export interface AddressItem {
|
|
150
166
|
prefer?: '1' | '0';
|
151
167
|
shippingId?: string;
|
152
168
|
}
|
169
|
+
type addressAutoSuggestDisabledType = 0 | 1;
|
153
170
|
export interface IPaypalConfiguration {
|
154
171
|
style?: object;
|
155
172
|
blockPayPalCreditButton?: boolean;
|
@@ -180,8 +197,8 @@ export interface Isubmit {
|
|
180
197
|
billingAddress?: IbillingAddress;
|
181
198
|
}
|
182
199
|
export interface IpaymentSessionConfig {
|
183
|
-
productScene:
|
184
|
-
paymentMethodCategoryType
|
200
|
+
productScene: productSceneEnum;
|
201
|
+
paymentMethodCategoryType?: paymentMethodCategoryTypeEnum;
|
185
202
|
productSceneVersion: string;
|
186
203
|
}
|
187
204
|
export interface IpaymentSecurityConfig {
|
@@ -199,27 +216,14 @@ export interface IsecurityConfig {
|
|
199
216
|
h5gateway: string;
|
200
217
|
}
|
201
218
|
export interface InitSecurityConfig {
|
202
|
-
product:
|
219
|
+
product: productSceneEnum;
|
203
220
|
region?: string;
|
204
221
|
}
|
205
222
|
export interface frontModulesToBeLoadedInterface {
|
206
223
|
acquirerName: string;
|
207
224
|
scriptUrl: string;
|
208
225
|
}
|
209
|
-
export interface
|
210
|
-
amountConfirmRequired?: boolean;
|
211
|
-
autoDebitWithToken: boolean;
|
212
|
-
enableSignAgreement?: boolean;
|
213
|
-
skipSdkQuery: boolean;
|
214
|
-
requireFastSdk: boolean;
|
215
|
-
nonCompliant?: boolean;
|
216
|
-
skipSdkQueryForm?: {
|
217
|
-
value: boolean;
|
218
|
-
version: string;
|
219
|
-
platform: string;
|
220
|
-
};
|
221
|
-
}
|
222
|
-
export interface IPaymentSessionMetaData {
|
226
|
+
export interface IpaymentSessionMetaData {
|
223
227
|
clientId?: string;
|
224
228
|
renderDisplayType?: string;
|
225
229
|
paymentSessionConfig?: IpaymentSessionConfig;
|
@@ -227,7 +231,18 @@ export interface IPaymentSessionMetaData {
|
|
227
231
|
moneyView?: any;
|
228
232
|
extendInfo?: string;
|
229
233
|
paymentMethodInfoView?: any;
|
230
|
-
action?:
|
234
|
+
action?: {
|
235
|
+
amountConfirmRequired?: boolean;
|
236
|
+
autoDebitWithToken: boolean;
|
237
|
+
enableSignAgreement?: boolean;
|
238
|
+
skipSdkQuery: boolean;
|
239
|
+
requireFastSdk: boolean;
|
240
|
+
skipSdkQueryForm?: {
|
241
|
+
value: boolean;
|
242
|
+
version: string;
|
243
|
+
platform: string;
|
244
|
+
};
|
245
|
+
};
|
231
246
|
authUrlInfo?: {
|
232
247
|
appIdentifier?: string;
|
233
248
|
applinkUrl?: string;
|
@@ -298,9 +313,6 @@ export interface IPaymentSessionMetaData {
|
|
298
313
|
};
|
299
314
|
frontModulesToBeLoaded?: frontModulesToBeLoadedInterface[];
|
300
315
|
};
|
301
|
-
connectFactor?: {
|
302
|
-
enableConnect?: boolean;
|
303
|
-
};
|
304
316
|
}
|
305
317
|
export interface IPaymentSessionFactor {
|
306
318
|
merchantInfo?: IMerchantInfo;
|
@@ -347,7 +359,7 @@ export declare enum networkModeEnum {
|
|
347
359
|
export interface IcheckoutState {
|
348
360
|
paymentMethodType?: string;
|
349
361
|
}
|
350
|
-
export declare enum
|
362
|
+
export declare enum environmentEnum {
|
351
363
|
sandbox = "sandbox",
|
352
364
|
prod = "prod",
|
353
365
|
light_sandbox = "light_sandbox"
|
@@ -368,7 +380,7 @@ export interface Ienv {
|
|
368
380
|
terminalType: terminalTypeEnum;
|
369
381
|
environment: string;
|
370
382
|
}
|
371
|
-
export declare enum
|
383
|
+
export declare enum platformEnum {
|
372
384
|
desktop = "desktop",
|
373
385
|
mobile = "mobile"
|
374
386
|
}
|
@@ -422,19 +434,19 @@ export type callOnBeforeSubmit = (state?: Record<string, any>) => Promise<onBefo
|
|
422
434
|
* @description Create an event handler, In pop-up layer mode, the user clicks the semi floating layer close button and is called.
|
423
435
|
*/
|
424
436
|
export type callOnClose = () => void;
|
425
|
-
export declare enum
|
437
|
+
export declare enum messageName {
|
426
438
|
SDK_TO_APP = "SDK_TO_APP",
|
427
439
|
APP_TO_SDK = "APP_TO_SDK",
|
428
440
|
APP_TO_APP = "APP_TO_APP"
|
429
441
|
}
|
430
|
-
export interface
|
431
|
-
name:
|
442
|
+
export interface eventPayload {
|
443
|
+
name: messageName;
|
432
444
|
mode?: string;
|
433
445
|
appId?: string;
|
434
446
|
instanceId: string;
|
435
|
-
context:
|
447
|
+
context: eventPayloadContext;
|
436
448
|
}
|
437
|
-
export interface
|
449
|
+
export interface eventPayloadContext {
|
438
450
|
event: string;
|
439
451
|
data: any;
|
440
452
|
eventCallbackId?: string;
|
@@ -450,7 +462,7 @@ export interface AMSCheckoutOptions {
|
|
450
462
|
export interface Ianalytics {
|
451
463
|
enabled: boolean;
|
452
464
|
}
|
453
|
-
export declare enum
|
465
|
+
export declare enum targetEnum {
|
454
466
|
BLANK = "_blank",
|
455
467
|
SELF = "_self",
|
456
468
|
REPLACE = "_replace"
|
@@ -519,7 +531,6 @@ export interface CashierSubmitPayRequest {
|
|
519
531
|
verifyFactors?: Record<string, string>;
|
520
532
|
paymentSessionData: string;
|
521
533
|
paymentSessionConfig?: any;
|
522
|
-
traceId?: string;
|
523
534
|
extParams?: any;
|
524
535
|
}
|
525
536
|
export interface CashierSdkActionQueryResult {
|
@@ -537,7 +548,6 @@ export interface CashierSdkActionQueryResult {
|
|
537
548
|
normalUrl?: string;
|
538
549
|
applinkUrl?: string;
|
539
550
|
schemeUrl?: string;
|
540
|
-
traceId?: string;
|
541
551
|
authUrl?: string;
|
542
552
|
extendInfo?: {
|
543
553
|
channelOrderId?: string;
|
@@ -583,7 +593,6 @@ export interface CashierSubmitPayResult {
|
|
583
593
|
normalUrl?: string;
|
584
594
|
errorStatus?: string;
|
585
595
|
message?: string;
|
586
|
-
traceId?: string;
|
587
596
|
}
|
588
597
|
export declare enum eventCodeEnum {
|
589
598
|
SDK_START_OF_LOADING = "SDK_START_OF_LOADING",
|
@@ -637,25 +646,10 @@ export declare enum ProductSceneVersion {
|
|
637
646
|
V1 = "1.0",
|
638
647
|
V2 = "2.0"
|
639
648
|
}
|
640
|
-
export
|
641
|
-
|
642
|
-
|
643
|
-
}
|
644
|
-
export interface IElementOptions {
|
645
|
-
sessionData: string;
|
646
|
-
environment?: string;
|
647
|
-
locale?: string;
|
648
|
-
mode?: string;
|
649
|
-
onEventCallback?: ({ code, message }: {
|
650
|
-
code: EventCallbackCode;
|
651
|
-
message: string;
|
652
|
-
}) => void;
|
653
|
-
loading?: {
|
654
|
-
showLoading: boolean;
|
655
|
-
onStartLoading?: () => void;
|
656
|
-
onEndLoading?: () => void;
|
657
|
-
};
|
658
|
-
}
|
649
|
+
export type IAppendParams = {
|
650
|
+
componentSign: componentSignEnum;
|
651
|
+
iframeNodesParams: IappendIframeNodesParams;
|
652
|
+
};
|
659
653
|
export interface IoptionsAddressParams {
|
660
654
|
environment?: string;
|
661
655
|
locale?: string;
|
package/esm/types/index.js
CHANGED
@@ -11,51 +11,55 @@
|
|
11
11
|
* SDK options
|
12
12
|
*/
|
13
13
|
|
14
|
-
export var
|
15
|
-
|
16
|
-
|
17
|
-
return
|
14
|
+
export var renderDisplayTypeEnum = /*#__PURE__*/function (renderDisplayTypeEnum) {
|
15
|
+
renderDisplayTypeEnum["popup"] = "popup";
|
16
|
+
renderDisplayTypeEnum["inline"] = "inline";
|
17
|
+
return renderDisplayTypeEnum;
|
18
18
|
}({});
|
19
19
|
export var ComponentSignEnumV2 = /*#__PURE__*/function (ComponentSignEnumV2) {
|
20
20
|
ComponentSignEnumV2["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
21
21
|
ComponentSignEnumV2["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
22
22
|
return ComponentSignEnumV2;
|
23
23
|
}({});
|
24
|
-
export var
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
24
|
+
export var componentSignEnum = /*#__PURE__*/function (componentSignEnum) {
|
25
|
+
componentSignEnum["EASY_PAY_WALLET"] = "EASY_PAY_WALLET";
|
26
|
+
componentSignEnum["EASY_PAY_APM"] = "EASY_PAY_APM";
|
27
|
+
componentSignEnum["CASHIER_PAYMENT_CARD"] = "CASHIER_PAYMENT_CARD";
|
28
|
+
componentSignEnum["CASHIER_PAYMENT_BANK"] = "CASHIER_PAYMENT_BANK";
|
29
|
+
componentSignEnum["CASHIER_PAYMENT_APM"] = "CASHIER_PAYMENT_APM";
|
30
|
+
componentSignEnum["AUTO_DEBIT_WALLET"] = "AUTO_DEBIT_WALLET";
|
31
|
+
componentSignEnum["AUTO_DEBIT_PAY_WALLET"] = "AUTO_DEBIT_PAY_WALLET";
|
32
|
+
componentSignEnum["NONE"] = "NONE";
|
33
|
+
componentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
|
34
|
+
componentSignEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
35
|
+
componentSignEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
36
|
+
componentSignEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
|
37
|
+
return componentSignEnum;
|
38
|
+
}({});
|
39
|
+
export var productSceneEnum = /*#__PURE__*/function (productSceneEnum) {
|
40
|
+
productSceneEnum["EASY_PAY"] = "EASY_PAY";
|
41
|
+
productSceneEnum["CASHIER_PAYMENT"] = "CASHIER_PAYMENT";
|
42
|
+
productSceneEnum["AUTO_DEBIT"] = "AUTO_DEBIT";
|
43
|
+
productSceneEnum["AUTO_DEBIT_PAY"] = "AUTO_DEBIT_PAY";
|
44
|
+
productSceneEnum["VAULTING"] = "VAULTING";
|
45
|
+
productSceneEnum["FLASH_BUY"] = "FLASH_BUY";
|
46
|
+
productSceneEnum["CARD_APPLE_PAY"] = "CARD_APPLE_PAY";
|
47
|
+
productSceneEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT";
|
48
|
+
productSceneEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS";
|
49
|
+
productSceneEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
|
50
|
+
return productSceneEnum;
|
51
|
+
}({});
|
52
|
+
export var paymentMethodCategoryTypeEnum = /*#__PURE__*/function (paymentMethodCategoryTypeEnum) {
|
53
|
+
paymentMethodCategoryTypeEnum["CARD"] = "CARD";
|
54
|
+
paymentMethodCategoryTypeEnum["WALLET"] = "WALLET";
|
55
|
+
paymentMethodCategoryTypeEnum["BANK"] = "BANK";
|
56
|
+
paymentMethodCategoryTypeEnum["APM"] = "APM";
|
57
|
+
paymentMethodCategoryTypeEnum["ALL"] = "ALL";
|
58
|
+
return paymentMethodCategoryTypeEnum;
|
58
59
|
}({});
|
60
|
+
|
61
|
+
/** 表单地址数据 */
|
62
|
+
|
59
63
|
export var payPalConfigurationIntentEnum = /*#__PURE__*/function (payPalConfigurationIntentEnum) {
|
60
64
|
payPalConfigurationIntentEnum["intent"] = "intent";
|
61
65
|
payPalConfigurationIntentEnum["capture"] = "capture";
|
@@ -84,11 +88,11 @@ export var networkModeEnum = /*#__PURE__*/function (networkModeEnum) {
|
|
84
88
|
networkModeEnum["session"] = "session";
|
85
89
|
return networkModeEnum;
|
86
90
|
}({});
|
87
|
-
export var
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
return
|
91
|
+
export var environmentEnum = /*#__PURE__*/function (environmentEnum) {
|
92
|
+
environmentEnum["sandbox"] = "sandbox";
|
93
|
+
environmentEnum["prod"] = "prod";
|
94
|
+
environmentEnum["light_sandbox"] = "light_sandbox";
|
95
|
+
return environmentEnum;
|
92
96
|
}({});
|
93
97
|
export var osTypeEnum = /*#__PURE__*/function (osTypeEnum) {
|
94
98
|
osTypeEnum["IOS"] = "IOS";
|
@@ -103,10 +107,10 @@ export var terminalTypeEnum = /*#__PURE__*/function (terminalTypeEnum) {
|
|
103
107
|
terminalTypeEnum["MINI_APP"] = "MINI_APP";
|
104
108
|
return terminalTypeEnum;
|
105
109
|
}({});
|
106
|
-
export var
|
107
|
-
|
108
|
-
|
109
|
-
return
|
110
|
+
export var platformEnum = /*#__PURE__*/function (platformEnum) {
|
111
|
+
platformEnum["desktop"] = "desktop";
|
112
|
+
platformEnum["mobile"] = "mobile";
|
113
|
+
return platformEnum;
|
110
114
|
}({});
|
111
115
|
|
112
116
|
/**
|
@@ -125,17 +129,17 @@ export var PlatformEnum = /*#__PURE__*/function (PlatformEnum) {
|
|
125
129
|
* @description Create an event handler, In pop-up layer mode, the user clicks the semi floating layer close button and is called.
|
126
130
|
*/
|
127
131
|
|
128
|
-
export var
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
return
|
133
|
-
}({});
|
134
|
-
export var
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
return
|
132
|
+
export var messageName = /*#__PURE__*/function (messageName) {
|
133
|
+
messageName["SDK_TO_APP"] = "SDK_TO_APP";
|
134
|
+
messageName["APP_TO_SDK"] = "APP_TO_SDK";
|
135
|
+
messageName["APP_TO_APP"] = "APP_TO_APP";
|
136
|
+
return messageName;
|
137
|
+
}({});
|
138
|
+
export var targetEnum = /*#__PURE__*/function (targetEnum) {
|
139
|
+
targetEnum["BLANK"] = "_blank";
|
140
|
+
targetEnum["SELF"] = "_self";
|
141
|
+
targetEnum["REPLACE"] = "_replace";
|
142
|
+
return targetEnum;
|
139
143
|
}({});
|
140
144
|
export var errorEnum = /*#__PURE__*/function (errorEnum) {
|
141
145
|
errorEnum["PARAMS"] = "PARAMS";
|
@@ -204,9 +208,4 @@ export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
|
|
204
208
|
ProductSceneVersion["V1"] = "1.0";
|
205
209
|
ProductSceneVersion["V2"] = "2.0";
|
206
210
|
return ProductSceneVersion;
|
207
|
-
}({});
|
208
|
-
export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
|
209
|
-
EventCallbackCode["Failed"] = "Failed";
|
210
|
-
EventCallbackCode["Completed"] = "Completed";
|
211
|
-
return EventCallbackCode;
|
212
211
|
}({});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { Iselector, renderDisplayTypeEnum } from '../types';
|
2
|
+
/**
|
3
|
+
* @description context中需要包含app节点,用于插入selector中
|
4
|
+
*/
|
5
|
+
export declare const createIframeNode: (context: any, selector: Iselector, renderDisplayType: renderDisplayTypeEnum) => Promise<void>;
|
6
|
+
export declare const createPreloadIframeNode: (virtualPreloadIframe: any) => void;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
5
|
+
* 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.
|
6
|
+
*/
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
8
|
+
import { getType } from '.';
|
9
|
+
import { ERRORMESSAGE, EVENT } from "../constant";
|
10
|
+
import { messageName, renderDisplayTypeEnum } from "../types";
|
11
|
+
/**
|
12
|
+
* @description context中需要包含app节点,用于插入selector中
|
13
|
+
*/
|
14
|
+
export var createIframeNode = function createIframeNode(context, selector, renderDisplayType) {
|
15
|
+
return new Promise(function (resolve, reject) {
|
16
|
+
var dorpinDom = null;
|
17
|
+
if (getType(selector) === 'string') {
|
18
|
+
dorpinDom = document.querySelector(selector);
|
19
|
+
}
|
20
|
+
if (dorpinDom === null) {
|
21
|
+
var error = {
|
22
|
+
code: ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR.code,
|
23
|
+
message: "Failed to execute 'querySelector' on 'Document': ".concat(selector, " is not a valid selector")
|
24
|
+
};
|
25
|
+
reject(error);
|
26
|
+
context._dispatchToSDK({
|
27
|
+
name: messageName.APP_TO_SDK,
|
28
|
+
instanceId: context.AMSSDK._instanceId,
|
29
|
+
context: {
|
30
|
+
event: EVENT.error.name,
|
31
|
+
data: error
|
32
|
+
}
|
33
|
+
});
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
if (renderDisplayType === renderDisplayTypeEnum.popup) dorpinDom.innerHTML = '';
|
37
|
+
if (context.app) {
|
38
|
+
dorpinDom.appendChild(context.app);
|
39
|
+
}
|
40
|
+
resolve();
|
41
|
+
});
|
42
|
+
};
|
43
|
+
export var createPreloadIframeNode = function createPreloadIframeNode(virtualPreloadIframe) {
|
44
|
+
var body = document.body || null;
|
45
|
+
if (body) {
|
46
|
+
body.appendChild(virtualPreloadIframe);
|
47
|
+
}
|
48
|
+
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { Logger } from './logger';
|
2
2
|
/**
|
3
3
|
* 通过配置规则检测 UA 和获得回跳 scheme
|
4
4
|
*/
|
5
|
-
export declare function getBackScheme(mockUa?: string, logger?:
|
5
|
+
export declare function getBackScheme(mockUa?: string, logger?: Logger): any;
|
@@ -1,81 +1,5 @@
|
|
1
|
-
|
2
|
-
|
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
|
-
|
1
|
+
import { isAndroid, isIOS } from "./ua";
|
2
|
+
import { RULES } from "../constant/index";
|
79
3
|
/**
|
80
4
|
* 通过配置规则检测 UA 和获得回跳 scheme
|
81
5
|
*/
|
@@ -115,20 +39,4 @@ function logBackScheme(logger, userAgent, scheme) {
|
|
115
39
|
backScheme: scheme
|
116
40
|
});
|
117
41
|
}
|
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);
|
134
42
|
}
|
package/esm/util/index.d.ts
CHANGED
@@ -5,6 +5,16 @@
|
|
5
5
|
* 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.
|
6
6
|
*/
|
7
7
|
declare const getType: (target: any) => string;
|
8
|
+
declare class EventCenter {
|
9
|
+
private events;
|
10
|
+
private eventsKey;
|
11
|
+
constructor();
|
12
|
+
on(name: string, func: any, key?: string): void;
|
13
|
+
off(name: string, func: any, key?: string): void;
|
14
|
+
emit(name: string, ...rest: any): void;
|
15
|
+
once(name: string, func: any, key?: string): void;
|
16
|
+
isExist(name: string): boolean;
|
17
|
+
}
|
8
18
|
declare const getViewPort: (key: string) => any;
|
9
19
|
declare const getOrigin: () => string;
|
10
20
|
declare const serialize: (obj: Record<string, string>) => string;
|
@@ -36,4 +46,4 @@ declare function loadSDKScript({ src, attrOptions, timeOut, loadCallback }: {
|
|
36
46
|
timeOut?: number;
|
37
47
|
loadCallback?: any;
|
38
48
|
}, logger: any): Promise<unknown>;
|
39
|
-
export { getType, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, loadSDKScript, };
|
49
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, loadSDKScript, };
|