@alipay/ams-checkout 2.0.21 → 2.0.22
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/modernElementController/index.js +71 -33
- 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 +34 -1
- package/types.untrimmed.d.ts +34 -1
|
@@ -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";
|
|
@@ -905,6 +905,10 @@ declare abstract class BaseElementsFactory extends BaseFactory {
|
|
|
905
905
|
declare abstract class BaseFactory {
|
|
906
906
|
/* Excluded from this release type: config */
|
|
907
907
|
/* Excluded from this release type: isInit */
|
|
908
|
+
/**
|
|
909
|
+
* Indicates whether this factory instance has been destroyed.
|
|
910
|
+
*/
|
|
911
|
+
isDestroyed: boolean;
|
|
908
912
|
/**
|
|
909
913
|
* @description 当前版本号
|
|
910
914
|
* 用于日志上报
|
|
@@ -6891,6 +6895,7 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
6891
6895
|
*/
|
|
6892
6896
|
sessionData?: string;
|
|
6893
6897
|
/* Excluded from this release type: merchantDomain */
|
|
6898
|
+
doMain?: string;
|
|
6894
6899
|
/* Excluded from this release type: renderData */
|
|
6895
6900
|
/* Excluded from this release type: connectAccount */
|
|
6896
6901
|
/* Excluded from this release type: sessionMetaData */
|
|
@@ -24252,6 +24257,34 @@ export declare const themeColorMap: Record<AntomTheme, {
|
|
|
24252
24257
|
backgroundColor: string;
|
|
24253
24258
|
}>;
|
|
24254
24259
|
|
|
24260
|
+
/** Configuration options for rendering a toast notification. */
|
|
24261
|
+
export declare interface ToastParams {
|
|
24262
|
+
/** Text displayed in the toast. */
|
|
24263
|
+
message: string;
|
|
24264
|
+
/** Placement of the toast container within the viewport. */
|
|
24265
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
24266
|
+
/** Toast background color in any valid CSS color format. */
|
|
24267
|
+
backgroundColor?: string;
|
|
24268
|
+
/** Toast text color in any valid CSS color format. */
|
|
24269
|
+
color?: string;
|
|
24270
|
+
/** Toast padding in any valid CSS length format. */
|
|
24271
|
+
padding?: string;
|
|
24272
|
+
/** Toast border radius in any valid CSS length format. */
|
|
24273
|
+
borderRadius?: string;
|
|
24274
|
+
/** Toast font size in any valid CSS length format. */
|
|
24275
|
+
fontSize?: string;
|
|
24276
|
+
/** Stacking order of the toast container. */
|
|
24277
|
+
zIndex?: number;
|
|
24278
|
+
/** Toast width in any valid CSS length format. */
|
|
24279
|
+
width?: string;
|
|
24280
|
+
/** Time in milliseconds before the toast starts to disappear. */
|
|
24281
|
+
duration?: number;
|
|
24282
|
+
/** Preset status icon displayed above the message. */
|
|
24283
|
+
icon?: 'SUCCESS' | 'FAIL';
|
|
24284
|
+
/** Whether the status icon uses a spinning animation. */
|
|
24285
|
+
spin?: boolean;
|
|
24286
|
+
}
|
|
24287
|
+
|
|
24255
24288
|
/**
|
|
24256
24289
|
* @description 交易信息
|
|
24257
24290
|
*/
|
package/types.untrimmed.d.ts
CHANGED
|
@@ -406,7 +406,7 @@ export declare const AntomSDKErrorCodes: {
|
|
|
406
406
|
readonly UPDATE_CONFIG_TIMEOUT: "UPDATE_CONFIG_TIMEOUT";
|
|
407
407
|
readonly UPDATE_CONFIG_NOT_READY: "UPDATE_CONFIG_NOT_READY";
|
|
408
408
|
/**
|
|
409
|
-
*
|
|
409
|
+
* 查询到的结果消息
|
|
410
410
|
*/
|
|
411
411
|
readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
|
|
412
412
|
readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
|
|
@@ -1190,6 +1190,10 @@ declare abstract class BaseFactory {
|
|
|
1190
1190
|
* @internal
|
|
1191
1191
|
*/
|
|
1192
1192
|
private isInit;
|
|
1193
|
+
/**
|
|
1194
|
+
* Indicates whether this factory instance has been destroyed.
|
|
1195
|
+
*/
|
|
1196
|
+
isDestroyed: boolean;
|
|
1193
1197
|
/**
|
|
1194
1198
|
* @description 当前版本号
|
|
1195
1199
|
* 用于日志上报
|
|
@@ -7315,6 +7319,7 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
7315
7319
|
* @internal sdk所在hostname
|
|
7316
7320
|
*/
|
|
7317
7321
|
merchantDomain?: string;
|
|
7322
|
+
doMain?: string;
|
|
7318
7323
|
/**
|
|
7319
7324
|
* @internal 渲染数据
|
|
7320
7325
|
*/
|
|
@@ -24722,6 +24727,34 @@ export declare const themeColorMap: Record<AntomTheme, {
|
|
|
24722
24727
|
backgroundColor: string;
|
|
24723
24728
|
}>;
|
|
24724
24729
|
|
|
24730
|
+
/** Configuration options for rendering a toast notification. */
|
|
24731
|
+
export declare interface ToastParams {
|
|
24732
|
+
/** Text displayed in the toast. */
|
|
24733
|
+
message: string;
|
|
24734
|
+
/** Placement of the toast container within the viewport. */
|
|
24735
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
24736
|
+
/** Toast background color in any valid CSS color format. */
|
|
24737
|
+
backgroundColor?: string;
|
|
24738
|
+
/** Toast text color in any valid CSS color format. */
|
|
24739
|
+
color?: string;
|
|
24740
|
+
/** Toast padding in any valid CSS length format. */
|
|
24741
|
+
padding?: string;
|
|
24742
|
+
/** Toast border radius in any valid CSS length format. */
|
|
24743
|
+
borderRadius?: string;
|
|
24744
|
+
/** Toast font size in any valid CSS length format. */
|
|
24745
|
+
fontSize?: string;
|
|
24746
|
+
/** Stacking order of the toast container. */
|
|
24747
|
+
zIndex?: number;
|
|
24748
|
+
/** Toast width in any valid CSS length format. */
|
|
24749
|
+
width?: string;
|
|
24750
|
+
/** Time in milliseconds before the toast starts to disappear. */
|
|
24751
|
+
duration?: number;
|
|
24752
|
+
/** Preset status icon displayed above the message. */
|
|
24753
|
+
icon?: 'SUCCESS' | 'FAIL';
|
|
24754
|
+
/** Whether the status icon uses a spinning animation. */
|
|
24755
|
+
spin?: boolean;
|
|
24756
|
+
}
|
|
24757
|
+
|
|
24725
24758
|
/**
|
|
24726
24759
|
* @description 交易信息
|
|
24727
24760
|
*/
|