@alipay/ams-checkout 0.0.1787898127-dev.2 → 0.0.1787898127-dev.21
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/dist/ams-checkout.min.js.map +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/ckp/index.js +21 -1
- package/esm/core/component/element/elementController/index.js +4 -3
- package/esm/core/component/element/modernElementController/adapter.js +3 -3
- package/esm/core/component/element/modernElementController/index.d.ts +6 -1
- package/esm/core/component/element/modernElementController/index.js +260 -189
- package/esm/core/component/element/type.d.ts +2 -2
- package/esm/foundation/service/log/keys.js +4 -0
- package/esm/index.d.ts +6 -7
- package/esm/index.js +9 -14
- 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/sdk/elements/appearanceRules.d.ts +59 -0
- package/esm/modern/tools.js +1 -1
- package/esm/tsdoc-metadata.json +1 -1
- 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 +12 -12
- package/types.d.ts +401 -78
- package/types.untrimmed.d.ts +407 -78
package/types.d.ts
CHANGED
|
@@ -208,18 +208,22 @@ export declare type AntomLayouts = 'tabs' | 'accordion';
|
|
|
208
208
|
*/
|
|
209
209
|
export declare class AntomSDK extends BaseElementsFactory {
|
|
210
210
|
static version: string;
|
|
211
|
+
private stopModalMessageMonitor;
|
|
212
|
+
private readonly apiTracker;
|
|
211
213
|
constructor(config?: AntomSDKConfig);
|
|
212
214
|
protected canUseElements(): Array<ElementListItemType>;
|
|
215
|
+
init(): Promise<this>;
|
|
213
216
|
/**
|
|
214
217
|
* @description 更新配置
|
|
215
218
|
*/
|
|
216
219
|
updateConfig(config: Partial<BaseFactoryConfig>): void;
|
|
220
|
+
destroy(): void;
|
|
217
221
|
/* Excluded from this release type: redirect */
|
|
218
222
|
/* Excluded from this release type: openModal */
|
|
219
223
|
elements(): Elements;
|
|
220
224
|
createElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
|
|
221
225
|
createElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
|
|
222
|
-
createElement(elementType: 'CVV', options
|
|
226
|
+
createElement(elementType: 'CVV', options: CVVAppConfig): CVVElement;
|
|
223
227
|
createElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
|
|
224
228
|
createElement(elementType: 'expressVaulting', options?: ExpressVaultingAppConfig): ExpressVaultingElement;
|
|
225
229
|
getElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
|
|
@@ -233,7 +237,9 @@ export declare class AntomSDK extends BaseElementsFactory {
|
|
|
233
237
|
*/
|
|
234
238
|
private extractMainElement;
|
|
235
239
|
confirmCardSetup(options: ConfirmCardSetupOptions): Promise<SubmitResult>;
|
|
240
|
+
private runConfirmCardSetup;
|
|
236
241
|
confirmPayment(options: ConfirmPaymentOptions): Promise<SubmitResult>;
|
|
242
|
+
private runConfirmPayment;
|
|
237
243
|
/**
|
|
238
244
|
* 触发 Express Vaulting element 的 PayPal 绑卡提交流程。
|
|
239
245
|
*
|
|
@@ -306,9 +312,29 @@ export declare const AntomSDKErrorCodes: {
|
|
|
306
312
|
*/
|
|
307
313
|
readonly AMOUNT_VALUE_EMPTY: "AMOUNT_VALUE_EMPTY";
|
|
308
314
|
/**
|
|
309
|
-
* @description
|
|
315
|
+
* @description 金额格式非法(仅允许 ASCII 数字字符串)
|
|
310
316
|
*/
|
|
311
317
|
readonly AMOUNT_VALUE_INVALID: "AMOUNT_VALUE_INVALID";
|
|
318
|
+
/**
|
|
319
|
+
* @description Amount currency does not match the payment session currency
|
|
320
|
+
*/
|
|
321
|
+
readonly AMOUNT_CURRENCY_MISMATCH: "AMOUNT_CURRENCY_MISMATCH";
|
|
322
|
+
/**
|
|
323
|
+
* @description Amount currency is not supported
|
|
324
|
+
*/
|
|
325
|
+
readonly AMOUNT_CURRENCY_UNSUPPORTED: "AMOUNT_CURRENCY_UNSUPPORTED";
|
|
326
|
+
/**
|
|
327
|
+
* @description Amount currency precision is not supported
|
|
328
|
+
*/
|
|
329
|
+
readonly AMOUNT_PRECISION_UNSUPPORTED: "AMOUNT_PRECISION_UNSUPPORTED";
|
|
330
|
+
/**
|
|
331
|
+
* @description Amount conversion timed out
|
|
332
|
+
*/
|
|
333
|
+
readonly AMOUNT_RESOLVE_TIMEOUT: "AMOUNT_RESOLVE_TIMEOUT";
|
|
334
|
+
/**
|
|
335
|
+
* @description Amount conversion failed
|
|
336
|
+
*/
|
|
337
|
+
readonly AMOUNT_RESOLVE_FAILED: "AMOUNT_RESOLVE_FAILED";
|
|
312
338
|
readonly GENERATE_ELEMENT_KEY_FAILED: "GENERATE_ELEMENT_KEY_FAILED";
|
|
313
339
|
readonly ELEMENT_INIT_FAILED: "ELEMENT_INIT_FAILED";
|
|
314
340
|
readonly MOUNT_TIMEOUT: "MOUNT_TIMEOUT";
|
|
@@ -321,15 +347,12 @@ export declare const AntomSDKErrorCodes: {
|
|
|
321
347
|
readonly ELEMENT_DEFINE_ERROR: "ELEMENT_DEFINE_ERROR";
|
|
322
348
|
readonly ELEMENT_ALREADY_REGISTERED: "ELEMENT_ALREADY_REGISTERED";
|
|
323
349
|
readonly CANNOT_CREATE_SAME_ELEMENT_TWICE: "CANNOT_CREATE_SAME_ELEMENT_TWICE";
|
|
324
|
-
readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT";
|
|
325
|
-
readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT";
|
|
350
|
+
readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT"; /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
|
|
351
|
+
readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT"; /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
|
|
326
352
|
readonly NOT_SUPPORT_ELEMENT: "NOT_SUPPORT_ELEMENT";
|
|
327
353
|
readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
|
|
328
354
|
readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
|
|
329
355
|
readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
|
|
330
|
-
/**
|
|
331
|
-
* 查询到的结果消息
|
|
332
|
-
*/
|
|
333
356
|
readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
|
|
334
357
|
readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
|
|
335
358
|
readonly API_MISS_PARAMS: "API_MISS_PARAMS";
|
|
@@ -347,7 +370,11 @@ export declare type AntomSDKErrorCodes = (typeof AntomSDKErrorCodes)[keyof typeo
|
|
|
347
370
|
|
|
348
371
|
export declare type AntomTheme = 'default' | 'agateGreen' | 'night' | 'nostalgicGray' | 'gamingPurple' | 'cherryBlossomPink' | 'light';
|
|
349
372
|
|
|
350
|
-
|
|
373
|
+
/**
|
|
374
|
+
* @deprecated Use {@link AppearanceVariables} (Token 2.0) instead.
|
|
375
|
+
* 保留仅为向后兼容,将在下一个 major 版本中删除。
|
|
376
|
+
*/
|
|
377
|
+
export declare type AntomVariables = LegacyAppearanceVariables;
|
|
351
378
|
|
|
352
379
|
/**
|
|
353
380
|
* @description SDK UI组件的外观配置。
|
|
@@ -363,12 +390,80 @@ declare interface Appearance<Props extends Partial<DefaultAppearanceProps> = Def
|
|
|
363
390
|
fonts?: FontSource[];
|
|
364
391
|
}
|
|
365
392
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
393
|
+
/** Target-level layout declarations admitted before runtime capability intersection. */
|
|
394
|
+
export declare type AppearanceLayoutDeclarations = {
|
|
395
|
+
[Property in Exclude<AppearanceLayoutProperty, 'height'>]?: AppearanceSpacingValue;
|
|
396
|
+
} & {
|
|
397
|
+
/** Exact integer-pixel enum allocated by the target contract. */
|
|
398
|
+
readonly height?: `${number}px`;
|
|
370
399
|
};
|
|
371
400
|
|
|
401
|
+
/** Controlled layout longhands intersected with the concrete Part at runtime. */
|
|
402
|
+
export declare type AppearanceLayoutProperty = 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'height';
|
|
403
|
+
|
|
404
|
+
/** Paint declarations accepted before WebApp and Components runtime validation. */
|
|
405
|
+
declare type AppearancePaintDeclarations = Partial<Record<Exclude<AppearancePaintProperty, 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'textDecorationStyle' | 'outlineStyle'>, string> & Record<'fillOpacity' | 'strokeOpacity' | 'strokeWidth', string | number> & {
|
|
406
|
+
textDecorationStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'dashed' | 'dotted' | 'double' | 'solid' | 'wavy';
|
|
407
|
+
outlineStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'auto' | 'dashed' | 'dotted' | 'double' | 'groove' | 'inset' | 'none' | 'outset' | 'ridge' | 'solid';
|
|
408
|
+
}>;
|
|
409
|
+
|
|
410
|
+
/** Paint-only property names exposed by the SDK contract. */
|
|
411
|
+
export declare 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';
|
|
412
|
+
|
|
413
|
+
/** Paint declarations plus controlled typography and target-level layout fields. */
|
|
414
|
+
declare type AppearanceRuleDeclarations = AppearancePaintDeclarations & AppearanceLayoutDeclarations & {
|
|
415
|
+
/** Single font family identifier admitted only for authorized targets at runtime. */
|
|
416
|
+
readonly fontFamily?: string;
|
|
417
|
+
/** Integer pixel size admitted only for authorized text targets at runtime. */
|
|
418
|
+
readonly fontSize?: `${number}px`;
|
|
419
|
+
/** Controlled font weight admitted only for authorized text targets at runtime. */
|
|
420
|
+
readonly fontWeight?: 400 | 500 | 600 | 700;
|
|
421
|
+
/** Controlled font style admitted only for authorized text targets at runtime. */
|
|
422
|
+
readonly fontStyle?: 'normal' | 'italic';
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/** Controlled pseudo-class accepted by the merchant selector grammar. */
|
|
426
|
+
declare type AppearanceRulePseudoClass = 'autofill';
|
|
427
|
+
|
|
428
|
+
/** Controlled pseudo-element accepted by the merchant selector grammar. */
|
|
429
|
+
declare type AppearanceRulePseudoElement = 'placeholder' | 'selection';
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Optional state or controlled pseudo suffix on one alias.
|
|
433
|
+
*/
|
|
434
|
+
export declare type AppearanceRuleScopeSuffix = '' | `:${AppearanceRuleState | AppearanceRulePseudoClass}` | `::${AppearanceRulePseudoElement}`;
|
|
435
|
+
|
|
436
|
+
/** One merchant alias with an optional semantic suffix. */
|
|
437
|
+
export declare type AppearanceRuleSelector<RuleAlias extends string> = `${RuleAlias}${AppearanceRuleScopeSuffix}`;
|
|
438
|
+
|
|
439
|
+
/** Semantic states accepted by the merchant selector grammar. */
|
|
440
|
+
declare type AppearanceRuleState = 'hover' | 'focus' | 'focus-visible' | 'active' | 'disabled' | 'loading' | 'selected' | 'checked' | 'expanded' | 'invalid' | 'success' | 'error';
|
|
441
|
+
|
|
442
|
+
/** Backward-compatible name for the Express appearance configuration. */
|
|
443
|
+
export declare type AppearanceSetting = ExpressAppearance;
|
|
444
|
+
|
|
445
|
+
/** Exact official spacing Token accepted by controlled margin and padding. */
|
|
446
|
+
export declare type AppearanceSpacingToken = `var(--spacing-${'base' | 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'})`;
|
|
447
|
+
|
|
448
|
+
/** Runtime-constrained non-negative integer pixel value for spacing longhands. */
|
|
449
|
+
export declare type AppearanceSpacingValue = '0' | `${number}px` | AppearanceSpacingToken;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* 对客公开 appearance variables 类型(Token 2.x,figma-v4「3 层 + 状态」命名)。
|
|
453
|
+
* 字段名为新 CSS 变量名去掉 '--' 前缀(如 color-text-primary)。
|
|
454
|
+
*
|
|
455
|
+
* 权威源:`antom-web-checkout-v2/packages/elements2/src/utils/themeConfig.ts` 的 `PUBLIC_TOKENS`
|
|
456
|
+
* (54 color + 4 radius + 10 spacing = 68 项)。本 union 是该清单的手工镜像,
|
|
457
|
+
* 增删 token 时必须两侧同步,否则商户会遇到「类型报错但运行时可用」的错位。
|
|
458
|
+
*
|
|
459
|
+
* 命名规则:`--color-<scene>-<level>[-<state>]`;brand 场景并入 scene 段的 camelCase
|
|
460
|
+
* (如 `color-backgroundBrand-primary-hover`),CSS 变量大小写敏感,不可改写为 kebab。
|
|
461
|
+
*
|
|
462
|
+
* @example
|
|
463
|
+
* variables: { 'color-text-primary': '#2a3a52', 'radius-sm': '4px' }
|
|
464
|
+
*/
|
|
465
|
+
export declare type AppearanceVariables = 'color-background-primary' | 'color-background-primary-hover' | 'color-background-primary-active' | 'color-background-secondary' | 'color-background-secondary-hover' | 'color-background-secondary-active' | 'color-background-layout' | 'color-background-inverse' | 'color-background-disabled' | 'color-background-transparency' | 'color-background-mask' | 'color-background-success' | 'color-background-warning' | 'color-background-danger' | 'color-background-info' | 'color-background-neutral' | 'color-background-promotional' | 'color-backgroundBrand-primary' | 'color-backgroundBrand-primary-hover' | 'color-backgroundBrand-secondary' | 'color-backgroundBrand-secondary-hover' | 'color-backgroundBrand-tertiary' | 'color-backgroundBrand-disabled' | 'color-text-primary' | 'color-text-secondary' | 'color-text-tertiary' | 'color-text-inverse' | 'color-text-active' | 'color-text-disabled' | 'color-text-success' | 'color-text-warning' | 'color-text-danger' | 'color-text-info' | 'color-text-neutral' | 'color-text-promotional' | 'color-textBrand-primary' | 'color-textBrand-secondary' | 'color-textBrand-secondary-hover' | 'color-textBrand-disabled' | 'color-border-primary' | 'color-border-secondary' | 'color-border-inverse' | 'color-border-active' | 'color-border-subtle' | 'color-border-disabled' | 'color-border-success' | 'color-border-warning' | 'color-border-danger' | 'color-border-info' | 'color-border-neutral' | 'color-border-promotional' | 'color-borderBrand-primary' | 'color-borderBrand-primary-hover' | 'color-borderBrand-disabled' | 'radius-sm' | 'radius-md' | 'radius-lg' | 'radius-xl' | 'spacing-base' | 'spacing-none' | 'spacing-2xs' | 'spacing-xs' | 'spacing-sm' | 'spacing-md' | 'spacing-lg' | 'spacing-xl' | 'spacing-2xl' | 'spacing-3xl';
|
|
466
|
+
|
|
372
467
|
declare interface AppleMerchantInfo {
|
|
373
468
|
/**
|
|
374
469
|
* @description Apple商户ID
|
|
@@ -757,10 +852,6 @@ declare interface BankInfo {
|
|
|
757
852
|
hasSchemaUrl?: boolean;
|
|
758
853
|
}
|
|
759
854
|
|
|
760
|
-
declare interface BaseAppearance<A extends Partial<Appearance>> {
|
|
761
|
-
appearance?: A;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
855
|
/**
|
|
765
856
|
* @description 内置基础的桥接事件映射类型
|
|
766
857
|
*/
|
|
@@ -2077,18 +2168,22 @@ export declare interface ConfirmCardSetupOptions {
|
|
|
2077
2168
|
redirect?: 'always' | 'if_required';
|
|
2078
2169
|
}
|
|
2079
2170
|
|
|
2080
|
-
export declare
|
|
2081
|
-
sessionData: string;
|
|
2082
|
-
/**
|
|
2083
|
-
* @description 传入已挂载的 CVVElement / PaymentElement / Elements 实例,不传则使用无 UI 自动提交模式
|
|
2084
|
-
*/
|
|
2085
|
-
elements?: BaseMainElement | BaseElements;
|
|
2171
|
+
export declare type ConfirmPaymentOptions = PaymentSubmitParams & {
|
|
2086
2172
|
appearance?: CVVAppearance;
|
|
2087
2173
|
/**
|
|
2088
2174
|
* @description 集成用户自定义信息(如 cardHolderName)
|
|
2089
2175
|
*/
|
|
2090
2176
|
params?: Record<string, unknown>;
|
|
2091
|
-
}
|
|
2177
|
+
} & ({
|
|
2178
|
+
/** 已挂载的 Element;确认时使用其创建时绑定的会话。 */
|
|
2179
|
+
elements: BaseMainElement | BaseElements;
|
|
2180
|
+
/** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
|
|
2181
|
+
sessionData?: string;
|
|
2182
|
+
} | {
|
|
2183
|
+
elements?: undefined;
|
|
2184
|
+
/** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
|
|
2185
|
+
sessionData: string;
|
|
2186
|
+
});
|
|
2092
2187
|
|
|
2093
2188
|
/**
|
|
2094
2189
|
* @description Connect流程参数
|
|
@@ -2225,11 +2320,13 @@ declare interface CustomFontSource {
|
|
|
2225
2320
|
* @public
|
|
2226
2321
|
* @description CVV element app config type
|
|
2227
2322
|
*/
|
|
2228
|
-
export declare interface CVVAppConfig extends
|
|
2323
|
+
export declare interface CVVAppConfig extends BaseElementAppConfig {
|
|
2324
|
+
/** CVV appearance configuration including optional alias-only Rules. */
|
|
2325
|
+
appearance?: CVVAppearance;
|
|
2229
2326
|
/**
|
|
2230
|
-
* @description
|
|
2327
|
+
* @description 创建时必填的支付会话;不可通过 updateConfig 或 submit 替换
|
|
2231
2328
|
*/
|
|
2232
|
-
sessionData
|
|
2329
|
+
sessionData: string;
|
|
2233
2330
|
/* Excluded from this release type: paymentSessionConfig */
|
|
2234
2331
|
/* Excluded from this release type: renderData */
|
|
2235
2332
|
/* Excluded from this release type: sdkVersion */
|
|
@@ -2241,12 +2338,13 @@ export declare interface CVVAppConfig extends BaseAppearance<CVVAppearance>, Bas
|
|
|
2241
2338
|
/* Excluded from this release type: paymentFlow */
|
|
2242
2339
|
}
|
|
2243
2340
|
|
|
2244
|
-
export declare type CVVAppearance =
|
|
2341
|
+
export declare type CVVAppearance = PickAntomAppearance<CVVAppearanceProps>;
|
|
2245
2342
|
|
|
2246
2343
|
export declare type CVVAppearanceProps = {
|
|
2247
2344
|
theme: AntomTheme;
|
|
2248
|
-
variables: AntomVariables;
|
|
2345
|
+
variables: AppearanceVariables | AntomVariables;
|
|
2249
2346
|
fonts?: FontSource[];
|
|
2347
|
+
rules: AppearanceRuleSelector<string>;
|
|
2250
2348
|
};
|
|
2251
2349
|
|
|
2252
2350
|
/**
|
|
@@ -2254,9 +2352,18 @@ export declare type CVVAppearanceProps = {
|
|
|
2254
2352
|
*/
|
|
2255
2353
|
export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVElementEvents> {
|
|
2256
2354
|
static elementType: string;
|
|
2355
|
+
private readonly sessionData;
|
|
2356
|
+
private readonly elementTracker;
|
|
2357
|
+
private _mountInProgress;
|
|
2358
|
+
private _destroyInProgress;
|
|
2257
2359
|
constructor(name: string, config: CVVElementConfig);
|
|
2258
2360
|
/* Excluded from this release type: setup */
|
|
2361
|
+
/* Excluded from this release type: updateConfig */
|
|
2259
2362
|
/* Excluded from this release type: submit */
|
|
2363
|
+
mount(container: HTMLElement): Promise<void>;
|
|
2364
|
+
on<T extends keyof CVVElementEvents>(event: T, handler: (payload: CVVElementEvents[T]) => void): void;
|
|
2365
|
+
unmount(): void;
|
|
2366
|
+
destroy(): void;
|
|
2260
2367
|
protected focus(): void;
|
|
2261
2368
|
protected blur(): void;
|
|
2262
2369
|
protected clear(): void;
|
|
@@ -2267,20 +2374,10 @@ export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVEle
|
|
|
2267
2374
|
* @description CVV element config type
|
|
2268
2375
|
*/
|
|
2269
2376
|
export declare interface CVVElementConfig extends BaseElementConfig<CVVAppConfig> {
|
|
2377
|
+
appConfig: CVVAppConfig;
|
|
2270
2378
|
}
|
|
2271
2379
|
|
|
2272
|
-
export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams
|
|
2273
|
-
/**
|
|
2274
|
-
* @description Emitted event about form
|
|
2275
|
-
*/
|
|
2276
|
-
form: {
|
|
2277
|
-
errors?: Array<{
|
|
2278
|
-
field: string | number;
|
|
2279
|
-
message: string;
|
|
2280
|
-
currentValue: any;
|
|
2281
|
-
}>;
|
|
2282
|
-
message: string;
|
|
2283
|
-
};
|
|
2380
|
+
export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams & Pick<CVVAppConfig, 'sessionData'>> {
|
|
2284
2381
|
/**
|
|
2285
2382
|
* @description Emitted when the element is destroy
|
|
2286
2383
|
*/
|
|
@@ -2324,10 +2421,6 @@ export declare type CVVSubmitErrorCodes = 'NOT_FIND_MAINELEMENT' | 'SESSION_DATA
|
|
|
2324
2421
|
* @description CVV 支付提交参数
|
|
2325
2422
|
*/
|
|
2326
2423
|
export declare interface CVVSubmitParams {
|
|
2327
|
-
/**
|
|
2328
|
-
* 支付会话数据
|
|
2329
|
-
*/
|
|
2330
|
-
sessionData?: string;
|
|
2331
2424
|
/**
|
|
2332
2425
|
* 重定向策略
|
|
2333
2426
|
*/
|
|
@@ -3011,8 +3104,12 @@ declare interface ElementPluginChangeStates {
|
|
|
3011
3104
|
declare type ElementPluginNameEnum = 'SET_STATE' | 'PASSIVE_SET_STATE';
|
|
3012
3105
|
|
|
3013
3106
|
declare class Elements extends BaseElements {
|
|
3107
|
+
private readonly apiTracker;
|
|
3014
3108
|
protected canUseElements(): Array<ElementListItemType>;
|
|
3015
3109
|
constructor(config: BaseElementsConfig);
|
|
3110
|
+
init(): Promise<this>;
|
|
3111
|
+
updateConfig(config: Partial<BaseElementsConfig>): void;
|
|
3112
|
+
destroy(): void;
|
|
3016
3113
|
createElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
|
|
3017
3114
|
createElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
|
|
3018
3115
|
getElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
|
|
@@ -3140,20 +3237,21 @@ declare interface ExpPaymentOptionDetail {
|
|
|
3140
3237
|
* @public
|
|
3141
3238
|
* @description Express element app config type
|
|
3142
3239
|
*/
|
|
3143
|
-
export declare interface ExpressAppConfig extends
|
|
3240
|
+
export declare interface ExpressAppConfig extends BaseElementAppConfig {
|
|
3241
|
+
/** Express appearance configuration. */
|
|
3242
|
+
appearance?: ExpressAppearance;
|
|
3144
3243
|
/** payment SessionData */
|
|
3145
3244
|
sessionData?: string;
|
|
3146
|
-
/** Business division (country/region) */
|
|
3147
|
-
businessDivision?: string;
|
|
3148
3245
|
/**
|
|
3149
3246
|
* Amount & Currency
|
|
3150
3247
|
*
|
|
3151
|
-
*
|
|
3152
|
-
*
|
|
3153
|
-
*
|
|
3248
|
+
* For Apple Pay and Google Pay, `value` is a positive ASCII digit string in
|
|
3249
|
+
* the payment session currency's minor unit; `currency` may be omitted.
|
|
3250
|
+
* For example, USD 10.99 is passed as `{ value: '1099' }`.
|
|
3251
|
+
* PayPal keeps its existing major-unit amount semantics and requires `currency`.
|
|
3154
3252
|
*/
|
|
3155
3253
|
amount?: {
|
|
3156
|
-
currency
|
|
3254
|
+
currency?: string;
|
|
3157
3255
|
value: string;
|
|
3158
3256
|
};
|
|
3159
3257
|
/** PayPal 配置 */
|
|
@@ -3198,6 +3296,17 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
|
|
|
3198
3296
|
/* Excluded from this release type: doMain */
|
|
3199
3297
|
}
|
|
3200
3298
|
|
|
3299
|
+
/** Express element appearance configuration. */
|
|
3300
|
+
declare type ExpressAppearance = PickAntomAppearance<ExpressAppearanceProps>;
|
|
3301
|
+
|
|
3302
|
+
/** Express element appearance properties. */
|
|
3303
|
+
export declare type ExpressAppearanceProps = {
|
|
3304
|
+
displaySetting: 'showCardBrandIcon';
|
|
3305
|
+
theme: 'light' | 'dark';
|
|
3306
|
+
layout: 'accordion' | 'tabs';
|
|
3307
|
+
rules: AppearanceRuleSelector<string>;
|
|
3308
|
+
};
|
|
3309
|
+
|
|
3201
3310
|
/** cancel 事件负载 */
|
|
3202
3311
|
export declare interface ExpressCancelEvent {
|
|
3203
3312
|
expressPaymentType: string;
|
|
@@ -3209,6 +3318,17 @@ export declare interface ExpressClickEvent {
|
|
|
3209
3318
|
expressPaymentType: string;
|
|
3210
3319
|
}
|
|
3211
3320
|
|
|
3321
|
+
declare type ExpressCompletePaymentResult = {
|
|
3322
|
+
success: boolean;
|
|
3323
|
+
result?: any;
|
|
3324
|
+
error?: {
|
|
3325
|
+
code: string;
|
|
3326
|
+
message: string;
|
|
3327
|
+
};
|
|
3328
|
+
userCanceled3D?: boolean;
|
|
3329
|
+
status?: 'SUCCESS' | 'CANCELLED' | 'FAIL' | 'PROCESSING';
|
|
3330
|
+
};
|
|
3331
|
+
|
|
3212
3332
|
/** confirm 事件负载(统一终态,替代 approve) */
|
|
3213
3333
|
export declare interface ExpressConfirmData {
|
|
3214
3334
|
expressPaymentType: string;
|
|
@@ -3255,6 +3375,10 @@ export declare interface ExpressConfirmData {
|
|
|
3255
3375
|
*/
|
|
3256
3376
|
export declare class ExpressElement extends BaseMainElement<ExpressElementConfig, ExpressElementEvents> {
|
|
3257
3377
|
static elementType: string;
|
|
3378
|
+
private readonly elementTracker;
|
|
3379
|
+
private _mountInProgress;
|
|
3380
|
+
private _destroyInProgress;
|
|
3381
|
+
private _registeringInternalListeners;
|
|
3258
3382
|
/**
|
|
3259
3383
|
* Store all function-type callbacks locally, not involved in postMessage serialization
|
|
3260
3384
|
*/
|
|
@@ -3273,7 +3397,23 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
|
|
|
3273
3397
|
private _localHandlers;
|
|
3274
3398
|
/** 支付流程进行中标志(click → confirm/error/cancel 之间) */
|
|
3275
3399
|
private _paymentInProgress;
|
|
3400
|
+
/**
|
|
3401
|
+
* confirm 窗口超时标志:iframe 在 20s onTimeout 发 error(MERCHANT_CONFIRM_TIMEOUT) 时置位,
|
|
3402
|
+
* completePayment 入口据此立即返失败(不发 COMPLETE_PAYMENT,不进 5min 兜底)。
|
|
3403
|
+
* 每新一轮 confirm 事件到达时复位(见 on() 重写)。
|
|
3404
|
+
*/
|
|
3405
|
+
private _confirmWindowTimedOut;
|
|
3406
|
+
/**
|
|
3407
|
+
* 是否已收到 iframe 业务层 ready 事件(app.tsx sendReady)。
|
|
3408
|
+
* 注意:与 host `status='ready'`(由 HANDSHAKE_ACK 触发,bridge.js:450 同步回发,与 amount 解析无关)不同。
|
|
3409
|
+
* 首屏 amount setupError 时 iframe 不发业务 ready → _readyReceived 保持 false,
|
|
3410
|
+
* 据此判别"首屏失败"以阻断后续 updateConfig。
|
|
3411
|
+
*/
|
|
3412
|
+
private _readyReceived;
|
|
3413
|
+
/** 首屏 setupError 致命标志:置位后 updateConfig 被 CHECKOUT_NOT_READY 阻断,只能 destroy 重开。 */
|
|
3414
|
+
private _setupFailed;
|
|
3276
3415
|
private _paypalOverlay;
|
|
3416
|
+
private _updateQueue;
|
|
3277
3417
|
constructor(name: string, config: ExpressElementConfig);
|
|
3278
3418
|
/**
|
|
3279
3419
|
* 重写 on:对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
|
|
@@ -3284,24 +3424,30 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
|
|
|
3284
3424
|
* 用于 Native WebView 场景下 SDK 需要向商户透传跳转信息等。
|
|
3285
3425
|
*/
|
|
3286
3426
|
private _emit;
|
|
3287
|
-
updateConfig(newConfig:
|
|
3427
|
+
updateConfig(newConfig: ExpressAppConfig): Promise<ExpressElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
3428
|
+
private runUpdateConfig;
|
|
3429
|
+
private updateConfigTransaction;
|
|
3430
|
+
private updateAmountConfigWithSanitizedDebug;
|
|
3431
|
+
private getAmountValidationReason;
|
|
3432
|
+
/** iframe 业务 ready 事件到达:置 _readyReceived,后续运行时 error 不再视为首屏失败。
|
|
3433
|
+
* ready 是"本次首屏成功"的确实信号(首屏 setupError 时 iframe 不发 ready),
|
|
3434
|
+
* 故同时清掉 _setupFailed——unmount+remount 同实例二次首屏成功后可恢复 updateConfig。
|
|
3435
|
+
*/
|
|
3436
|
+
private _handleReady;
|
|
3437
|
+
/** iframe error 事件:若 business ready 未到达,视为首屏 setupError → 置 _setupFailed 阻断后续 updateConfig。 */
|
|
3438
|
+
private _handleError;
|
|
3288
3439
|
/**
|
|
3289
3440
|
* 商户在 confirm 回调内调用,触发实际支付提交。
|
|
3290
3441
|
* iframe 收到 OPENSDK@COMPLETE_PAYMENT 后执行 submitPay / polling 等,
|
|
3291
3442
|
* 完成后通过 OPENSDK@COMPLETE_PAYMENT_RESULT 回包,Promise resolve。
|
|
3292
3443
|
*/
|
|
3293
|
-
completePayment(redirect?: 'always' | 'if_required'): Promise<
|
|
3294
|
-
|
|
3295
|
-
result?: any;
|
|
3296
|
-
error?: {
|
|
3297
|
-
code: string;
|
|
3298
|
-
message: string;
|
|
3299
|
-
};
|
|
3300
|
-
/** 用户是否手动关闭 3D 弹窗(透传 webapp COMPLETE_PAYMENT_RESULT.userCanceled3D) */
|
|
3301
|
-
userCanceled3D?: boolean;
|
|
3302
|
-
}>;
|
|
3444
|
+
completePayment(redirect?: 'always' | 'if_required'): Promise<ExpressCompletePaymentResult>;
|
|
3445
|
+
private runCompletePayment;
|
|
3303
3446
|
setup(): Promise<Partial<ExpressAppConfig> | undefined>;
|
|
3304
3447
|
private registerInternalListeners;
|
|
3448
|
+
mount(container: HTMLElement): Promise<void>;
|
|
3449
|
+
unmount(): void;
|
|
3450
|
+
destroy(): void;
|
|
3305
3451
|
protected focus(): void;
|
|
3306
3452
|
protected blur(): void;
|
|
3307
3453
|
protected clear(): void;
|
|
@@ -3373,6 +3519,11 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
|
|
|
3373
3519
|
'OPENSDK@GET_APPLE_PAY_TOKEN': {
|
|
3374
3520
|
requestId: string;
|
|
3375
3521
|
expressPaymentType: string;
|
|
3522
|
+
/** iframe 已转好的 major unit 金额(来自 resolvedAmount);host 委托 Apple Pay 消费,不再做 minor→major 转换。 */
|
|
3523
|
+
walletAmount?: {
|
|
3524
|
+
value: string;
|
|
3525
|
+
currency: string;
|
|
3526
|
+
};
|
|
3376
3527
|
};
|
|
3377
3528
|
/** host 完成 Apple Pay token 获取后回包给 iframe,submit/3DS/polling 均由 webapp 完成 */
|
|
3378
3529
|
'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': {
|
|
@@ -3437,7 +3588,7 @@ export declare interface ExpressVaultingAppConfig extends BaseElementAppConfig {
|
|
|
3437
3588
|
* @description cancel 事件负载
|
|
3438
3589
|
*/
|
|
3439
3590
|
export declare interface ExpressVaultingCancelEvent {
|
|
3440
|
-
|
|
3591
|
+
paymentMethodType: ExpressVaultingMethod;
|
|
3441
3592
|
data?: unknown;
|
|
3442
3593
|
}
|
|
3443
3594
|
|
|
@@ -3446,7 +3597,7 @@ export declare interface ExpressVaultingCancelEvent {
|
|
|
3446
3597
|
* @description click 事件负载
|
|
3447
3598
|
*/
|
|
3448
3599
|
export declare interface ExpressVaultingClickEvent {
|
|
3449
|
-
|
|
3600
|
+
paymentMethodType: ExpressVaultingMethod;
|
|
3450
3601
|
}
|
|
3451
3602
|
|
|
3452
3603
|
/**
|
|
@@ -3454,9 +3605,8 @@ export declare interface ExpressVaultingClickEvent {
|
|
|
3454
3605
|
* @description confirm 事件负载(PayPal onApprove 成功后触发,商户可在回调中调 confirmVaulting)
|
|
3455
3606
|
*/
|
|
3456
3607
|
export declare interface ExpressVaultingConfirmEvent {
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
email?: string;
|
|
3608
|
+
paymentMethodType: ExpressVaultingMethod;
|
|
3609
|
+
payerInfo?: ExpressVaultingPayerInfo;
|
|
3460
3610
|
}
|
|
3461
3611
|
|
|
3462
3612
|
/**
|
|
@@ -3521,12 +3671,12 @@ export declare interface ExpressVaultingElementEvents extends AntomBridgeWithNat
|
|
|
3521
3671
|
* @description error 事件负载
|
|
3522
3672
|
*/
|
|
3523
3673
|
export declare interface ExpressVaultingErrorEvent extends ErrorPayload<string> {
|
|
3524
|
-
|
|
3674
|
+
paymentMethodType: ExpressVaultingMethod;
|
|
3525
3675
|
}
|
|
3526
3676
|
|
|
3527
3677
|
/**
|
|
3528
3678
|
* Supported express vaulting payment methods. All bridge event payloads carry
|
|
3529
|
-
* `
|
|
3679
|
+
* `paymentMethodType` — use this enum instead of硬编码 strings so adding a
|
|
3530
3680
|
* new wallet only needs one entry here. Must match the iframe-side enum in
|
|
3531
3681
|
* elements2/express_vaulting/interface.ts.
|
|
3532
3682
|
*/
|
|
@@ -3534,6 +3684,19 @@ declare enum ExpressVaultingMethod {
|
|
|
3534
3684
|
PAYPAL_DIRECTDEBIT = "PAYPAL_DIRECTDEBIT"
|
|
3535
3685
|
}
|
|
3536
3686
|
|
|
3687
|
+
/**
|
|
3688
|
+
* @public
|
|
3689
|
+
* @description Braintree tokenizePayment 返回的 payer 信息,随 confirm 事件透传给商户
|
|
3690
|
+
*/
|
|
3691
|
+
export declare interface ExpressVaultingPayerInfo {
|
|
3692
|
+
payerId?: string;
|
|
3693
|
+
email?: string;
|
|
3694
|
+
firstName?: string;
|
|
3695
|
+
lastName?: string;
|
|
3696
|
+
countryCode?: string;
|
|
3697
|
+
phone?: string;
|
|
3698
|
+
}
|
|
3699
|
+
|
|
3537
3700
|
/**
|
|
3538
3701
|
* MERCHANT_CONFIRM_TIMEOUT is owned by the iframe side (mirrors express_element:
|
|
3539
3702
|
* iframe starts a 20s timer on the `confirm` event and sends
|
|
@@ -3649,6 +3812,57 @@ declare interface FrontSupportIppBank {
|
|
|
3649
3812
|
logo?: Logo;
|
|
3650
3813
|
}
|
|
3651
3814
|
|
|
3815
|
+
/** host 回传 webapp 的 OPENSDK@GET_APPLE_PAY_TOKEN_REPLY 形态(result 对齐老链路 {token,billingContact,shippingContact})。 */
|
|
3816
|
+
declare interface GetApplePayTokenReply {
|
|
3817
|
+
success: boolean;
|
|
3818
|
+
result?: {
|
|
3819
|
+
token?: unknown;
|
|
3820
|
+
billingContact?: unknown;
|
|
3821
|
+
shippingContact?: unknown;
|
|
3822
|
+
} | {
|
|
3823
|
+
errorCode: string;
|
|
3824
|
+
};
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
/** webapp 传来的 OPENSDK@GET_APPLE_PAY_TOKEN payload 形态。 */
|
|
3828
|
+
declare interface GetApplePayTokenRequest {
|
|
3829
|
+
paymentMethod?: {
|
|
3830
|
+
paymentMethodDetail?: {
|
|
3831
|
+
applePayProps?: {
|
|
3832
|
+
paymentRequest?: unknown;
|
|
3833
|
+
};
|
|
3834
|
+
};
|
|
3835
|
+
};
|
|
3836
|
+
shipping?: unknown;
|
|
3837
|
+
}
|
|
3838
|
+
|
|
3839
|
+
/** host 回传 webapp 的 OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY 形态。 */
|
|
3840
|
+
declare interface GetGooglePayTokenReply {
|
|
3841
|
+
success: boolean;
|
|
3842
|
+
result?: unknown;
|
|
3843
|
+
err?: {
|
|
3844
|
+
statusCode?: string;
|
|
3845
|
+
[key: string]: unknown;
|
|
3846
|
+
};
|
|
3847
|
+
}
|
|
3848
|
+
|
|
3849
|
+
/** webapp 传来的 OPENSDK@GET_GOOGLE_PAY_TOKEN payload 形态。 */
|
|
3850
|
+
declare interface GetGooglePayTokenRequest {
|
|
3851
|
+
actionName?: string;
|
|
3852
|
+
data?: {
|
|
3853
|
+
environment?: string;
|
|
3854
|
+
paymentRequest?: unknown;
|
|
3855
|
+
paymentMethod?: unknown;
|
|
3856
|
+
paymentMethodDetail?: {
|
|
3857
|
+
googlePayProps?: {
|
|
3858
|
+
environment?: string;
|
|
3859
|
+
paymentRequest?: unknown;
|
|
3860
|
+
};
|
|
3861
|
+
};
|
|
3862
|
+
[key: string]: unknown;
|
|
3863
|
+
};
|
|
3864
|
+
}
|
|
3865
|
+
|
|
3652
3866
|
declare type GetI18nQueryParam = string | {
|
|
3653
3867
|
/**
|
|
3654
3868
|
* 多语言文案的 key
|
|
@@ -4499,6 +4713,58 @@ declare interface Language {
|
|
|
4499
4713
|
country?: string;
|
|
4500
4714
|
}
|
|
4501
4715
|
|
|
4716
|
+
/**
|
|
4717
|
+
* @deprecated Token 1.0 老字段类型 — 请迁移到 {@link AppearanceVariables}。
|
|
4718
|
+
* 所有字段均已废弃,运行时由 WebApp 侧 LEGACY_TO_NEW_TOKEN_MAP 翻译为新 token。
|
|
4719
|
+
*
|
|
4720
|
+
* @deprecated 'content-primary' → color-text-primary
|
|
4721
|
+
* @deprecated 'content-secondary' → color-text-secondary
|
|
4722
|
+
* @deprecated 'content-tertiary' → color-text-tertiary
|
|
4723
|
+
* @deprecated 'content-quaternary' → color-text-inverse
|
|
4724
|
+
* @deprecated 'background-primary' → color-background-primary
|
|
4725
|
+
* @deprecated 'background-secondary' → color-background-secondary
|
|
4726
|
+
* @deprecated 'background-disable' → color-background-disabled
|
|
4727
|
+
* @deprecated 'background-transparency' → color-background-transparency
|
|
4728
|
+
* @deprecated 'border-primary' → color-border-primary
|
|
4729
|
+
* @deprecated 'border-secondary' → color-border-secondary
|
|
4730
|
+
* @deprecated 'border-disable' → color-border-disabled
|
|
4731
|
+
* @deprecated 'border-active' → color-border-active
|
|
4732
|
+
* @deprecated 'action-normal' → 一对多 fan-out(无单值映射;运行时展开为 3 个新 token,老 key 不再注入):
|
|
4733
|
+
* - background/background-color → color-backgroundBrand-primary
|
|
4734
|
+
* - border/border-color/box-shadow → color-border-active
|
|
4735
|
+
* - color/文本/图标/勾选态 → color-text-active
|
|
4736
|
+
* @deprecated 'action-hover' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
|
|
4737
|
+
* - background → color-backgroundBrand-primary-hover
|
|
4738
|
+
* - border → color-borderBrand-primary-hover
|
|
4739
|
+
* 文字色 color-textBrand-secondary-hover 不参与派生
|
|
4740
|
+
* (设计稿中与 bg/border 不同色阶),需要时请显式传入该新 token 键
|
|
4741
|
+
* @deprecated 'action-secondary' → color-backgroundBrand-secondary
|
|
4742
|
+
* @deprecated 'action-disable' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
|
|
4743
|
+
* - background/background-color → color-backgroundBrand-disabled
|
|
4744
|
+
* - border/border-color → color-borderBrand-disabled
|
|
4745
|
+
* 文字色 color-textBrand-disabled 不参与派生
|
|
4746
|
+
* (设计稿中全部主题均与 bg/border 不同色阶),需要时请显式传入该新 token 键
|
|
4747
|
+
* @deprecated 'state-success' → color-text-success
|
|
4748
|
+
* @deprecated 'state-failure' → color-text-danger
|
|
4749
|
+
* @deprecated 'state-warning' → color-text-warning
|
|
4750
|
+
* @deprecated 'state-info' → color-text-info
|
|
4751
|
+
* @deprecated 'state-conventional' → color-text-neutral
|
|
4752
|
+
* @deprecated 'state-marketing' → color-text-promotional(color 上下文;background 上下文由 CSS 层直接迁移)
|
|
4753
|
+
* @deprecated 'radius-backup' → radius-sm
|
|
4754
|
+
* @deprecated 'radius-component' → radius-md
|
|
4755
|
+
* @deprecated 'radius-module' → radius-lg
|
|
4756
|
+
* @deprecated 'radius-button' → radius-lg(与 radius-module 同档合并)
|
|
4757
|
+
* @deprecated 'wrapper-padding' → spacing-lg
|
|
4758
|
+
* @deprecated 'stroke-default' → 由 Rules 机制接管
|
|
4759
|
+
* @deprecated 'stroke-active' → 由 Rules 机制接管
|
|
4760
|
+
*
|
|
4761
|
+
* 注:fan-out 展开基数以 figma-v4 设计稿的色阶一致性为准,故 action-hover / action-disable
|
|
4762
|
+
* 为 1→2 而非 1→3;三者合计派生 7 项。
|
|
4763
|
+
*/
|
|
4764
|
+
export declare type LegacyAppearanceVariables = 'content-primary' | 'content-secondary' | 'content-tertiary' | 'content-quaternary' | 'background-primary' | 'background-secondary' | 'background-disable' | 'background-transparency' | 'border-primary' | 'border-secondary' | 'border-disable' | 'action-normal' | 'action-hover' | 'action-disable' | 'action-secondary' | 'state-failure' | 'state-warning' | 'state-success' | 'state-info' | 'state-marketing' | 'state-conventional' | 'radius-backup' | 'radius-module' | 'radius-component' | 'radius-button' | 'wrapper-padding' | 'stroke-default' | 'stroke-active'
|
|
4765
|
+
/** 非 Token 体系字段,由 WebApp 侧展开为 design-font-family-* 系列 */
|
|
4766
|
+
| 'fontFamily';
|
|
4767
|
+
|
|
4502
4768
|
declare interface Link {
|
|
4503
4769
|
/**
|
|
4504
4770
|
* @description 发起关联的父元素,如国家
|
|
@@ -7086,7 +7352,9 @@ declare interface PayByLinkInfo {
|
|
|
7086
7352
|
/**
|
|
7087
7353
|
* @description Payment element app config type
|
|
7088
7354
|
*/
|
|
7089
|
-
export declare interface PaymentAppConfig extends
|
|
7355
|
+
export declare interface PaymentAppConfig extends BaseElementAppConfig {
|
|
7356
|
+
/** Payment appearance configuration including optional alias-only Rules. */
|
|
7357
|
+
appearance?: PaymentAppearance;
|
|
7090
7358
|
/**
|
|
7091
7359
|
* @description sessionData,无法通过updateConfig更新
|
|
7092
7360
|
*/
|
|
@@ -7115,12 +7383,18 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
7115
7383
|
/**
|
|
7116
7384
|
* @description Payment element appearance type
|
|
7117
7385
|
*/
|
|
7118
|
-
export declare type PaymentAppearance =
|
|
7386
|
+
export declare type PaymentAppearance = PickAntomAppearance<PaymentAppearanceProps>;
|
|
7387
|
+
|
|
7388
|
+
/**
|
|
7389
|
+
* @description Payment element appearance properties
|
|
7390
|
+
*/
|
|
7391
|
+
export declare type PaymentAppearanceProps = {
|
|
7119
7392
|
displaySetting: 'showPaymentMethodListWhenSingleOption' | 'showCardBrandIcon' | 'showRadioWhenAccordionLayout' | 'showCardCVV';
|
|
7120
7393
|
theme: AntomTheme;
|
|
7121
|
-
variables: AntomVariables;
|
|
7394
|
+
variables: AppearanceVariables | AntomVariables;
|
|
7122
7395
|
layout: AntomLayouts;
|
|
7123
|
-
|
|
7396
|
+
rules: AppearanceRuleSelector<string>;
|
|
7397
|
+
};
|
|
7124
7398
|
|
|
7125
7399
|
/**
|
|
7126
7400
|
* @description Payment element
|
|
@@ -7128,13 +7402,23 @@ export declare type PaymentAppearance = PickAppearance<{
|
|
|
7128
7402
|
export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
|
|
7129
7403
|
static elementType: string;
|
|
7130
7404
|
private _paymentInProgress;
|
|
7405
|
+
private readonly paymentTracker;
|
|
7406
|
+
private _mountStartedAt;
|
|
7407
|
+
private _mountInProgress;
|
|
7408
|
+
private _mountPhase;
|
|
7409
|
+
private _destroyInProgress;
|
|
7410
|
+
private readonly walletLogger;
|
|
7131
7411
|
constructor(name: string, config: PaymentElementConfig);
|
|
7132
7412
|
/* Excluded from this release type: setup */
|
|
7413
|
+
mount(container: HTMLElement): Promise<void>;
|
|
7133
7414
|
/**
|
|
7134
|
-
* @description Update payment element configuration with amount validation
|
|
7415
|
+
* @description Update payment element configuration with amount validation and appearance Rules support
|
|
7135
7416
|
*/
|
|
7136
|
-
updateConfig(newConfig:
|
|
7417
|
+
updateConfig(newConfig: Partial<PaymentAppConfig>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
7137
7418
|
/* Excluded from this release type: submit */
|
|
7419
|
+
on<T extends keyof PaymentElementEvents>(event: T, handler: (payload: PaymentElementEvents[T]) => void): void;
|
|
7420
|
+
unmount(): void;
|
|
7421
|
+
destroy(): void;
|
|
7138
7422
|
protected focus(): void;
|
|
7139
7423
|
protected blur(): void;
|
|
7140
7424
|
protected clear(): void;
|
|
@@ -7150,6 +7434,25 @@ declare interface PaymentElementConfig extends BaseElementConfig<PaymentAppConfi
|
|
|
7150
7434
|
* @description Payment element events
|
|
7151
7435
|
*/
|
|
7152
7436
|
export declare interface PaymentElementEvents extends AntomBridgeWithNativeEventMap<PaymentAppConfig, PaymentSubmitParams, PaymentSubmitResult> {
|
|
7437
|
+
/**
|
|
7438
|
+
* webapp 委托 host(父 frame)拉起 Apple Pay 拿 token。
|
|
7439
|
+
* payload 结构对齐 ModernElementController.GetApplePayTokenRequest(放 paymentMethod/shipping)。
|
|
7440
|
+
*/
|
|
7441
|
+
'OPENSDK@GET_APPLE_PAY_TOKEN': GetApplePayTokenRequest;
|
|
7442
|
+
/** host 完成 Apple Pay token 获取后回包给 webapp */
|
|
7443
|
+
'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': GetApplePayTokenReply;
|
|
7444
|
+
/**
|
|
7445
|
+
* webapp 委托 host(父 frame)拉起 Google Pay 拿 token。
|
|
7446
|
+
* payload 结构对齐 ModernElementController.GetGooglePayTokenRequest(放 data.environment/paymentRequest)。
|
|
7447
|
+
*/
|
|
7448
|
+
'OPENSDK@GET_GOOGLE_PAY_TOKEN': GetGooglePayTokenRequest;
|
|
7449
|
+
/** host 完成 Google Pay token 获取后回包给 webapp */
|
|
7450
|
+
'OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY': GetGooglePayTokenReply;
|
|
7451
|
+
/** WebApp notifies the host when the selected payment method changes. */
|
|
7452
|
+
paymentMethodChanged: {
|
|
7453
|
+
type: string;
|
|
7454
|
+
name?: string;
|
|
7455
|
+
};
|
|
7153
7456
|
}
|
|
7154
7457
|
|
|
7155
7458
|
declare interface PaymentElementView {
|
|
@@ -7841,6 +8144,7 @@ export declare interface PayPalConfig {
|
|
|
7841
8144
|
channelMerchantAccountId?: string;
|
|
7842
8145
|
/** Button style (fine-grained override) */
|
|
7843
8146
|
style?: PayPalButtonStyle;
|
|
8147
|
+
businessDivision?: string;
|
|
7844
8148
|
/** Callback to create PayPal order, no params, returns sessionData */
|
|
7845
8149
|
createOrder?: () => Promise<string>;
|
|
7846
8150
|
/** Callback when user changes shipping address, data is raw data returned by PayPal */
|
|
@@ -7860,6 +8164,9 @@ declare interface PeriodRule {
|
|
|
7860
8164
|
periodCount?: number;
|
|
7861
8165
|
}
|
|
7862
8166
|
|
|
8167
|
+
/** Builds an Antom appearance type with the restricted Rules declaration contract. */
|
|
8168
|
+
declare type PickAntomAppearance<T extends Record<string, any>> = PickAppearance<T, AppearanceRuleDeclarations>;
|
|
8169
|
+
|
|
7863
8170
|
/**
|
|
7864
8171
|
* @description 工具类型,仅从 Appearance 中拾取与 Props 类型匹配的属性。
|
|
7865
8172
|
* 返回受 Props 中存在的键约束的部分外观对象。
|
|
@@ -24563,7 +24870,9 @@ declare interface UserName {
|
|
|
24563
24870
|
* @public
|
|
24564
24871
|
* @description Vaulting element app config type
|
|
24565
24872
|
*/
|
|
24566
|
-
export declare interface VaultingAppConfig extends
|
|
24873
|
+
export declare interface VaultingAppConfig extends BaseElementAppConfig {
|
|
24874
|
+
/** Vaulting appearance configuration including optional alias-only Rules. */
|
|
24875
|
+
appearance?: VaultingAppearance;
|
|
24567
24876
|
/**
|
|
24568
24877
|
* @description sessionData,无法通过updateConfig更新
|
|
24569
24878
|
*/
|
|
@@ -24575,13 +24884,14 @@ export declare interface VaultingAppConfig extends BaseAppearance<VaultingAppear
|
|
|
24575
24884
|
/* Excluded from this release type: _requestConfig */
|
|
24576
24885
|
}
|
|
24577
24886
|
|
|
24578
|
-
export declare type VaultingAppearance =
|
|
24887
|
+
export declare type VaultingAppearance = PickAntomAppearance<VaultingAppearanceProps>;
|
|
24579
24888
|
|
|
24580
24889
|
export declare type VaultingAppearanceProps = {
|
|
24581
24890
|
displaySetting: 'showCardBrandIcon';
|
|
24582
24891
|
theme: AntomTheme;
|
|
24583
|
-
variables: AntomVariables;
|
|
24892
|
+
variables: AppearanceVariables | AntomVariables;
|
|
24584
24893
|
fonts?: FontSource[];
|
|
24894
|
+
rules: AppearanceRuleSelector<string>;
|
|
24585
24895
|
};
|
|
24586
24896
|
|
|
24587
24897
|
/**
|
|
@@ -24589,9 +24899,22 @@ export declare type VaultingAppearanceProps = {
|
|
|
24589
24899
|
*/
|
|
24590
24900
|
export declare class VaultingElement extends BaseMainElement<VaultingElementConfig, VaultingElementEvents> {
|
|
24591
24901
|
static elementType: string;
|
|
24902
|
+
private readonly elementTracker;
|
|
24903
|
+
private _mountInProgress;
|
|
24904
|
+
private _destroyInProgress;
|
|
24592
24905
|
constructor(name: string, config: VaultingElementConfig);
|
|
24593
24906
|
/* Excluded from this release type: setup */
|
|
24907
|
+
/**
|
|
24908
|
+
* Updates Vaulting configuration while preserving the public Rules clear semantics.
|
|
24909
|
+
* @param newConfig Partial Vaulting configuration patch.
|
|
24910
|
+
* @returns The WebApp update acknowledgement.
|
|
24911
|
+
*/
|
|
24912
|
+
updateConfig(newConfig: Partial<VaultingAppConfig>): Promise<VaultingElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
24594
24913
|
/* Excluded from this release type: submit */
|
|
24914
|
+
mount(container: HTMLElement): Promise<void>;
|
|
24915
|
+
on<T extends keyof VaultingElementEvents>(event: T, handler: (payload: VaultingElementEvents[T]) => void): void;
|
|
24916
|
+
unmount(): void;
|
|
24917
|
+
destroy(): void;
|
|
24595
24918
|
protected focus(): void;
|
|
24596
24919
|
protected blur(): void;
|
|
24597
24920
|
protected clear(): void;
|