@alipay/ams-checkout 0.0.1788166152-dev.6 → 0.0.1788166152-dev.7

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.
Files changed (172) hide show
  1. package/ams-checkout.js +3 -3
  2. package/dist/ams-checkout.min.js +1 -1
  3. package/dist/ams-checkout.min.js.map +1 -1
  4. package/esm/config/index.js +1 -1
  5. package/esm/core/component/element/modernElementController/index.d.ts +1 -1
  6. package/esm/core/component/element/modernElementController/index.js +9 -9
  7. package/esm/modern/{modern/index.d.ts → index.d.ts} +1 -1
  8. package/esm/modern/index.js +1 -1
  9. package/esm/modern/tools.js +1 -1
  10. package/esm/util/logger.js +1 -1
  11. package/package.json +1 -2
  12. package/types.d.ts +2 -17
  13. package/types.untrimmed.d.ts +2 -35
  14. package/esm/modern/component/channel.d.ts +0 -21
  15. package/esm/modern/component/component.inline.style.d.ts +0 -10
  16. package/esm/modern/component/component.popup.style.d.ts +0 -26
  17. package/esm/modern/component/popupWindow.style.d.ts +0 -27
  18. package/esm/modern/config/index.d.ts +0 -23
  19. package/esm/modern/config/request.d.ts +0 -21
  20. package/esm/modern/constant/auto-debit.d.ts +0 -12
  21. package/esm/modern/constant/easysafepay.d.ts +0 -16
  22. package/esm/modern/constant/element.d.ts +0 -27
  23. package/esm/modern/constant/index.d.ts +0 -331
  24. package/esm/modern/core/bus/ability/callback.d.ts +0 -9
  25. package/esm/modern/core/bus/ability/security.d.ts +0 -10
  26. package/esm/modern/core/bus/ability/tracker.d.ts +0 -9
  27. package/esm/modern/core/bus/index.d.ts +0 -125
  28. package/esm/modern/core/bus/interface.d.ts +0 -36
  29. package/esm/modern/core/component/address.d.ts +0 -8
  30. package/esm/modern/core/component/appPreloadProcessing.d.ts +0 -1
  31. package/esm/modern/core/component/ckp/index.d.ts +0 -29
  32. package/esm/modern/core/component/element/EventCenter/index.d.ts +0 -41
  33. package/esm/modern/core/component/element/config.d.ts +0 -10
  34. package/esm/modern/core/component/element/elementContainerService/containerService.d.ts +0 -34
  35. package/esm/modern/core/component/element/elementContainerService/index.d.ts +0 -20
  36. package/esm/modern/core/component/element/elementController/index.d.ts +0 -54
  37. package/esm/modern/core/component/element/elementProcessor/addressProcessor.d.ts +0 -20
  38. package/esm/modern/core/component/element/elementProcessor/authProcessor.d.ts +0 -20
  39. package/esm/modern/core/component/element/elementProcessor/baseElementProcessor.d.ts +0 -42
  40. package/esm/modern/core/component/element/elementProcessor/convertPaymentMethods.d.ts +0 -22
  41. package/esm/modern/core/component/element/elementProcessor/paymentProcessor.d.ts +0 -37
  42. package/esm/modern/core/component/element/index.d.ts +0 -17
  43. package/esm/modern/core/component/element/mock.d.ts +0 -10
  44. package/esm/modern/core/component/element/modernElementController/adapter.d.ts +0 -19
  45. package/esm/modern/core/component/element/modernElementController/index.d.ts +0 -172
  46. package/esm/modern/core/component/element/type.d.ts +0 -586
  47. package/esm/modern/core/component/element/util.d.ts +0 -93
  48. package/esm/modern/core/component/index.d.ts +0 -58
  49. package/esm/modern/core/instance/index.d.ts +0 -97
  50. package/esm/modern/core/utils/connectConfig.d.ts +0 -11
  51. package/esm/modern/foundation/core/index.d.ts +0 -36
  52. package/esm/modern/foundation/index.d.ts +0 -93
  53. package/esm/modern/foundation/product-processor/autoDebit/deps.d.ts +0 -14
  54. package/esm/modern/foundation/product-processor/autoDebit/index.d.ts +0 -48
  55. package/esm/modern/foundation/product-processor/easysafepay/deps.d.ts +0 -20
  56. package/esm/modern/foundation/product-processor/easysafepay/index.d.ts +0 -29
  57. package/esm/modern/foundation/product-processor/element/index.d.ts +0 -7
  58. package/esm/modern/foundation/service/api-bus/ability/globalData.d.ts +0 -10
  59. package/esm/modern/foundation/service/api-bus/ability/request.d.ts +0 -10
  60. package/esm/modern/foundation/service/api-bus/ability/security.d.ts +0 -12
  61. package/esm/modern/foundation/service/api-bus/ability/tracker.d.ts +0 -9
  62. package/esm/modern/foundation/service/api-bus/busManager.d.ts +0 -127
  63. package/esm/modern/foundation/service/api-bus/index.d.ts +0 -20
  64. package/esm/modern/foundation/service/api-bus/interface.d.ts +0 -48
  65. package/esm/modern/foundation/service/container/index.d.ts +0 -42
  66. package/esm/modern/foundation/service/container/popup.d.ts +0 -31
  67. package/esm/modern/foundation/service/container/utils.d.ts +0 -7
  68. package/esm/modern/foundation/service/event-center.d.ts +0 -82
  69. package/esm/modern/foundation/service/global-data/index.d.ts +0 -11
  70. package/esm/modern/foundation/service/index.d.ts +0 -19
  71. package/esm/modern/foundation/service/log/index.d.ts +0 -44
  72. package/esm/modern/foundation/service/log/keys.d.ts +0 -13
  73. package/esm/modern/foundation/service/log/processor.d.ts +0 -9
  74. package/esm/modern/foundation/service/log/types.d.ts +0 -33
  75. package/esm/modern/foundation/service/requester/deps.d.ts +0 -17
  76. package/esm/modern/foundation/service/requester/requester.d.ts +0 -22
  77. package/esm/modern/foundation/service/security/index.d.ts +0 -33
  78. package/esm/modern/foundation/service/security/security.d.ts +0 -54
  79. package/esm/modern/foundation/utils/gray_scale_utils.d.ts +0 -7
  80. package/esm/modern/foundation/utils/payment_context_utils.d.ts +0 -13
  81. package/esm/modern/foundation/utils/payment_product_utils.d.ts +0 -13
  82. package/esm/modern/foundation/utils/preload_helper.d.ts +0 -24
  83. package/esm/modern/foundation/utils/redirect_utils.d.ts +0 -11
  84. package/esm/modern/foundation/utils/system_events.d.ts +0 -4
  85. package/esm/modern/foundation/utils/web_app_url_utils.d.ts +0 -114
  86. package/esm/modern/loader/constant.d.ts +0 -36
  87. package/esm/modern/loader/utils/proxyPerformance.d.ts +0 -20
  88. package/esm/modern/main.d.ts +0 -54
  89. package/esm/modern/modern/loadAntomTracker.d.ts +0 -7
  90. package/esm/modern/modern/preload/antomManifestAdapter.d.ts +0 -11
  91. package/esm/modern/modern/preload/config.d.ts +0 -10
  92. package/esm/modern/modern/preload/gatewayPreconnection.d.ts +0 -53
  93. package/esm/modern/modern/preload/preloadAntomElements.d.ts +0 -9
  94. package/esm/modern/modern/preload/startAntomPreload.d.ts +0 -2
  95. package/esm/modern/modern/sdk/applepay-core/ApplePayHostService.d.ts +0 -102
  96. package/esm/modern/modern/sdk/elements/CVVElement.d.ts +0 -144
  97. package/esm/modern/modern/sdk/elements/PaymentElement.d.ts +0 -204
  98. package/esm/modern/modern/sdk/elements/appearanceRules.d.ts +0 -59
  99. package/esm/modern/modern/sdk/elements/appearanceRulesDefaults.d.ts +0 -2
  100. package/esm/modern/modern/sdk/eventsMap.d.ts +0 -135
  101. package/esm/modern/modern/sdk/oneapi/iexpfront/PaymentSessionService.d.ts +0 -69
  102. package/esm/modern/modern/sdk/oneapi/iexpfront/definitions.d.ts +0 -5311
  103. package/esm/modern/modern/sdk/oneapi/iexpfront/preConnection.d.ts +0 -6
  104. package/esm/modern/modern/sdk/stageName.d.ts +0 -3
  105. package/esm/modern/modern/sdk/tools/awaitWrap.d.ts +0 -14
  106. package/esm/modern/modern/sdk/tools/buildPageUrl.d.ts +0 -4
  107. package/esm/modern/modern/sdk/tools/checkSessionData.d.ts +0 -1
  108. package/esm/modern/modern/sdk/tools/expressElement/applePay.d.ts +0 -9
  109. package/esm/modern/modern/sdk/tools/expressElement/applePayHostToken.d.ts +0 -32
  110. package/esm/modern/modern/sdk/tools/expressElement/types.d.ts +0 -277
  111. package/esm/modern/modern/sdk/tools/getDevReqConfig.d.ts +0 -2
  112. package/esm/modern/modern/sdk/tools/getLocaleFromRenderData.d.ts +0 -6
  113. package/esm/modern/modern/sdk/tools/getMetaData.d.ts +0 -126
  114. package/esm/modern/modern/sdk/tools/modalMessageMonitor.d.ts +0 -41
  115. package/esm/modern/modern/sdk/tools/openModal.d.ts +0 -20
  116. package/esm/modern/modern/sdk/tools/paymentElement/applePayHostToken.d.ts +0 -38
  117. package/esm/modern/modern/sdk/tools/paymentElement/googlePayHostToken.d.ts +0 -38
  118. package/esm/modern/modern/sdk/tools/paymentElement/tracker.d.ts +0 -16
  119. package/esm/modern/modern/sdk/tools/paymentElement/walletHostListeners.d.ts +0 -19
  120. package/esm/modern/modern/sdk/tools/preloadTracking.d.ts +0 -5
  121. package/esm/modern/modern/sdk/tools/showToast.d.ts +0 -33
  122. package/esm/modern/modern/sdk/tools/validatePaymentAmount.d.ts +0 -19
  123. package/esm/modern/modern/sdk/tracking/elementTracker.d.ts +0 -65
  124. package/esm/modern/modern/sdk/types.d.ts +0 -310
  125. package/esm/modern/modern/tools.d.ts +0 -26
  126. package/esm/modern/plugin/applepay/component.d.ts +0 -50
  127. package/esm/modern/plugin/applepay/index.d.ts +0 -17
  128. package/esm/modern/plugin/applepay/interface.d.ts +0 -161
  129. package/esm/modern/plugin/applepay/service.d.ts +0 -54
  130. package/esm/modern/plugin/component/cashierApp.d.ts +0 -38
  131. package/esm/modern/plugin/component/channel.d.ts +0 -73
  132. package/esm/modern/plugin/component/component.inline.style.d.ts +0 -10
  133. package/esm/modern/plugin/component/component.popup.style.d.ts +0 -25
  134. package/esm/modern/plugin/component/index.d.ts +0 -133
  135. package/esm/modern/plugin/component/popupWindow.style.d.ts +0 -11
  136. package/esm/modern/plugin/const.d.ts +0 -2
  137. package/esm/modern/plugin/payment-element/utils.d.ts +0 -2
  138. package/esm/modern/plugin/paypal/index.d.ts +0 -20
  139. package/esm/modern/plugin/type.d.ts +0 -34
  140. package/esm/modern/plugin/utils.d.ts +0 -6
  141. package/esm/modern/preload/antomManifestAdapter.d.ts +0 -11
  142. package/esm/modern/preload/antomManifestAdapter.js +0 -117
  143. package/esm/modern/preload/config.d.ts +0 -10
  144. package/esm/modern/preload/config.js +0 -37
  145. package/esm/modern/preload/gatewayPreconnection.d.ts +0 -53
  146. package/esm/modern/preload/gatewayPreconnection.js +0 -213
  147. package/esm/modern/preload/preloadAntomElements.d.ts +0 -9
  148. package/esm/modern/preload/preloadAntomElements.js +0 -95
  149. package/esm/modern/preload/startAntomPreload.d.ts +0 -2
  150. package/esm/modern/preload/startAntomPreload.js +0 -9
  151. package/esm/modern/request/index.d.ts +0 -9
  152. package/esm/modern/request/utils.d.ts +0 -28
  153. package/esm/modern/service/index.d.ts +0 -13
  154. package/esm/modern/types/index.d.ts +0 -856
  155. package/esm/modern/util/beforeConfirm.d.ts +0 -14
  156. package/esm/modern/util/createIframeNode.d.ts +0 -6
  157. package/esm/modern/util/debug.d.ts +0 -1
  158. package/esm/modern/util/get.d.ts +0 -25
  159. package/esm/modern/util/getBackScheme.d.ts +0 -5
  160. package/esm/modern/util/index.d.ts +0 -61
  161. package/esm/modern/util/jshield-apdid/apdid-loader.d.ts +0 -89
  162. package/esm/modern/util/jshield-apdid/index.d.ts +0 -21
  163. package/esm/modern/util/logger.d.ts +0 -67
  164. package/esm/modern/util/mock.d.ts +0 -1
  165. package/esm/modern/util/redirect.d.ts +0 -6
  166. package/esm/modern/util/security-registry.d.ts +0 -72
  167. package/esm/modern/util/security.d.ts +0 -55
  168. package/esm/modern/util/spm-map.d.ts +0 -217
  169. package/esm/modern/util/storage.d.ts +0 -2
  170. package/esm/modern/util/timezone.d.ts +0 -1
  171. package/esm/modern/util/upgrade.d.ts +0 -39
  172. package/esm/modern/util/versionCompare.d.ts +0 -15
