@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.untrimmed.d.ts
CHANGED
|
@@ -289,12 +289,16 @@ export declare interface AntomOpenModalConfig extends OpenModalParams {
|
|
|
289
289
|
*/
|
|
290
290
|
export declare class AntomSDK extends BaseElementsFactory {
|
|
291
291
|
static version: string;
|
|
292
|
+
private stopModalMessageMonitor;
|
|
293
|
+
private readonly apiTracker;
|
|
292
294
|
constructor(config?: AntomSDKConfig);
|
|
293
295
|
protected canUseElements(): Array<ElementListItemType>;
|
|
296
|
+
init(): Promise<this>;
|
|
294
297
|
/**
|
|
295
298
|
* @description 更新配置
|
|
296
299
|
*/
|
|
297
300
|
updateConfig(config: Partial<BaseFactoryConfig>): void;
|
|
301
|
+
destroy(): void;
|
|
298
302
|
/**
|
|
299
303
|
* @internal
|
|
300
304
|
* @param payload
|
|
@@ -311,7 +315,7 @@ export declare class AntomSDK extends BaseElementsFactory {
|
|
|
311
315
|
elements(): Elements;
|
|
312
316
|
createElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
|
|
313
317
|
createElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
|
|
314
|
-
createElement(elementType: 'CVV', options
|
|
318
|
+
createElement(elementType: 'CVV', options: CVVAppConfig): CVVElement;
|
|
315
319
|
createElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
|
|
316
320
|
createElement(elementType: 'expressVaulting', options?: ExpressVaultingAppConfig): ExpressVaultingElement;
|
|
317
321
|
getElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
|
|
@@ -325,7 +329,9 @@ export declare class AntomSDK extends BaseElementsFactory {
|
|
|
325
329
|
*/
|
|
326
330
|
private extractMainElement;
|
|
327
331
|
confirmCardSetup(options: ConfirmCardSetupOptions): Promise<SubmitResult>;
|
|
332
|
+
private runConfirmCardSetup;
|
|
328
333
|
confirmPayment(options: ConfirmPaymentOptions): Promise<SubmitResult>;
|
|
334
|
+
private runConfirmPayment;
|
|
329
335
|
/**
|
|
330
336
|
* 触发 Express Vaulting element 的 PayPal 绑卡提交流程。
|
|
331
337
|
*
|
|
@@ -398,9 +404,29 @@ export declare const AntomSDKErrorCodes: {
|
|
|
398
404
|
*/
|
|
399
405
|
readonly AMOUNT_VALUE_EMPTY: "AMOUNT_VALUE_EMPTY";
|
|
400
406
|
/**
|
|
401
|
-
* @description
|
|
407
|
+
* @description 金额格式非法(仅允许 ASCII 数字字符串)
|
|
402
408
|
*/
|
|
403
409
|
readonly AMOUNT_VALUE_INVALID: "AMOUNT_VALUE_INVALID";
|
|
410
|
+
/**
|
|
411
|
+
* @description Amount currency does not match the payment session currency
|
|
412
|
+
*/
|
|
413
|
+
readonly AMOUNT_CURRENCY_MISMATCH: "AMOUNT_CURRENCY_MISMATCH";
|
|
414
|
+
/**
|
|
415
|
+
* @description Amount currency is not supported
|
|
416
|
+
*/
|
|
417
|
+
readonly AMOUNT_CURRENCY_UNSUPPORTED: "AMOUNT_CURRENCY_UNSUPPORTED";
|
|
418
|
+
/**
|
|
419
|
+
* @description Amount currency precision is not supported
|
|
420
|
+
*/
|
|
421
|
+
readonly AMOUNT_PRECISION_UNSUPPORTED: "AMOUNT_PRECISION_UNSUPPORTED";
|
|
422
|
+
/**
|
|
423
|
+
* @description Amount conversion timed out
|
|
424
|
+
*/
|
|
425
|
+
readonly AMOUNT_RESOLVE_TIMEOUT: "AMOUNT_RESOLVE_TIMEOUT";
|
|
426
|
+
/**
|
|
427
|
+
* @description Amount conversion failed
|
|
428
|
+
*/
|
|
429
|
+
readonly AMOUNT_RESOLVE_FAILED: "AMOUNT_RESOLVE_FAILED";
|
|
404
430
|
readonly GENERATE_ELEMENT_KEY_FAILED: "GENERATE_ELEMENT_KEY_FAILED";
|
|
405
431
|
readonly ELEMENT_INIT_FAILED: "ELEMENT_INIT_FAILED";
|
|
406
432
|
readonly MOUNT_TIMEOUT: "MOUNT_TIMEOUT";
|
|
@@ -413,15 +439,12 @@ export declare const AntomSDKErrorCodes: {
|
|
|
413
439
|
readonly ELEMENT_DEFINE_ERROR: "ELEMENT_DEFINE_ERROR";
|
|
414
440
|
readonly ELEMENT_ALREADY_REGISTERED: "ELEMENT_ALREADY_REGISTERED";
|
|
415
441
|
readonly CANNOT_CREATE_SAME_ELEMENT_TWICE: "CANNOT_CREATE_SAME_ELEMENT_TWICE";
|
|
416
|
-
readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT";
|
|
417
|
-
readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT";
|
|
442
|
+
readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT"; /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
|
|
443
|
+
readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT"; /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
|
|
418
444
|
readonly NOT_SUPPORT_ELEMENT: "NOT_SUPPORT_ELEMENT";
|
|
419
445
|
readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
|
|
420
446
|
readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
|
|
421
447
|
readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
|
|
422
|
-
/**
|
|
423
|
-
* 查询到的结果消息
|
|
424
|
-
*/
|
|
425
448
|
readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
|
|
426
449
|
readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
|
|
427
450
|
readonly API_MISS_PARAMS: "API_MISS_PARAMS";
|
|
@@ -439,7 +462,11 @@ export declare type AntomSDKErrorCodes = (typeof AntomSDKErrorCodes)[keyof typeo
|
|
|
439
462
|
|
|
440
463
|
export declare type AntomTheme = 'default' | 'agateGreen' | 'night' | 'nostalgicGray' | 'gamingPurple' | 'cherryBlossomPink' | 'light';
|
|
441
464
|
|
|
442
|
-
|
|
465
|
+
/**
|
|
466
|
+
* @deprecated Use {@link AppearanceVariables} (Token 2.0) instead.
|
|
467
|
+
* 保留仅为向后兼容,将在下一个 major 版本中删除。
|
|
468
|
+
*/
|
|
469
|
+
export declare type AntomVariables = LegacyAppearanceVariables;
|
|
443
470
|
|
|
444
471
|
/**
|
|
445
472
|
* @description SDK UI组件的外观配置。
|
|
@@ -455,12 +482,80 @@ declare interface Appearance<Props extends Partial<DefaultAppearanceProps> = Def
|
|
|
455
482
|
fonts?: FontSource[];
|
|
456
483
|
}
|
|
457
484
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
485
|
+
/** Target-level layout declarations admitted before runtime capability intersection. */
|
|
486
|
+
export declare type AppearanceLayoutDeclarations = {
|
|
487
|
+
[Property in Exclude<AppearanceLayoutProperty, 'height'>]?: AppearanceSpacingValue;
|
|
488
|
+
} & {
|
|
489
|
+
/** Exact integer-pixel enum allocated by the target contract. */
|
|
490
|
+
readonly height?: `${number}px`;
|
|
462
491
|
};
|
|
463
492
|
|
|
493
|
+
/** Controlled layout longhands intersected with the concrete Part at runtime. */
|
|
494
|
+
export declare type AppearanceLayoutProperty = 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'height';
|
|
495
|
+
|
|
496
|
+
/** Paint declarations accepted before WebApp and Components runtime validation. */
|
|
497
|
+
declare type AppearancePaintDeclarations = Partial<Record<Exclude<AppearancePaintProperty, 'fillOpacity' | 'strokeOpacity' | 'strokeWidth' | 'textDecorationStyle' | 'outlineStyle'>, string> & Record<'fillOpacity' | 'strokeOpacity' | 'strokeWidth', string | number> & {
|
|
498
|
+
textDecorationStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'dashed' | 'dotted' | 'double' | 'solid' | 'wavy';
|
|
499
|
+
outlineStyle: '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' | 'auto' | 'dashed' | 'dotted' | 'double' | 'groove' | 'inset' | 'none' | 'outset' | 'ridge' | 'solid';
|
|
500
|
+
}>;
|
|
501
|
+
|
|
502
|
+
/** Paint-only property names exposed by the SDK contract. */
|
|
503
|
+
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';
|
|
504
|
+
|
|
505
|
+
/** Paint declarations plus controlled typography and target-level layout fields. */
|
|
506
|
+
declare type AppearanceRuleDeclarations = AppearancePaintDeclarations & AppearanceLayoutDeclarations & {
|
|
507
|
+
/** Single font family identifier admitted only for authorized targets at runtime. */
|
|
508
|
+
readonly fontFamily?: string;
|
|
509
|
+
/** Integer pixel size admitted only for authorized text targets at runtime. */
|
|
510
|
+
readonly fontSize?: `${number}px`;
|
|
511
|
+
/** Controlled font weight admitted only for authorized text targets at runtime. */
|
|
512
|
+
readonly fontWeight?: 400 | 500 | 600 | 700;
|
|
513
|
+
/** Controlled font style admitted only for authorized text targets at runtime. */
|
|
514
|
+
readonly fontStyle?: 'normal' | 'italic';
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
/** Controlled pseudo-class accepted by the merchant selector grammar. */
|
|
518
|
+
declare type AppearanceRulePseudoClass = 'autofill';
|
|
519
|
+
|
|
520
|
+
/** Controlled pseudo-element accepted by the merchant selector grammar. */
|
|
521
|
+
declare type AppearanceRulePseudoElement = 'placeholder' | 'selection';
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Optional state or controlled pseudo suffix on one alias.
|
|
525
|
+
*/
|
|
526
|
+
export declare type AppearanceRuleScopeSuffix = '' | `:${AppearanceRuleState | AppearanceRulePseudoClass}` | `::${AppearanceRulePseudoElement}`;
|
|
527
|
+
|
|
528
|
+
/** One merchant alias with an optional semantic suffix. */
|
|
529
|
+
export declare type AppearanceRuleSelector<RuleAlias extends string> = `${RuleAlias}${AppearanceRuleScopeSuffix}`;
|
|
530
|
+
|
|
531
|
+
/** Semantic states accepted by the merchant selector grammar. */
|
|
532
|
+
declare type AppearanceRuleState = 'hover' | 'focus' | 'focus-visible' | 'active' | 'disabled' | 'loading' | 'selected' | 'checked' | 'expanded' | 'invalid' | 'success' | 'error';
|
|
533
|
+
|
|
534
|
+
/** Backward-compatible name for the Express appearance configuration. */
|
|
535
|
+
export declare type AppearanceSetting = ExpressAppearance;
|
|
536
|
+
|
|
537
|
+
/** Exact official spacing Token accepted by controlled margin and padding. */
|
|
538
|
+
export declare type AppearanceSpacingToken = `var(--spacing-${'base' | 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'})`;
|
|
539
|
+
|
|
540
|
+
/** Runtime-constrained non-negative integer pixel value for spacing longhands. */
|
|
541
|
+
export declare type AppearanceSpacingValue = '0' | `${number}px` | AppearanceSpacingToken;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* 对客公开 appearance variables 类型(Token 2.x,figma-v4「3 层 + 状态」命名)。
|
|
545
|
+
* 字段名为新 CSS 变量名去掉 '--' 前缀(如 color-text-primary)。
|
|
546
|
+
*
|
|
547
|
+
* 权威源:`antom-web-checkout-v2/packages/elements2/src/utils/themeConfig.ts` 的 `PUBLIC_TOKENS`
|
|
548
|
+
* (54 color + 4 radius + 10 spacing = 68 项)。本 union 是该清单的手工镜像,
|
|
549
|
+
* 增删 token 时必须两侧同步,否则商户会遇到「类型报错但运行时可用」的错位。
|
|
550
|
+
*
|
|
551
|
+
* 命名规则:`--color-<scene>-<level>[-<state>]`;brand 场景并入 scene 段的 camelCase
|
|
552
|
+
* (如 `color-backgroundBrand-primary-hover`),CSS 变量大小写敏感,不可改写为 kebab。
|
|
553
|
+
*
|
|
554
|
+
* @example
|
|
555
|
+
* variables: { 'color-text-primary': '#2a3a52', 'radius-sm': '4px' }
|
|
556
|
+
*/
|
|
557
|
+
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';
|
|
558
|
+
|
|
464
559
|
declare interface AppleMerchantInfo {
|
|
465
560
|
/**
|
|
466
561
|
* @description Apple商户ID
|
|
@@ -849,10 +944,6 @@ declare interface BankInfo {
|
|
|
849
944
|
hasSchemaUrl?: boolean;
|
|
850
945
|
}
|
|
851
946
|
|
|
852
|
-
declare interface BaseAppearance<A extends Partial<Appearance>> {
|
|
853
|
-
appearance?: A;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
947
|
/**
|
|
857
948
|
* @description 内置基础的桥接事件映射类型
|
|
858
949
|
*/
|
|
@@ -2472,18 +2563,22 @@ export declare interface ConfirmCardSetupOptions {
|
|
|
2472
2563
|
redirect?: 'always' | 'if_required';
|
|
2473
2564
|
}
|
|
2474
2565
|
|
|
2475
|
-
export declare
|
|
2476
|
-
sessionData: string;
|
|
2477
|
-
/**
|
|
2478
|
-
* @description 传入已挂载的 CVVElement / PaymentElement / Elements 实例,不传则使用无 UI 自动提交模式
|
|
2479
|
-
*/
|
|
2480
|
-
elements?: BaseMainElement | BaseElements;
|
|
2566
|
+
export declare type ConfirmPaymentOptions = PaymentSubmitParams & {
|
|
2481
2567
|
appearance?: CVVAppearance;
|
|
2482
2568
|
/**
|
|
2483
2569
|
* @description 集成用户自定义信息(如 cardHolderName)
|
|
2484
2570
|
*/
|
|
2485
2571
|
params?: Record<string, unknown>;
|
|
2486
|
-
}
|
|
2572
|
+
} & ({
|
|
2573
|
+
/** 已挂载的 Element;确认时使用其创建时绑定的会话。 */
|
|
2574
|
+
elements: BaseMainElement | BaseElements;
|
|
2575
|
+
/** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
|
|
2576
|
+
sessionData?: string;
|
|
2577
|
+
} | {
|
|
2578
|
+
elements?: undefined;
|
|
2579
|
+
/** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
|
|
2580
|
+
sessionData: string;
|
|
2581
|
+
});
|
|
2487
2582
|
|
|
2488
2583
|
/**
|
|
2489
2584
|
* @description Connect流程参数
|
|
@@ -2620,11 +2715,13 @@ declare interface CustomFontSource {
|
|
|
2620
2715
|
* @public
|
|
2621
2716
|
* @description CVV element app config type
|
|
2622
2717
|
*/
|
|
2623
|
-
export declare interface CVVAppConfig extends
|
|
2718
|
+
export declare interface CVVAppConfig extends BaseElementAppConfig {
|
|
2719
|
+
/** CVV appearance configuration including optional alias-only Rules. */
|
|
2720
|
+
appearance?: CVVAppearance;
|
|
2624
2721
|
/**
|
|
2625
|
-
* @description
|
|
2722
|
+
* @description 创建时必填的支付会话;不可通过 updateConfig 或 submit 替换
|
|
2626
2723
|
*/
|
|
2627
|
-
sessionData
|
|
2724
|
+
sessionData: string;
|
|
2628
2725
|
/**
|
|
2629
2726
|
* @internal sessionConfig 渲染数据,内部使用,无需用户传递
|
|
2630
2727
|
*/
|
|
@@ -2654,12 +2751,13 @@ export declare interface CVVAppConfig extends BaseAppearance<CVVAppearance>, Bas
|
|
|
2654
2751
|
paymentFlow?: 'automatic' | 'cvv';
|
|
2655
2752
|
}
|
|
2656
2753
|
|
|
2657
|
-
export declare type CVVAppearance =
|
|
2754
|
+
export declare type CVVAppearance = PickAntomAppearance<CVVAppearanceProps>;
|
|
2658
2755
|
|
|
2659
2756
|
export declare type CVVAppearanceProps = {
|
|
2660
2757
|
theme: AntomTheme;
|
|
2661
|
-
variables: AntomVariables;
|
|
2758
|
+
variables: AppearanceVariables | AntomVariables;
|
|
2662
2759
|
fonts?: FontSource[];
|
|
2760
|
+
rules: AppearanceRuleSelector<string>;
|
|
2663
2761
|
};
|
|
2664
2762
|
|
|
2665
2763
|
/**
|
|
@@ -2667,15 +2765,30 @@ export declare type CVVAppearanceProps = {
|
|
|
2667
2765
|
*/
|
|
2668
2766
|
export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVElementEvents> {
|
|
2669
2767
|
static elementType: string;
|
|
2768
|
+
private readonly sessionData;
|
|
2769
|
+
private readonly elementTracker;
|
|
2770
|
+
private _mountInProgress;
|
|
2771
|
+
private _destroyInProgress;
|
|
2670
2772
|
constructor(name: string, config: CVVElementConfig);
|
|
2671
2773
|
/**
|
|
2672
2774
|
* @internal
|
|
2673
2775
|
*/
|
|
2674
2776
|
setup(): Promise<Partial<CVVAppConfig> | undefined>;
|
|
2777
|
+
/**
|
|
2778
|
+
* @internal Not supported by the public CVV integration API.
|
|
2779
|
+
* Updates appearance only, preserving the Rules clear semantics.
|
|
2780
|
+
* @param newConfig Appearance configuration patch.
|
|
2781
|
+
* @returns The WebApp update acknowledgement.
|
|
2782
|
+
*/
|
|
2783
|
+
updateConfig(newConfig: Pick<CVVAppConfig, 'appearance'>): Promise<CVVElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
2675
2784
|
/**
|
|
2676
2785
|
* @internal
|
|
2677
2786
|
*/
|
|
2678
2787
|
submit(data?: CVVSubmitParams): Promise<SubmitResult>;
|
|
2788
|
+
mount(container: HTMLElement): Promise<void>;
|
|
2789
|
+
on<T extends keyof CVVElementEvents>(event: T, handler: (payload: CVVElementEvents[T]) => void): void;
|
|
2790
|
+
unmount(): void;
|
|
2791
|
+
destroy(): void;
|
|
2679
2792
|
protected focus(): void;
|
|
2680
2793
|
protected blur(): void;
|
|
2681
2794
|
protected clear(): void;
|
|
@@ -2686,20 +2799,10 @@ export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVEle
|
|
|
2686
2799
|
* @description CVV element config type
|
|
2687
2800
|
*/
|
|
2688
2801
|
export declare interface CVVElementConfig extends BaseElementConfig<CVVAppConfig> {
|
|
2802
|
+
appConfig: CVVAppConfig;
|
|
2689
2803
|
}
|
|
2690
2804
|
|
|
2691
|
-
export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams
|
|
2692
|
-
/**
|
|
2693
|
-
* @description Emitted event about form
|
|
2694
|
-
*/
|
|
2695
|
-
form: {
|
|
2696
|
-
errors?: Array<{
|
|
2697
|
-
field: string | number;
|
|
2698
|
-
message: string;
|
|
2699
|
-
currentValue: any;
|
|
2700
|
-
}>;
|
|
2701
|
-
message: string;
|
|
2702
|
-
};
|
|
2805
|
+
export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams & Pick<CVVAppConfig, 'sessionData'>> {
|
|
2703
2806
|
/**
|
|
2704
2807
|
* @description Emitted when the element is destroy
|
|
2705
2808
|
*/
|
|
@@ -2743,10 +2846,6 @@ export declare type CVVSubmitErrorCodes = 'NOT_FIND_MAINELEMENT' | 'SESSION_DATA
|
|
|
2743
2846
|
* @description CVV 支付提交参数
|
|
2744
2847
|
*/
|
|
2745
2848
|
export declare interface CVVSubmitParams {
|
|
2746
|
-
/**
|
|
2747
|
-
* 支付会话数据
|
|
2748
|
-
*/
|
|
2749
|
-
sessionData?: string;
|
|
2750
2849
|
/**
|
|
2751
2850
|
* 重定向策略
|
|
2752
2851
|
*/
|
|
@@ -3430,8 +3529,12 @@ declare interface ElementPluginChangeStates {
|
|
|
3430
3529
|
declare type ElementPluginNameEnum = 'SET_STATE' | 'PASSIVE_SET_STATE';
|
|
3431
3530
|
|
|
3432
3531
|
declare class Elements extends BaseElements {
|
|
3532
|
+
private readonly apiTracker;
|
|
3433
3533
|
protected canUseElements(): Array<ElementListItemType>;
|
|
3434
3534
|
constructor(config: BaseElementsConfig);
|
|
3535
|
+
init(): Promise<this>;
|
|
3536
|
+
updateConfig(config: Partial<BaseElementsConfig>): void;
|
|
3537
|
+
destroy(): void;
|
|
3435
3538
|
createElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
|
|
3436
3539
|
createElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
|
|
3437
3540
|
getElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
|
|
@@ -3559,20 +3662,21 @@ declare interface ExpPaymentOptionDetail {
|
|
|
3559
3662
|
* @public
|
|
3560
3663
|
* @description Express element app config type
|
|
3561
3664
|
*/
|
|
3562
|
-
export declare interface ExpressAppConfig extends
|
|
3665
|
+
export declare interface ExpressAppConfig extends BaseElementAppConfig {
|
|
3666
|
+
/** Express appearance configuration. */
|
|
3667
|
+
appearance?: ExpressAppearance;
|
|
3563
3668
|
/** payment SessionData */
|
|
3564
3669
|
sessionData?: string;
|
|
3565
|
-
/** Business division (country/region) */
|
|
3566
|
-
businessDivision?: string;
|
|
3567
3670
|
/**
|
|
3568
3671
|
* Amount & Currency
|
|
3569
3672
|
*
|
|
3570
|
-
*
|
|
3571
|
-
*
|
|
3572
|
-
*
|
|
3673
|
+
* For Apple Pay and Google Pay, `value` is a positive ASCII digit string in
|
|
3674
|
+
* the payment session currency's minor unit; `currency` may be omitted.
|
|
3675
|
+
* For example, USD 10.99 is passed as `{ value: '1099' }`.
|
|
3676
|
+
* PayPal keeps its existing major-unit amount semantics and requires `currency`.
|
|
3573
3677
|
*/
|
|
3574
3678
|
amount?: {
|
|
3575
|
-
currency
|
|
3679
|
+
currency?: string;
|
|
3576
3680
|
value: string;
|
|
3577
3681
|
};
|
|
3578
3682
|
/** PayPal 配置 */
|
|
@@ -3626,6 +3730,17 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
|
|
|
3626
3730
|
doMain?: string;
|
|
3627
3731
|
}
|
|
3628
3732
|
|
|
3733
|
+
/** Express element appearance configuration. */
|
|
3734
|
+
declare type ExpressAppearance = PickAntomAppearance<ExpressAppearanceProps>;
|
|
3735
|
+
|
|
3736
|
+
/** Express element appearance properties. */
|
|
3737
|
+
export declare type ExpressAppearanceProps = {
|
|
3738
|
+
displaySetting: 'showCardBrandIcon';
|
|
3739
|
+
theme: 'light' | 'dark';
|
|
3740
|
+
layout: 'accordion' | 'tabs';
|
|
3741
|
+
rules: AppearanceRuleSelector<string>;
|
|
3742
|
+
};
|
|
3743
|
+
|
|
3629
3744
|
/** cancel 事件负载 */
|
|
3630
3745
|
export declare interface ExpressCancelEvent {
|
|
3631
3746
|
expressPaymentType: string;
|
|
@@ -3637,6 +3752,17 @@ export declare interface ExpressClickEvent {
|
|
|
3637
3752
|
expressPaymentType: string;
|
|
3638
3753
|
}
|
|
3639
3754
|
|
|
3755
|
+
declare type ExpressCompletePaymentResult = {
|
|
3756
|
+
success: boolean;
|
|
3757
|
+
result?: any;
|
|
3758
|
+
error?: {
|
|
3759
|
+
code: string;
|
|
3760
|
+
message: string;
|
|
3761
|
+
};
|
|
3762
|
+
userCanceled3D?: boolean;
|
|
3763
|
+
status?: 'SUCCESS' | 'CANCELLED' | 'FAIL' | 'PROCESSING';
|
|
3764
|
+
};
|
|
3765
|
+
|
|
3640
3766
|
/** confirm 事件负载(统一终态,替代 approve) */
|
|
3641
3767
|
export declare interface ExpressConfirmData {
|
|
3642
3768
|
expressPaymentType: string;
|
|
@@ -3683,6 +3809,10 @@ export declare interface ExpressConfirmData {
|
|
|
3683
3809
|
*/
|
|
3684
3810
|
export declare class ExpressElement extends BaseMainElement<ExpressElementConfig, ExpressElementEvents> {
|
|
3685
3811
|
static elementType: string;
|
|
3812
|
+
private readonly elementTracker;
|
|
3813
|
+
private _mountInProgress;
|
|
3814
|
+
private _destroyInProgress;
|
|
3815
|
+
private _registeringInternalListeners;
|
|
3686
3816
|
/**
|
|
3687
3817
|
* Store all function-type callbacks locally, not involved in postMessage serialization
|
|
3688
3818
|
*/
|
|
@@ -3701,7 +3831,23 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
|
|
|
3701
3831
|
private _localHandlers;
|
|
3702
3832
|
/** 支付流程进行中标志(click → confirm/error/cancel 之间) */
|
|
3703
3833
|
private _paymentInProgress;
|
|
3834
|
+
/**
|
|
3835
|
+
* confirm 窗口超时标志:iframe 在 20s onTimeout 发 error(MERCHANT_CONFIRM_TIMEOUT) 时置位,
|
|
3836
|
+
* completePayment 入口据此立即返失败(不发 COMPLETE_PAYMENT,不进 5min 兜底)。
|
|
3837
|
+
* 每新一轮 confirm 事件到达时复位(见 on() 重写)。
|
|
3838
|
+
*/
|
|
3839
|
+
private _confirmWindowTimedOut;
|
|
3840
|
+
/**
|
|
3841
|
+
* 是否已收到 iframe 业务层 ready 事件(app.tsx sendReady)。
|
|
3842
|
+
* 注意:与 host `status='ready'`(由 HANDSHAKE_ACK 触发,bridge.js:450 同步回发,与 amount 解析无关)不同。
|
|
3843
|
+
* 首屏 amount setupError 时 iframe 不发业务 ready → _readyReceived 保持 false,
|
|
3844
|
+
* 据此判别"首屏失败"以阻断后续 updateConfig。
|
|
3845
|
+
*/
|
|
3846
|
+
private _readyReceived;
|
|
3847
|
+
/** 首屏 setupError 致命标志:置位后 updateConfig 被 CHECKOUT_NOT_READY 阻断,只能 destroy 重开。 */
|
|
3848
|
+
private _setupFailed;
|
|
3704
3849
|
private _paypalOverlay;
|
|
3850
|
+
private _updateQueue;
|
|
3705
3851
|
constructor(name: string, config: ExpressElementConfig);
|
|
3706
3852
|
/**
|
|
3707
3853
|
* 重写 on:对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
|
|
@@ -3712,24 +3858,30 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
|
|
|
3712
3858
|
* 用于 Native WebView 场景下 SDK 需要向商户透传跳转信息等。
|
|
3713
3859
|
*/
|
|
3714
3860
|
private _emit;
|
|
3715
|
-
updateConfig(newConfig:
|
|
3861
|
+
updateConfig(newConfig: ExpressAppConfig): Promise<ExpressElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
3862
|
+
private runUpdateConfig;
|
|
3863
|
+
private updateConfigTransaction;
|
|
3864
|
+
private updateAmountConfigWithSanitizedDebug;
|
|
3865
|
+
private getAmountValidationReason;
|
|
3866
|
+
/** iframe 业务 ready 事件到达:置 _readyReceived,后续运行时 error 不再视为首屏失败。
|
|
3867
|
+
* ready 是"本次首屏成功"的确实信号(首屏 setupError 时 iframe 不发 ready),
|
|
3868
|
+
* 故同时清掉 _setupFailed——unmount+remount 同实例二次首屏成功后可恢复 updateConfig。
|
|
3869
|
+
*/
|
|
3870
|
+
private _handleReady;
|
|
3871
|
+
/** iframe error 事件:若 business ready 未到达,视为首屏 setupError → 置 _setupFailed 阻断后续 updateConfig。 */
|
|
3872
|
+
private _handleError;
|
|
3716
3873
|
/**
|
|
3717
3874
|
* 商户在 confirm 回调内调用,触发实际支付提交。
|
|
3718
3875
|
* iframe 收到 OPENSDK@COMPLETE_PAYMENT 后执行 submitPay / polling 等,
|
|
3719
3876
|
* 完成后通过 OPENSDK@COMPLETE_PAYMENT_RESULT 回包,Promise resolve。
|
|
3720
3877
|
*/
|
|
3721
|
-
completePayment(redirect?: 'always' | 'if_required'): Promise<
|
|
3722
|
-
|
|
3723
|
-
result?: any;
|
|
3724
|
-
error?: {
|
|
3725
|
-
code: string;
|
|
3726
|
-
message: string;
|
|
3727
|
-
};
|
|
3728
|
-
/** 用户是否手动关闭 3D 弹窗(透传 webapp COMPLETE_PAYMENT_RESULT.userCanceled3D) */
|
|
3729
|
-
userCanceled3D?: boolean;
|
|
3730
|
-
}>;
|
|
3878
|
+
completePayment(redirect?: 'always' | 'if_required'): Promise<ExpressCompletePaymentResult>;
|
|
3879
|
+
private runCompletePayment;
|
|
3731
3880
|
setup(): Promise<Partial<ExpressAppConfig> | undefined>;
|
|
3732
3881
|
private registerInternalListeners;
|
|
3882
|
+
mount(container: HTMLElement): Promise<void>;
|
|
3883
|
+
unmount(): void;
|
|
3884
|
+
destroy(): void;
|
|
3733
3885
|
protected focus(): void;
|
|
3734
3886
|
protected blur(): void;
|
|
3735
3887
|
protected clear(): void;
|
|
@@ -3801,6 +3953,11 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
|
|
|
3801
3953
|
'OPENSDK@GET_APPLE_PAY_TOKEN': {
|
|
3802
3954
|
requestId: string;
|
|
3803
3955
|
expressPaymentType: string;
|
|
3956
|
+
/** iframe 已转好的 major unit 金额(来自 resolvedAmount);host 委托 Apple Pay 消费,不再做 minor→major 转换。 */
|
|
3957
|
+
walletAmount?: {
|
|
3958
|
+
value: string;
|
|
3959
|
+
currency: string;
|
|
3960
|
+
};
|
|
3804
3961
|
};
|
|
3805
3962
|
/** host 完成 Apple Pay token 获取后回包给 iframe,submit/3DS/polling 均由 webapp 完成 */
|
|
3806
3963
|
'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': {
|
|
@@ -3865,7 +4022,7 @@ export declare interface ExpressVaultingAppConfig extends BaseElementAppConfig {
|
|
|
3865
4022
|
* @description cancel 事件负载
|
|
3866
4023
|
*/
|
|
3867
4024
|
export declare interface ExpressVaultingCancelEvent {
|
|
3868
|
-
|
|
4025
|
+
paymentMethodType: ExpressVaultingMethod;
|
|
3869
4026
|
data?: unknown;
|
|
3870
4027
|
}
|
|
3871
4028
|
|
|
@@ -3874,7 +4031,7 @@ export declare interface ExpressVaultingCancelEvent {
|
|
|
3874
4031
|
* @description click 事件负载
|
|
3875
4032
|
*/
|
|
3876
4033
|
export declare interface ExpressVaultingClickEvent {
|
|
3877
|
-
|
|
4034
|
+
paymentMethodType: ExpressVaultingMethod;
|
|
3878
4035
|
}
|
|
3879
4036
|
|
|
3880
4037
|
/**
|
|
@@ -3882,9 +4039,8 @@ export declare interface ExpressVaultingClickEvent {
|
|
|
3882
4039
|
* @description confirm 事件负载(PayPal onApprove 成功后触发,商户可在回调中调 confirmVaulting)
|
|
3883
4040
|
*/
|
|
3884
4041
|
export declare interface ExpressVaultingConfirmEvent {
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
email?: string;
|
|
4042
|
+
paymentMethodType: ExpressVaultingMethod;
|
|
4043
|
+
payerInfo?: ExpressVaultingPayerInfo;
|
|
3888
4044
|
}
|
|
3889
4045
|
|
|
3890
4046
|
/**
|
|
@@ -3966,12 +4122,12 @@ export declare interface ExpressVaultingElementEvents extends AntomBridgeWithNat
|
|
|
3966
4122
|
* @description error 事件负载
|
|
3967
4123
|
*/
|
|
3968
4124
|
export declare interface ExpressVaultingErrorEvent extends ErrorPayload<string> {
|
|
3969
|
-
|
|
4125
|
+
paymentMethodType: ExpressVaultingMethod;
|
|
3970
4126
|
}
|
|
3971
4127
|
|
|
3972
4128
|
/**
|
|
3973
4129
|
* Supported express vaulting payment methods. All bridge event payloads carry
|
|
3974
|
-
* `
|
|
4130
|
+
* `paymentMethodType` — use this enum instead of硬编码 strings so adding a
|
|
3975
4131
|
* new wallet only needs one entry here. Must match the iframe-side enum in
|
|
3976
4132
|
* elements2/express_vaulting/interface.ts.
|
|
3977
4133
|
*/
|
|
@@ -3979,6 +4135,19 @@ declare enum ExpressVaultingMethod {
|
|
|
3979
4135
|
PAYPAL_DIRECTDEBIT = "PAYPAL_DIRECTDEBIT"
|
|
3980
4136
|
}
|
|
3981
4137
|
|
|
4138
|
+
/**
|
|
4139
|
+
* @public
|
|
4140
|
+
* @description Braintree tokenizePayment 返回的 payer 信息,随 confirm 事件透传给商户
|
|
4141
|
+
*/
|
|
4142
|
+
export declare interface ExpressVaultingPayerInfo {
|
|
4143
|
+
payerId?: string;
|
|
4144
|
+
email?: string;
|
|
4145
|
+
firstName?: string;
|
|
4146
|
+
lastName?: string;
|
|
4147
|
+
countryCode?: string;
|
|
4148
|
+
phone?: string;
|
|
4149
|
+
}
|
|
4150
|
+
|
|
3982
4151
|
/**
|
|
3983
4152
|
* MERCHANT_CONFIRM_TIMEOUT is owned by the iframe side (mirrors express_element:
|
|
3984
4153
|
* iframe starts a 20s timer on the `confirm` event and sends
|
|
@@ -4094,6 +4263,57 @@ declare interface FrontSupportIppBank {
|
|
|
4094
4263
|
logo?: Logo;
|
|
4095
4264
|
}
|
|
4096
4265
|
|
|
4266
|
+
/** host 回传 webapp 的 OPENSDK@GET_APPLE_PAY_TOKEN_REPLY 形态(result 对齐老链路 {token,billingContact,shippingContact})。 */
|
|
4267
|
+
declare interface GetApplePayTokenReply {
|
|
4268
|
+
success: boolean;
|
|
4269
|
+
result?: {
|
|
4270
|
+
token?: unknown;
|
|
4271
|
+
billingContact?: unknown;
|
|
4272
|
+
shippingContact?: unknown;
|
|
4273
|
+
} | {
|
|
4274
|
+
errorCode: string;
|
|
4275
|
+
};
|
|
4276
|
+
}
|
|
4277
|
+
|
|
4278
|
+
/** webapp 传来的 OPENSDK@GET_APPLE_PAY_TOKEN payload 形态。 */
|
|
4279
|
+
declare interface GetApplePayTokenRequest {
|
|
4280
|
+
paymentMethod?: {
|
|
4281
|
+
paymentMethodDetail?: {
|
|
4282
|
+
applePayProps?: {
|
|
4283
|
+
paymentRequest?: unknown;
|
|
4284
|
+
};
|
|
4285
|
+
};
|
|
4286
|
+
};
|
|
4287
|
+
shipping?: unknown;
|
|
4288
|
+
}
|
|
4289
|
+
|
|
4290
|
+
/** host 回传 webapp 的 OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY 形态。 */
|
|
4291
|
+
declare interface GetGooglePayTokenReply {
|
|
4292
|
+
success: boolean;
|
|
4293
|
+
result?: unknown;
|
|
4294
|
+
err?: {
|
|
4295
|
+
statusCode?: string;
|
|
4296
|
+
[key: string]: unknown;
|
|
4297
|
+
};
|
|
4298
|
+
}
|
|
4299
|
+
|
|
4300
|
+
/** webapp 传来的 OPENSDK@GET_GOOGLE_PAY_TOKEN payload 形态。 */
|
|
4301
|
+
declare interface GetGooglePayTokenRequest {
|
|
4302
|
+
actionName?: string;
|
|
4303
|
+
data?: {
|
|
4304
|
+
environment?: string;
|
|
4305
|
+
paymentRequest?: unknown;
|
|
4306
|
+
paymentMethod?: unknown;
|
|
4307
|
+
paymentMethodDetail?: {
|
|
4308
|
+
googlePayProps?: {
|
|
4309
|
+
environment?: string;
|
|
4310
|
+
paymentRequest?: unknown;
|
|
4311
|
+
};
|
|
4312
|
+
};
|
|
4313
|
+
[key: string]: unknown;
|
|
4314
|
+
};
|
|
4315
|
+
}
|
|
4316
|
+
|
|
4097
4317
|
declare type GetI18nQueryParam = string | {
|
|
4098
4318
|
/**
|
|
4099
4319
|
* 多语言文案的 key
|
|
@@ -4944,6 +5164,58 @@ declare interface Language {
|
|
|
4944
5164
|
country?: string;
|
|
4945
5165
|
}
|
|
4946
5166
|
|
|
5167
|
+
/**
|
|
5168
|
+
* @deprecated Token 1.0 老字段类型 — 请迁移到 {@link AppearanceVariables}。
|
|
5169
|
+
* 所有字段均已废弃,运行时由 WebApp 侧 LEGACY_TO_NEW_TOKEN_MAP 翻译为新 token。
|
|
5170
|
+
*
|
|
5171
|
+
* @deprecated 'content-primary' → color-text-primary
|
|
5172
|
+
* @deprecated 'content-secondary' → color-text-secondary
|
|
5173
|
+
* @deprecated 'content-tertiary' → color-text-tertiary
|
|
5174
|
+
* @deprecated 'content-quaternary' → color-text-inverse
|
|
5175
|
+
* @deprecated 'background-primary' → color-background-primary
|
|
5176
|
+
* @deprecated 'background-secondary' → color-background-secondary
|
|
5177
|
+
* @deprecated 'background-disable' → color-background-disabled
|
|
5178
|
+
* @deprecated 'background-transparency' → color-background-transparency
|
|
5179
|
+
* @deprecated 'border-primary' → color-border-primary
|
|
5180
|
+
* @deprecated 'border-secondary' → color-border-secondary
|
|
5181
|
+
* @deprecated 'border-disable' → color-border-disabled
|
|
5182
|
+
* @deprecated 'border-active' → color-border-active
|
|
5183
|
+
* @deprecated 'action-normal' → 一对多 fan-out(无单值映射;运行时展开为 3 个新 token,老 key 不再注入):
|
|
5184
|
+
* - background/background-color → color-backgroundBrand-primary
|
|
5185
|
+
* - border/border-color/box-shadow → color-border-active
|
|
5186
|
+
* - color/文本/图标/勾选态 → color-text-active
|
|
5187
|
+
* @deprecated 'action-hover' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
|
|
5188
|
+
* - background → color-backgroundBrand-primary-hover
|
|
5189
|
+
* - border → color-borderBrand-primary-hover
|
|
5190
|
+
* 文字色 color-textBrand-secondary-hover 不参与派生
|
|
5191
|
+
* (设计稿中与 bg/border 不同色阶),需要时请显式传入该新 token 键
|
|
5192
|
+
* @deprecated 'action-secondary' → color-backgroundBrand-secondary
|
|
5193
|
+
* @deprecated 'action-disable' → 一对多 fan-out(运行时展开为 2 个新 token,老 key 不再注入):
|
|
5194
|
+
* - background/background-color → color-backgroundBrand-disabled
|
|
5195
|
+
* - border/border-color → color-borderBrand-disabled
|
|
5196
|
+
* 文字色 color-textBrand-disabled 不参与派生
|
|
5197
|
+
* (设计稿中全部主题均与 bg/border 不同色阶),需要时请显式传入该新 token 键
|
|
5198
|
+
* @deprecated 'state-success' → color-text-success
|
|
5199
|
+
* @deprecated 'state-failure' → color-text-danger
|
|
5200
|
+
* @deprecated 'state-warning' → color-text-warning
|
|
5201
|
+
* @deprecated 'state-info' → color-text-info
|
|
5202
|
+
* @deprecated 'state-conventional' → color-text-neutral
|
|
5203
|
+
* @deprecated 'state-marketing' → color-text-promotional(color 上下文;background 上下文由 CSS 层直接迁移)
|
|
5204
|
+
* @deprecated 'radius-backup' → radius-sm
|
|
5205
|
+
* @deprecated 'radius-component' → radius-md
|
|
5206
|
+
* @deprecated 'radius-module' → radius-lg
|
|
5207
|
+
* @deprecated 'radius-button' → radius-lg(与 radius-module 同档合并)
|
|
5208
|
+
* @deprecated 'wrapper-padding' → spacing-lg
|
|
5209
|
+
* @deprecated 'stroke-default' → 由 Rules 机制接管
|
|
5210
|
+
* @deprecated 'stroke-active' → 由 Rules 机制接管
|
|
5211
|
+
*
|
|
5212
|
+
* 注:fan-out 展开基数以 figma-v4 设计稿的色阶一致性为准,故 action-hover / action-disable
|
|
5213
|
+
* 为 1→2 而非 1→3;三者合计派生 7 项。
|
|
5214
|
+
*/
|
|
5215
|
+
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'
|
|
5216
|
+
/** 非 Token 体系字段,由 WebApp 侧展开为 design-font-family-* 系列 */
|
|
5217
|
+
| 'fontFamily';
|
|
5218
|
+
|
|
4947
5219
|
declare interface Link {
|
|
4948
5220
|
/**
|
|
4949
5221
|
* @description 发起关联的父元素,如国家
|
|
@@ -7534,7 +7806,9 @@ declare interface PayByLinkInfo {
|
|
|
7534
7806
|
/**
|
|
7535
7807
|
* @description Payment element app config type
|
|
7536
7808
|
*/
|
|
7537
|
-
export declare interface PaymentAppConfig extends
|
|
7809
|
+
export declare interface PaymentAppConfig extends BaseElementAppConfig {
|
|
7810
|
+
/** Payment appearance configuration including optional alias-only Rules. */
|
|
7811
|
+
appearance?: PaymentAppearance;
|
|
7538
7812
|
/**
|
|
7539
7813
|
* @description sessionData,无法通过updateConfig更新
|
|
7540
7814
|
*/
|
|
@@ -7596,12 +7870,18 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
7596
7870
|
/**
|
|
7597
7871
|
* @description Payment element appearance type
|
|
7598
7872
|
*/
|
|
7599
|
-
export declare type PaymentAppearance =
|
|
7873
|
+
export declare type PaymentAppearance = PickAntomAppearance<PaymentAppearanceProps>;
|
|
7874
|
+
|
|
7875
|
+
/**
|
|
7876
|
+
* @description Payment element appearance properties
|
|
7877
|
+
*/
|
|
7878
|
+
export declare type PaymentAppearanceProps = {
|
|
7600
7879
|
displaySetting: 'showPaymentMethodListWhenSingleOption' | 'showCardBrandIcon' | 'showRadioWhenAccordionLayout' | 'showCardCVV';
|
|
7601
7880
|
theme: AntomTheme;
|
|
7602
|
-
variables: AntomVariables;
|
|
7881
|
+
variables: AppearanceVariables | AntomVariables;
|
|
7603
7882
|
layout: AntomLayouts;
|
|
7604
|
-
|
|
7883
|
+
rules: AppearanceRuleSelector<string>;
|
|
7884
|
+
};
|
|
7605
7885
|
|
|
7606
7886
|
/**
|
|
7607
7887
|
* @description Payment element
|
|
@@ -7609,19 +7889,29 @@ export declare type PaymentAppearance = PickAppearance<{
|
|
|
7609
7889
|
export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
|
|
7610
7890
|
static elementType: string;
|
|
7611
7891
|
private _paymentInProgress;
|
|
7892
|
+
private readonly paymentTracker;
|
|
7893
|
+
private _mountStartedAt;
|
|
7894
|
+
private _mountInProgress;
|
|
7895
|
+
private _mountPhase;
|
|
7896
|
+
private _destroyInProgress;
|
|
7897
|
+
private readonly walletLogger;
|
|
7612
7898
|
constructor(name: string, config: PaymentElementConfig);
|
|
7613
7899
|
/**
|
|
7614
7900
|
* @internal
|
|
7615
7901
|
*/
|
|
7616
7902
|
setup(): Promise<Partial<PaymentAppConfig> | undefined>;
|
|
7903
|
+
mount(container: HTMLElement): Promise<void>;
|
|
7617
7904
|
/**
|
|
7618
|
-
* @description Update payment element configuration with amount validation
|
|
7905
|
+
* @description Update payment element configuration with amount validation and appearance Rules support
|
|
7619
7906
|
*/
|
|
7620
|
-
updateConfig(newConfig:
|
|
7907
|
+
updateConfig(newConfig: Partial<PaymentAppConfig>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
7621
7908
|
/**
|
|
7622
7909
|
* @internal
|
|
7623
7910
|
*/
|
|
7624
7911
|
submit(data?: PaymentSubmitParams): Promise<PaymentSubmitResult>;
|
|
7912
|
+
on<T extends keyof PaymentElementEvents>(event: T, handler: (payload: PaymentElementEvents[T]) => void): void;
|
|
7913
|
+
unmount(): void;
|
|
7914
|
+
destroy(): void;
|
|
7625
7915
|
protected focus(): void;
|
|
7626
7916
|
protected blur(): void;
|
|
7627
7917
|
protected clear(): void;
|
|
@@ -7637,6 +7927,25 @@ declare interface PaymentElementConfig extends BaseElementConfig<PaymentAppConfi
|
|
|
7637
7927
|
* @description Payment element events
|
|
7638
7928
|
*/
|
|
7639
7929
|
export declare interface PaymentElementEvents extends AntomBridgeWithNativeEventMap<PaymentAppConfig, PaymentSubmitParams, PaymentSubmitResult> {
|
|
7930
|
+
/**
|
|
7931
|
+
* webapp 委托 host(父 frame)拉起 Apple Pay 拿 token。
|
|
7932
|
+
* payload 结构对齐 ModernElementController.GetApplePayTokenRequest(放 paymentMethod/shipping)。
|
|
7933
|
+
*/
|
|
7934
|
+
'OPENSDK@GET_APPLE_PAY_TOKEN': GetApplePayTokenRequest;
|
|
7935
|
+
/** host 完成 Apple Pay token 获取后回包给 webapp */
|
|
7936
|
+
'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': GetApplePayTokenReply;
|
|
7937
|
+
/**
|
|
7938
|
+
* webapp 委托 host(父 frame)拉起 Google Pay 拿 token。
|
|
7939
|
+
* payload 结构对齐 ModernElementController.GetGooglePayTokenRequest(放 data.environment/paymentRequest)。
|
|
7940
|
+
*/
|
|
7941
|
+
'OPENSDK@GET_GOOGLE_PAY_TOKEN': GetGooglePayTokenRequest;
|
|
7942
|
+
/** host 完成 Google Pay token 获取后回包给 webapp */
|
|
7943
|
+
'OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY': GetGooglePayTokenReply;
|
|
7944
|
+
/** WebApp notifies the host when the selected payment method changes. */
|
|
7945
|
+
paymentMethodChanged: {
|
|
7946
|
+
type: string;
|
|
7947
|
+
name?: string;
|
|
7948
|
+
};
|
|
7640
7949
|
}
|
|
7641
7950
|
|
|
7642
7951
|
declare interface PaymentElementView {
|
|
@@ -8328,6 +8637,7 @@ export declare interface PayPalConfig {
|
|
|
8328
8637
|
channelMerchantAccountId?: string;
|
|
8329
8638
|
/** Button style (fine-grained override) */
|
|
8330
8639
|
style?: PayPalButtonStyle;
|
|
8640
|
+
businessDivision?: string;
|
|
8331
8641
|
/** Callback to create PayPal order, no params, returns sessionData */
|
|
8332
8642
|
createOrder?: () => Promise<string>;
|
|
8333
8643
|
/** Callback when user changes shipping address, data is raw data returned by PayPal */
|
|
@@ -8347,6 +8657,9 @@ declare interface PeriodRule {
|
|
|
8347
8657
|
periodCount?: number;
|
|
8348
8658
|
}
|
|
8349
8659
|
|
|
8660
|
+
/** Builds an Antom appearance type with the restricted Rules declaration contract. */
|
|
8661
|
+
declare type PickAntomAppearance<T extends Record<string, any>> = PickAppearance<T, AppearanceRuleDeclarations>;
|
|
8662
|
+
|
|
8350
8663
|
/**
|
|
8351
8664
|
* @description 工具类型,仅从 Appearance 中拾取与 Props 类型匹配的属性。
|
|
8352
8665
|
* 返回受 Props 中存在的键约束的部分外观对象。
|
|
@@ -25060,7 +25373,9 @@ declare interface UserName {
|
|
|
25060
25373
|
* @public
|
|
25061
25374
|
* @description Vaulting element app config type
|
|
25062
25375
|
*/
|
|
25063
|
-
export declare interface VaultingAppConfig extends
|
|
25376
|
+
export declare interface VaultingAppConfig extends BaseElementAppConfig {
|
|
25377
|
+
/** Vaulting appearance configuration including optional alias-only Rules. */
|
|
25378
|
+
appearance?: VaultingAppearance;
|
|
25064
25379
|
/**
|
|
25065
25380
|
* @description sessionData,无法通过updateConfig更新
|
|
25066
25381
|
*/
|
|
@@ -25087,13 +25402,14 @@ export declare interface VaultingAppConfig extends BaseAppearance<VaultingAppear
|
|
|
25087
25402
|
_requestConfig?: Partial<Omit<RequestOptions, 'scope' | 'tracker'>>;
|
|
25088
25403
|
}
|
|
25089
25404
|
|
|
25090
|
-
export declare type VaultingAppearance =
|
|
25405
|
+
export declare type VaultingAppearance = PickAntomAppearance<VaultingAppearanceProps>;
|
|
25091
25406
|
|
|
25092
25407
|
export declare type VaultingAppearanceProps = {
|
|
25093
25408
|
displaySetting: 'showCardBrandIcon';
|
|
25094
25409
|
theme: AntomTheme;
|
|
25095
|
-
variables: AntomVariables;
|
|
25410
|
+
variables: AppearanceVariables | AntomVariables;
|
|
25096
25411
|
fonts?: FontSource[];
|
|
25412
|
+
rules: AppearanceRuleSelector<string>;
|
|
25097
25413
|
};
|
|
25098
25414
|
|
|
25099
25415
|
/**
|
|
@@ -25101,15 +25417,28 @@ export declare type VaultingAppearanceProps = {
|
|
|
25101
25417
|
*/
|
|
25102
25418
|
export declare class VaultingElement extends BaseMainElement<VaultingElementConfig, VaultingElementEvents> {
|
|
25103
25419
|
static elementType: string;
|
|
25420
|
+
private readonly elementTracker;
|
|
25421
|
+
private _mountInProgress;
|
|
25422
|
+
private _destroyInProgress;
|
|
25104
25423
|
constructor(name: string, config: VaultingElementConfig);
|
|
25105
25424
|
/**
|
|
25106
25425
|
* @internal
|
|
25107
25426
|
*/
|
|
25108
25427
|
setup(): Promise<Partial<VaultingAppConfig> | undefined>;
|
|
25428
|
+
/**
|
|
25429
|
+
* Updates Vaulting configuration while preserving the public Rules clear semantics.
|
|
25430
|
+
* @param newConfig Partial Vaulting configuration patch.
|
|
25431
|
+
* @returns The WebApp update acknowledgement.
|
|
25432
|
+
*/
|
|
25433
|
+
updateConfig(newConfig: Partial<VaultingAppConfig>): Promise<VaultingElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
25109
25434
|
/**
|
|
25110
25435
|
* @internal
|
|
25111
25436
|
*/
|
|
25112
25437
|
submit(data?: VaultingSubmitParams): Promise<SubmitResult>;
|
|
25438
|
+
mount(container: HTMLElement): Promise<void>;
|
|
25439
|
+
on<T extends keyof VaultingElementEvents>(event: T, handler: (payload: VaultingElementEvents[T]) => void): void;
|
|
25440
|
+
unmount(): void;
|
|
25441
|
+
destroy(): void;
|
|
25113
25442
|
protected focus(): void;
|
|
25114
25443
|
protected blur(): void;
|
|
25115
25444
|
protected clear(): void;
|