@alipay/ams-checkout 0.0.1784542444-dev.2 → 0.0.1784542444-dev.4
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/modernElementController/index.js +108 -38
- 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 +30 -1
- package/types.untrimmed.d.ts +30 -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/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";
|
|
@@ -6883,6 +6883,7 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
6883
6883
|
*/
|
|
6884
6884
|
sessionData?: string;
|
|
6885
6885
|
/* Excluded from this release type: merchantDomain */
|
|
6886
|
+
doMain?: string;
|
|
6886
6887
|
/* Excluded from this release type: renderData */
|
|
6887
6888
|
/* Excluded from this release type: connectAccount */
|
|
6888
6889
|
/* Excluded from this release type: sessionMetaData */
|
|
@@ -24244,6 +24245,34 @@ export declare const themeColorMap: Record<AntomTheme, {
|
|
|
24244
24245
|
backgroundColor: string;
|
|
24245
24246
|
}>;
|
|
24246
24247
|
|
|
24248
|
+
/** Configuration options for rendering a toast notification. */
|
|
24249
|
+
export declare interface ToastParams {
|
|
24250
|
+
/** Text displayed in the toast. */
|
|
24251
|
+
message: string;
|
|
24252
|
+
/** Placement of the toast container within the viewport. */
|
|
24253
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
24254
|
+
/** Toast background color in any valid CSS color format. */
|
|
24255
|
+
backgroundColor?: string;
|
|
24256
|
+
/** Toast text color in any valid CSS color format. */
|
|
24257
|
+
color?: string;
|
|
24258
|
+
/** Toast padding in any valid CSS length format. */
|
|
24259
|
+
padding?: string;
|
|
24260
|
+
/** Toast border radius in any valid CSS length format. */
|
|
24261
|
+
borderRadius?: string;
|
|
24262
|
+
/** Toast font size in any valid CSS length format. */
|
|
24263
|
+
fontSize?: string;
|
|
24264
|
+
/** Stacking order of the toast container. */
|
|
24265
|
+
zIndex?: number;
|
|
24266
|
+
/** Toast width in any valid CSS length format. */
|
|
24267
|
+
width?: string;
|
|
24268
|
+
/** Time in milliseconds before the toast starts to disappear. */
|
|
24269
|
+
duration?: number;
|
|
24270
|
+
/** Preset status icon displayed above the message. */
|
|
24271
|
+
icon?: 'SUCCESS' | 'FAIL';
|
|
24272
|
+
/** Whether the status icon uses a spinning animation. */
|
|
24273
|
+
spin?: boolean;
|
|
24274
|
+
}
|
|
24275
|
+
|
|
24247
24276
|
/**
|
|
24248
24277
|
* @description 交易信息
|
|
24249
24278
|
*/
|
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";
|
|
@@ -7307,6 +7307,7 @@ export declare interface PaymentAppConfig extends BaseAppearance<PaymentAppearan
|
|
|
7307
7307
|
* @internal sdk所在hostname
|
|
7308
7308
|
*/
|
|
7309
7309
|
merchantDomain?: string;
|
|
7310
|
+
doMain?: string;
|
|
7310
7311
|
/**
|
|
7311
7312
|
* @internal 渲染数据
|
|
7312
7313
|
*/
|
|
@@ -24714,6 +24715,34 @@ export declare const themeColorMap: Record<AntomTheme, {
|
|
|
24714
24715
|
backgroundColor: string;
|
|
24715
24716
|
}>;
|
|
24716
24717
|
|
|
24718
|
+
/** Configuration options for rendering a toast notification. */
|
|
24719
|
+
export declare interface ToastParams {
|
|
24720
|
+
/** Text displayed in the toast. */
|
|
24721
|
+
message: string;
|
|
24722
|
+
/** Placement of the toast container within the viewport. */
|
|
24723
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
|
|
24724
|
+
/** Toast background color in any valid CSS color format. */
|
|
24725
|
+
backgroundColor?: string;
|
|
24726
|
+
/** Toast text color in any valid CSS color format. */
|
|
24727
|
+
color?: string;
|
|
24728
|
+
/** Toast padding in any valid CSS length format. */
|
|
24729
|
+
padding?: string;
|
|
24730
|
+
/** Toast border radius in any valid CSS length format. */
|
|
24731
|
+
borderRadius?: string;
|
|
24732
|
+
/** Toast font size in any valid CSS length format. */
|
|
24733
|
+
fontSize?: string;
|
|
24734
|
+
/** Stacking order of the toast container. */
|
|
24735
|
+
zIndex?: number;
|
|
24736
|
+
/** Toast width in any valid CSS length format. */
|
|
24737
|
+
width?: string;
|
|
24738
|
+
/** Time in milliseconds before the toast starts to disappear. */
|
|
24739
|
+
duration?: number;
|
|
24740
|
+
/** Preset status icon displayed above the message. */
|
|
24741
|
+
icon?: 'SUCCESS' | 'FAIL';
|
|
24742
|
+
/** Whether the status icon uses a spinning animation. */
|
|
24743
|
+
spin?: boolean;
|
|
24744
|
+
}
|
|
24745
|
+
|
|
24717
24746
|
/**
|
|
24718
24747
|
* @description 交易信息
|
|
24719
24748
|
*/
|