@@ -1,6 +0,0 @@
1
- import { type RequestOptions } from '@antintl/antom-toolset';
2
- /** Warm up the gateway selected by the shared request configuration. */
3
- export declare function preConnection(payload?: Record<string, never>, extraParams?: RequestOptions): Promise<Record<string, unknown> & {
4
- traceId?: string;
5
- errorMessage?: string;
6
- }>;
@@ -1,3 +0,0 @@
1
- type StageName = 'DEV' | 'PROD' | 'LOCAL';
2
- export declare const stageName: StageName;
3
- export {};
@@ -1,14 +0,0 @@
1
- import type { ErrorPayload } from '@antintl/opensdk-core';
2
- /**
3
- * @description 将 Promise 拍平为 {error, data} 格式,避免 try-catch 嵌套
4
- * @template T Promise resolve 的值类型
5
- * @param promise 待处理的 Promise
6
- * @returns {error, data} 对象,error 为 AntomError,data 为 resolve 的值
7
- */
8
- export declare function awaitWrap<T>(promise: Promise<T>): Promise<{
9
- error: ErrorPayload<string>;
10
- data: undefined;
11
- } | {
12
- error: undefined;
13
- data: T;
14
- }>;
@@ -1,4 +0,0 @@
1
- /**
2
- * 根据pathname构建页面地址
3
- */
4
- export declare function buildPageUrl(pathname: string, elements2?: boolean): string;
@@ -1 +0,0 @@
1
- export declare function checkSessionData(sessionData?: string, expectedProductScene?: string): import("./getMetaData").IPaymentSessionMetaData;
@@ -1,9 +0,0 @@
1
- /**
2
- * Load the Apple Pay SDK script into the host document.
3
- *
4
- * 缓存策略:成功才长期缓存;Android 永不支持,缓存 false 无需重试。
5
- * 失败/超时清空 `_sdkPromise` 允许下次调用重试,避免单个挂起的 Promise 被模块级缓存永久锁死。
6
- */
7
- export declare function loadHostApplePaySdk(): Promise<boolean>;
8
- /** Extract the Apple Pay paymentRequest object from sdkQuery renderData. */
9
- export declare function extractApplePayRequest(renderData: any): any;
@@ -1,32 +0,0 @@
1
- import type { ExpressAppConfig, ExpressElementEvents } from './types';
2
- type ApplePayTokenReply = ExpressElementEvents['OPENSDK@GET_APPLE_PAY_TOKEN_REPLY'];
3
- interface HandleApplePayTokenAtHostOptions {
4
- requestId: string;
5
- renderData: unknown;
6
- appConfig?: ExpressAppConfig;
7
- /** iframe 已转好的 major unit 金额(来自 resolvedAmount);host 委托直接消费,不再做 minor→major 转换。 */
8
- walletAmount?: {
9
- value: string;
10
- currency: string;
11
- };
12
- sendReply: (payload: ApplePayTokenReply) => void;
13
- }
14
- /**
15
- * 非 Safari PC 路径:host 只负责在顶层 document 拉起 ApplePaySession 并取 token。
16
- * token 回到 express_element webapp 后,submit/2DS/3DS/polling 继续由 webapp 承接。
17
- */
18
- export declare function handleApplePayTokenAtHost({ requestId, renderData, appConfig, walletAmount, sendReply, }: HandleApplePayTokenAtHostOptions): Promise<void>;
19
- export declare function buildRecurringPaymentRequest(sessionData: string, merchantInfo: {
20
- countryCode?: string;
21
- merchantName?: string;
22
- } | undefined, paymentAmount: {
23
- value?: string;
24
- currency?: string;
25
- } | undefined): {
26
- paymentDescription: string;
27
- billingAgreement?: string;
28
- regularBilling: any;
29
- managementURL: string;
30
- tokenNotificationURL?: string;
31
- } | null;
32
- export {};
@@ -1,277 +0,0 @@
1
- import type { BaseElementAppConfig, BaseElementConfig, ErrorPayload } from '@antintl/opensdk-core';
2
- import type { AppearanceRuleSelector, PickAntomAppearance } from '../../elements/appearanceRules';
3
- import type { AntomBridgeWithNativeEventMap, PreloadTelemetryContext } from '../../types';
4
- export declare const SUPPORTED_EXPRESS_METHODS: readonly ["paypal", "applePay", "googlePay", "alipay"];
5
- export type ExpressPaymentMethod = (typeof SUPPORTED_EXPRESS_METHODS)[number];
6
- export type ExpressSetupError = ErrorPayload & {
7
- expressPaymentType?: ExpressPaymentMethod;
8
- /** 服务端返回的 errorMessage 已完成国际化,可直接对客展示 */
9
- mulityLanguageMapping?: boolean;
10
- };
11
- /** Express element appearance properties. */
12
- export type ExpressAppearanceProps = {
13
- displaySetting: 'showCardBrandIcon';
14
- theme: 'light' | 'dark';
15
- layout: 'accordion' | 'tabs';
16
- rules: AppearanceRuleSelector<string>;
17
- };
18
- /** Express element appearance configuration. */
19
- type ExpressAppearance = PickAntomAppearance<ExpressAppearanceProps>;
20
- /** Backward-compatible name for the Express appearance configuration. */
21
- export type AppearanceSetting = ExpressAppearance;
22
- /**
23
- * @public
24
- * @description PayPal button style configuration
25
- */
26
- export interface PayPalButtonStyle {
27
- /** Button shape: rect (rectangle) | pill (capsule) | sharp (square corners) */
28
- shape?: 'rect' | 'pill' | 'sharp';
29
- }
30
- /**
31
- * @public
32
- * @description PayPal payment method configuration
33
- */
34
- export interface PayPalConfig {
35
- /** Merchant ID, used internally by Ant to query PayPal account */
36
- channelMerchantAccountId?: string;
37
- /** Button style (fine-grained override) */
38
- style?: PayPalButtonStyle;
39
- businessDivision?: string;
40
- /** Callback to create PayPal order, no params, returns sessionData */
41
- createOrder?: () => Promise<string>;
42
- /** Callback when user changes shipping address, data is raw data returned by PayPal */
43
- onShippingAddressChange?: (data: any, actions: any) => Promise<void>;
44
- /** Callback when user changes shipping option, data is raw data returned by PayPal */
45
- onShippingOptionsChange?: (data: any, actions: any) => Promise<void>;
46
- }
47
- /** shippingaddresschange 事件 resolve 参数 */
48
- export interface ShippingResolveOptions {
49
- shippingRates?: Array<{
50
- id: string;
51
- displayName: string;
52
- amount: string;
53
- }>;
54
- lineItems?: Array<{
55
- name: string;
56
- amount: string;
57
- }>;
58
- }
59
- /** shippingratechange 事件 resolve 参数 */
60
- export interface RateResolveOptions {
61
- lineItems?: Array<{
62
- name: string;
63
- amount: string;
64
- }>;
65
- }
66
- /** confirm 事件负载(统一终态,替代 approve) */
67
- export interface ExpressConfirmData {
68
- expressPaymentType: string;
69
- billingDetails?: {
70
- name?: string;
71
- email?: string;
72
- phone?: string;
73
- address?: {
74
- line1?: string;
75
- line2?: string;
76
- city?: string;
77
- state?: string;
78
- postalCode?: string;
79
- country?: string;
80
- };
81
- };
82
- shippingAddress?: {
83
- name?: string;
84
- phone?: string;
85
- address?: {
86
- line1?: string;
87
- line2?: string;
88
- city?: string;
89
- state?: string;
90
- postalCode?: string;
91
- country?: string;
92
- };
93
- };
94
- /** 支付方式返回的原始支付数据(如 alipayCn、applePay 等) */
95
- paymentData?: unknown;
96
- /**
97
- * 商户主动拒绝本次支付(如库存不足、价格变动等)。
98
- * 调用后 SDK 立即取消支付流程,confirmPayment() 无需调用。
99
- */
100
- paymentFailed: () => void;
101
- }
102
- /** click 事件负载(纯通知,商户可用于埋点,SDK 不等待响应) */
103
- export interface ExpressClickEvent {
104
- expressPaymentType: string;
105
- }
106
- /** cancel 事件负载 */
107
- export interface ExpressCancelEvent {
108
- expressPaymentType: string;
109
- data?: any;
110
- }
111
- /**
112
- * @public
113
- * @description Express element app config type
114
- */
115
- export interface ExpressAppConfig extends BaseElementAppConfig {
116
- /** Express appearance configuration. */
117
- appearance?: ExpressAppearance;
118
- /** payment SessionData */
119
- sessionData?: string;
120
- /**
121
- * Amount & Currency
122
- *
123
- * For Apple Pay and Google Pay, `value` is a positive ASCII digit string in
124
- * the payment session currency's minor unit; `currency` may be omitted.
125
- * For example, USD 10.99 is passed as `{ value: '1099' }`.
126
- * PayPal keeps its existing major-unit amount semantics and requires `currency`.
127
- */
128
- amount?: {
129
- currency?: string;
130
- value: string;
131
- };
132
- /** PayPal 配置 */
133
- paypal?: PayPalConfig;
134
- /**
135
- * Button text type (following Stripe Express Checkout Element design)
136
- * Each payment method can independently set the button display text.
137
- */
138
- buttonType?: {
139
- /** PayPal: paypal | checkout | buynow | pay */
140
- paypal?: 'paypal' | 'checkout' | 'buynow' | 'pay';
141
- [method: string]: string | undefined;
142
- };
143
- /**
144
- * Unified height for all buttons (px)
145
- */
146
- buttonHeight?: number;
147
- /**
148
- * Button color theme (following Stripe Express Checkout Element design)
149
- * Each payment method can independently set the theme color.
150
- */
151
- buttonTheme?: {
152
- /** PayPal: gold | blue | silver | white | black */
153
- paypal?: 'gold' | 'blue' | 'silver' | 'white' | 'black';
154
- [method: string]: string | undefined;
155
- };
156
- /**
157
- * List of enabled payment methods, also determines button rendering order
158
- * Required when integrating PayPal, append string for new payment methods
159
- * @example ['paypal']
160
- */
161
- paymentMethods?: string[];
162
- /**
163
- * @internal setup 阶段的错误信息,传给 iframe 侧处理
164
- */
165
- setupError?: ExpressSetupError;
166
- /**
167
- * @internal Locale is injected from loadAntom and defaults to en_US.
168
- */
169
- locale?: string;
170
- /** @internal PayPal v6 core script environment injected from the element env. */
171
- _paypalSdkEnvironment?: 'sandbox' | 'prod';
172
- /** @internal Elements2 preload grouping data. */
173
- preloadTelemetryContext?: PreloadTelemetryContext;
174
- /**
175
- * 是否运行在 Native App 的 WebView 中。
176
- * 为 true 时,跳转通过 onRedirect 事件委托给 Native 端处理。
177
- */
178
- isNativeAppWebview?: boolean;
179
- /** @internal SDK host 侧商户域名,供 Apple Pay merchant validation 使用 */
180
- merchantDomain?: string;
181
- /** @internal Elements2 历史协议字段,含义同 merchantDomain */
182
- doMain?: string;
183
- }
184
- /**
185
- * @public
186
- * @description Express element config type
187
- */
188
- export interface ExpressElementConfig extends BaseElementConfig<ExpressAppConfig> {
189
- }
190
- /**
191
- * @public
192
- * @description Express element events type
193
- */
194
- export interface ExpressElementEvents extends AntomBridgeWithNativeEventMap<ExpressAppConfig> {
195
- ready: {
196
- availablePaymentMethods: Record<string, boolean>;
197
- };
198
- click: ExpressClickEvent;
199
- confirm: ExpressConfirmData;
200
- error: ErrorPayload & {
201
- expressPaymentType: string;
202
- };
203
- cancel: ExpressCancelEvent;
204
- shippingaddresschange: {
205
- expressPaymentType: string;
206
- address: any;
207
- resolve: (options: ShippingResolveOptions) => void;
208
- reject: (reason: string) => void;
209
- };
210
- shippingratechange: {
211
- expressPaymentType: string;
212
- shippingRate: any;
213
- resolve: (options: RateResolveOptions) => void;
214
- };
215
- contentHeightChanged: {
216
- height: number;
217
- };
218
- 'OPENSDK@CLICK': {
219
- expressPaymentType: string;
220
- };
221
- 'OPENSDK@CLICK_RESOLVE': Record<string, never>;
222
- 'OPENSDK@PAYPAL_CREATE_ORDER': {
223
- requestId: string;
224
- };
225
- 'OPENSDK@PAYPAL_CREATE_ORDER_REPLY': {
226
- requestId: string;
227
- sessionData?: string;
228
- error?: string;
229
- };
230
- 'OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE': {
231
- requestId: string;
232
- shippingData: any;
233
- };
234
- 'OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY': {
235
- requestId: string;
236
- error?: string;
237
- };
238
- 'OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE': {
239
- requestId: string;
240
- shippingData: any;
241
- };
242
- 'OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY': {
243
- requestId: string;
244
- error?: string;
245
- };
246
- 'OPENSDK@GET_APPLE_PAY_TOKEN': {
247
- requestId: string;
248
- expressPaymentType: string;
249
- /** iframe 已转好的 major unit 金额(来自 resolvedAmount);host 委托 Apple Pay 消费,不再做 minor→major 转换。 */
250
- walletAmount?: {
251
- value: string;
252
- currency: string;
253
- };
254
- };
255
- /** host 完成 Apple Pay token 获取后回包给 iframe,submit/3DS/polling 均由 webapp 完成 */
256
- 'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': {
257
- requestId: string;
258
- success: boolean;
259
- result?: any;
260
- errorCode?: string;
261
- errorMessage?: string;
262
- billingDetails?: any;
263
- shippingAddress?: any;
264
- };
265
- 'OPENSDK@UPDATE_CONFIG_REPLY': {
266
- error?: ErrorPayload<string>;
267
- };
268
- 'OPENSDK@COMPLETE_PAYMENT_REJECT': Record<string, never>;
269
- onRedirect: {
270
- normalUrl: string;
271
- applinkUrl?: string;
272
- schemaUrl?: string;
273
- isDestroy: boolean;
274
- needReset: boolean;
275
- };
276
- }
277
- export {};
@@ -1,2 +0,0 @@
1
- import { type RequestOptions } from '@antintl/antom-toolset';
2
- export declare function getDevReqConfig(): Partial<RequestOptions> | undefined;
@@ -1,6 +0,0 @@
1
- export declare function getLocaleFromRenderData(renderData?: {
2
- supportedLanguages?: {
3
- preferred?: boolean;
4
- locale?: string;
5
- }[];
6
- }): string | undefined;
@@ -1,126 +0,0 @@
1
- import type { PaymentSessionAction, PaymentSessionConfig, SessionSecurityConfig } from '../oneapi/iexpfront/definitions';
2
- export interface FrontModulesToBeLoadedInterface {
3
- acquirerName: string;
4
- scriptUrl: string;
5
- }
6
- export interface IApplePayContactField {
7
- email: string;
8
- name: string;
9
- phone: string;
10
- postalAddress: string;
11
- phoneticName: string;
12
- }
13
- export interface IPaymentSessionMetaData {
14
- clientId?: string;
15
- renderDisplayType?: string;
16
- paymentSessionConfig?: PaymentSessionConfig;
17
- securityConfig?: SessionSecurityConfig;
18
- moneyView?: any;
19
- extendInfo?: string;
20
- paymentMethodInfoView?: any;
21
- paymentView?: any;
22
- modernWeb?: boolean;
23
- action?: PaymentSessionAction;
24
- /**
25
- * @description 是一个string,灰度开关,格式为 flag1,flag2,flag3
26
- */
27
- flowSwitchTags?: string;
28
- authUrlInfo?: {
29
- appIdentifier?: string;
30
- applinkUrl?: string;
31
- normalUrl?: string;
32
- schemeUrl?: string;
33
- authUrl?: string;
34
- };
35
- paymentSessionFactor?: {
36
- externalRiskTimeout?: number;
37
- extendInfo?: {
38
- merchantCapabilities?: string[];
39
- supportedNetworks?: string[];
40
- requiredBillingContactFields: IApplePayContactField[];
41
- requiredShippingContactFields: IApplePayContactField[];
42
- };
43
- merchantInfo?: {
44
- registeredCountry?: string;
45
- partnerId?: string;
46
- merchantName?: string;
47
- };
48
- order?: {
49
- orderDescription: string;
50
- };
51
- paymentAmount?: {
52
- value?: string;
53
- currency?: string;
54
- };
55
- paymentMethodInfo?: {
56
- paymentMethodType?: string;
57
- };
58
- paymentMethodViewMetaData?: any;
59
- paymentRequestId?: string;
60
- supportedLanguages?: any;
61
- /**
62
- * 当前为苹果分期场景的信息
63
- */
64
- recurringInfo?: {
65
- /**
66
- * 代扣协议开始日期 不传为当前系统时间
67
- */
68
- startDate?: number;
69
- /**
70
- * 代扣协议结束日期 不传不限制结束时间
71
- */
72
- endDate?: number;
73
- /**
74
- * 付款时间间隔单位,支持:"year" "month" "day" "hour" "minute" 不传默认month
75
- */
76
- intervalUnit?: string;
77
- /**
78
- * 付款时间间隔。比如每过6个月付款一次,intervalCount就是6, 不传默认为1
79
- */
80
- intervalCount?: number;
81
- /**
82
- * 分期标题信息
83
- */
84
- title?: string;
85
- /**
86
- * 分期管理页面
87
- */
88
- managementURL?: string;
89
- /**
90
- * 苹果通知ipay MAPN信息变更的地址
91
- */
92
- tokenNotificationURL?: string;
93
- /**
94
- * 分期协议描述
95
- */
96
- agreementDescription?: string;
97
- };
98
- frontModulesToBeLoaded?: FrontModulesToBeLoadedInterface[];
99
- };
100
- connectFactor?: {
101
- enableConnect?: boolean;
102
- };
103
- skipRenderPaymentMethod?: boolean;
104
- needAccountConfirmPage?: boolean;
105
- }
106
- export declare const getMetaData: (sessionData: string) => IPaymentSessionMetaData;
107
- /**
108
- * Local debug switch used to force modernWeb in production during controlled rollout.
109
- */
110
- export declare const MODERN_WEB_STORAGE_KEY = "antom-web-checkout-v2_modern_web";
111
- /**
112
- * Resolves whether a session enables the selected modern Web flow.
113
- *
114
- * @param sessionData Opaque payment session data parsed by `getMetaData`.
115
- * @param key Exact, case-sensitive `flowSwitchTags` entry to match.
116
- * @returns The resolved modern-flow state and the non-production frontend source when present.
117
- */
118
- export declare const isModernWeb: (sessionData: string | undefined, key?: string) => {
119
- fromFrontend?: boolean;
120
- modernWeb: boolean;
121
- };
122
- /**
123
- * @param sessionData
124
- */
125
- export declare function adjustSessionData(sessionData: string | undefined): string;
126
- export declare const isElements2: (sessionData: string | undefined) => boolean;
@@ -1,41 +0,0 @@
1
- interface ModalMessageReport {
2
- stage: string;
3
- modalId: string;
4
- scope: string;
5
- origin: string;
6
- elapsedMs: number;
7
- modalState: string;
8
- modalStyle: string;
9
- iframePath: string;
10
- visibilityState: string;
11
- layerState: string;
12
- sourceState: string;
13
- sourceFrameIndex: number;
14
- modalCount: number;
15
- overlayCount: number;
16
- }
17
- /** Maps a modal lifecycle snapshot to the shared tracker field schema. */
18
- export declare const getModalMessageTrackData: (data: ModalMessageReport) => {
19
- d1: string;
20
- d2: string;
21
- d3: string;
22
- d4: string;
23
- d5: string;
24
- d6: string;
25
- d7: string;
26
- d8: string;
27
- d9: string;
28
- d10: string;
29
- d11: string;
30
- m1: number;
31
- m2: number;
32
- m3: number;
33
- };
34
- /**
35
- * Installs a passive host-window monitor for the modal bridge lifecycle.
36
- * @param report Receives sanitized lifecycle snapshots.
37
- * @param acceptOpen Restricts which OPEN_MODAL source starts this monitor.
38
- * @returns A function that removes the listener and pending timers.
39
- */
40
- export declare function installModalMessageMonitor(report: (data: ModalMessageReport) => void, acceptOpen?: (event: MessageEvent) => boolean): () => void;
41
- export {};
@@ -1,20 +0,0 @@
1
- import type { BaseOpenModalConfig } from '@antintl/opensdk-core';
2
- export interface OpenModalParams extends Omit<BaseOpenModalConfig, 'hideCloseWhenLoaded'> {
3
- mode: 'desktop' | 'mobile';
4
- loadingConfig?: {
5
- theme?: 'light' | 'dark';
6
- backgroundColor?: string;
7
- };
8
- textDirection?: 'ltr' | 'rtl';
9
- }
10
- export declare const openModal: (params: OpenModalParams) => {
11
- iframe: HTMLIFrameElement;
12
- destroy: () => void;
13
- };
14
- /**
15
- *
16
- * @param designSize 设计的size
17
- * @param maxFontSize 最大fontsize
18
- * @returns 确认后的size
19
- */
20
- export declare function getDesignFontSize(designSize?: number, maxFontSize?: number): number;
@@ -1,38 +0,0 @@
1
- import { Logger } from "../../../../util/logger";
2
- import type { PaymentHostTracker } from './tracker';
3
- /** webapp 传来的 OPENSDK@GET_APPLE_PAY_TOKEN payload 形态。 */
4
- export interface GetApplePayTokenRequest {
5
- paymentMethod?: {
6
- paymentMethodDetail?: {
7
- applePayProps?: {
8
- paymentRequest?: unknown;
9
- };
10
- };
11
- };
12
- shipping?: unknown;
13
- }
14
- /** host 回传 webapp 的 OPENSDK@GET_APPLE_PAY_TOKEN_REPLY 形态(result 对齐老链路 {token,billingContact,shippingContact})。 */
15
- export interface GetApplePayTokenReply {
16
- success: boolean;
17
- result?: {
18
- token?: unknown;
19
- billingContact?: unknown;
20
- shippingContact?: unknown;
21
- } | {
22
- errorCode: string;
23
- };
24
- }
25
- interface HandleApplePayTokenAtHostOptions {
26
- sessionData: string;
27
- env: string;
28
- payload: unknown;
29
- logger: Logger;
30
- tracker: PaymentHostTracker;
31
- sendReply: (reply: GetApplePayTokenReply) => void;
32
- }
33
- /**
34
- * host 端拉起 Apple Pay sheet 拿 token,拿到后通过 sendReply 回传给 webapp。
35
- * 失败/取消也通过 sendReply 回传,webapp 侧自行决定是否走 doSubmit。
36
- */
37
- export declare function handleApplePayTokenAtHost({ sessionData, env, payload, logger, tracker, sendReply, }: HandleApplePayTokenAtHostOptions): Promise<void>;
38
- export {};
@@ -1,38 +0,0 @@
1
- import type { PaymentHostTracker } from './tracker';
2
- /** webapp 传来的 OPENSDK@GET_GOOGLE_PAY_TOKEN payload 形态。 */
3
- export interface GetGooglePayTokenRequest {
4
- actionName?: string;
5
- data?: {
6
- environment?: string;
7
- paymentRequest?: unknown;
8
- paymentMethod?: unknown;
9
- paymentMethodDetail?: {
10
- googlePayProps?: {
11
- environment?: string;
12
- paymentRequest?: unknown;
13
- };
14
- };
15
- [key: string]: unknown;
16
- };
17
- }
18
- /** host 回传 webapp 的 OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY 形态。 */
19
- export interface GetGooglePayTokenReply {
20
- success: boolean;
21
- result?: unknown;
22
- err?: {
23
- statusCode?: string;
24
- [key: string]: unknown;
25
- };
26
- }
27
- type SendReply = (reply: GetGooglePayTokenReply) => void;
28
- interface HandleGooglePayTokenAtHostOptions {
29
- payload: unknown;
30
- tracker: PaymentHostTracker;
31
- sendReply: SendReply;
32
- }
33
- /**
34
- * host 端拉起 Google Pay 拿 token,通过 sendReply 回传给 webapp。
35
- * 动态加载 GP SDK(若未加载)→ PaymentsClient.isReadyToPay → loadPaymentData。
36
- */
37
- export declare function handleGooglePayTokenAtHost({ payload, tracker, sendReply }: HandleGooglePayTokenAtHostOptions): void;
38
- export {};
@@ -1,16 +0,0 @@
1
- import { type ApiError, type ApiOutput, type ApiReport, type AsyncApiRunOptions, type ElementTracker, type ElementTrackerEnrichment, type SyncApiRunOptions } from '../../tracking/elementTracker';
2
- export { normalizeElementEventName } from '../../tracking/elementTracker';
3
- export type { ApiOutcome } from '../../tracking/elementTracker';
4
- export type PaymentTrackerEnrichment = ElementTrackerEnrichment;
5
- export type PaymentApiReport = ApiReport;
6
- export type PaymentApiOutput = ApiOutput;
7
- export type PaymentApiError = ApiError;
8
- export type PaymentAsyncApiRunOptions<T> = AsyncApiRunOptions<T>;
9
- export type PaymentSyncApiRunOptions<T> = SyncApiRunOptions<T>;
10
- export type PaymentHostTracker = ElementTracker;
11
- interface CreatePaymentHostTrackerOptions {
12
- env?: string;
13
- locale?: string;
14
- elementInstanceId?: string;
15
- }
16
- export declare function createPaymentHostTracker(sessionData?: string, options?: CreatePaymentHostTrackerOptions): PaymentHostTracker;
@@ -1,19 +0,0 @@
1
- import { Logger } from "../../../../util/logger";
2
- import { type PaymentHostTracker } from './tracker';
3
- /** BaseMainElement 的 on/send 收发接口(避免耦合具体 element 类)。 */
4
- export interface WalletHostBridge {
5
- on: (event: string, handler: (payload: unknown) => void) => void;
6
- send: (event: string, payload: unknown) => void;
7
- }
8
- interface RegisterWalletHostListenersOptions {
9
- bridge: WalletHostBridge;
10
- sessionData: string | undefined;
11
- env: string;
12
- logger: Logger;
13
- tracker?: PaymentHostTracker;
14
- }
15
- /**
16
- * 注册 GP/AP host 监听。在 element setup() 内调用一次,生命周期与 element 一致。
17
- */
18
- export declare function registerWalletHostListeners({ bridge, sessionData, env, logger, tracker, }: RegisterWalletHostListenersOptions): void;
19
- export {};
@@ -1,5 +0,0 @@
1
- import type { AntomPreloadElement } from '../../preload/config';
2
- import type { PreloadTelemetryContext } from '../types';
3
- export declare function trackPreloadAtElementCreate(element: AntomPreloadElement, sessionData: string | undefined, env: 'sandbox' | 'prod'): void;
4
- export declare function getPreloadTelemetryContext(element: AntomPreloadElement, env: 'sandbox' | 'prod'): PreloadTelemetryContext;
5
- export declare function trackGatewayPreconnectionAtFirstRpcEnd(env: 'sandbox' | 'prod'): void;