@alipay/ams-checkout 0.0.1725951289-dev.4 → 0.0.1726046231-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 -8
- package/esm/constant/index.js +9 -81
- package/esm/core/bus/ability/globalData.d.ts +10 -0
- package/esm/core/bus/ability/globalData.js +89 -0
- package/esm/core/bus/ability/request.d.ts +10 -0
- package/esm/core/bus/ability/request.js +151 -0
- package/esm/core/bus/interface.d.ts +12 -0
- package/esm/core/bus/interface.js +16 -2
- package/esm/core/component/address.d.ts +2 -2
- package/esm/core/component/appPreloadProcessing.js +2 -0
- package/esm/core/component/ckp/index.d.ts +3 -3
- package/esm/core/component/ckp/index.js +3 -3
- package/esm/core/component/element/components/address.d.ts +17 -0
- package/esm/core/component/element/components/address.js +63 -0
- package/esm/core/component/element/components/auth.d.ts +17 -0
- package/esm/core/component/element/components/auth.js +54 -0
- package/esm/core/component/element/components/payment.d.ts +17 -0
- package/esm/core/component/element/components/payment.js +67 -0
- package/esm/core/component/element/index.d.ts +44 -0
- package/esm/core/component/element/index.js +615 -0
- package/esm/core/component/element/mock.d.ts +3 -0
- package/esm/core/component/element/mock.js +1156 -0
- package/esm/core/component/element/type.d.ts +120 -0
- package/esm/core/component/element/type.js +14 -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 +5 -5
- package/esm/core/component/index.js +20 -16
- package/esm/core/drop-in/index.d.ts +2 -2
- package/esm/core/drop-in/index.js +2 -2
- package/esm/core/instance/index.d.ts +5 -6
- package/esm/core/instance/index.js +11 -14
- package/esm/foundation/core/index.d.ts +26 -0
- package/esm/foundation/core/index.js +301 -0
- package/esm/foundation/index.d.ts +71 -0
- package/esm/foundation/index.js +42 -0
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +15 -0
- package/esm/foundation/product-processor/easysafepay/deps.js +9 -0
- package/esm/foundation/product-processor/easysafepay/index.d.ts +26 -0
- package/esm/foundation/product-processor/easysafepay/index.js +536 -0
- package/esm/foundation/service/container/index.d.ts +28 -0
- package/esm/foundation/service/container/index.js +255 -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-bus/ability/callback.d.ts +9 -0
- package/esm/foundation/service/event-bus/ability/callback.js +55 -0
- package/esm/foundation/service/event-bus/ability/globalData.d.ts +10 -0
- package/esm/foundation/service/event-bus/ability/globalData.js +89 -0
- package/esm/foundation/service/event-bus/ability/request.d.ts +10 -0
- package/esm/foundation/service/event-bus/ability/request.js +151 -0
- package/esm/foundation/service/event-bus/ability/security.d.ts +12 -0
- package/esm/foundation/service/event-bus/ability/security.js +151 -0
- package/esm/foundation/service/event-bus/ability/tracker.d.ts +9 -0
- package/esm/foundation/service/event-bus/ability/tracker.js +80 -0
- package/esm/foundation/service/event-bus/busManager.d.ts +127 -0
- package/esm/foundation/service/event-bus/busManager.js +398 -0
- package/esm/foundation/service/event-bus/index.d.ts +20 -0
- package/esm/foundation/service/event-bus/index.js +88 -0
- package/esm/foundation/service/event-center.d.ts +75 -0
- package/esm/foundation/service/event-center.js +244 -0
- package/esm/foundation/service/global-data/index.d.ts +11 -0
- package/esm/foundation/service/global-data/index.js +69 -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 +211 -0
- package/esm/foundation/service/security/index.d.ts +26 -0
- package/esm/foundation/service/security/index.js +216 -0
- package/esm/{util → foundation/service/security}/security.d.ts +2 -2
- package/esm/{util → foundation/service/security}/security.js +3 -3
- package/esm/foundation/types/index.d.ts +4 -0
- package/esm/foundation/types/index.js +4 -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/redirect_utils.d.ts +6 -0
- package/esm/foundation/utils/redirect_utils.js +99 -0
- package/esm/foundation/utils/system_events.d.ts +4 -0
- package/esm/foundation/utils/system_events.js +71 -0
- package/esm/foundation/utils/web_app_url_utils.d.ts +37 -0
- package/esm/foundation/utils/web_app_url_utils.js +97 -0
- package/esm/index.d.ts +16 -10
- package/esm/index.js +70 -59
- 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 +16 -8
- package/esm/plugin/component/channel.d.ts +3 -4
- package/esm/plugin/component/channel.js +1 -37
- package/esm/plugin/component/component.inline.style.d.ts +4 -4
- package/esm/plugin/component/component.inline.style.js +10 -7
- package/esm/plugin/component/component.popup.style.d.ts +15 -6
- package/esm/plugin/component/component.popup.style.js +33 -15
- package/esm/plugin/component/index.d.ts +7 -8
- package/esm/plugin/component/index.js +130 -176
- 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/payment-element/utils.d.ts +1 -1
- package/esm/plugin/payment-element/utils.js +2 -1
- package/esm/plugin/type.d.ts +4 -4
- 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 +257 -39
- package/esm/types/index.js +107 -59
- package/esm/util/createIframeNode.d.ts +2 -2
- package/esm/util/createIframeNode.js +3 -3
- package/esm/util/index.d.ts +1 -1
- package/esm/util/index.js +3 -4
- package/package.json +2 -2
- package/esm/util/getBackScheme.d.ts +0 -5
- package/esm/util/getBackScheme.js +0 -42
- 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.d.ts
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
* 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
|
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
|
+
export * from '../core/component/element/type';
|
8
9
|
export type onChange = () => onCnageResult;
|
9
10
|
interface onCnageResult {
|
10
11
|
complete: boolean;
|
@@ -19,7 +20,7 @@ interface AddressValueResult {
|
|
19
20
|
/**
|
20
21
|
* SDK options
|
21
22
|
*/
|
22
|
-
export interface
|
23
|
+
export interface IOptionsParams {
|
23
24
|
environment?: string;
|
24
25
|
locale?: string;
|
25
26
|
onError?: callOnError;
|
@@ -37,10 +38,10 @@ export interface IoptionsParams {
|
|
37
38
|
product?: string;
|
38
39
|
onBeforeSubmit?: callOnBeforeSubmit;
|
39
40
|
}
|
40
|
-
export interface IApplePayOptionsParams extends Pick<
|
41
|
+
export interface IApplePayOptionsParams extends Pick<IOptionsParams, 'locale' | 'environment' | 'onEventCallback' | 'analytics'> {
|
41
42
|
}
|
42
43
|
export type Iselector = string;
|
43
|
-
export declare enum
|
44
|
+
export declare enum DisplayTypeEnum {
|
44
45
|
'popup' = "popup",
|
45
46
|
'inline' = "inline"
|
46
47
|
}
|
@@ -57,7 +58,7 @@ export declare enum ComponentSignEnumV2 {
|
|
57
58
|
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT_ALL",
|
58
59
|
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL"
|
59
60
|
}
|
60
|
-
export declare enum
|
61
|
+
export declare enum ComponentSignEnum {
|
61
62
|
'EASY_PAY_WALLET' = "EASY_PAY_WALLET",
|
62
63
|
'EASY_PAY_APM' = "EASY_PAY_APM",
|
63
64
|
'CASHIER_PAYMENT_CARD' = "CASHIER_PAYMENT_CARD",
|
@@ -68,10 +69,9 @@ export declare enum componentSignEnum {
|
|
68
69
|
'NONE' = "NONE",
|
69
70
|
'VAULTING_CARD' = "VAULTING_CARD",
|
70
71
|
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT_ALL",
|
71
|
-
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL"
|
72
|
-
'CHECKOUT_PAYMENT' = "CHECKOUT_PAYMENT"
|
72
|
+
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL"
|
73
73
|
}
|
74
|
-
export declare enum
|
74
|
+
export declare enum ProductSceneEnum {
|
75
75
|
'EASY_PAY' = "EASY_PAY",
|
76
76
|
'CASHIER_PAYMENT' = "CASHIER_PAYMENT",
|
77
77
|
'AUTO_DEBIT' = "AUTO_DEBIT",
|
@@ -83,7 +83,7 @@ export declare enum productSceneEnum {
|
|
83
83
|
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS",
|
84
84
|
'CHECKOUT_PAYMENT' = "CHECKOUT_PAYMENT"
|
85
85
|
}
|
86
|
-
export declare enum
|
86
|
+
export declare enum PaymentMethodCategoryTypeEnum {
|
87
87
|
'CARD' = "CARD",
|
88
88
|
'WALLET' = "WALLET",
|
89
89
|
'BANK' = "BANK",
|
@@ -92,28 +92,34 @@ export declare enum paymentMethodCategoryTypeEnum {
|
|
92
92
|
}
|
93
93
|
export interface DeviceIdParameter {
|
94
94
|
scene?: string;
|
95
|
-
productScene?:
|
96
|
-
paymentMethodCategoryType?:
|
95
|
+
productScene?: ProductSceneEnum;
|
96
|
+
paymentMethodCategoryType?: PaymentMethodCategoryTypeEnum;
|
97
97
|
tokenCollectTime?: string;
|
98
98
|
dataPollingInterval?: string;
|
99
99
|
}
|
100
100
|
export interface IcreateComponent {
|
101
101
|
sessionData: string;
|
102
102
|
paymentSessionData?: string;
|
103
|
+
debugProps?: {
|
104
|
+
localLink: string;
|
105
|
+
};
|
106
|
+
appendAliasContainerId?: boolean;
|
103
107
|
notRedirectAfterComplete?: boolean;
|
104
108
|
appearance?: {
|
105
109
|
[x: string]: any;
|
106
110
|
themeType?: string;
|
107
111
|
accentColor?: string;
|
108
112
|
};
|
109
|
-
isAppWebview?: boolean;
|
110
113
|
merchantAppointParam?: IMerchantAppointParam;
|
111
114
|
}
|
112
115
|
export interface IappendIframeNodesParams extends IcreateComponent {
|
113
|
-
paymentSessionMetaData:
|
114
|
-
renderDisplayType:
|
116
|
+
paymentSessionMetaData: IPaymentSessionMetaData;
|
117
|
+
renderDisplayType: DisplayTypeEnum;
|
115
118
|
selector?: Iselector;
|
116
119
|
paypalConfiguration?: IPaypalConfiguration;
|
120
|
+
connectFactor?: {
|
121
|
+
enableConnect: boolean;
|
122
|
+
};
|
117
123
|
/** 将address-element参数定义合入原参数定义 */
|
118
124
|
configParams?: {
|
119
125
|
hideFields?: string[];
|
@@ -197,8 +203,8 @@ export interface Isubmit {
|
|
197
203
|
billingAddress?: IbillingAddress;
|
198
204
|
}
|
199
205
|
export interface IpaymentSessionConfig {
|
200
|
-
productScene:
|
201
|
-
paymentMethodCategoryType
|
206
|
+
productScene: ProductSceneEnum;
|
207
|
+
paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
|
202
208
|
productSceneVersion: string;
|
203
209
|
}
|
204
210
|
export interface IpaymentSecurityConfig {
|
@@ -216,14 +222,26 @@ export interface IsecurityConfig {
|
|
216
222
|
h5gateway: string;
|
217
223
|
}
|
218
224
|
export interface InitSecurityConfig {
|
219
|
-
product:
|
225
|
+
product: ProductSceneEnum;
|
220
226
|
region?: string;
|
221
227
|
}
|
222
228
|
export interface frontModulesToBeLoadedInterface {
|
223
229
|
acquirerName: string;
|
224
230
|
scriptUrl: string;
|
225
231
|
}
|
226
|
-
export interface
|
232
|
+
export interface PaymentSessionActionData {
|
233
|
+
amountConfirmRequired?: boolean;
|
234
|
+
autoDebitWithToken: boolean;
|
235
|
+
enableSignAgreement?: boolean;
|
236
|
+
skipSdkQuery: boolean;
|
237
|
+
requireFastSdk: boolean;
|
238
|
+
skipSdkQueryForm?: {
|
239
|
+
value: boolean;
|
240
|
+
version: string;
|
241
|
+
platform: string;
|
242
|
+
};
|
243
|
+
}
|
244
|
+
export interface IPaymentSessionMetaData {
|
227
245
|
clientId?: string;
|
228
246
|
renderDisplayType?: string;
|
229
247
|
paymentSessionConfig?: IpaymentSessionConfig;
|
@@ -231,18 +249,7 @@ export interface IpaymentSessionMetaData {
|
|
231
249
|
moneyView?: any;
|
232
250
|
extendInfo?: string;
|
233
251
|
paymentMethodInfoView?: any;
|
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
|
-
};
|
252
|
+
action?: PaymentSessionActionData;
|
246
253
|
authUrlInfo?: {
|
247
254
|
appIdentifier?: string;
|
248
255
|
applinkUrl?: string;
|
@@ -313,6 +320,9 @@ export interface IpaymentSessionMetaData {
|
|
313
320
|
};
|
314
321
|
frontModulesToBeLoaded?: frontModulesToBeLoadedInterface[];
|
315
322
|
};
|
323
|
+
connectFactor?: {
|
324
|
+
enableConnect?: boolean;
|
325
|
+
};
|
316
326
|
}
|
317
327
|
export interface IPaymentSessionFactor {
|
318
328
|
merchantInfo?: IMerchantInfo;
|
@@ -359,7 +369,7 @@ export declare enum networkModeEnum {
|
|
359
369
|
export interface IcheckoutState {
|
360
370
|
paymentMethodType?: string;
|
361
371
|
}
|
362
|
-
export declare enum
|
372
|
+
export declare enum EnvironmentEnum {
|
363
373
|
sandbox = "sandbox",
|
364
374
|
prod = "prod",
|
365
375
|
light_sandbox = "light_sandbox"
|
@@ -380,7 +390,7 @@ export interface Ienv {
|
|
380
390
|
terminalType: terminalTypeEnum;
|
381
391
|
environment: string;
|
382
392
|
}
|
383
|
-
export declare enum
|
393
|
+
export declare enum PlatformEnum {
|
384
394
|
desktop = "desktop",
|
385
395
|
mobile = "mobile"
|
386
396
|
}
|
@@ -434,19 +444,19 @@ export type callOnBeforeSubmit = (state?: Record<string, any>) => Promise<onBefo
|
|
434
444
|
* @description Create an event handler, In pop-up layer mode, the user clicks the semi floating layer close button and is called.
|
435
445
|
*/
|
436
446
|
export type callOnClose = () => void;
|
437
|
-
export declare enum
|
447
|
+
export declare enum MessageName {
|
438
448
|
SDK_TO_APP = "SDK_TO_APP",
|
439
449
|
APP_TO_SDK = "APP_TO_SDK",
|
440
450
|
APP_TO_APP = "APP_TO_APP"
|
441
451
|
}
|
442
|
-
export interface
|
443
|
-
name:
|
452
|
+
export interface EventPayload {
|
453
|
+
name: MessageName;
|
444
454
|
mode?: string;
|
445
455
|
appId?: string;
|
446
456
|
instanceId: string;
|
447
|
-
context:
|
457
|
+
context: EventPayloadContext;
|
448
458
|
}
|
449
|
-
export interface
|
459
|
+
export interface EventPayloadContext {
|
450
460
|
event: string;
|
451
461
|
data: any;
|
452
462
|
eventCallbackId?: string;
|
@@ -462,7 +472,7 @@ export interface AMSCheckoutOptions {
|
|
462
472
|
export interface Ianalytics {
|
463
473
|
enabled: boolean;
|
464
474
|
}
|
465
|
-
export declare enum
|
475
|
+
export declare enum TargetEnum {
|
466
476
|
BLANK = "_blank",
|
467
477
|
SELF = "_self",
|
468
478
|
REPLACE = "_replace"
|
@@ -647,9 +657,218 @@ export declare enum ProductSceneVersion {
|
|
647
657
|
V2 = "2.0"
|
648
658
|
}
|
649
659
|
export type IAppendParams = {
|
650
|
-
componentSign:
|
660
|
+
componentSign: ComponentSignEnum;
|
651
661
|
iframeNodesParams: IappendIframeNodesParams;
|
652
662
|
};
|
663
|
+
export declare enum EventCallbackCode {
|
664
|
+
Failed = "Failed",
|
665
|
+
Completed = "Completed"
|
666
|
+
}
|
667
|
+
export interface IElementOptions {
|
668
|
+
sessionData: string;
|
669
|
+
environment?: string;
|
670
|
+
locale?: string;
|
671
|
+
mode?: string;
|
672
|
+
onEventCallback?: ({ code, message }: {
|
673
|
+
code: EventCallbackCode;
|
674
|
+
message: string;
|
675
|
+
}) => void;
|
676
|
+
loading?: {
|
677
|
+
onStartLoading: () => void;
|
678
|
+
onEndLoading: () => void;
|
679
|
+
};
|
680
|
+
}
|
681
|
+
export declare enum AccountStatusEnum {
|
682
|
+
EFFECTIVE = "EFFECTIVE",
|
683
|
+
UNREGISTERED = "UNREGISTERED"
|
684
|
+
}
|
685
|
+
export type IAccountInfo = {
|
686
|
+
email?: string;
|
687
|
+
verifyId?: string;
|
688
|
+
accountStatus?: AccountStatusEnum;
|
689
|
+
oneAccountId?: string;
|
690
|
+
needOtp?: boolean;
|
691
|
+
errorMsg?: string;
|
692
|
+
inputStatus?: 'success' | 'loading' | 'error' | 'focused' | '';
|
693
|
+
resendLeftTimes?: number;
|
694
|
+
};
|
695
|
+
export interface AccountQueryRequest {
|
696
|
+
paymentSessionData: string;
|
697
|
+
paymentSessionConfig: any;
|
698
|
+
accountInfo: IAccountInfo;
|
699
|
+
}
|
700
|
+
export interface ShippingsItem {
|
701
|
+
shippingName: {
|
702
|
+
firstName: string;
|
703
|
+
lastName: string;
|
704
|
+
};
|
705
|
+
prefer: '1' | '0';
|
706
|
+
shippingId: string;
|
707
|
+
shippingPhoneNo: string;
|
708
|
+
shippingAddress: {
|
709
|
+
region: string;
|
710
|
+
state: string;
|
711
|
+
city: string;
|
712
|
+
address1: string;
|
713
|
+
address2: string;
|
714
|
+
zipCode: string;
|
715
|
+
};
|
716
|
+
}
|
717
|
+
export interface ISubPaymentElementView {
|
718
|
+
defaultText: string;
|
719
|
+
defaultValue: string;
|
720
|
+
elementMandatory: boolean;
|
721
|
+
elementRegx?: string;
|
722
|
+
elementType: string;
|
723
|
+
extendInfo: string;
|
724
|
+
paramIllegalText: string;
|
725
|
+
paymentElementKey: string;
|
726
|
+
title: string;
|
727
|
+
validateFunction?: string;
|
728
|
+
isPart?: boolean;
|
729
|
+
isPartEnd?: boolean;
|
730
|
+
}
|
731
|
+
export interface IPaymentElement {
|
732
|
+
defaultValue: string;
|
733
|
+
elementMandatory: boolean;
|
734
|
+
elementType: string;
|
735
|
+
extendInfo: string;
|
736
|
+
paymentElementKey: string;
|
737
|
+
subPaymentElementView: ISubPaymentElementView[];
|
738
|
+
title: string;
|
739
|
+
}
|
740
|
+
export declare enum InterActionTypeEnum {
|
741
|
+
COLLECT_REDIRECT = "COLLECT_REDIRECT",
|
742
|
+
SHOW_CODE = "SHOW_CODE",
|
743
|
+
COLLECT_SHOW_CODE = "COLLECT_SHOW_CODE",
|
744
|
+
REDIRECT = "REDIRECT"
|
745
|
+
}
|
746
|
+
export interface IAmount {
|
747
|
+
amount?: string;
|
748
|
+
currency: string;
|
749
|
+
currencyLabel: string;
|
750
|
+
formattedAmount?: string;
|
751
|
+
formattedAmountWithCurrency?: string;
|
752
|
+
value: string;
|
753
|
+
}
|
754
|
+
export interface IAmountView {
|
755
|
+
currency: string;
|
756
|
+
currencyDivider: string;
|
757
|
+
currencyLabel: string;
|
758
|
+
currencySymbolPosition: 'L' | 'R';
|
759
|
+
formattedValue: string;
|
760
|
+
value: string;
|
761
|
+
}
|
762
|
+
export interface IPaymentMethod {
|
763
|
+
paymentMethodKey?: string;
|
764
|
+
antomPage?: string;
|
765
|
+
redirectUrl?: string;
|
766
|
+
icon?: string;
|
767
|
+
iconName?: string;
|
768
|
+
logoList?: Array<{
|
769
|
+
cardBrand: string;
|
770
|
+
logoUrl: string;
|
771
|
+
}>;
|
772
|
+
paymentMethod?: string;
|
773
|
+
paymentMethodName: string;
|
774
|
+
paymentMethodType: string;
|
775
|
+
category?: string;
|
776
|
+
paymentElements?: IPaymentElement[];
|
777
|
+
paymentMethodId?: string;
|
778
|
+
paymentMethodDetail?: {
|
779
|
+
last4?: string;
|
780
|
+
requireIssuerAuthentication?: string;
|
781
|
+
};
|
782
|
+
interActionType?: InterActionTypeEnum;
|
783
|
+
recommend?: boolean;
|
784
|
+
expressCheckout?: boolean;
|
785
|
+
webRedirectType?: string;
|
786
|
+
paymentCurrencyList?: string[];
|
787
|
+
paymentAmount?: IAmount;
|
788
|
+
paymentAmountView?: IAmountView;
|
789
|
+
paymentQuoteId?: string;
|
790
|
+
}
|
791
|
+
interface Estimate {
|
792
|
+
unit: string;
|
793
|
+
value: number;
|
794
|
+
}
|
795
|
+
interface DeliveryEstimate {
|
796
|
+
maximum: Estimate;
|
797
|
+
minimum: Estimate;
|
798
|
+
}
|
799
|
+
interface FixedAmount {
|
800
|
+
amount: number;
|
801
|
+
currency: string;
|
802
|
+
}
|
803
|
+
interface ShippingRateData {
|
804
|
+
displayName: string;
|
805
|
+
deliveryEstimate: DeliveryEstimate;
|
806
|
+
fixedAmount: FixedAmount;
|
807
|
+
}
|
808
|
+
export interface ShippingAddress {
|
809
|
+
address1: string;
|
810
|
+
address2: string;
|
811
|
+
city: string;
|
812
|
+
region: string;
|
813
|
+
state: string;
|
814
|
+
zipCode: string;
|
815
|
+
}
|
816
|
+
export interface IUserName {
|
817
|
+
firstName: string;
|
818
|
+
middleName?: string;
|
819
|
+
lastName: string;
|
820
|
+
fullName?: string;
|
821
|
+
}
|
822
|
+
export type Shippings = ShippingsItem[];
|
823
|
+
export type IPaymentMethods = IPaymentMethod[];
|
824
|
+
export interface CKPShipping {
|
825
|
+
shippingRateId?: string;
|
826
|
+
shippingRateData?: ShippingRateData;
|
827
|
+
shippingAddress: ShippingAddress;
|
828
|
+
shippingFee?: IAmount;
|
829
|
+
shippingFeeView?: IAmountView;
|
830
|
+
shippingDescription?: string;
|
831
|
+
deliveryEstimate?: DeliveryEstimate;
|
832
|
+
shippingFeeId?: string;
|
833
|
+
shippingName?: IUserName;
|
834
|
+
shippingPhoneNo?: string;
|
835
|
+
shipToEmail?: string;
|
836
|
+
notes?: string;
|
837
|
+
}
|
838
|
+
export interface AccountQueryResult {
|
839
|
+
accountInfo: IAccountInfo;
|
840
|
+
actionForm?: ActionForm;
|
841
|
+
paymentMethods: IPaymentMethods;
|
842
|
+
shippings: Shippings;
|
843
|
+
success: boolean;
|
844
|
+
errorCode?: string;
|
845
|
+
errorMessage?: string;
|
846
|
+
errorStatus?: string;
|
847
|
+
shippingInfo?: CKPShipping;
|
848
|
+
}
|
849
|
+
export declare enum ElementPaymentMethod {
|
850
|
+
CONTAINER_ELEMENT = "CONTAINER_ELEMENT",
|
851
|
+
AUTH_ELEMENT = "AUTH_ELEMENT",
|
852
|
+
ADDRESS_ELEMENT = "ADDRESS_ELEMENT",
|
853
|
+
PAYMENT_ELEMENT = "PAYMENT_ELEMENT"
|
854
|
+
}
|
855
|
+
export declare enum ElementPaymentEvent {
|
856
|
+
INITIAL_DATA_READY = "initialDataReady",
|
857
|
+
CAPTURE_ASSET = "onCaptureAsset",
|
858
|
+
SIGN_OUT = "onSignout",
|
859
|
+
BLUR = "onBlur",
|
860
|
+
VALIDATE = "validate",
|
861
|
+
SUBMIT_RISK = "onSubmitRisk",
|
862
|
+
AFTER_SUBMIT = "onAfterSubmit",
|
863
|
+
SIZE_CHANGE = "onSizeChange",
|
864
|
+
LAUNCH = "onLaunch",
|
865
|
+
CALLBACK = "callback"
|
866
|
+
}
|
867
|
+
export declare enum ConnectErrorCode {
|
868
|
+
RISK_REJECT = "RISK_REJECT",
|
869
|
+
USER_AUTH_VERIFICATION_FAILED = "USER_AUTH_VERIFICATION_FAILED",
|
870
|
+
USER_NOT_EXISTS = "USER_NOT_EXISTS"
|
871
|
+
}
|
653
872
|
export interface IoptionsAddressParams {
|
654
873
|
environment?: string;
|
655
874
|
locale?: string;
|
@@ -660,4 +879,3 @@ export interface IoptionsAddressParams {
|
|
660
879
|
};
|
661
880
|
product?: string;
|
662
881
|
}
|
663
|
-
export {};
|
package/esm/types/index.js
CHANGED
@@ -6,56 +6,56 @@
|
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
return paymentMethodCategoryTypeEnum;
|
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["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
36
|
+
ComponentSignEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
37
|
+
return ComponentSignEnum;
|
38
|
+
}({}); // 'CHECKOUT_PAYMENT' = 'CHECKOUT_PAYMENT',
|
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;
|
59
59
|
}({});
|
60
60
|
|
61
61
|
/** 表单地址数据 */
|
@@ -88,11 +88,11 @@ export var networkModeEnum = /*#__PURE__*/function (networkModeEnum) {
|
|
88
88
|
networkModeEnum["session"] = "session";
|
89
89
|
return networkModeEnum;
|
90
90
|
}({});
|
91
|
-
export var
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
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;
|
96
96
|
}({});
|
97
97
|
export var osTypeEnum = /*#__PURE__*/function (osTypeEnum) {
|
98
98
|
osTypeEnum["IOS"] = "IOS";
|
@@ -107,10 +107,10 @@ export var terminalTypeEnum = /*#__PURE__*/function (terminalTypeEnum) {
|
|
107
107
|
terminalTypeEnum["MINI_APP"] = "MINI_APP";
|
108
108
|
return terminalTypeEnum;
|
109
109
|
}({});
|
110
|
-
export var
|
111
|
-
|
112
|
-
|
113
|
-
return
|
110
|
+
export var PlatformEnum = /*#__PURE__*/function (PlatformEnum) {
|
111
|
+
PlatformEnum["desktop"] = "desktop";
|
112
|
+
PlatformEnum["mobile"] = "mobile";
|
113
|
+
return PlatformEnum;
|
114
114
|
}({});
|
115
115
|
|
116
116
|
/**
|
@@ -129,17 +129,17 @@ export var platformEnum = /*#__PURE__*/function (platformEnum) {
|
|
129
129
|
* @description Create an event handler, In pop-up layer mode, the user clicks the semi floating layer close button and is called.
|
130
130
|
*/
|
131
131
|
|
132
|
-
export var
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
return
|
137
|
-
}({});
|
138
|
-
export var
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
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;
|
143
143
|
}({});
|
144
144
|
export var errorEnum = /*#__PURE__*/function (errorEnum) {
|
145
145
|
errorEnum["PARAMS"] = "PARAMS";
|
@@ -208,4 +208,52 @@ export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
|
|
208
208
|
ProductSceneVersion["V1"] = "1.0";
|
209
209
|
ProductSceneVersion["V2"] = "2.0";
|
210
210
|
return ProductSceneVersion;
|
211
|
+
}({});
|
212
|
+
export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
|
213
|
+
EventCallbackCode["Failed"] = "Failed";
|
214
|
+
EventCallbackCode["Completed"] = "Completed";
|
215
|
+
return EventCallbackCode;
|
216
|
+
}({});
|
217
|
+
export var AccountStatusEnum = /*#__PURE__*/function (AccountStatusEnum) {
|
218
|
+
AccountStatusEnum["EFFECTIVE"] = "EFFECTIVE";
|
219
|
+
AccountStatusEnum["UNREGISTERED"] = "UNREGISTERED";
|
220
|
+
return AccountStatusEnum;
|
221
|
+
}({});
|
222
|
+
|
223
|
+
// element 接口start
|
224
|
+
|
225
|
+
export var InterActionTypeEnum = /*#__PURE__*/function (InterActionTypeEnum) {
|
226
|
+
InterActionTypeEnum["COLLECT_REDIRECT"] = "COLLECT_REDIRECT";
|
227
|
+
InterActionTypeEnum["SHOW_CODE"] = "SHOW_CODE";
|
228
|
+
InterActionTypeEnum["COLLECT_SHOW_CODE"] = "COLLECT_SHOW_CODE";
|
229
|
+
InterActionTypeEnum["REDIRECT"] = "REDIRECT";
|
230
|
+
return InterActionTypeEnum;
|
231
|
+
}({});
|
232
|
+
// element 接口end
|
233
|
+
|
234
|
+
export var ElementPaymentMethod = /*#__PURE__*/function (ElementPaymentMethod) {
|
235
|
+
ElementPaymentMethod["CONTAINER_ELEMENT"] = "CONTAINER_ELEMENT";
|
236
|
+
ElementPaymentMethod["AUTH_ELEMENT"] = "AUTH_ELEMENT";
|
237
|
+
ElementPaymentMethod["ADDRESS_ELEMENT"] = "ADDRESS_ELEMENT";
|
238
|
+
ElementPaymentMethod["PAYMENT_ELEMENT"] = "PAYMENT_ELEMENT";
|
239
|
+
return ElementPaymentMethod;
|
240
|
+
}({});
|
241
|
+
export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
|
242
|
+
ElementPaymentEvent["INITIAL_DATA_READY"] = "initialDataReady";
|
243
|
+
ElementPaymentEvent["CAPTURE_ASSET"] = "onCaptureAsset";
|
244
|
+
ElementPaymentEvent["SIGN_OUT"] = "onSignout";
|
245
|
+
ElementPaymentEvent["BLUR"] = "onBlur";
|
246
|
+
ElementPaymentEvent["VALIDATE"] = "validate";
|
247
|
+
ElementPaymentEvent["SUBMIT_RISK"] = "onSubmitRisk";
|
248
|
+
ElementPaymentEvent["AFTER_SUBMIT"] = "onAfterSubmit";
|
249
|
+
ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
|
250
|
+
ElementPaymentEvent["LAUNCH"] = "onLaunch";
|
251
|
+
ElementPaymentEvent["CALLBACK"] = "callback";
|
252
|
+
return ElementPaymentEvent;
|
253
|
+
}({});
|
254
|
+
export var ConnectErrorCode = /*#__PURE__*/function (ConnectErrorCode) {
|
255
|
+
ConnectErrorCode["RISK_REJECT"] = "RISK_REJECT";
|
256
|
+
ConnectErrorCode["USER_AUTH_VERIFICATION_FAILED"] = "USER_AUTH_VERIFICATION_FAILED";
|
257
|
+
ConnectErrorCode["USER_NOT_EXISTS"] = "USER_NOT_EXISTS";
|
258
|
+
return ConnectErrorCode;
|
211
259
|
}({});
|
@@ -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;
|