@alipay/ams-checkout 2.0.21 → 2.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +7 -5
- package/esm/core/component/element/modernElementController/adapter.js +1 -0
- package/esm/core/component/element/modernElementController/index.d.ts +3 -1
- package/esm/core/component/element/modernElementController/index.js +474 -262
- package/esm/core/utils/connectConfig.d.ts +11 -0
- package/esm/core/utils/connectConfig.js +28 -0
- package/esm/foundation/service/event-center.js +12 -9
- package/esm/modern/index.js +1 -1
- package/esm/modern/tools.js +1 -1
- package/esm/plugin/component/channel.d.ts +1 -1
- package/esm/plugin/component/channel.js +11 -2
- package/esm/tsdoc-metadata.json +1 -1
- package/esm/util/logger.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +79 -10
- package/types.untrimmed.d.ts +88 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EventPayload, type IPaymentSessionMetaData } from '../../types';
|
|
2
1
|
import type { CKPShipping } from '../../core/component/element/type';
|
|
2
|
+
import { type EventPayload, type IPaymentSessionMetaData } from '../../types';
|
|
3
3
|
import { Logger } from '../../util/logger';
|
|
4
4
|
export type IChannelBehavior = {
|
|
5
5
|
usePaymentSessionAsQueryResult: boolean;
|
|
@@ -17,7 +17,7 @@ import { getDoubleFaUrlFromSession } from "../../foundation/utils/web_app_url_ut
|
|
|
17
17
|
import { getApplePayPaymentSession, submitPayInfo } from "../../service";
|
|
18
18
|
import { EnvironmentEnum } from "../../types";
|
|
19
19
|
import { device, isEmpty } from "../../util";
|
|
20
|
-
import {
|
|
20
|
+
import { BEFORE_CONFIRM_TIMEOUT_MS, executeWithTimeout, MERCHANT_CONFIRM_ABORT_CODE, MERCHANT_CONFIRM_TIMEOUT_CODE } from "../../util/beforeConfirm";
|
|
21
21
|
import { APPLE_PAY_RECURRING_VERSION, APPLE_PAY_VERSION } from "../applepay/interface";
|
|
22
22
|
var APPLEPAYERRORENUM = /*#__PURE__*/function (APPLEPAYERRORENUM) {
|
|
23
23
|
APPLEPAYERRORENUM["APPLE_PAY_MISSING_DATA"] = "APPLE_PAY_MISSING_DATA";
|
|
@@ -92,7 +92,16 @@ export var handleGooglePay = function handleGooglePay(data) {
|
|
|
92
92
|
var script = document.createElement('script');
|
|
93
93
|
script.src = 'https://pay.google.com/gp/p/js/pay.js';
|
|
94
94
|
script.async = true;
|
|
95
|
-
|
|
95
|
+
|
|
96
|
+
// 当判断条件成立时,代表 document.body.appendChild 方法已经被劫持
|
|
97
|
+
if (document.body.appendChild !== Node.prototype.appendChild) {
|
|
98
|
+
// 使用原生 appendChild 避免微前端沙箱(如 qiankun)将动态 <script> 劫持为 fetch 加载,
|
|
99
|
+
// 导致不支持 CORS 的第三方脚本(如 pay.google.com)加载失败
|
|
100
|
+
Node.prototype.appendChild.call(document.body, script);
|
|
101
|
+
} else {
|
|
102
|
+
document.body.appendChild(script);
|
|
103
|
+
}
|
|
104
|
+
|
|
96
105
|
// 执行googlePay sdk
|
|
97
106
|
script.onload = function () {
|
|
98
107
|
var paymentsClient = new window.google.payments.api.PaymentsClient({
|
package/esm/tsdoc-metadata.json
CHANGED
package/esm/util/logger.js
CHANGED
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -313,7 +313,7 @@ export declare const AntomSDKErrorCodes: {
|
|
|
313
313
|
readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
|
|
314
314
|
readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
|
|
315
315
|
/**
|
|
316
|
-
*
|
|
316
|
+
* 查询到的结果消息
|
|
317
317
|
*/
|
|
318
318
|
readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
|
|
319
319
|
readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
|
|
@@ -629,6 +629,8 @@ declare type AxiosHeaderMatcher =
|
|
|
629
629
|
| RegExp
|
|
630
630
|
| ((this: AxiosHeaders, value: string, name: string) => boolean);
|
|
631
631
|
|
|
632
|
+
declare type AxiosHeaderParameters = Record<string, string>;
|
|
633
|
+
|
|
632
634
|
declare type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;
|
|
633
635
|
|
|
634
636
|
declare class AxiosHeaders {
|
|
@@ -644,6 +646,7 @@ declare class AxiosHeaders {
|
|
|
644
646
|
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
|
645
647
|
set(headers?: Iterable<[string, AxiosHeaderValue]>, rewrite?: boolean): AxiosHeaders;
|
|
646
648
|
|
|
649
|
+
get(headerName: string, parser: typeof AxiosHeaders.parseParameters): AxiosHeaderParameters;
|
|
647
650
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
|
648
651
|
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
|
649
652
|
|
|
@@ -665,6 +668,8 @@ declare class AxiosHeaders {
|
|
|
665
668
|
|
|
666
669
|
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
|
667
670
|
|
|
671
|
+
static parseParameters(value: AxiosHeaderValue): AxiosHeaderParameters;
|
|
672
|
+
|
|
668
673
|
static accessor(header: string | string[]): AxiosHeaders;
|
|
669
674
|
|
|
670
675
|
static concat(
|
|
@@ -767,6 +772,7 @@ declare interface BaseBridgeEventMap<AppConfig extends Record<string, any> = Rec
|
|
|
767
772
|
/* Excluded from this release type: "OPENSDK@CLOSE_MODAL" */
|
|
768
773
|
/* Excluded from this release type: "OPENSDK@REDIRECT" */
|
|
769
774
|
/* Excluded from this release type: "OPENSDK@TRANSFER_MODAL_PORT" */
|
|
775
|
+
/* Excluded from this release type: "OPENSDK@MODAL_TRANSFER_READY" */
|
|
770
776
|
/* Excluded from this release type: "OPENSDK@TRANSFER_MODAL_APPEARANCE" */
|
|
771
777
|
/* Excluded from this release type: "OPENSDK@TRANSFER_MODAL_INITIALDATA" */
|
|
772
778
|
/* Excluded from this release type: "OPENSDK@TRANSFER_APP_PORT" */
|
|
@@ -905,6 +911,10 @@ declare abstract class BaseElementsFactory extends BaseFactory {
|
|
|
905
911
|
declare abstract class BaseFactory {
|
|
906
912
|
/* Excluded from this release type: config */
|
|
907
913
|
/* Excluded from this release type: isInit */
|
|
914
|
+
/**
|
|
915
|
+
* Indicates whether this factory instance has been destroyed.
|
|
916
|
+
*/
|
|
917
|
+
isDestroyed: boolean;
|
|
908
918
|
/**
|
|
909
919
|
* @description 当前版本号
|
|
910
920
|
* 用于日志上报
|
|
@@ -916,6 +926,7 @@ declare abstract class BaseFactory {
|
|
|
916
926
|
/* Excluded from this release type: globalBridgeForModal */
|
|
917
927
|
/* Excluded from this release type: openModalHandle */
|
|
918
928
|
/* Excluded from this release type: elementClasses */
|
|
929
|
+
/* Excluded from this release type: modalIsReady */
|
|
919
930
|
/**
|
|
920
931
|
* @param config 配置
|
|
921
932
|
*/
|
|
@@ -3161,10 +3172,8 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
|
|
|
3161
3172
|
*/
|
|
3162
3173
|
paymentMethods?: string[];
|
|
3163
3174
|
/* Excluded from this release type: setupError */
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
*/
|
|
3167
|
-
locale?: string;
|
|
3175
|
+
/* Excluded from this release type: locale */
|
|
3176
|
+
/* Excluded from this release type: _paypalSdkEnvironment */
|
|
3168
3177
|
/**
|
|
3169
3178
|
* 是否运行在 Native App 的 WebView 中。
|
|
3170
3179
|
* 为 true 时,跳转通过 onRedirect 事件委托给 Native 端处理。
|
|
@@ -3252,9 +3261,7 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
|
|
|
3252
3261
|
private _paypalOverlay;
|
|
3253
3262
|
constructor(name: string, config: ExpressElementConfig);
|
|
3254
3263
|
/**
|
|
3255
|
-
* 重写 on
|
|
3256
|
-
* 1. 对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
|
|
3257
|
-
* 2. 对 onRedirect 事件同步注册到 _localHandlers(SDK host 主动推送时商户能收到)
|
|
3264
|
+
* 重写 on:对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
|
|
3258
3265
|
*/
|
|
3259
3266
|
on(event: string, handler: (...args: any[]) => void): void;
|
|
3260
3267
|
/**
|
|
@@ -3275,6 +3282,8 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
|
|
|
3275
3282
|
code: string;
|
|
3276
3283
|
message: string;
|
|
3277
3284
|
};
|
|
3285
|
+
/** 用户是否手动关闭 3D 弹窗(透传 webapp COMPLETE_PAYMENT_RESULT.userCanceled3D) */
|
|
3286
|
+
userCanceled3D?: boolean;
|
|
3278
3287
|
}>;
|
|
3279
3288
|
setup(): Promise<Partial<ExpressAppConfig> | undefined>;
|
|
3280
3289
|
private registerInternalListeners;
|
|
@@ -3373,6 +3382,14 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
|
|
|
3373
3382
|
};
|
|
3374
3383
|
}
|
|
3375
3384
|
|
|
3385
|
+
declare type ExpressPaymentMethod = (typeof SUPPORTED_EXPRESS_METHODS)[number];
|
|
3386
|
+
|
|
3387
|
+
declare type ExpressSetupError = ErrorPayload & {
|
|
3388
|
+
expressPaymentType?: ExpressPaymentMethod;
|
|
3389
|
+
/** 服务端返回的 errorMessage 已完成国际化,可直接对客展示 */
|
|
3390
|
+
mulityLanguageMapping?: boolean;
|
|
3391
|
+
};
|
|
3392
|
+
|
|
3376
3393
|
declare interface ExpSupportBank {
|
|
3377
3394
|
/**
|
|
3378
3395
|
* @description 银行名称
|
|
@@ -6672,11 +6689,14 @@ declare interface OneAccountQueryResult {
|
|
|
6672
6689
|
*/
|
|
6673
6690
|
declare type OpenModalHandle = {
|
|
6674
6691
|
destroy: () => void;
|
|
6675
|
-
|
|
6692
|
+
/**
|
|
6693
|
+
* @deprecated 移除,内部监听ready事件
|
|
6694
|
+
*/
|
|
6695
|
+
onLoadedSuccess?: (onLoadSuccess: () => void) => void;
|
|
6676
6696
|
getContentWindow: () => Window | null;
|
|
6677
6697
|
};
|
|
6678
6698
|
|
|
6679
|
-
declare interface OpenModalParams extends BaseOpenModalConfig {
|
|
6699
|
+
declare interface OpenModalParams extends Omit<BaseOpenModalConfig, 'hideCloseWhenLoaded'> {
|
|
6680
6700
|
mode: 'desktop' | 'mobile';
|
|
6681
6701
|
loadingConfig?: {
|
|
6682
6702
|
theme?: 'light' | 'dark';
|
|
@@ -6891,6 +6911,7 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
6891
6911
|
*/
|
|
6892
6912
|
sessionData?: string;
|
|
6893
6913
|
/* Excluded from this release type: merchantDomain */
|
|
6914
|
+
doMain?: string;
|
|
6894
6915
|
/* Excluded from this release type: renderData */
|
|
6895
6916
|
/* Excluded from this release type: connectAccount */
|
|
6896
6917
|
/* Excluded from this release type: sessionMetaData */
|
|
@@ -6899,6 +6920,15 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
6899
6920
|
/* Excluded from this release type: _requestConfig */
|
|
6900
6921
|
/* Excluded from this release type: logMetaData */
|
|
6901
6922
|
/* Excluded from this release type: heightOfVisible */
|
|
6923
|
+
/**
|
|
6924
|
+
* Amount & Currency
|
|
6925
|
+
*
|
|
6926
|
+
* Only effective via `updateConfig({ amount })` at runtime.
|
|
6927
|
+
*/
|
|
6928
|
+
amount?: {
|
|
6929
|
+
currency: string;
|
|
6930
|
+
value: string;
|
|
6931
|
+
};
|
|
6902
6932
|
}
|
|
6903
6933
|
|
|
6904
6934
|
/**
|
|
@@ -6916,8 +6946,13 @@ export declare type PaymentAppearance = PickAppearance<{
|
|
|
6916
6946
|
*/
|
|
6917
6947
|
export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
|
|
6918
6948
|
static elementType: string;
|
|
6949
|
+
private _paymentInProgress;
|
|
6919
6950
|
constructor(name: string, config: PaymentElementConfig);
|
|
6920
6951
|
/* Excluded from this release type: setup */
|
|
6952
|
+
/**
|
|
6953
|
+
* @description Update payment element configuration with amount validation
|
|
6954
|
+
*/
|
|
6955
|
+
updateConfig(newConfig: Pick<PaymentAppConfig, 'amount'>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
6921
6956
|
/* Excluded from this release type: submit */
|
|
6922
6957
|
protected focus(): void;
|
|
6923
6958
|
protected blur(): void;
|
|
@@ -23780,6 +23815,10 @@ export declare type SubmitResult = {
|
|
|
23780
23815
|
* 查询到的结果消息
|
|
23781
23816
|
*/
|
|
23782
23817
|
message?: string;
|
|
23818
|
+
/**
|
|
23819
|
+
* @description 接口错误时的链路追踪 id,用于定位排查根因(非错误状态无该字段)
|
|
23820
|
+
*/
|
|
23821
|
+
traceId?: string;
|
|
23783
23822
|
/**
|
|
23784
23823
|
* @description 是否需要更换 session 重试
|
|
23785
23824
|
*/
|
|
@@ -23901,6 +23940,8 @@ declare interface SubscriptionPricePlan {
|
|
|
23901
23940
|
pricePlanAmountView?: PaymentView;
|
|
23902
23941
|
}
|
|
23903
23942
|
|
|
23943
|
+
declare const SUPPORTED_EXPRESS_METHODS: readonly ["paypal", "applePay", "googlePay", "alipay"];
|
|
23944
|
+
|
|
23904
23945
|
declare type SvgAttributes =
|
|
23905
23946
|
| "[-khtml-opacity]"
|
|
23906
23947
|
| "[-moz-opacity]"
|
|
@@ -24252,6 +24293,34 @@ export declare const themeColorMap: Record<AntomTheme, {
|
|
|
24252
24293
|
backgroundColor: string;
|
|
24253
24294
|
}>;
|
|
24254
24295
|
|
|
24296
|
+
/** Configuration options for rendering a toast notification. */
|
|
24297
|
+
export declare interface ToastParams {
|
|
24298
|
+
/** Text displayed in the toast. */
|
|
24299
|
+
message: string;
|
|
24300
|
+
/** Placement of the toast container within the viewport. */
|
|
24301
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
24302
|
+
/** Toast background color in any valid CSS color format. */
|
|
24303
|
+
backgroundColor?: string;
|
|
24304
|
+
/** Toast text color in any valid CSS color format. */
|
|
24305
|
+
color?: string;
|
|
24306
|
+
/** Toast padding in any valid CSS length format. */
|
|
24307
|
+
padding?: string;
|
|
24308
|
+
/** Toast border radius in any valid CSS length format. */
|
|
24309
|
+
borderRadius?: string;
|
|
24310
|
+
/** Toast font size in any valid CSS length format. */
|
|
24311
|
+
fontSize?: string;
|
|
24312
|
+
/** Stacking order of the toast container. */
|
|
24313
|
+
zIndex?: number;
|
|
24314
|
+
/** Toast width in any valid CSS length format. */
|
|
24315
|
+
width?: string;
|
|
24316
|
+
/** Time in milliseconds before the toast starts to disappear. */
|
|
24317
|
+
duration?: number;
|
|
24318
|
+
/** Preset status icon displayed above the message. */
|
|
24319
|
+
icon?: 'SUCCESS' | 'FAIL';
|
|
24320
|
+
/** Whether the status icon uses a spinning animation. */
|
|
24321
|
+
spin?: boolean;
|
|
24322
|
+
}
|
|
24323
|
+
|
|
24255
24324
|
/**
|
|
24256
24325
|
* @description 交易信息
|
|
24257
24326
|
*/
|
package/types.untrimmed.d.ts
CHANGED
|
@@ -306,7 +306,6 @@ export declare class AntomSDK extends BaseElementsFactory {
|
|
|
306
306
|
*/
|
|
307
307
|
protected openModal(payload: AntomOpenModalConfig): Promise<{
|
|
308
308
|
destroy: () => void;
|
|
309
|
-
onLoadedSuccess: (onLoadSuccess: () => void) => void;
|
|
310
309
|
getContentWindow: () => Window;
|
|
311
310
|
}>;
|
|
312
311
|
elements(): Elements;
|
|
@@ -406,7 +405,7 @@ export declare const AntomSDKErrorCodes: {
|
|
|
406
405
|
readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
|
|
407
406
|
readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
|
|
408
407
|
/**
|
|
409
|
-
*
|
|
408
|
+
* 查询到的结果消息
|
|
410
409
|
*/
|
|
411
410
|
readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
|
|
412
411
|
readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
|
|
@@ -722,6 +721,8 @@ declare type AxiosHeaderMatcher =
|
|
|
722
721
|
| RegExp
|
|
723
722
|
| ((this: AxiosHeaders, value: string, name: string) => boolean);
|
|
724
723
|
|
|
724
|
+
declare type AxiosHeaderParameters = Record<string, string>;
|
|
725
|
+
|
|
725
726
|
declare type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;
|
|
726
727
|
|
|
727
728
|
declare class AxiosHeaders {
|
|
@@ -737,6 +738,7 @@ declare class AxiosHeaders {
|
|
|
737
738
|
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
|
738
739
|
set(headers?: Iterable<[string, AxiosHeaderValue]>, rewrite?: boolean): AxiosHeaders;
|
|
739
740
|
|
|
741
|
+
get(headerName: string, parser: typeof AxiosHeaders.parseParameters): AxiosHeaderParameters;
|
|
740
742
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
|
741
743
|
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
|
742
744
|
|
|
@@ -758,6 +760,8 @@ declare class AxiosHeaders {
|
|
|
758
760
|
|
|
759
761
|
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
|
760
762
|
|
|
763
|
+
static parseParameters(value: AxiosHeaderValue): AxiosHeaderParameters;
|
|
764
|
+
|
|
761
765
|
static accessor(header: string | string[]): AxiosHeaders;
|
|
762
766
|
|
|
763
767
|
static concat(
|
|
@@ -898,6 +902,10 @@ declare interface BaseBridgeEventMap<AppConfig extends Record<string, any> = Rec
|
|
|
898
902
|
* @internal 内部事件 不暴露给商户
|
|
899
903
|
*/
|
|
900
904
|
"OPENSDK@TRANSFER_MODAL_PORT": string;
|
|
905
|
+
/**
|
|
906
|
+
* @internal 内部事件 不暴露给商户
|
|
907
|
+
*/
|
|
908
|
+
"OPENSDK@MODAL_TRANSFER_READY": void;
|
|
901
909
|
/**
|
|
902
910
|
* @internal 内部事件 不暴露给商户
|
|
903
911
|
*/
|
|
@@ -1190,6 +1198,10 @@ declare abstract class BaseFactory {
|
|
|
1190
1198
|
* @internal
|
|
1191
1199
|
*/
|
|
1192
1200
|
private isInit;
|
|
1201
|
+
/**
|
|
1202
|
+
* Indicates whether this factory instance has been destroyed.
|
|
1203
|
+
*/
|
|
1204
|
+
isDestroyed: boolean;
|
|
1193
1205
|
/**
|
|
1194
1206
|
* @description 当前版本号
|
|
1195
1207
|
* 用于日志上报
|
|
@@ -1224,6 +1236,11 @@ declare abstract class BaseFactory {
|
|
|
1224
1236
|
* @internal
|
|
1225
1237
|
*/
|
|
1226
1238
|
protected elementClasses: Record<string, iBaseElementClass | undefined>;
|
|
1239
|
+
/**
|
|
1240
|
+
* @description modal是否已准备好
|
|
1241
|
+
* @internal
|
|
1242
|
+
*/
|
|
1243
|
+
private modalIsReady;
|
|
1227
1244
|
/**
|
|
1228
1245
|
* @param config 配置
|
|
1229
1246
|
*/
|
|
@@ -3576,11 +3593,13 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
|
|
|
3576
3593
|
/**
|
|
3577
3594
|
* @internal setup 阶段的错误信息,传给 iframe 侧处理
|
|
3578
3595
|
*/
|
|
3579
|
-
setupError?:
|
|
3596
|
+
setupError?: ExpressSetupError;
|
|
3580
3597
|
/**
|
|
3581
|
-
* Locale
|
|
3598
|
+
* @internal Locale is injected from loadAntom and defaults to en_US.
|
|
3582
3599
|
*/
|
|
3583
3600
|
locale?: string;
|
|
3601
|
+
/** @internal PayPal v6 core script environment injected from the element env. */
|
|
3602
|
+
_paypalSdkEnvironment?: 'sandbox' | 'prod';
|
|
3584
3603
|
/**
|
|
3585
3604
|
* 是否运行在 Native App 的 WebView 中。
|
|
3586
3605
|
* 为 true 时,跳转通过 onRedirect 事件委托给 Native 端处理。
|
|
@@ -3670,9 +3689,7 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
|
|
|
3670
3689
|
private _paypalOverlay;
|
|
3671
3690
|
constructor(name: string, config: ExpressElementConfig);
|
|
3672
3691
|
/**
|
|
3673
|
-
* 重写 on
|
|
3674
|
-
* 1. 对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
|
|
3675
|
-
* 2. 对 onRedirect 事件同步注册到 _localHandlers(SDK host 主动推送时商户能收到)
|
|
3692
|
+
* 重写 on:对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
|
|
3676
3693
|
*/
|
|
3677
3694
|
on(event: string, handler: (...args: any[]) => void): void;
|
|
3678
3695
|
/**
|
|
@@ -3693,6 +3710,8 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
|
|
|
3693
3710
|
code: string;
|
|
3694
3711
|
message: string;
|
|
3695
3712
|
};
|
|
3713
|
+
/** 用户是否手动关闭 3D 弹窗(透传 webapp COMPLETE_PAYMENT_RESULT.userCanceled3D) */
|
|
3714
|
+
userCanceled3D?: boolean;
|
|
3696
3715
|
}>;
|
|
3697
3716
|
setup(): Promise<Partial<ExpressAppConfig> | undefined>;
|
|
3698
3717
|
private registerInternalListeners;
|
|
@@ -3791,6 +3810,14 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
|
|
|
3791
3810
|
};
|
|
3792
3811
|
}
|
|
3793
3812
|
|
|
3813
|
+
declare type ExpressPaymentMethod = (typeof SUPPORTED_EXPRESS_METHODS)[number];
|
|
3814
|
+
|
|
3815
|
+
declare type ExpressSetupError = ErrorPayload & {
|
|
3816
|
+
expressPaymentType?: ExpressPaymentMethod;
|
|
3817
|
+
/** 服务端返回的 errorMessage 已完成国际化,可直接对客展示 */
|
|
3818
|
+
mulityLanguageMapping?: boolean;
|
|
3819
|
+
};
|
|
3820
|
+
|
|
3794
3821
|
declare interface ExpSupportBank {
|
|
3795
3822
|
/**
|
|
3796
3823
|
* @description 银行名称
|
|
@@ -7090,11 +7117,14 @@ declare interface OneAccountQueryResult {
|
|
|
7090
7117
|
*/
|
|
7091
7118
|
declare type OpenModalHandle = {
|
|
7092
7119
|
destroy: () => void;
|
|
7093
|
-
|
|
7120
|
+
/**
|
|
7121
|
+
* @deprecated 移除,内部监听ready事件
|
|
7122
|
+
*/
|
|
7123
|
+
onLoadedSuccess?: (onLoadSuccess: () => void) => void;
|
|
7094
7124
|
getContentWindow: () => Window | null;
|
|
7095
7125
|
};
|
|
7096
7126
|
|
|
7097
|
-
declare interface OpenModalParams extends BaseOpenModalConfig {
|
|
7127
|
+
declare interface OpenModalParams extends Omit<BaseOpenModalConfig, 'hideCloseWhenLoaded'> {
|
|
7098
7128
|
mode: 'desktop' | 'mobile';
|
|
7099
7129
|
loadingConfig?: {
|
|
7100
7130
|
theme?: 'light' | 'dark';
|
|
@@ -7315,6 +7345,7 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
7315
7345
|
* @internal sdk所在hostname
|
|
7316
7346
|
*/
|
|
7317
7347
|
merchantDomain?: string;
|
|
7348
|
+
doMain?: string;
|
|
7318
7349
|
/**
|
|
7319
7350
|
* @internal 渲染数据
|
|
7320
7351
|
*/
|
|
@@ -7353,6 +7384,15 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
7353
7384
|
* @internal 内部使用,无需用户传递,高度信息
|
|
7354
7385
|
*/
|
|
7355
7386
|
heightOfVisible?: number;
|
|
7387
|
+
/**
|
|
7388
|
+
* Amount & Currency
|
|
7389
|
+
*
|
|
7390
|
+
* Only effective via `updateConfig({ amount })` at runtime.
|
|
7391
|
+
*/
|
|
7392
|
+
amount?: {
|
|
7393
|
+
currency: string;
|
|
7394
|
+
value: string;
|
|
7395
|
+
};
|
|
7356
7396
|
}
|
|
7357
7397
|
|
|
7358
7398
|
/**
|
|
@@ -7370,11 +7410,16 @@ export declare type PaymentAppearance = PickAppearance<{
|
|
|
7370
7410
|
*/
|
|
7371
7411
|
export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
|
|
7372
7412
|
static elementType: string;
|
|
7413
|
+
private _paymentInProgress;
|
|
7373
7414
|
constructor(name: string, config: PaymentElementConfig);
|
|
7374
7415
|
/**
|
|
7375
7416
|
* @internal
|
|
7376
7417
|
*/
|
|
7377
7418
|
setup(): Promise<Partial<PaymentAppConfig> | undefined>;
|
|
7419
|
+
/**
|
|
7420
|
+
* @description Update payment element configuration with amount validation
|
|
7421
|
+
*/
|
|
7422
|
+
updateConfig(newConfig: Pick<PaymentAppConfig, 'amount'>): Promise<PaymentElementEvents['OPENSDK@UPDATE_CONFIG_REPLY']>;
|
|
7378
7423
|
/**
|
|
7379
7424
|
* @internal
|
|
7380
7425
|
*/
|
|
@@ -24250,6 +24295,10 @@ export declare type SubmitResult = {
|
|
|
24250
24295
|
* 查询到的结果消息
|
|
24251
24296
|
*/
|
|
24252
24297
|
message?: string;
|
|
24298
|
+
/**
|
|
24299
|
+
* @description 接口错误时的链路追踪 id,用于定位排查根因(非错误状态无该字段)
|
|
24300
|
+
*/
|
|
24301
|
+
traceId?: string;
|
|
24253
24302
|
/**
|
|
24254
24303
|
* @description 是否需要更换 session 重试
|
|
24255
24304
|
*/
|
|
@@ -24371,6 +24420,8 @@ declare interface SubscriptionPricePlan {
|
|
|
24371
24420
|
pricePlanAmountView?: PaymentView;
|
|
24372
24421
|
}
|
|
24373
24422
|
|
|
24423
|
+
declare const SUPPORTED_EXPRESS_METHODS: readonly ["paypal", "applePay", "googlePay", "alipay"];
|
|
24424
|
+
|
|
24374
24425
|
declare type SvgAttributes =
|
|
24375
24426
|
| "[-khtml-opacity]"
|
|
24376
24427
|
| "[-moz-opacity]"
|
|
@@ -24722,6 +24773,34 @@ export declare const themeColorMap: Record<AntomTheme, {
|
|
|
24722
24773
|
backgroundColor: string;
|
|
24723
24774
|
}>;
|
|
24724
24775
|
|
|
24776
|
+
/** Configuration options for rendering a toast notification. */
|
|
24777
|
+
export declare interface ToastParams {
|
|
24778
|
+
/** Text displayed in the toast. */
|
|
24779
|
+
message: string;
|
|
24780
|
+
/** Placement of the toast container within the viewport. */
|
|
24781
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
24782
|
+
/** Toast background color in any valid CSS color format. */
|
|
24783
|
+
backgroundColor?: string;
|
|
24784
|
+
/** Toast text color in any valid CSS color format. */
|
|
24785
|
+
color?: string;
|
|
24786
|
+
/** Toast padding in any valid CSS length format. */
|
|
24787
|
+
padding?: string;
|
|
24788
|
+
/** Toast border radius in any valid CSS length format. */
|
|
24789
|
+
borderRadius?: string;
|
|
24790
|
+
/** Toast font size in any valid CSS length format. */
|
|
24791
|
+
fontSize?: string;
|
|
24792
|
+
/** Stacking order of the toast container. */
|
|
24793
|
+
zIndex?: number;
|
|
24794
|
+
/** Toast width in any valid CSS length format. */
|
|
24795
|
+
width?: string;
|
|
24796
|
+
/** Time in milliseconds before the toast starts to disappear. */
|
|
24797
|
+
duration?: number;
|
|
24798
|
+
/** Preset status icon displayed above the message. */
|
|
24799
|
+
icon?: 'SUCCESS' | 'FAIL';
|
|
24800
|
+
/** Whether the status icon uses a spinning animation. */
|
|
24801
|
+
spin?: boolean;
|
|
24802
|
+
}
|
|
24803
|
+
|
|
24725
24804
|
/**
|
|
24726
24805
|
* @description 交易信息
|
|
24727
24806
|
*/
|