@alipay/ams-checkout 2.0.28 → 2.0.30
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/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/element/elementProcessor/convertPaymentMethods.d.ts +1 -0
- package/esm/core/component/element/elementProcessor/convertPaymentMethods.js +4 -2
- package/esm/core/component/element/modernElementController/index.d.ts +4 -1
- package/esm/core/component/element/modernElementController/index.js +184 -132
- package/esm/core/component/element/type.d.ts +4 -0
- package/esm/modern/component/channel.d.ts +21 -0
- package/esm/modern/component/component.inline.style.d.ts +10 -0
- package/esm/modern/component/component.popup.style.d.ts +26 -0
- package/esm/modern/component/popupWindow.style.d.ts +27 -0
- package/esm/modern/config/index.d.ts +23 -0
- package/esm/modern/config/request.d.ts +21 -0
- package/esm/modern/constant/auto-debit.d.ts +12 -0
- package/esm/modern/constant/easysafepay.d.ts +16 -0
- package/esm/modern/constant/element.d.ts +27 -0
- package/esm/modern/constant/index.d.ts +331 -0
- package/esm/modern/core/bus/ability/callback.d.ts +9 -0
- package/esm/modern/core/bus/ability/security.d.ts +10 -0
- package/esm/modern/core/bus/ability/tracker.d.ts +9 -0
- package/esm/modern/core/bus/index.d.ts +125 -0
- package/esm/modern/core/bus/interface.d.ts +36 -0
- package/esm/modern/core/component/address.d.ts +8 -0
- package/esm/modern/core/component/appPreloadProcessing.d.ts +1 -0
- package/esm/modern/core/component/ckp/index.d.ts +29 -0
- package/esm/modern/core/component/element/EventCenter/index.d.ts +41 -0
- package/esm/modern/core/component/element/config.d.ts +10 -0
- package/esm/modern/core/component/element/elementContainerService/containerService.d.ts +34 -0
- package/esm/modern/core/component/element/elementContainerService/index.d.ts +20 -0
- package/esm/modern/core/component/element/elementController/index.d.ts +54 -0
- package/esm/modern/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
- package/esm/modern/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
- package/esm/modern/core/component/element/elementProcessor/baseElementProcessor.d.ts +42 -0
- package/esm/modern/core/component/element/elementProcessor/convertPaymentMethods.d.ts +23 -0
- package/esm/modern/core/component/element/elementProcessor/paymentProcessor.d.ts +37 -0
- package/esm/modern/core/component/element/index.d.ts +17 -0
- package/esm/modern/core/component/element/mock.d.ts +10 -0
- package/esm/modern/core/component/element/modernElementController/adapter.d.ts +19 -0
- package/esm/modern/core/component/element/modernElementController/index.d.ts +172 -0
- package/esm/modern/core/component/element/type.d.ts +590 -0
- package/esm/modern/core/component/element/util.d.ts +93 -0
- package/esm/modern/core/component/index.d.ts +58 -0
- package/esm/modern/core/instance/index.d.ts +97 -0
- package/esm/modern/core/utils/connectConfig.d.ts +11 -0
- package/esm/modern/foundation/core/index.d.ts +36 -0
- package/esm/modern/foundation/index.d.ts +93 -0
- package/esm/modern/foundation/product-processor/autoDebit/deps.d.ts +14 -0
- package/esm/modern/foundation/product-processor/autoDebit/index.d.ts +48 -0
- package/esm/modern/foundation/product-processor/easysafepay/deps.d.ts +20 -0
- package/esm/modern/foundation/product-processor/easysafepay/index.d.ts +29 -0
- package/esm/modern/foundation/product-processor/element/index.d.ts +7 -0
- package/esm/modern/foundation/service/api-bus/ability/globalData.d.ts +10 -0
- package/esm/modern/foundation/service/api-bus/ability/request.d.ts +10 -0
- package/esm/modern/foundation/service/api-bus/ability/security.d.ts +12 -0
- package/esm/modern/foundation/service/api-bus/ability/tracker.d.ts +9 -0
- package/esm/modern/foundation/service/api-bus/busManager.d.ts +127 -0
- package/esm/modern/foundation/service/api-bus/index.d.ts +20 -0
- package/esm/modern/foundation/service/api-bus/interface.d.ts +48 -0
- package/esm/modern/foundation/service/container/index.d.ts +42 -0
- package/esm/modern/foundation/service/container/popup.d.ts +31 -0
- package/esm/modern/foundation/service/container/utils.d.ts +7 -0
- package/esm/modern/foundation/service/event-center.d.ts +82 -0
- package/esm/modern/foundation/service/global-data/index.d.ts +11 -0
- package/esm/modern/foundation/service/index.d.ts +19 -0
- package/esm/modern/foundation/service/log/index.d.ts +44 -0
- package/esm/modern/foundation/service/log/keys.d.ts +13 -0
- package/esm/modern/foundation/service/log/processor.d.ts +9 -0
- package/esm/modern/foundation/service/log/types.d.ts +33 -0
- package/esm/modern/foundation/service/requester/deps.d.ts +17 -0
- package/esm/modern/foundation/service/requester/requester.d.ts +22 -0
- package/esm/modern/foundation/service/security/index.d.ts +33 -0
- package/esm/modern/foundation/service/security/security.d.ts +54 -0
- package/esm/modern/foundation/utils/gray_scale_utils.d.ts +7 -0
- package/esm/modern/foundation/utils/payment_context_utils.d.ts +13 -0
- package/esm/modern/foundation/utils/payment_product_utils.d.ts +13 -0
- package/esm/modern/foundation/utils/preload_helper.d.ts +24 -0
- package/esm/modern/foundation/utils/redirect_utils.d.ts +11 -0
- package/esm/modern/foundation/utils/system_events.d.ts +4 -0
- package/esm/modern/foundation/utils/web_app_url_utils.d.ts +114 -0
- package/esm/modern/index.js +1 -1
- package/esm/modern/loadAntomTracker.d.ts +7 -0
- package/esm/modern/loadAntomTracker.js +64 -0
- package/esm/modern/loader/constant.d.ts +36 -0
- package/esm/modern/loader/utils/proxyPerformance.d.ts +20 -0
- package/esm/modern/main.d.ts +54 -0
- package/esm/modern/{index.d.ts → modern/index.d.ts} +1 -1
- package/esm/modern/modern/loadAntomTracker.d.ts +7 -0
- package/esm/modern/modern/preload/antomManifestAdapter.d.ts +11 -0
- package/esm/modern/modern/preload/config.d.ts +10 -0
- package/esm/modern/modern/preload/gatewayPreconnection.d.ts +53 -0
- package/esm/modern/modern/preload/preloadAntomElements.d.ts +12 -0
- package/esm/modern/modern/preload/startAntomPreload.d.ts +2 -0
- package/esm/modern/modern/sdk/applepay-core/ApplePayHostService.d.ts +102 -0
- package/esm/modern/modern/sdk/elements/CVVElement.d.ts +144 -0
- package/esm/modern/modern/sdk/elements/PaymentElement.d.ts +204 -0
- package/esm/modern/modern/sdk/elements/appearanceRules.d.ts +59 -0
- package/esm/modern/modern/sdk/elements/appearanceRulesDefaults.d.ts +2 -0
- package/esm/modern/modern/sdk/eventsMap.d.ts +135 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/PaymentSessionService.d.ts +69 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/definitions.d.ts +5346 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/preConnection.d.ts +6 -0
- package/esm/modern/modern/sdk/stageName.d.ts +3 -0
- package/esm/modern/modern/sdk/tools/awaitWrap.d.ts +14 -0
- package/esm/modern/modern/sdk/tools/buildPageUrl.d.ts +4 -0
- package/esm/modern/modern/sdk/tools/checkSessionData.d.ts +1 -0
- package/esm/modern/modern/sdk/tools/expressElement/applePay.d.ts +9 -0
- package/esm/modern/modern/sdk/tools/expressElement/applePayHostToken.d.ts +32 -0
- package/esm/modern/modern/sdk/tools/expressElement/types.d.ts +277 -0
- package/esm/modern/modern/sdk/tools/getDevReqConfig.d.ts +2 -0
- package/esm/modern/modern/sdk/tools/getLocaleFromRenderData.d.ts +6 -0
- package/esm/modern/modern/sdk/tools/getMetaData.d.ts +126 -0
- package/esm/modern/modern/sdk/tools/modalMessageMonitor.d.ts +41 -0
- package/esm/modern/modern/sdk/tools/openModal.d.ts +20 -0
- package/esm/modern/modern/sdk/tools/paymentElement/applePayHostToken.d.ts +38 -0
- package/esm/modern/modern/sdk/tools/paymentElement/googlePayHostToken.d.ts +38 -0
- package/esm/modern/modern/sdk/tools/paymentElement/tracker.d.ts +16 -0
- package/esm/modern/modern/sdk/tools/paymentElement/walletHostListeners.d.ts +19 -0
- package/esm/modern/modern/sdk/tools/preloadTracking.d.ts +5 -0
- package/esm/modern/modern/sdk/tools/showToast.d.ts +33 -0
- package/esm/modern/modern/sdk/tools/validatePaymentAmount.d.ts +19 -0
- package/esm/modern/modern/sdk/tracking/elementTracker.d.ts +65 -0
- package/esm/modern/modern/sdk/types.d.ts +310 -0
- package/esm/modern/modern/tools.d.ts +26 -0
- package/esm/modern/plugin/applepay/component.d.ts +50 -0
- package/esm/modern/plugin/applepay/index.d.ts +17 -0
- package/esm/modern/plugin/applepay/interface.d.ts +161 -0
- package/esm/modern/plugin/applepay/service.d.ts +54 -0
- package/esm/modern/plugin/component/cashierApp.d.ts +38 -0
- package/esm/modern/plugin/component/channel.d.ts +73 -0
- package/esm/modern/plugin/component/component.inline.style.d.ts +10 -0
- package/esm/modern/plugin/component/component.popup.style.d.ts +25 -0
- package/esm/modern/plugin/component/index.d.ts +133 -0
- package/esm/modern/plugin/component/popupWindow.style.d.ts +11 -0
- package/esm/modern/plugin/const.d.ts +2 -0
- package/esm/modern/plugin/payment-element/utils.d.ts +2 -0
- package/esm/modern/plugin/paypal/index.d.ts +20 -0
- package/esm/modern/plugin/type.d.ts +34 -0
- package/esm/modern/plugin/utils.d.ts +6 -0
- package/esm/modern/preload/antomManifestAdapter.d.ts +11 -0
- package/esm/modern/preload/antomManifestAdapter.js +116 -0
- package/esm/modern/preload/config.d.ts +10 -0
- package/esm/modern/preload/config.js +46 -0
- package/esm/modern/preload/gatewayPreconnection.d.ts +53 -0
- package/esm/modern/preload/gatewayPreconnection.js +213 -0
- package/esm/modern/preload/preloadAntomElements.d.ts +12 -0
- package/esm/modern/preload/preloadAntomElements.js +99 -0
- package/esm/modern/preload/startAntomPreload.d.ts +2 -0
- package/esm/modern/preload/startAntomPreload.js +9 -0
- package/esm/modern/request/index.d.ts +9 -0
- package/esm/modern/request/utils.d.ts +28 -0
- package/esm/modern/service/index.d.ts +13 -0
- package/esm/modern/tools.js +1 -1
- package/esm/modern/types/index.d.ts +862 -0
- package/esm/modern/util/beforeConfirm.d.ts +14 -0
- package/esm/modern/util/createIframeNode.d.ts +6 -0
- package/esm/modern/util/debug.d.ts +1 -0
- package/esm/modern/util/get.d.ts +25 -0
- package/esm/modern/util/getBackScheme.d.ts +5 -0
- package/esm/modern/util/index.d.ts +61 -0
- package/esm/modern/util/jshield-apdid/apdid-loader.d.ts +89 -0
- package/esm/modern/util/jshield-apdid/index.d.ts +21 -0
- package/esm/modern/util/logger.d.ts +67 -0
- package/esm/modern/util/mock.d.ts +1 -0
- package/esm/modern/util/redirect.d.ts +6 -0
- package/esm/modern/util/security-registry.d.ts +72 -0
- package/esm/modern/util/security.d.ts +55 -0
- package/esm/modern/util/spm-map.d.ts +217 -0
- package/esm/modern/util/storage.d.ts +2 -0
- package/esm/modern/util/timezone.d.ts +1 -0
- package/esm/modern/util/upgrade.d.ts +39 -0
- package/esm/modern/util/versionCompare.d.ts +15 -0
- package/esm/tsdoc-metadata.json +1 -1
- package/esm/types/index.d.ts +6 -0
- package/esm/util/logger.js +1 -1
- package/esm/util/timezone.d.ts +1 -0
- package/esm/util/timezone.js +8 -0
- package/package.json +2 -1
- package/types.d.ts +308 -13
- package/types.untrimmed.d.ts +343 -13
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { type RequestOptions } from '@antintl/antom-toolset';
|
|
2
|
+
import { type BaseElementAppConfig, type BaseElementConfig, BaseMainElement, type ErrorPayload } from '@antintl/opensdk-core';
|
|
3
|
+
import type { CashierSdkActionQueryResult, OneAccountQueryResult, PaymentSessionConfig } from '../oneapi/iexpfront/definitions';
|
|
4
|
+
import { type IPaymentSessionMetaData } from '../tools/getMetaData';
|
|
5
|
+
import { type GetApplePayTokenReply, type GetApplePayTokenRequest } from '../tools/paymentElement/applePayHostToken';
|
|
6
|
+
import { type GetGooglePayTokenReply, type GetGooglePayTokenRequest } from '../tools/paymentElement/googlePayHostToken';
|
|
7
|
+
import { type AntomBridgeWithNativeEventMap, type AntomLayouts, type AntomTheme, type AntomVariables, type AppearanceVariables, type SubmitParams, type SubmitResult } from '../types';
|
|
8
|
+
import { type AppearanceRuleSelector, type PickAntomAppearance } from './appearanceRules';
|
|
9
|
+
/**
|
|
10
|
+
* @description Payment element appearance properties
|
|
11
|
+
*/
|
|
12
|
+
export type PaymentAppearanceProps = {
|
|
13
|
+
displaySetting: 'showPaymentMethodListWhenSingleOption' | 'showCardBrandIcon' | 'showRadioWhenAccordionLayout' | 'showCardCVV';
|
|
14
|
+
theme: AntomTheme;
|
|
15
|
+
variables: AppearanceVariables | AntomVariables;
|
|
16
|
+
layout: AntomLayouts;
|
|
17
|
+
rules: AppearanceRuleSelector<string>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @description Payment element appearance type
|
|
21
|
+
*/
|
|
22
|
+
export type PaymentAppearance = PickAntomAppearance<PaymentAppearanceProps>;
|
|
23
|
+
/**
|
|
24
|
+
* @description Payment element app config type
|
|
25
|
+
*/
|
|
26
|
+
export interface PaymentAppConfig extends BaseElementAppConfig {
|
|
27
|
+
/** Payment appearance configuration including optional alias-only Rules. */
|
|
28
|
+
appearance?: PaymentAppearance;
|
|
29
|
+
/**
|
|
30
|
+
* @description sessionData,无法通过updateConfig更新
|
|
31
|
+
*/
|
|
32
|
+
sessionData?: string;
|
|
33
|
+
/**
|
|
34
|
+
* @internal sdk所在hostname
|
|
35
|
+
*/
|
|
36
|
+
merchantDomain?: string;
|
|
37
|
+
doMain?: string;
|
|
38
|
+
/**
|
|
39
|
+
* @internal 渲染数据
|
|
40
|
+
*/
|
|
41
|
+
renderData?: CashierSdkActionQueryResult;
|
|
42
|
+
/**
|
|
43
|
+
* @internal connect时有这个数据
|
|
44
|
+
*/
|
|
45
|
+
connectAccount?: OneAccountQueryResult;
|
|
46
|
+
/**
|
|
47
|
+
* @internal sessionData解析后的数据
|
|
48
|
+
*/
|
|
49
|
+
sessionMetaData?: IPaymentSessionMetaData;
|
|
50
|
+
/**
|
|
51
|
+
* @internal 渲染数据错误信息
|
|
52
|
+
*/
|
|
53
|
+
renderDataError?: ErrorPayload;
|
|
54
|
+
/**
|
|
55
|
+
* @internal sdk 版本号
|
|
56
|
+
*/
|
|
57
|
+
sdkVersion?: string;
|
|
58
|
+
/**
|
|
59
|
+
* @internal 内部联调使用,生产环境传递无效
|
|
60
|
+
*/
|
|
61
|
+
_requestConfig?: Partial<Omit<RequestOptions, 'scope' | 'tracker'>>;
|
|
62
|
+
/**
|
|
63
|
+
* @internal 内部使用,无需用户传递,用于log日志原数据
|
|
64
|
+
*/
|
|
65
|
+
logMetaData?: {
|
|
66
|
+
paymentMethodCategoryType?: PaymentSessionConfig['paymentMethodCategoryType'];
|
|
67
|
+
productSceneVersion?: PaymentSessionConfig['productSceneVersion'];
|
|
68
|
+
trackId: string;
|
|
69
|
+
merchantId?: string;
|
|
70
|
+
paymentMethodType?: string;
|
|
71
|
+
};
|
|
72
|
+
/** @internal Elements2 preload grouping data. */
|
|
73
|
+
preloadTelemetryContext?: import('../types').PreloadTelemetryContext;
|
|
74
|
+
/**
|
|
75
|
+
* @internal 内部使用,无需用户传递,高度信息
|
|
76
|
+
*/
|
|
77
|
+
heightOfVisible?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Amount & Currency
|
|
80
|
+
*
|
|
81
|
+
* Only effective via `updateConfig({ amount })` at runtime.
|
|
82
|
+
*/
|
|
83
|
+
amount?: {
|
|
84
|
+
currency: string;
|
|
85
|
+
value: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export interface ShippingInfo {
|
|
89
|
+
shippingName: {
|
|
90
|
+
firstName: string;
|
|
91
|
+
lastName: string;
|
|
92
|
+
middleName?: string;
|
|
93
|
+
fullName?: string;
|
|
94
|
+
};
|
|
95
|
+
shippingPhoneNo: string;
|
|
96
|
+
shippingAddress: {
|
|
97
|
+
region: string;
|
|
98
|
+
address1: string;
|
|
99
|
+
address2: string;
|
|
100
|
+
city?: string;
|
|
101
|
+
state?: string;
|
|
102
|
+
zipCode: string;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @description The submit params
|
|
107
|
+
*/
|
|
108
|
+
export interface PaymentSubmitParams extends SubmitParams {
|
|
109
|
+
/**
|
|
110
|
+
* @description 是否由antom sdk自动处理唤端逻辑,默认为true,由sdk自动处理。
|
|
111
|
+
* 如果antom sdk唤起客户端失败,建议设置为false,商家自行唤端
|
|
112
|
+
*/
|
|
113
|
+
handleActions?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* @description 收件地址信息
|
|
116
|
+
*/
|
|
117
|
+
shippingInfo?: ShippingInfo;
|
|
118
|
+
/**
|
|
119
|
+
* @description 集成用户自定义信息(如 cardHolderName)
|
|
120
|
+
*/
|
|
121
|
+
params?: Record<string, unknown>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @description Payment element submit result
|
|
125
|
+
*/
|
|
126
|
+
export interface PaymentSubmitResult extends SubmitResult {
|
|
127
|
+
paymentSession?: {
|
|
128
|
+
/**
|
|
129
|
+
* @description 回调页面的url链接,使用浏览器可直接打开,比如 http://xxx.app.com/xxx
|
|
130
|
+
*/
|
|
131
|
+
returnUrl: string;
|
|
132
|
+
/**
|
|
133
|
+
* @description 回调页面唤起app的url链接,使用浏览器可直接打开,比如 http://xxx.app.com/xxx
|
|
134
|
+
*/
|
|
135
|
+
returnAppUrl?: string;
|
|
136
|
+
/**
|
|
137
|
+
* @description 回调页面唤起app的scheme链接,比如 alipay://xxx
|
|
138
|
+
*/
|
|
139
|
+
returnAppScheme?: string;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @description Payment element events
|
|
144
|
+
*/
|
|
145
|
+
export interface PaymentElementEvents extends AntomBridgeWithNativeEventMap<PaymentAppConfig, PaymentSubmitParams, PaymentSubmitResult> {
|
|
146
|
+
/**
|
|
147
|
+
* webapp 委托 host(父 frame)拉起 Apple Pay 拿 token。
|
|
148
|
+
* payload 结构对齐 ModernElementController.GetApplePayTokenRequest(放 paymentMethod/shipping)。
|
|
149
|
+
*/
|
|
150
|
+
'OPENSDK@GET_APPLE_PAY_TOKEN': GetApplePayTokenRequest;
|
|
151
|
+
/** host 完成 Apple Pay token 获取后回包给 webapp */
|
|
152
|
+
'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': GetApplePayTokenReply;
|
|
153
|
+
/**
|
|
154
|
+
* webapp 委托 host(父 frame)拉起 Google Pay 拿 token。
|
|
155
|
+
* payload 结构对齐 ModernElementController.GetGooglePayTokenRequest(放 data.environment/paymentRequest)。
|
|
156
|
+
*/
|
|
157
|
+
'OPENSDK@GET_GOOGLE_PAY_TOKEN': GetGooglePayTokenRequest;
|
|
158
|
+
/** host 完成 Google Pay token 获取后回包给 webapp */
|
|
159
|
+
'OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY': GetGooglePayTokenReply;
|
|
160
|
+
/** WebApp notifies the host when the selected payment method changes. */
|
|
161
|
+
paymentMethodChanged: {
|
|
162
|
+
type: string;
|
|
163
|
+
name?: string;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* @description Payment element config type
|
|
168
|
+
*/
|
|
169
|
+
interface PaymentElementConfig extends BaseElementConfig<PaymentAppConfig> {
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @description Payment element
|
|
173
|
+
*/
|
|
174
|
+
export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
|
|
175
|
+
static elementType: string;
|
|
176
|
+
private _paymentInProgress;
|
|
177
|
+
private readonly paymentTracker;
|
|
178
|
+
private _mountStartedAt;
|
|
179
|
+
private _mountInProgress;
|
|
180
|
+
private _mountPhase;
|
|
181
|
+
private _destroyInProgress;
|
|
182
|
+
private readonly walletLogger;
|
|
183
|
+
constructor(name: string, config: PaymentElementConfig);
|
|
184
|
+
/**
|
|
185
|
+
* @internal
|
|
186
|
+
*/
|
|
187
|
+
setup(): Promise<Partial<PaymentAppConfig> | undefined>;
|
|
188
|
+
mount(container: HTMLElement): Promise<void>;
|
|
189
|
+
/**
|
|
190
|
+
* @description Update payment element configuration with amount validation and appearance Rules support
|
|
191
|
+
*/
|
|
192
|
+
updateConfig(newConfig: Partial<PaymentAppConfig>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
193
|
+
/**
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
submit(data?: PaymentSubmitParams): Promise<PaymentSubmitResult>;
|
|
197
|
+
on<T extends keyof PaymentElementEvents>(event: T, handler: (payload: PaymentElementEvents[T]) => void): void;
|
|
198
|
+
unmount(): void;
|
|
199
|
+
destroy(): void;
|
|
200
|
+
protected focus(): void;
|
|
201
|
+
protected blur(): void;
|
|
202
|
+
protected clear(): void;
|
|
203
|
+
}
|
|
204
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { PickAppearance } from '@antintl/opensdk-core';
|
|
2
|
+
/** Semantic states accepted by the merchant selector grammar. */
|
|
3
|
+
type AppearanceRuleState = 'hover' | 'focus' | 'focus-visible' | 'active' | 'disabled' | 'loading' | 'selected' | 'checked' | 'expanded' | 'invalid' | 'success' | 'error';
|
|
4
|
+
/** Controlled pseudo-class accepted by the merchant selector grammar. */
|
|
5
|
+
type AppearanceRulePseudoClass = 'autofill';
|
|
6
|
+
/** Controlled pseudo-element accepted by the merchant selector grammar. */
|
|
7
|
+
type AppearanceRulePseudoElement = 'placeholder' | 'selection';
|
|
8
|
+
/**
|
|
9
|
+
* Optional state or controlled pseudo suffix on one alias.
|
|
10
|
+
*/
|
|
11
|
+
export type AppearanceRuleScopeSuffix = '' | `:${AppearanceRuleState | AppearanceRulePseudoClass}` | `::${AppearanceRulePseudoElement}`;
|
|
12
|
+
/** One merchant alias with an optional semantic suffix. */
|
|
13
|
+
export type AppearanceRuleSelector<RuleAlias extends string> = `${RuleAlias}${AppearanceRuleScopeSuffix}`;
|
|
14
|
+
/** Paint-only property names exposed by the SDK contract. */
|
|
15
|
+
export type AppearancePaintProperty = 'color' | 'WebkitTextFillColor' | 'textDecorationColor' | 'textDecorationLine' | 'textDecorationStyle' | 'textShadow' | 'backgroundColor' | 'borderColor' | 'borderTopColor' | 'borderRightColor' | 'borderBottomColor' | 'borderLeftColor' | 'borderRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderBottomRightRadius' | 'borderBottomLeftRadius' | 'borderStyle' | 'boxShadow' | 'fill' | 'stroke' | 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'outlineColor' | 'outlineStyle' | 'outlineWidth' | 'outlineOffset' | 'caretColor' | 'accentColor';
|
|
16
|
+
/** Controlled layout longhands intersected with the concrete Part at runtime. */
|
|
17
|
+
export type AppearanceLayoutProperty = 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'height';
|
|
18
|
+
/** Exact official spacing Token accepted by controlled margin and padding. */
|
|
19
|
+
export type AppearanceSpacingToken = `var(--spacing-${'base' | 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'})`;
|
|
20
|
+
/** Runtime-constrained non-negative integer pixel value for spacing longhands. */
|
|
21
|
+
export type AppearanceSpacingValue = '0' | `${number}px` | AppearanceSpacingToken;
|
|
22
|
+
/** Paint declarations accepted before WebApp and Components runtime validation. */
|
|
23
|
+
type AppearancePaintDeclarations = Partial<Record<Exclude<AppearancePaintProperty, 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'textDecorationStyle' | 'outlineStyle'>, string> & Record<'fillOpacity' | 'strokeOpacity' | 'strokeWidth', string | number> & {
|
|
24
|
+
textDecorationStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'dashed' | 'dotted' | 'double' | 'solid' | 'wavy';
|
|
25
|
+
outlineStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'auto' | 'dashed' | 'dotted' | 'double' | 'groove' | 'inset' | 'none' | 'outset' | 'ridge' | 'solid';
|
|
26
|
+
}>;
|
|
27
|
+
/** Target-level layout declarations admitted before runtime capability intersection. */
|
|
28
|
+
export type AppearanceLayoutDeclarations = {
|
|
29
|
+
[Property in Exclude<AppearanceLayoutProperty, 'height'>]?: AppearanceSpacingValue;
|
|
30
|
+
} & {
|
|
31
|
+
/** Exact integer-pixel enum allocated by the target contract. */
|
|
32
|
+
readonly height?: `${number}px`;
|
|
33
|
+
};
|
|
34
|
+
/** Paint declarations plus controlled typography and target-level layout fields. */
|
|
35
|
+
type AppearanceRuleDeclarations = AppearancePaintDeclarations & AppearanceLayoutDeclarations & {
|
|
36
|
+
/** Single font family identifier admitted only for authorized targets at runtime. */
|
|
37
|
+
readonly fontFamily?: string;
|
|
38
|
+
/** Integer pixel size admitted only for authorized text targets at runtime. */
|
|
39
|
+
readonly fontSize?: `${number}px`;
|
|
40
|
+
/** Controlled font weight admitted only for authorized text targets at runtime. */
|
|
41
|
+
readonly fontWeight?: 400 | 500 | 600 | 700;
|
|
42
|
+
/** Controlled font style admitted only for authorized text targets at runtime. */
|
|
43
|
+
readonly fontStyle?: 'normal' | 'italic';
|
|
44
|
+
};
|
|
45
|
+
/** Builds an Antom appearance type with the restricted Rules declaration contract. */
|
|
46
|
+
export type PickAntomAppearance<T extends Record<string, any>> = PickAppearance<T, AppearanceRuleDeclarations>;
|
|
47
|
+
type AppearanceRulesAppConfig = {
|
|
48
|
+
appearance?: {
|
|
49
|
+
rules?: unknown;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Resets stored Rules before the core deep merge handles an explicit empty patch.
|
|
54
|
+
*
|
|
55
|
+
* @param currentConfig - Current complete SDK configuration.
|
|
56
|
+
* @param update - Merchant configuration patch being merged.
|
|
57
|
+
*/
|
|
58
|
+
export declare function prepareAppearanceRulesUpdate(currentConfig: AppearanceRulesAppConfig, update: AppearanceRulesAppConfig): void;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { BaseBridgeEventMap } from "@antintl/opensdk-core";
|
|
2
|
+
import type { AntomOpenModalConfig, SubmitResult } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* @description native回调错误信息格式
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface CallbackErrorInfo {
|
|
8
|
+
code: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
needChangeSessionForRetry?: boolean;
|
|
11
|
+
traceId?: string;
|
|
12
|
+
context?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @description native回调会话下一步操作,包含了回调的url
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export interface CallbackSessionNextAction {
|
|
19
|
+
normalUrl?: string;
|
|
20
|
+
schemeUrl?: string;
|
|
21
|
+
applinkUrl?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @description native回调返回数据
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export interface CallbackReturnData {
|
|
28
|
+
status?: string;
|
|
29
|
+
userCanceled3D?: boolean;
|
|
30
|
+
isExposed?: boolean;
|
|
31
|
+
error?: CallbackErrorInfo;
|
|
32
|
+
session?: {
|
|
33
|
+
nextAction?: CallbackSessionNextAction;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 给中间页使用的桥接事件类型
|
|
38
|
+
* @internal 内部使用,不暴露到外部
|
|
39
|
+
*/
|
|
40
|
+
export interface AntomMiddlePageEventMap extends AntomBridgeEventMap {
|
|
41
|
+
/**
|
|
42
|
+
* @description 3DS流程完成
|
|
43
|
+
* @deprecated 使用auto_close_modal
|
|
44
|
+
*/
|
|
45
|
+
three_ds_end: void;
|
|
46
|
+
/**
|
|
47
|
+
* @description 正常结束自动关闭事件
|
|
48
|
+
*/
|
|
49
|
+
auto_close_modal: void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* AntomBridge事件类型,包含了SDK与webapp通信的所有事件类型
|
|
53
|
+
*/
|
|
54
|
+
export interface AntomBridgeEventMap<AppConfig extends Record<string, any> = Record<string, any>, SubmitParams extends Record<string, any> = Record<string, any>, SR extends SubmitResult = SubmitResult> extends BaseBridgeEventMap<AppConfig, SR, SubmitParams, string, AntomOpenModalConfig> {
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @description 整合了native事件的eventMap,如果你的业务element需要支持native,事件请继承这个类型
|
|
58
|
+
*/
|
|
59
|
+
export interface AntomBridgeWithNativeEventMap<AppConfig extends Record<string, any> = Record<string, any>, SubmitParams extends Record<string, any> = Record<string, any>, SR extends SubmitResult = SubmitResult> extends AntomBridgeEventMap<AppConfig, SubmitParams, SR> {
|
|
60
|
+
/**
|
|
61
|
+
* @internal 展示半浮层
|
|
62
|
+
*/
|
|
63
|
+
showPopup: {
|
|
64
|
+
mode: string;
|
|
65
|
+
showAnimation: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @internal 隐藏loading
|
|
69
|
+
*/
|
|
70
|
+
dismissLoading: Record<string, never>;
|
|
71
|
+
/**
|
|
72
|
+
* @internal 通知APP 收银台已经ready
|
|
73
|
+
*/
|
|
74
|
+
webAppReady: {
|
|
75
|
+
source: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @internal 通知app 应用已启动
|
|
79
|
+
*/
|
|
80
|
+
onLaunch: {
|
|
81
|
+
success: boolean;
|
|
82
|
+
source: string;
|
|
83
|
+
target: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @internal 收到客户端返回action query的数据和商户的配置
|
|
87
|
+
*/
|
|
88
|
+
renderComponent: {
|
|
89
|
+
sessionResult?: Record<string, unknown>;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* @internal 心跳事件
|
|
93
|
+
*/
|
|
94
|
+
appHeartBeat: {
|
|
95
|
+
success: boolean;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* @internal 客户端 展示toast弹窗
|
|
99
|
+
*/
|
|
100
|
+
showToast: {
|
|
101
|
+
icon: string;
|
|
102
|
+
message: string;
|
|
103
|
+
source: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* @internal 客户端eventCallback 事件
|
|
107
|
+
*/
|
|
108
|
+
onEventCallback: {
|
|
109
|
+
code: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* @internal 发送回调码事件
|
|
113
|
+
*/
|
|
114
|
+
onSubmitPayCallback: CallbackReturnData;
|
|
115
|
+
/**
|
|
116
|
+
* @internal 重置收银台
|
|
117
|
+
*/
|
|
118
|
+
reset: Record<string, never>;
|
|
119
|
+
/**
|
|
120
|
+
* @internal 销毁收银台
|
|
121
|
+
*/
|
|
122
|
+
destroy: Record<string, never>;
|
|
123
|
+
/**
|
|
124
|
+
* @internal 关闭收银台
|
|
125
|
+
*/
|
|
126
|
+
onClose: Record<string, never>;
|
|
127
|
+
/**
|
|
128
|
+
* @internal 重定向
|
|
129
|
+
*/
|
|
130
|
+
onRedirect: {
|
|
131
|
+
normalUrl: string;
|
|
132
|
+
isDestroy: boolean;
|
|
133
|
+
needReset: boolean;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { RequestOptions } from '@antintl/antom-toolset';
|
|
2
|
+
import { ApplePayPaymentSessionRequest, ApplePayPaymentSessionResponse, CashierSdkActionQueryRequest, CashierSdkActionQueryResult, ChannelClientIdQueryRequest, ChannelClientIdQueryResult, InquiryPaymentBySessionResult, MobileSessionRequest, OneAccountQueryRequest, OneAccountQueryResult, SubmitPayByPaymentSessionRequest, SubmitPayByPaymentSessionResult } from './definitions';
|
|
3
|
+
export { preConnection } from './preConnection';
|
|
4
|
+
/**
|
|
5
|
+
* @description 查询渠道clientId
|
|
6
|
+
* @param channelClientIdQueryRequest
|
|
7
|
+
* @return
|
|
8
|
+
* @method com.ipay.iexpfront.channelClientId.query
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare function channelClientIdQuery(payload: ChannelClientIdQueryRequest, extraParams?: RequestOptions): Promise<ChannelClientIdQueryResult & {
|
|
12
|
+
traceId?: string;
|
|
13
|
+
errorMessage?: string;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* @description 创建ApplePay支付会话,用于Apple Pay Web
|
|
17
|
+
* @param request 会话请求
|
|
18
|
+
* @return 会话对象
|
|
19
|
+
* @method com.ipay.iexpcashier.cashier.createApplePayPaymentSession
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare function createApplePayPaymentSession(payload: ApplePayPaymentSessionRequest, extraParams?: RequestOptions): Promise<ApplePayPaymentSessionResponse & {
|
|
23
|
+
traceId?: string;
|
|
24
|
+
errorMessage?: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* @description 根据session查询支付结果
|
|
28
|
+
* @param mobileSessionRequest session
|
|
29
|
+
* @return
|
|
30
|
+
* @method com.ipay.iexpfront.sdk.inquiryPaymentBySession
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
export declare function inquiryPaymentBySession(payload: MobileSessionRequest, extraParams?: RequestOptions): Promise<InquiryPaymentBySessionResult & {
|
|
34
|
+
traceId?: string;
|
|
35
|
+
errorMessage?: string;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* @description one account 账户信息查询
|
|
39
|
+
* @param accountQueryRequest
|
|
40
|
+
* @return
|
|
41
|
+
* @method com.ipay.iexpfront.one.account.query
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
export declare function oneAccountQuery(payload: OneAccountQueryRequest, extraParams?: RequestOptions): Promise<OneAccountQueryResult & {
|
|
45
|
+
traceId?: string;
|
|
46
|
+
errorMessage?: string;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* @description sdk action 编排接口,要素二次收集和确认等
|
|
50
|
+
* @param cashierSdkActionQueryRequest sessionData等
|
|
51
|
+
* @return 端交互信息
|
|
52
|
+
* @method com.ipay.iexpcashier.sdkAction.query
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
export declare function sdkQuery(payload: CashierSdkActionQueryRequest, extraParams?: RequestOptions): Promise<CashierSdkActionQueryResult & {
|
|
56
|
+
traceId?: string;
|
|
57
|
+
errorMessage?: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* @description 支付要素提交,完成支付
|
|
61
|
+
* @param submitPayByPaymentSessionRequest 提交支付session
|
|
62
|
+
* @return 提交支付结果
|
|
63
|
+
* @method com.ipay.iexpcashier.cashier.submitPayByPaymentSession
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
export declare function submitPayByPaymentSession(payload: SubmitPayByPaymentSessionRequest, extraParams?: RequestOptions): Promise<SubmitPayByPaymentSessionResult & {
|
|
67
|
+
traceId?: string;
|
|
68
|
+
errorMessage?: string;
|
|
69
|
+
}>;
|