@alipay/ams-checkout 0.0.1730107332-dev.3 → 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 -28
- 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 +38 -66
- package/esm/types/index.js +59 -63
- package/esm/util/createIframeNode.d.ts +6 -0
- package/esm/util/createIframeNode.js +48 -0
- package/esm/util/getBackScheme.d.ts +5 -0
- package/esm/util/getBackScheme.js +42 -0
- package/esm/util/index.d.ts +1 -1
- package/esm/util/index.js +4 -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 -362
- package/esm/foundation/index.d.ts +0 -71
- package/esm/foundation/index.js +0 -42
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -17
- package/esm/foundation/product-processor/easysafepay/deps.js +0 -11
- package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -27
- package/esm/foundation/product-processor/easysafepay/index.js +0 -587
- 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 -257
- 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 -99
- package/esm/foundation/utils/system_events.d.ts +0 -4
- package/esm/foundation/utils/system_events.js +0 -71
- package/esm/foundation/utils/web_app_url_utils.d.ts +0 -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,16 +106,14 @@ export interface IcreateComponent {
|
|
105
106
|
themeType?: string;
|
106
107
|
accentColor?: string;
|
107
108
|
};
|
109
|
+
isAppWebview?: boolean;
|
108
110
|
merchantAppointParam?: IMerchantAppointParam;
|
109
111
|
}
|
110
112
|
export interface IappendIframeNodesParams extends IcreateComponent {
|
111
|
-
paymentSessionMetaData:
|
112
|
-
renderDisplayType:
|
113
|
+
paymentSessionMetaData: IpaymentSessionMetaData;
|
114
|
+
renderDisplayType: renderDisplayTypeEnum;
|
113
115
|
selector?: Iselector;
|
114
116
|
paypalConfiguration?: IPaypalConfiguration;
|
115
|
-
connectFactor?: {
|
116
|
-
enableConnect: boolean;
|
117
|
-
};
|
118
117
|
/** 将address-element参数定义合入原参数定义 */
|
119
118
|
configParams?: {
|
120
119
|
hideFields?: string[];
|
@@ -198,8 +197,8 @@ export interface Isubmit {
|
|
198
197
|
billingAddress?: IbillingAddress;
|
199
198
|
}
|
200
199
|
export interface IpaymentSessionConfig {
|
201
|
-
productScene:
|
202
|
-
paymentMethodCategoryType
|
200
|
+
productScene: productSceneEnum;
|
201
|
+
paymentMethodCategoryType?: paymentMethodCategoryTypeEnum;
|
203
202
|
productSceneVersion: string;
|
204
203
|
}
|
205
204
|
export interface IpaymentSecurityConfig {
|
@@ -217,27 +216,14 @@ export interface IsecurityConfig {
|
|
217
216
|
h5gateway: string;
|
218
217
|
}
|
219
218
|
export interface InitSecurityConfig {
|
220
|
-
product:
|
219
|
+
product: productSceneEnum;
|
221
220
|
region?: string;
|
222
221
|
}
|
223
222
|
export interface frontModulesToBeLoadedInterface {
|
224
223
|
acquirerName: string;
|
225
224
|
scriptUrl: string;
|
226
225
|
}
|
227
|
-
export interface
|
228
|
-
amountConfirmRequired?: boolean;
|
229
|
-
autoDebitWithToken: boolean;
|
230
|
-
enableSignAgreement?: boolean;
|
231
|
-
skipSdkQuery: boolean;
|
232
|
-
requireFastSdk: boolean;
|
233
|
-
nonCompliant?: boolean;
|
234
|
-
skipSdkQueryForm?: {
|
235
|
-
value: boolean;
|
236
|
-
version: string;
|
237
|
-
platform: string;
|
238
|
-
};
|
239
|
-
}
|
240
|
-
export interface IPaymentSessionMetaData {
|
226
|
+
export interface IpaymentSessionMetaData {
|
241
227
|
clientId?: string;
|
242
228
|
renderDisplayType?: string;
|
243
229
|
paymentSessionConfig?: IpaymentSessionConfig;
|
@@ -245,7 +231,18 @@ export interface IPaymentSessionMetaData {
|
|
245
231
|
moneyView?: any;
|
246
232
|
extendInfo?: string;
|
247
233
|
paymentMethodInfoView?: any;
|
248
|
-
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
|
+
};
|
249
246
|
authUrlInfo?: {
|
250
247
|
appIdentifier?: string;
|
251
248
|
applinkUrl?: string;
|
@@ -316,9 +313,6 @@ export interface IPaymentSessionMetaData {
|
|
316
313
|
};
|
317
314
|
frontModulesToBeLoaded?: frontModulesToBeLoadedInterface[];
|
318
315
|
};
|
319
|
-
connectFactor?: {
|
320
|
-
enableConnect?: boolean;
|
321
|
-
};
|
322
316
|
}
|
323
317
|
export interface IPaymentSessionFactor {
|
324
318
|
merchantInfo?: IMerchantInfo;
|
@@ -365,7 +359,7 @@ export declare enum networkModeEnum {
|
|
365
359
|
export interface IcheckoutState {
|
366
360
|
paymentMethodType?: string;
|
367
361
|
}
|
368
|
-
export declare enum
|
362
|
+
export declare enum environmentEnum {
|
369
363
|
sandbox = "sandbox",
|
370
364
|
prod = "prod",
|
371
365
|
light_sandbox = "light_sandbox"
|
@@ -386,7 +380,7 @@ export interface Ienv {
|
|
386
380
|
terminalType: terminalTypeEnum;
|
387
381
|
environment: string;
|
388
382
|
}
|
389
|
-
export declare enum
|
383
|
+
export declare enum platformEnum {
|
390
384
|
desktop = "desktop",
|
391
385
|
mobile = "mobile"
|
392
386
|
}
|
@@ -440,19 +434,19 @@ export type callOnBeforeSubmit = (state?: Record<string, any>) => Promise<onBefo
|
|
440
434
|
* @description Create an event handler, In pop-up layer mode, the user clicks the semi floating layer close button and is called.
|
441
435
|
*/
|
442
436
|
export type callOnClose = () => void;
|
443
|
-
export declare enum
|
437
|
+
export declare enum messageName {
|
444
438
|
SDK_TO_APP = "SDK_TO_APP",
|
445
439
|
APP_TO_SDK = "APP_TO_SDK",
|
446
440
|
APP_TO_APP = "APP_TO_APP"
|
447
441
|
}
|
448
|
-
export interface
|
449
|
-
name:
|
442
|
+
export interface eventPayload {
|
443
|
+
name: messageName;
|
450
444
|
mode?: string;
|
451
445
|
appId?: string;
|
452
446
|
instanceId: string;
|
453
|
-
context:
|
447
|
+
context: eventPayloadContext;
|
454
448
|
}
|
455
|
-
export interface
|
449
|
+
export interface eventPayloadContext {
|
456
450
|
event: string;
|
457
451
|
data: any;
|
458
452
|
eventCallbackId?: string;
|
@@ -468,7 +462,7 @@ export interface AMSCheckoutOptions {
|
|
468
462
|
export interface Ianalytics {
|
469
463
|
enabled: boolean;
|
470
464
|
}
|
471
|
-
export declare enum
|
465
|
+
export declare enum targetEnum {
|
472
466
|
BLANK = "_blank",
|
473
467
|
SELF = "_self",
|
474
468
|
REPLACE = "_replace"
|
@@ -537,7 +531,6 @@ export interface CashierSubmitPayRequest {
|
|
537
531
|
verifyFactors?: Record<string, string>;
|
538
532
|
paymentSessionData: string;
|
539
533
|
paymentSessionConfig?: any;
|
540
|
-
traceId?: string;
|
541
534
|
extParams?: any;
|
542
535
|
}
|
543
536
|
export interface CashierSdkActionQueryResult {
|
@@ -555,7 +548,6 @@ export interface CashierSdkActionQueryResult {
|
|
555
548
|
normalUrl?: string;
|
556
549
|
applinkUrl?: string;
|
557
550
|
schemeUrl?: string;
|
558
|
-
traceId?: string;
|
559
551
|
authUrl?: string;
|
560
552
|
extendInfo?: {
|
561
553
|
channelOrderId?: string;
|
@@ -601,7 +593,6 @@ export interface CashierSubmitPayResult {
|
|
601
593
|
normalUrl?: string;
|
602
594
|
errorStatus?: string;
|
603
595
|
message?: string;
|
604
|
-
traceId?: string;
|
605
596
|
}
|
606
597
|
export declare enum eventCodeEnum {
|
607
598
|
SDK_START_OF_LOADING = "SDK_START_OF_LOADING",
|
@@ -656,28 +647,9 @@ export declare enum ProductSceneVersion {
|
|
656
647
|
V2 = "2.0"
|
657
648
|
}
|
658
649
|
export type IAppendParams = {
|
659
|
-
componentSign:
|
650
|
+
componentSign: componentSignEnum;
|
660
651
|
iframeNodesParams: IappendIframeNodesParams;
|
661
652
|
};
|
662
|
-
export declare enum EventCallbackCode {
|
663
|
-
Failed = "Failed",
|
664
|
-
Completed = "Completed"
|
665
|
-
}
|
666
|
-
export interface IElementOptions {
|
667
|
-
sessionData: string;
|
668
|
-
environment?: string;
|
669
|
-
locale?: string;
|
670
|
-
mode?: string;
|
671
|
-
onEventCallback?: ({ code, message }: {
|
672
|
-
code: EventCallbackCode;
|
673
|
-
message: string;
|
674
|
-
}) => void;
|
675
|
-
loading?: {
|
676
|
-
showLoading: boolean;
|
677
|
-
onStartLoading?: () => void;
|
678
|
-
onEndLoading?: () => void;
|
679
|
-
};
|
680
|
-
}
|
681
653
|
export interface IoptionsAddressParams {
|
682
654
|
environment?: string;
|
683
655
|
locale?: string;
|
package/esm/types/index.js
CHANGED
@@ -11,50 +11,51 @@
|
|
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
|
}({});
|
59
60
|
|
60
61
|
/** 表单地址数据 */
|
@@ -87,11 +88,11 @@ export var networkModeEnum = /*#__PURE__*/function (networkModeEnum) {
|
|
87
88
|
networkModeEnum["session"] = "session";
|
88
89
|
return networkModeEnum;
|
89
90
|
}({});
|
90
|
-
export var
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
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;
|
95
96
|
}({});
|
96
97
|
export var osTypeEnum = /*#__PURE__*/function (osTypeEnum) {
|
97
98
|
osTypeEnum["IOS"] = "IOS";
|
@@ -106,10 +107,10 @@ export var terminalTypeEnum = /*#__PURE__*/function (terminalTypeEnum) {
|
|
106
107
|
terminalTypeEnum["MINI_APP"] = "MINI_APP";
|
107
108
|
return terminalTypeEnum;
|
108
109
|
}({});
|
109
|
-
export var
|
110
|
-
|
111
|
-
|
112
|
-
return
|
110
|
+
export var platformEnum = /*#__PURE__*/function (platformEnum) {
|
111
|
+
platformEnum["desktop"] = "desktop";
|
112
|
+
platformEnum["mobile"] = "mobile";
|
113
|
+
return platformEnum;
|
113
114
|
}({});
|
114
115
|
|
115
116
|
/**
|
@@ -128,17 +129,17 @@ export var PlatformEnum = /*#__PURE__*/function (PlatformEnum) {
|
|
128
129
|
* @description Create an event handler, In pop-up layer mode, the user clicks the semi floating layer close button and is called.
|
129
130
|
*/
|
130
131
|
|
131
|
-
export var
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
return
|
136
|
-
}({});
|
137
|
-
export var
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
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;
|
142
143
|
}({});
|
143
144
|
export var errorEnum = /*#__PURE__*/function (errorEnum) {
|
144
145
|
errorEnum["PARAMS"] = "PARAMS";
|
@@ -207,9 +208,4 @@ export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
|
|
207
208
|
ProductSceneVersion["V1"] = "1.0";
|
208
209
|
ProductSceneVersion["V2"] = "2.0";
|
209
210
|
return ProductSceneVersion;
|
210
|
-
}({});
|
211
|
-
export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
|
212
|
-
EventCallbackCode["Failed"] = "Failed";
|
213
|
-
EventCallbackCode["Completed"] = "Completed";
|
214
|
-
return EventCallbackCode;
|
215
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
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { isAndroid, isIOS } from "./ua";
|
2
|
+
import { RULES } from "../constant/index";
|
3
|
+
/**
|
4
|
+
* 通过配置规则检测 UA 和获得回跳 scheme
|
5
|
+
*/
|
6
|
+
export function getBackScheme(mockUa, logger) {
|
7
|
+
var ua = mockUa || window.navigator.userAgent || '';
|
8
|
+
// 获取规则
|
9
|
+
var uaMatchedRule = RULES;
|
10
|
+
var matchedRule;
|
11
|
+
var matched = null;
|
12
|
+
for (var i = 0; i < uaMatchedRule.length; i++) {
|
13
|
+
var rule = uaMatchedRule[i];
|
14
|
+
matched = ua.match(rule.matchRule);
|
15
|
+
if (matched) {
|
16
|
+
matchedRule = rule;
|
17
|
+
break;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
if (!matchedRule) {
|
21
|
+
logBackScheme(logger, ua, '');
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
if (isAndroid(ua)) {
|
25
|
+
logBackScheme(logger, ua, matchedRule.andScheme);
|
26
|
+
return matchedRule.andScheme;
|
27
|
+
}
|
28
|
+
if (isIOS(ua)) {
|
29
|
+
logBackScheme(logger, ua, matchedRule.iosScheme);
|
30
|
+
return matchedRule.iosScheme;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
function logBackScheme(logger, userAgent, scheme) {
|
34
|
+
if (logger) {
|
35
|
+
logger.logInfo({
|
36
|
+
title: 'a3753.b101271.c377460'
|
37
|
+
}, {
|
38
|
+
userAgent: userAgent,
|
39
|
+
backScheme: scheme
|
40
|
+
});
|
41
|
+
}
|
42
|
+
}
|
package/esm/util/index.d.ts
CHANGED
@@ -4,6 +4,7 @@
|
|
4
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
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
|
+
declare const getType: (target: any) => string;
|
7
8
|
declare class EventCenter {
|
8
9
|
private events;
|
9
10
|
private eventsKey;
|
@@ -14,7 +15,6 @@ declare class EventCenter {
|
|
14
15
|
once(name: string, func: any, key?: string): void;
|
15
16
|
isExist(name: string): boolean;
|
16
17
|
}
|
17
|
-
declare const getType: (target: any) => string;
|
18
18
|
declare const getViewPort: (key: string) => any;
|
19
19
|
declare const getOrigin: () => string;
|
20
20
|
declare const serialize: (obj: Record<string, string>) => string;
|
package/esm/util/index.js
CHANGED
@@ -12,6 +12,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
12
12
|
* 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.
|
13
13
|
*/
|
14
14
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
15
|
+
|
16
|
+
var getType = function getType(target) {
|
17
|
+
return Object.prototype.toString.call(target).slice(8, -1).toLowerCase();
|
18
|
+
};
|
15
19
|
var EventCenter = /*#__PURE__*/function () {
|
16
20
|
function EventCenter() {
|
17
21
|
_classCallCheck(this, EventCenter);
|
@@ -87,9 +91,6 @@ var EventCenter = /*#__PURE__*/function () {
|
|
87
91
|
}]);
|
88
92
|
return EventCenter;
|
89
93
|
}();
|
90
|
-
var getType = function getType(target) {
|
91
|
-
return Object.prototype.toString.call(target).slice(8, -1).toLowerCase();
|
92
|
-
};
|
93
94
|
var getViewPort = function getViewPort(key) {
|
94
95
|
var meta = document.getElementsByTagName('meta');
|
95
96
|
// HTMLMetaElement
|
@@ -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",
|
@@ -8,8 +8,8 @@ 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 {
|
12
|
-
import APDID from "
|
11
|
+
import { productSceneEnum } from "../types";
|
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);
|
15
15
|
};
|
@@ -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": "0.0.
|
3
|
+
"version": "0.0.1730441340-dev.0",
|
4
4
|
"description": "",
|
5
5
|
"author": "",
|
6
6
|
"main": "esm/index.js",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
],
|
16
16
|
"scripts": {
|
17
17
|
"build": "father build",
|
18
|
-
"
|
18
|
+
"dev": "father dev",
|
19
19
|
"ci": "npm run lint",
|
20
20
|
"cov": "jest --coverage",
|
21
21
|
"format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
|