@alipay/ams-checkout 0.0.1788334613-dev.2 → 0.0.1788334613-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.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.59.0"
8
+ "packageVersion": "7.59.1"
9
9
  }
10
10
  ]
11
11
  }
@@ -296,6 +296,6 @@ export var LogConfig = {
296
296
  version: 'iteration/20231021',
297
297
  mdata: {
298
298
  firstLogTime: Date.now(),
299
- sdkVersion: "0.0.1788334613-dev.2"
299
+ sdkVersion: "0.0.1788334613-dev.21"
300
300
  }
301
301
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1788334613-dev.2",
3
+ "version": "0.0.1788334613-dev.21",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "exports": {
package/types.d.ts CHANGED
@@ -221,7 +221,7 @@ export declare class AntomSDK extends BaseElementsFactory {
221
221
  elements(): Elements;
222
222
  createElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
223
223
  createElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
224
- createElement(elementType: 'CVV', options?: CVVAppConfig): CVVElement;
224
+ createElement(elementType: 'CVV', options: CVVAppConfig): CVVElement;
225
225
  createElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
226
226
  getElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
227
227
  getElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
@@ -293,13 +293,29 @@ export declare const AntomSDKErrorCodes: {
293
293
  */
294
294
  readonly AMOUNT_VALUE_EMPTY: "AMOUNT_VALUE_EMPTY";
295
295
  /**
296
- * @description 金额格式非法(仅允许整数和小数)
296
+ * @description 金额格式非法(仅允许 ASCII 数字字符串)
297
297
  */
298
298
  readonly AMOUNT_VALUE_INVALID: "AMOUNT_VALUE_INVALID";
299
299
  /**
300
- * @description Amount is outside the supported range
300
+ * @description Amount currency does not match the payment session currency
301
301
  */
302
- readonly AMOUNT_VALUE_OUT_OF_RANGE: "AMOUNT_VALUE_OUT_OF_RANGE";
302
+ readonly AMOUNT_CURRENCY_MISMATCH: "AMOUNT_CURRENCY_MISMATCH";
303
+ /**
304
+ * @description Amount currency is not supported
305
+ */
306
+ readonly AMOUNT_CURRENCY_UNSUPPORTED: "AMOUNT_CURRENCY_UNSUPPORTED";
307
+ /**
308
+ * @description Amount currency precision is not supported
309
+ */
310
+ readonly AMOUNT_PRECISION_UNSUPPORTED: "AMOUNT_PRECISION_UNSUPPORTED";
311
+ /**
312
+ * @description Amount conversion timed out
313
+ */
314
+ readonly AMOUNT_RESOLVE_TIMEOUT: "AMOUNT_RESOLVE_TIMEOUT";
315
+ /**
316
+ * @description Amount conversion failed
317
+ */
318
+ readonly AMOUNT_RESOLVE_FAILED: "AMOUNT_RESOLVE_FAILED";
303
319
  readonly GENERATE_ELEMENT_KEY_FAILED: "GENERATE_ELEMENT_KEY_FAILED";
304
320
  readonly ELEMENT_INIT_FAILED: "ELEMENT_INIT_FAILED";
305
321
  readonly MOUNT_TIMEOUT: "MOUNT_TIMEOUT";
@@ -312,8 +328,8 @@ export declare const AntomSDKErrorCodes: {
312
328
  readonly ELEMENT_DEFINE_ERROR: "ELEMENT_DEFINE_ERROR";
313
329
  readonly ELEMENT_ALREADY_REGISTERED: "ELEMENT_ALREADY_REGISTERED";
314
330
  readonly CANNOT_CREATE_SAME_ELEMENT_TWICE: "CANNOT_CREATE_SAME_ELEMENT_TWICE";
315
- readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT";
316
- readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT";
331
+ readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT"; /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
332
+ readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT"; /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
317
333
  readonly NOT_SUPPORT_ELEMENT: "NOT_SUPPORT_ELEMENT";
318
334
  readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
319
335
  readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
@@ -2133,18 +2149,22 @@ export declare interface ConfirmCardSetupOptions {
2133
2149
  redirect?: 'always' | 'if_required';
2134
2150
  }
2135
2151
 
2136
- export declare interface ConfirmPaymentOptions extends Omit<ConfirmCardSetupOptions, 'elements'>, PaymentSubmitParams {
2137
- sessionData: string;
2138
- /**
2139
- * @description 传入已挂载的 CVVElement / PaymentElement / Elements 实例,不传则使用无 UI 自动提交模式
2140
- */
2141
- elements?: BaseMainElement | BaseElements;
2152
+ export declare type ConfirmPaymentOptions = PaymentSubmitParams & {
2142
2153
  appearance?: CVVAppearance;
2143
2154
  /**
2144
2155
  * @description 集成用户自定义信息(如 cardHolderName)
2145
2156
  */
2146
2157
  params?: Record<string, unknown>;
2147
- }
2158
+ } & ({
2159
+ /** 已挂载的 Element;确认时使用其创建时绑定的会话。 */
2160
+ elements: BaseMainElement | BaseElements;
2161
+ /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
2162
+ sessionData?: string;
2163
+ } | {
2164
+ elements?: undefined;
2165
+ /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
2166
+ sessionData: string;
2167
+ });
2148
2168
 
2149
2169
  /**
2150
2170
  * @description Connect流程参数
@@ -2285,9 +2305,9 @@ export declare interface CVVAppConfig extends BaseElementAppConfig {
2285
2305
  /** CVV appearance configuration including optional alias-only Rules. */
2286
2306
  appearance?: CVVAppearance;
2287
2307
  /**
2288
- * @description sessionData
2308
+ * @description 创建时必填的支付会话;不可通过 updateConfig 或 submit 替换
2289
2309
  */
2290
- sessionData?: string;
2310
+ sessionData: string;
2291
2311
  /* Excluded from this release type: paymentSessionConfig */
2292
2312
  /* Excluded from this release type: renderData */
2293
2313
  /* Excluded from this release type: sdkVersion */
@@ -2313,14 +2333,10 @@ export declare type CVVAppearanceProps = {
2313
2333
  */
2314
2334
  export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVElementEvents> {
2315
2335
  static elementType: string;
2336
+ private readonly sessionData;
2316
2337
  constructor(name: string, config: CVVElementConfig);
2317
2338
  /* Excluded from this release type: setup */
2318
- /**
2319
- * Updates CVV configuration while preserving the public Rules clear semantics.
2320
- * @param newConfig Partial CVV configuration patch.
2321
- * @returns The WebApp update acknowledgement.
2322
- */
2323
- updateConfig(newConfig: Partial<CVVAppConfig>): Promise<CVVElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
2339
+ /* Excluded from this release type: updateConfig */
2324
2340
  /* Excluded from this release type: submit */
2325
2341
  protected focus(): void;
2326
2342
  protected blur(): void;
@@ -2332,20 +2348,10 @@ export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVEle
2332
2348
  * @description CVV element config type
2333
2349
  */
2334
2350
  export declare interface CVVElementConfig extends BaseElementConfig<CVVAppConfig> {
2351
+ appConfig: CVVAppConfig;
2335
2352
  }
2336
2353
 
2337
- export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams> {
2338
- /**
2339
- * @description Emitted event about form
2340
- */
2341
- form: {
2342
- errors?: Array<{
2343
- field: string | number;
2344
- message: string;
2345
- currentValue: any;
2346
- }>;
2347
- message: string;
2348
- };
2354
+ export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams & Pick<CVVAppConfig, 'sessionData'>> {
2349
2355
  /**
2350
2356
  * @description Emitted when the element is destroy
2351
2357
  */
@@ -2389,10 +2395,6 @@ export declare type CVVSubmitErrorCodes = 'NOT_FIND_MAINELEMENT' | 'SESSION_DATA
2389
2395
  * @description CVV 支付提交参数
2390
2396
  */
2391
2397
  export declare interface CVVSubmitParams {
2392
- /**
2393
- * 支付会话数据
2394
- */
2395
- sessionData?: string;
2396
2398
  /**
2397
2399
  * 重定向策略
2398
2400
  */
@@ -3213,11 +3215,13 @@ export declare interface ExpressAppConfig extends BaseElementAppConfig {
3213
3215
  /**
3214
3216
  * Amount & Currency
3215
3217
  *
3216
- * `value` is a positive ASCII digit string in the currency's minor unit.
3217
- * For example, USD 10.99 is passed as `{ currency: 'USD', value: '1099' }`.
3218
+ * For Apple Pay and Google Pay, `value` is a positive ASCII digit string in
3219
+ * the payment session currency's minor unit; `currency` may be omitted.
3220
+ * For example, USD 10.99 is passed as `{ value: '1099' }`.
3221
+ * PayPal keeps its existing major-unit amount semantics and requires `currency`.
3218
3222
  */
3219
3223
  amount?: {
3220
- currency: string;
3224
+ currency?: string;
3221
3225
  value: string;
3222
3226
  };
3223
3227
  /** PayPal 配置 */
@@ -3348,6 +3352,15 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3348
3352
  private _localHandlers;
3349
3353
  /** 支付流程进行中标志(click → confirm/error/cancel 之间) */
3350
3354
  private _paymentInProgress;
3355
+ /**
3356
+ * 是否已收到 iframe 业务层 ready 事件(app.tsx sendReady)。
3357
+ * 注意:与 host `status='ready'`(由 HANDSHAKE_ACK 触发,bridge.js:450 同步回发,与 amount 解析无关)不同。
3358
+ * 首屏 amount setupError 时 iframe 不发业务 ready → _readyReceived 保持 false,
3359
+ * 据此判别"首屏失败"以阻断后续 updateConfig。
3360
+ */
3361
+ private _readyReceived;
3362
+ /** 首屏 setupError 致命标志:置位后 updateConfig 被 CHECKOUT_NOT_READY 阻断,只能 destroy 重开。 */
3363
+ private _setupFailed;
3351
3364
  private _paypalOverlay;
3352
3365
  private _updateQueue;
3353
3366
  constructor(name: string, config: ExpressElementConfig);
@@ -3364,6 +3377,13 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3364
3377
  private updateConfigTransaction;
3365
3378
  private updateAmountConfigWithSanitizedDebug;
3366
3379
  private getAmountValidationReason;
3380
+ /** iframe 业务 ready 事件到达:置 _readyReceived,后续运行时 error 不再视为首屏失败。
3381
+ * ready 是"本次首屏成功"的确实信号(首屏 setupError 时 iframe 不发 ready),
3382
+ * 故同时清掉 _setupFailed——unmount+remount 同实例二次首屏成功后可恢复 updateConfig。
3383
+ */
3384
+ private _handleReady;
3385
+ /** iframe error 事件:若 business ready 未到达,视为首屏 setupError → 置 _setupFailed 阻断后续 updateConfig。 */
3386
+ private _handleError;
3367
3387
  /**
3368
3388
  * 商户在 confirm 回调内调用,触发实际支付提交。
3369
3389
  * iframe 收到 OPENSDK@COMPLETE_PAYMENT 后执行 submitPay / polling 等,
@@ -3568,6 +3588,57 @@ declare interface FrontSupportIppBank {
3568
3588
  logo?: Logo;
3569
3589
  }
3570
3590
 
3591
+ /** host 回传 webapp 的 OPENSDK@GET_APPLE_PAY_TOKEN_REPLY 形态(result 对齐老链路 {token,billingContact,shippingContact})。 */
3592
+ declare interface GetApplePayTokenReply {
3593
+ success: boolean;
3594
+ result?: {
3595
+ token?: unknown;
3596
+ billingContact?: unknown;
3597
+ shippingContact?: unknown;
3598
+ } | {
3599
+ errorCode: string;
3600
+ };
3601
+ }
3602
+
3603
+ /** webapp 传来的 OPENSDK@GET_APPLE_PAY_TOKEN payload 形态。 */
3604
+ declare interface GetApplePayTokenRequest {
3605
+ paymentMethod?: {
3606
+ paymentMethodDetail?: {
3607
+ applePayProps?: {
3608
+ paymentRequest?: unknown;
3609
+ };
3610
+ };
3611
+ };
3612
+ shipping?: unknown;
3613
+ }
3614
+
3615
+ /** host 回传 webapp 的 OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY 形态。 */
3616
+ declare interface GetGooglePayTokenReply {
3617
+ success: boolean;
3618
+ result?: unknown;
3619
+ err?: {
3620
+ statusCode?: string;
3621
+ [key: string]: unknown;
3622
+ };
3623
+ }
3624
+
3625
+ /** webapp 传来的 OPENSDK@GET_GOOGLE_PAY_TOKEN payload 形态。 */
3626
+ declare interface GetGooglePayTokenRequest {
3627
+ actionName?: string;
3628
+ data?: {
3629
+ environment?: string;
3630
+ paymentRequest?: unknown;
3631
+ paymentMethod?: unknown;
3632
+ paymentMethodDetail?: {
3633
+ googlePayProps?: {
3634
+ environment?: string;
3635
+ paymentRequest?: unknown;
3636
+ };
3637
+ };
3638
+ [key: string]: unknown;
3639
+ };
3640
+ }
3641
+
3571
3642
  declare type GetI18nQueryParam = string | {
3572
3643
  /**
3573
3644
  * 多语言文案的 key
@@ -7107,6 +7178,7 @@ export declare type PaymentAppearanceProps = {
7107
7178
  export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
7108
7179
  static elementType: string;
7109
7180
  private _paymentInProgress;
7181
+ private readonly walletLogger;
7110
7182
  constructor(name: string, config: PaymentElementConfig);
7111
7183
  /* Excluded from this release type: setup */
7112
7184
  /**
@@ -7129,6 +7201,20 @@ declare interface PaymentElementConfig extends BaseElementConfig<PaymentAppConfi
7129
7201
  * @description Payment element events
7130
7202
  */
7131
7203
  export declare interface PaymentElementEvents extends AntomBridgeWithNativeEventMap<PaymentAppConfig, PaymentSubmitParams, PaymentSubmitResult> {
7204
+ /**
7205
+ * webapp 委托 host(父 frame)拉起 Apple Pay 拿 token。
7206
+ * payload 结构对齐 ModernElementController.GetApplePayTokenRequest(放 paymentMethod/shipping)。
7207
+ */
7208
+ 'OPENSDK@GET_APPLE_PAY_TOKEN': GetApplePayTokenRequest;
7209
+ /** host 完成 Apple Pay token 获取后回包给 webapp */
7210
+ 'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': GetApplePayTokenReply;
7211
+ /**
7212
+ * webapp 委托 host(父 frame)拉起 Google Pay 拿 token。
7213
+ * payload 结构对齐 ModernElementController.GetGooglePayTokenRequest(放 data.environment/paymentRequest)。
7214
+ */
7215
+ 'OPENSDK@GET_GOOGLE_PAY_TOKEN': GetGooglePayTokenRequest;
7216
+ /** host 完成 Google Pay token 获取后回包给 webapp */
7217
+ 'OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY': GetGooglePayTokenReply;
7132
7218
  }
7133
7219
 
7134
7220
  declare interface PaymentElementView {
@@ -313,7 +313,7 @@ export declare class AntomSDK extends BaseElementsFactory {
313
313
  elements(): Elements;
314
314
  createElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
315
315
  createElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
316
- createElement(elementType: 'CVV', options?: CVVAppConfig): CVVElement;
316
+ createElement(elementType: 'CVV', options: CVVAppConfig): CVVElement;
317
317
  createElement(elementType: 'express', options?: ExpressAppConfig): ExpressElement;
318
318
  getElement(elementType: 'payment', options?: PaymentAppConfig): PaymentElement;
319
319
  getElement(elementType: 'vaulting', options?: VaultingAppConfig): VaultingElement;
@@ -385,13 +385,29 @@ export declare const AntomSDKErrorCodes: {
385
385
  */
386
386
  readonly AMOUNT_VALUE_EMPTY: "AMOUNT_VALUE_EMPTY";
387
387
  /**
388
- * @description 金额格式非法(仅允许整数和小数)
388
+ * @description 金额格式非法(仅允许 ASCII 数字字符串)
389
389
  */
390
390
  readonly AMOUNT_VALUE_INVALID: "AMOUNT_VALUE_INVALID";
391
391
  /**
392
- * @description Amount is outside the supported range
392
+ * @description Amount currency does not match the payment session currency
393
393
  */
394
- readonly AMOUNT_VALUE_OUT_OF_RANGE: "AMOUNT_VALUE_OUT_OF_RANGE";
394
+ readonly AMOUNT_CURRENCY_MISMATCH: "AMOUNT_CURRENCY_MISMATCH";
395
+ /**
396
+ * @description Amount currency is not supported
397
+ */
398
+ readonly AMOUNT_CURRENCY_UNSUPPORTED: "AMOUNT_CURRENCY_UNSUPPORTED";
399
+ /**
400
+ * @description Amount currency precision is not supported
401
+ */
402
+ readonly AMOUNT_PRECISION_UNSUPPORTED: "AMOUNT_PRECISION_UNSUPPORTED";
403
+ /**
404
+ * @description Amount conversion timed out
405
+ */
406
+ readonly AMOUNT_RESOLVE_TIMEOUT: "AMOUNT_RESOLVE_TIMEOUT";
407
+ /**
408
+ * @description Amount conversion failed
409
+ */
410
+ readonly AMOUNT_RESOLVE_FAILED: "AMOUNT_RESOLVE_FAILED";
395
411
  readonly GENERATE_ELEMENT_KEY_FAILED: "GENERATE_ELEMENT_KEY_FAILED";
396
412
  readonly ELEMENT_INIT_FAILED: "ELEMENT_INIT_FAILED";
397
413
  readonly MOUNT_TIMEOUT: "MOUNT_TIMEOUT";
@@ -404,8 +420,8 @@ export declare const AntomSDKErrorCodes: {
404
420
  readonly ELEMENT_DEFINE_ERROR: "ELEMENT_DEFINE_ERROR";
405
421
  readonly ELEMENT_ALREADY_REGISTERED: "ELEMENT_ALREADY_REGISTERED";
406
422
  readonly CANNOT_CREATE_SAME_ELEMENT_TWICE: "CANNOT_CREATE_SAME_ELEMENT_TWICE";
407
- readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT";
408
- readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT";
423
+ readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT"; /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
424
+ readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT"; /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
409
425
  readonly NOT_SUPPORT_ELEMENT: "NOT_SUPPORT_ELEMENT";
410
426
  readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
411
427
  readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
@@ -2528,18 +2544,22 @@ export declare interface ConfirmCardSetupOptions {
2528
2544
  redirect?: 'always' | 'if_required';
2529
2545
  }
2530
2546
 
2531
- export declare interface ConfirmPaymentOptions extends Omit<ConfirmCardSetupOptions, 'elements'>, PaymentSubmitParams {
2532
- sessionData: string;
2533
- /**
2534
- * @description 传入已挂载的 CVVElement / PaymentElement / Elements 实例,不传则使用无 UI 自动提交模式
2535
- */
2536
- elements?: BaseMainElement | BaseElements;
2547
+ export declare type ConfirmPaymentOptions = PaymentSubmitParams & {
2537
2548
  appearance?: CVVAppearance;
2538
2549
  /**
2539
2550
  * @description 集成用户自定义信息(如 cardHolderName)
2540
2551
  */
2541
2552
  params?: Record<string, unknown>;
2542
- }
2553
+ } & ({
2554
+ /** 已挂载的 Element;确认时使用其创建时绑定的会话。 */
2555
+ elements: BaseMainElement | BaseElements;
2556
+ /** @deprecated 传入 elements 时无需重复传递,且不会覆盖 Element 的会话。 */
2557
+ sessionData?: string;
2558
+ } | {
2559
+ elements?: undefined;
2560
+ /** 无 UI 模式必填,仅用于创建内部 CVVElement。 */
2561
+ sessionData: string;
2562
+ });
2543
2563
 
2544
2564
  /**
2545
2565
  * @description Connect流程参数
@@ -2680,9 +2700,9 @@ export declare interface CVVAppConfig extends BaseElementAppConfig {
2680
2700
  /** CVV appearance configuration including optional alias-only Rules. */
2681
2701
  appearance?: CVVAppearance;
2682
2702
  /**
2683
- * @description sessionData
2703
+ * @description 创建时必填的支付会话;不可通过 updateConfig 或 submit 替换
2684
2704
  */
2685
- sessionData?: string;
2705
+ sessionData: string;
2686
2706
  /**
2687
2707
  * @internal sessionConfig 渲染数据,内部使用,无需用户传递
2688
2708
  */
@@ -2726,17 +2746,19 @@ export declare type CVVAppearanceProps = {
2726
2746
  */
2727
2747
  export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVElementEvents> {
2728
2748
  static elementType: string;
2749
+ private readonly sessionData;
2729
2750
  constructor(name: string, config: CVVElementConfig);
2730
2751
  /**
2731
2752
  * @internal
2732
2753
  */
2733
2754
  setup(): Promise<Partial<CVVAppConfig> | undefined>;
2734
2755
  /**
2735
- * Updates CVV configuration while preserving the public Rules clear semantics.
2736
- * @param newConfig Partial CVV configuration patch.
2756
+ * @internal Not supported by the public CVV integration API.
2757
+ * Updates appearance only, preserving the Rules clear semantics.
2758
+ * @param newConfig Appearance configuration patch.
2737
2759
  * @returns The WebApp update acknowledgement.
2738
2760
  */
2739
- updateConfig(newConfig: Partial<CVVAppConfig>): Promise<CVVElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
2761
+ updateConfig(newConfig: Pick<CVVAppConfig, 'appearance'>): Promise<CVVElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
2740
2762
  /**
2741
2763
  * @internal
2742
2764
  */
@@ -2751,20 +2773,10 @@ export declare class CVVElement extends BaseMainElement<CVVElementConfig, CVVEle
2751
2773
  * @description CVV element config type
2752
2774
  */
2753
2775
  export declare interface CVVElementConfig extends BaseElementConfig<CVVAppConfig> {
2776
+ appConfig: CVVAppConfig;
2754
2777
  }
2755
2778
 
2756
- export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams> {
2757
- /**
2758
- * @description Emitted event about form
2759
- */
2760
- form: {
2761
- errors?: Array<{
2762
- field: string | number;
2763
- message: string;
2764
- currentValue: any;
2765
- }>;
2766
- message: string;
2767
- };
2779
+ export declare interface CVVElementEvents extends AntomBridgeEventMap<CVVAppConfig, CVVSubmitParams & Pick<CVVAppConfig, 'sessionData'>> {
2768
2780
  /**
2769
2781
  * @description Emitted when the element is destroy
2770
2782
  */
@@ -2808,10 +2820,6 @@ export declare type CVVSubmitErrorCodes = 'NOT_FIND_MAINELEMENT' | 'SESSION_DATA
2808
2820
  * @description CVV 支付提交参数
2809
2821
  */
2810
2822
  export declare interface CVVSubmitParams {
2811
- /**
2812
- * 支付会话数据
2813
- */
2814
- sessionData?: string;
2815
2823
  /**
2816
2824
  * 重定向策略
2817
2825
  */
@@ -3632,11 +3640,13 @@ export declare interface ExpressAppConfig extends BaseElementAppConfig {
3632
3640
  /**
3633
3641
  * Amount & Currency
3634
3642
  *
3635
- * `value` is a positive ASCII digit string in the currency's minor unit.
3636
- * For example, USD 10.99 is passed as `{ currency: 'USD', value: '1099' }`.
3643
+ * For Apple Pay and Google Pay, `value` is a positive ASCII digit string in
3644
+ * the payment session currency's minor unit; `currency` may be omitted.
3645
+ * For example, USD 10.99 is passed as `{ value: '1099' }`.
3646
+ * PayPal keeps its existing major-unit amount semantics and requires `currency`.
3637
3647
  */
3638
3648
  amount?: {
3639
- currency: string;
3649
+ currency?: string;
3640
3650
  value: string;
3641
3651
  };
3642
3652
  /** PayPal 配置 */
@@ -3776,6 +3786,15 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3776
3786
  private _localHandlers;
3777
3787
  /** 支付流程进行中标志(click → confirm/error/cancel 之间) */
3778
3788
  private _paymentInProgress;
3789
+ /**
3790
+ * 是否已收到 iframe 业务层 ready 事件(app.tsx sendReady)。
3791
+ * 注意:与 host `status='ready'`(由 HANDSHAKE_ACK 触发,bridge.js:450 同步回发,与 amount 解析无关)不同。
3792
+ * 首屏 amount setupError 时 iframe 不发业务 ready → _readyReceived 保持 false,
3793
+ * 据此判别"首屏失败"以阻断后续 updateConfig。
3794
+ */
3795
+ private _readyReceived;
3796
+ /** 首屏 setupError 致命标志:置位后 updateConfig 被 CHECKOUT_NOT_READY 阻断,只能 destroy 重开。 */
3797
+ private _setupFailed;
3779
3798
  private _paypalOverlay;
3780
3799
  private _updateQueue;
3781
3800
  constructor(name: string, config: ExpressElementConfig);
@@ -3792,6 +3811,13 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3792
3811
  private updateConfigTransaction;
3793
3812
  private updateAmountConfigWithSanitizedDebug;
3794
3813
  private getAmountValidationReason;
3814
+ /** iframe 业务 ready 事件到达:置 _readyReceived,后续运行时 error 不再视为首屏失败。
3815
+ * ready 是"本次首屏成功"的确实信号(首屏 setupError 时 iframe 不发 ready),
3816
+ * 故同时清掉 _setupFailed——unmount+remount 同实例二次首屏成功后可恢复 updateConfig。
3817
+ */
3818
+ private _handleReady;
3819
+ /** iframe error 事件:若 business ready 未到达,视为首屏 setupError → 置 _setupFailed 阻断后续 updateConfig。 */
3820
+ private _handleError;
3795
3821
  /**
3796
3822
  * 商户在 confirm 回调内调用,触发实际支付提交。
3797
3823
  * iframe 收到 OPENSDK@COMPLETE_PAYMENT 后执行 submitPay / polling 等,
@@ -3996,6 +4022,57 @@ declare interface FrontSupportIppBank {
3996
4022
  logo?: Logo;
3997
4023
  }
3998
4024
 
4025
+ /** host 回传 webapp 的 OPENSDK@GET_APPLE_PAY_TOKEN_REPLY 形态(result 对齐老链路 {token,billingContact,shippingContact})。 */
4026
+ declare interface GetApplePayTokenReply {
4027
+ success: boolean;
4028
+ result?: {
4029
+ token?: unknown;
4030
+ billingContact?: unknown;
4031
+ shippingContact?: unknown;
4032
+ } | {
4033
+ errorCode: string;
4034
+ };
4035
+ }
4036
+
4037
+ /** webapp 传来的 OPENSDK@GET_APPLE_PAY_TOKEN payload 形态。 */
4038
+ declare interface GetApplePayTokenRequest {
4039
+ paymentMethod?: {
4040
+ paymentMethodDetail?: {
4041
+ applePayProps?: {
4042
+ paymentRequest?: unknown;
4043
+ };
4044
+ };
4045
+ };
4046
+ shipping?: unknown;
4047
+ }
4048
+
4049
+ /** host 回传 webapp 的 OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY 形态。 */
4050
+ declare interface GetGooglePayTokenReply {
4051
+ success: boolean;
4052
+ result?: unknown;
4053
+ err?: {
4054
+ statusCode?: string;
4055
+ [key: string]: unknown;
4056
+ };
4057
+ }
4058
+
4059
+ /** webapp 传来的 OPENSDK@GET_GOOGLE_PAY_TOKEN payload 形态。 */
4060
+ declare interface GetGooglePayTokenRequest {
4061
+ actionName?: string;
4062
+ data?: {
4063
+ environment?: string;
4064
+ paymentRequest?: unknown;
4065
+ paymentMethod?: unknown;
4066
+ paymentMethodDetail?: {
4067
+ googlePayProps?: {
4068
+ environment?: string;
4069
+ paymentRequest?: unknown;
4070
+ };
4071
+ };
4072
+ [key: string]: unknown;
4073
+ };
4074
+ }
4075
+
3999
4076
  declare type GetI18nQueryParam = string | {
4000
4077
  /**
4001
4078
  * 多语言文案的 key
@@ -7571,6 +7648,7 @@ export declare type PaymentAppearanceProps = {
7571
7648
  export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
7572
7649
  static elementType: string;
7573
7650
  private _paymentInProgress;
7651
+ private readonly walletLogger;
7574
7652
  constructor(name: string, config: PaymentElementConfig);
7575
7653
  /**
7576
7654
  * @internal
@@ -7599,6 +7677,20 @@ declare interface PaymentElementConfig extends BaseElementConfig<PaymentAppConfi
7599
7677
  * @description Payment element events
7600
7678
  */
7601
7679
  export declare interface PaymentElementEvents extends AntomBridgeWithNativeEventMap<PaymentAppConfig, PaymentSubmitParams, PaymentSubmitResult> {
7680
+ /**
7681
+ * webapp 委托 host(父 frame)拉起 Apple Pay 拿 token。
7682
+ * payload 结构对齐 ModernElementController.GetApplePayTokenRequest(放 paymentMethod/shipping)。
7683
+ */
7684
+ 'OPENSDK@GET_APPLE_PAY_TOKEN': GetApplePayTokenRequest;
7685
+ /** host 完成 Apple Pay token 获取后回包给 webapp */
7686
+ 'OPENSDK@GET_APPLE_PAY_TOKEN_REPLY': GetApplePayTokenReply;
7687
+ /**
7688
+ * webapp 委托 host(父 frame)拉起 Google Pay 拿 token。
7689
+ * payload 结构对齐 ModernElementController.GetGooglePayTokenRequest(放 data.environment/paymentRequest)。
7690
+ */
7691
+ 'OPENSDK@GET_GOOGLE_PAY_TOKEN': GetGooglePayTokenRequest;
7692
+ /** host 完成 Google Pay token 获取后回包给 webapp */
7693
+ 'OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY': GetGooglePayTokenReply;
7602
7694
  }
7603
7695
 
7604
7696
  declare interface PaymentElementView {