@alipay/ams-checkout 0.0.1784542444-dev.2 → 0.0.1784542444-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/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/tools.js +1 -1
- package/esm/plugin/component/channel.d.ts +1 -1
- package/esm/plugin/component/channel.js +11 -2
- package/esm/util/logger.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +82 -5
- package/types.untrimmed.d.ts +93 -6
|
@@ -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/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" */
|
|
@@ -920,6 +926,7 @@ declare abstract class BaseFactory {
|
|
|
920
926
|
/* Excluded from this release type: globalBridgeForModal */
|
|
921
927
|
/* Excluded from this release type: openModalHandle */
|
|
922
928
|
/* Excluded from this release type: elementClasses */
|
|
929
|
+
/* Excluded from this release type: modalIsReady */
|
|
923
930
|
/**
|
|
924
931
|
* @param config 配置
|
|
925
932
|
*/
|
|
@@ -3165,10 +3172,13 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
|
|
|
3165
3172
|
*/
|
|
3166
3173
|
paymentMethods?: string[];
|
|
3167
3174
|
/* Excluded from this release type: setupError */
|
|
3175
|
+
/* Excluded from this release type: locale */
|
|
3176
|
+
/* Excluded from this release type: _paypalSdkEnvironment */
|
|
3168
3177
|
/**
|
|
3169
|
-
*
|
|
3178
|
+
* 是否运行在 Native App 的 WebView 中。
|
|
3179
|
+
* 为 true 时,跳转通过 onRedirect 事件委托给 Native 端处理。
|
|
3170
3180
|
*/
|
|
3171
|
-
|
|
3181
|
+
isNativeAppWebview?: boolean;
|
|
3172
3182
|
/* Excluded from this release type: merchantDomain */
|
|
3173
3183
|
/* Excluded from this release type: doMain */
|
|
3174
3184
|
}
|
|
@@ -3363,8 +3373,23 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
|
|
|
3363
3373
|
error?: ErrorPayload<string>;
|
|
3364
3374
|
};
|
|
3365
3375
|
'OPENSDK@COMPLETE_PAYMENT_REJECT': Record<string, never>;
|
|
3376
|
+
onRedirect: {
|
|
3377
|
+
normalUrl: string;
|
|
3378
|
+
applinkUrl?: string;
|
|
3379
|
+
schemaUrl?: string;
|
|
3380
|
+
isDestroy: boolean;
|
|
3381
|
+
needReset: boolean;
|
|
3382
|
+
};
|
|
3366
3383
|
}
|
|
3367
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
|
+
|
|
3368
3393
|
declare interface ExpSupportBank {
|
|
3369
3394
|
/**
|
|
3370
3395
|
* @description 银行名称
|
|
@@ -6664,11 +6689,14 @@ declare interface OneAccountQueryResult {
|
|
|
6664
6689
|
*/
|
|
6665
6690
|
declare type OpenModalHandle = {
|
|
6666
6691
|
destroy: () => void;
|
|
6667
|
-
|
|
6692
|
+
/**
|
|
6693
|
+
* @deprecated 移除,内部监听ready事件
|
|
6694
|
+
*/
|
|
6695
|
+
onLoadedSuccess?: (onLoadSuccess: () => void) => void;
|
|
6668
6696
|
getContentWindow: () => Window | null;
|
|
6669
6697
|
};
|
|
6670
6698
|
|
|
6671
|
-
declare interface OpenModalParams extends BaseOpenModalConfig {
|
|
6699
|
+
declare interface OpenModalParams extends Omit<BaseOpenModalConfig, 'hideCloseWhenLoaded'> {
|
|
6672
6700
|
mode: 'desktop' | 'mobile';
|
|
6673
6701
|
loadingConfig?: {
|
|
6674
6702
|
theme?: 'light' | 'dark';
|
|
@@ -6883,6 +6911,7 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
6883
6911
|
*/
|
|
6884
6912
|
sessionData?: string;
|
|
6885
6913
|
/* Excluded from this release type: merchantDomain */
|
|
6914
|
+
doMain?: string;
|
|
6886
6915
|
/* Excluded from this release type: renderData */
|
|
6887
6916
|
/* Excluded from this release type: connectAccount */
|
|
6888
6917
|
/* Excluded from this release type: sessionMetaData */
|
|
@@ -6891,6 +6920,15 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
6891
6920
|
/* Excluded from this release type: _requestConfig */
|
|
6892
6921
|
/* Excluded from this release type: logMetaData */
|
|
6893
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
|
+
};
|
|
6894
6932
|
}
|
|
6895
6933
|
|
|
6896
6934
|
/**
|
|
@@ -6908,8 +6946,13 @@ export declare type PaymentAppearance = PickAppearance<{
|
|
|
6908
6946
|
*/
|
|
6909
6947
|
export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
|
|
6910
6948
|
static elementType: string;
|
|
6949
|
+
private _paymentInProgress;
|
|
6911
6950
|
constructor(name: string, config: PaymentElementConfig);
|
|
6912
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']>;
|
|
6913
6956
|
/* Excluded from this release type: submit */
|
|
6914
6957
|
protected focus(): void;
|
|
6915
6958
|
protected blur(): void;
|
|
@@ -23772,6 +23815,10 @@ export declare type SubmitResult = {
|
|
|
23772
23815
|
* 查询到的结果消息
|
|
23773
23816
|
*/
|
|
23774
23817
|
message?: string;
|
|
23818
|
+
/**
|
|
23819
|
+
* @description 接口错误时的链路追踪 id,用于定位排查根因(非错误状态无该字段)
|
|
23820
|
+
*/
|
|
23821
|
+
traceId?: string;
|
|
23775
23822
|
/**
|
|
23776
23823
|
* @description 是否需要更换 session 重试
|
|
23777
23824
|
*/
|
|
@@ -23893,6 +23940,8 @@ declare interface SubscriptionPricePlan {
|
|
|
23893
23940
|
pricePlanAmountView?: PaymentView;
|
|
23894
23941
|
}
|
|
23895
23942
|
|
|
23943
|
+
declare const SUPPORTED_EXPRESS_METHODS: readonly ["paypal", "applePay", "googlePay", "alipay"];
|
|
23944
|
+
|
|
23896
23945
|
declare type SvgAttributes =
|
|
23897
23946
|
| "[-khtml-opacity]"
|
|
23898
23947
|
| "[-moz-opacity]"
|
|
@@ -24244,6 +24293,34 @@ export declare const themeColorMap: Record<AntomTheme, {
|
|
|
24244
24293
|
backgroundColor: string;
|
|
24245
24294
|
}>;
|
|
24246
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
|
+
|
|
24247
24324
|
/**
|
|
24248
24325
|
* @description 交易信息
|
|
24249
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
|
*/
|
|
@@ -1228,6 +1236,11 @@ declare abstract class BaseFactory {
|
|
|
1228
1236
|
* @internal
|
|
1229
1237
|
*/
|
|
1230
1238
|
protected elementClasses: Record<string, iBaseElementClass | undefined>;
|
|
1239
|
+
/**
|
|
1240
|
+
* @description modal是否已准备好
|
|
1241
|
+
* @internal
|
|
1242
|
+
*/
|
|
1243
|
+
private modalIsReady;
|
|
1231
1244
|
/**
|
|
1232
1245
|
* @param config 配置
|
|
1233
1246
|
*/
|
|
@@ -3580,11 +3593,18 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
|
|
|
3580
3593
|
/**
|
|
3581
3594
|
* @internal setup 阶段的错误信息,传给 iframe 侧处理
|
|
3582
3595
|
*/
|
|
3583
|
-
setupError?:
|
|
3596
|
+
setupError?: ExpressSetupError;
|
|
3584
3597
|
/**
|
|
3585
|
-
* Locale
|
|
3598
|
+
* @internal Locale is injected from loadAntom and defaults to en_US.
|
|
3586
3599
|
*/
|
|
3587
3600
|
locale?: string;
|
|
3601
|
+
/** @internal PayPal v6 core script environment injected from the element env. */
|
|
3602
|
+
_paypalSdkEnvironment?: 'sandbox' | 'prod';
|
|
3603
|
+
/**
|
|
3604
|
+
* 是否运行在 Native App 的 WebView 中。
|
|
3605
|
+
* 为 true 时,跳转通过 onRedirect 事件委托给 Native 端处理。
|
|
3606
|
+
*/
|
|
3607
|
+
isNativeAppWebview?: boolean;
|
|
3588
3608
|
/** @internal SDK host 侧商户域名,供 Apple Pay merchant validation 使用 */
|
|
3589
3609
|
merchantDomain?: string;
|
|
3590
3610
|
/** @internal Elements2 历史协议字段,含义同 merchantDomain */
|
|
@@ -3781,8 +3801,23 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
|
|
|
3781
3801
|
error?: ErrorPayload<string>;
|
|
3782
3802
|
};
|
|
3783
3803
|
'OPENSDK@COMPLETE_PAYMENT_REJECT': Record<string, never>;
|
|
3804
|
+
onRedirect: {
|
|
3805
|
+
normalUrl: string;
|
|
3806
|
+
applinkUrl?: string;
|
|
3807
|
+
schemaUrl?: string;
|
|
3808
|
+
isDestroy: boolean;
|
|
3809
|
+
needReset: boolean;
|
|
3810
|
+
};
|
|
3784
3811
|
}
|
|
3785
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
|
+
|
|
3786
3821
|
declare interface ExpSupportBank {
|
|
3787
3822
|
/**
|
|
3788
3823
|
* @description 银行名称
|
|
@@ -7082,11 +7117,14 @@ declare interface OneAccountQueryResult {
|
|
|
7082
7117
|
*/
|
|
7083
7118
|
declare type OpenModalHandle = {
|
|
7084
7119
|
destroy: () => void;
|
|
7085
|
-
|
|
7120
|
+
/**
|
|
7121
|
+
* @deprecated 移除,内部监听ready事件
|
|
7122
|
+
*/
|
|
7123
|
+
onLoadedSuccess?: (onLoadSuccess: () => void) => void;
|
|
7086
7124
|
getContentWindow: () => Window | null;
|
|
7087
7125
|
};
|
|
7088
7126
|
|
|
7089
|
-
declare interface OpenModalParams extends BaseOpenModalConfig {
|
|
7127
|
+
declare interface OpenModalParams extends Omit<BaseOpenModalConfig, 'hideCloseWhenLoaded'> {
|
|
7090
7128
|
mode: 'desktop' | 'mobile';
|
|
7091
7129
|
loadingConfig?: {
|
|
7092
7130
|
theme?: 'light' | 'dark';
|
|
@@ -7307,6 +7345,7 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
7307
7345
|
* @internal sdk所在hostname
|
|
7308
7346
|
*/
|
|
7309
7347
|
merchantDomain?: string;
|
|
7348
|
+
doMain?: string;
|
|
7310
7349
|
/**
|
|
7311
7350
|
* @internal 渲染数据
|
|
7312
7351
|
*/
|
|
@@ -7345,6 +7384,15 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
7345
7384
|
* @internal 内部使用,无需用户传递,高度信息
|
|
7346
7385
|
*/
|
|
7347
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
|
+
};
|
|
7348
7396
|
}
|
|
7349
7397
|
|
|
7350
7398
|
/**
|
|
@@ -7362,11 +7410,16 @@ export declare type PaymentAppearance = PickAppearance<{
|
|
|
7362
7410
|
*/
|
|
7363
7411
|
export declare class PaymentElement extends BaseMainElement<PaymentElementConfig, PaymentElementEvents> {
|
|
7364
7412
|
static elementType: string;
|
|
7413
|
+
private _paymentInProgress;
|
|
7365
7414
|
constructor(name: string, config: PaymentElementConfig);
|
|
7366
7415
|
/**
|
|
7367
7416
|
* @internal
|
|
7368
7417
|
*/
|
|
7369
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']>;
|
|
7370
7423
|
/**
|
|
7371
7424
|
* @internal
|
|
7372
7425
|
*/
|
|
@@ -24242,6 +24295,10 @@ export declare type SubmitResult = {
|
|
|
24242
24295
|
* 查询到的结果消息
|
|
24243
24296
|
*/
|
|
24244
24297
|
message?: string;
|
|
24298
|
+
/**
|
|
24299
|
+
* @description 接口错误时的链路追踪 id,用于定位排查根因(非错误状态无该字段)
|
|
24300
|
+
*/
|
|
24301
|
+
traceId?: string;
|
|
24245
24302
|
/**
|
|
24246
24303
|
* @description 是否需要更换 session 重试
|
|
24247
24304
|
*/
|
|
@@ -24363,6 +24420,8 @@ declare interface SubscriptionPricePlan {
|
|
|
24363
24420
|
pricePlanAmountView?: PaymentView;
|
|
24364
24421
|
}
|
|
24365
24422
|
|
|
24423
|
+
declare const SUPPORTED_EXPRESS_METHODS: readonly ["paypal", "applePay", "googlePay", "alipay"];
|
|
24424
|
+
|
|
24366
24425
|
declare type SvgAttributes =
|
|
24367
24426
|
| "[-khtml-opacity]"
|
|
24368
24427
|
| "[-moz-opacity]"
|
|
@@ -24714,6 +24773,34 @@ export declare const themeColorMap: Record<AntomTheme, {
|
|
|
24714
24773
|
backgroundColor: string;
|
|
24715
24774
|
}>;
|
|
24716
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
|
+
|
|
24717
24804
|
/**
|
|
24718
24805
|
* @description 交易信息
|
|
24719
24806
|
*/
|