@alipay/ams-checkout 0.0.1784626568-dev.14 → 0.0.1784626568-dev.16

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.
@@ -1,5 +1,5 @@
1
- import type { CKPShipping } from '../../core/component/element/type';
2
1
  import { type EventPayload, type IPaymentSessionMetaData } from '../../types';
2
+ import type { CKPShipping } from '../../core/component/element/type';
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 { BEFORE_CONFIRM_TIMEOUT_MS, executeWithTimeout, MERCHANT_CONFIRM_ABORT_CODE, MERCHANT_CONFIRM_TIMEOUT_CODE } from "../../util/beforeConfirm";
20
+ import { executeWithTimeout, BEFORE_CONFIRM_TIMEOUT_MS, 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,16 +92,7 @@ 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
-
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
-
95
+ document.body.appendChild(script);
105
96
  // 执行googlePay sdk
106
97
  script.onload = function () {
107
98
  var paymentsClient = new window.google.payments.api.PaymentsClient({
@@ -296,6 +296,6 @@ export var LogConfig = {
296
296
  version: 'iteration/20231021',
297
297
  mdata: {
298
298
  firstLogTime: Date.now(),
299
- sdkVersion: "0.0.1784626568-dev.14"
299
+ sdkVersion: "0.0.1784626568-dev.16"
300
300
  }
301
301
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1784626568-dev.14",
3
+ "version": "0.0.1784626568-dev.16",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "exports": {
package/types.d.ts CHANGED
@@ -3165,11 +3165,6 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
3165
3165
  * Locale for internationalization, passed from entry params (loadAntom), default to en_US
3166
3166
  */
3167
3167
  locale?: string;
3168
- /**
3169
- * 是否运行在 Native App 的 WebView 中。
3170
- * 为 true 时,跳转通过 onRedirect 事件委托给 Native 端处理。
3171
- */
3172
- isNativeAppWebview?: boolean;
3173
3168
  /* Excluded from this release type: merchantDomain */
3174
3169
  /* Excluded from this release type: doMain */
3175
3170
  }
@@ -3252,9 +3247,7 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3252
3247
  private _paypalOverlay;
3253
3248
  constructor(name: string, config: ExpressElementConfig);
3254
3249
  /**
3255
- * 重写 on
3256
- * 1. 对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
3257
- * 2. 对 onRedirect 事件同步注册到 _localHandlers(SDK host 主动推送时商户能收到)
3250
+ * 重写 on:对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
3258
3251
  */
3259
3252
  on(event: string, handler: (...args: any[]) => void): void;
3260
3253
  /**
@@ -3275,6 +3268,8 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3275
3268
  code: string;
3276
3269
  message: string;
3277
3270
  };
3271
+ /** 用户是否手动关闭 3D 弹窗(透传 webapp COMPLETE_PAYMENT_RESULT.userCanceled3D) */
3272
+ userCanceled3D?: boolean;
3278
3273
  }>;
3279
3274
  setup(): Promise<Partial<ExpressAppConfig> | undefined>;
3280
3275
  private registerInternalListeners;
@@ -3364,13 +3359,6 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
3364
3359
  error?: ErrorPayload<string>;
3365
3360
  };
3366
3361
  'OPENSDK@COMPLETE_PAYMENT_REJECT': Record<string, never>;
3367
- onRedirect: {
3368
- normalUrl: string;
3369
- applinkUrl?: string;
3370
- schemaUrl?: string;
3371
- isDestroy: boolean;
3372
- needReset: boolean;
3373
- };
3374
3362
  }
3375
3363
 
3376
3364
  declare interface ExpSupportBank {
@@ -3581,11 +3581,6 @@ export declare interface ExpressAppConfig extends BaseAppearance<AppearanceSetti
3581
3581
  * Locale for internationalization, passed from entry params (loadAntom), default to en_US
3582
3582
  */
3583
3583
  locale?: string;
3584
- /**
3585
- * 是否运行在 Native App 的 WebView 中。
3586
- * 为 true 时,跳转通过 onRedirect 事件委托给 Native 端处理。
3587
- */
3588
- isNativeAppWebview?: boolean;
3589
3584
  /** @internal SDK host 侧商户域名,供 Apple Pay merchant validation 使用 */
3590
3585
  merchantDomain?: string;
3591
3586
  /** @internal Elements2 历史协议字段,含义同 merchantDomain */
@@ -3670,9 +3665,7 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3670
3665
  private _paypalOverlay;
3671
3666
  constructor(name: string, config: ExpressElementConfig);
3672
3667
  /**
3673
- * 重写 on
3674
- * 1. 对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
3675
- * 2. 对 onRedirect 事件同步注册到 _localHandlers(SDK host 主动推送时商户能收到)
3668
+ * 重写 on:对 confirm 事件拦截,在商户回调执行前注入 paymentFailed()
3676
3669
  */
3677
3670
  on(event: string, handler: (...args: any[]) => void): void;
3678
3671
  /**
@@ -3693,6 +3686,8 @@ export declare class ExpressElement extends BaseMainElement<ExpressElementConfig
3693
3686
  code: string;
3694
3687
  message: string;
3695
3688
  };
3689
+ /** 用户是否手动关闭 3D 弹窗(透传 webapp COMPLETE_PAYMENT_RESULT.userCanceled3D) */
3690
+ userCanceled3D?: boolean;
3696
3691
  }>;
3697
3692
  setup(): Promise<Partial<ExpressAppConfig> | undefined>;
3698
3693
  private registerInternalListeners;
@@ -3782,13 +3777,6 @@ export declare interface ExpressElementEvents extends AntomBridgeWithNativeEvent
3782
3777
  error?: ErrorPayload<string>;
3783
3778
  };
3784
3779
  'OPENSDK@COMPLETE_PAYMENT_REJECT': Record<string, never>;
3785
- onRedirect: {
3786
- normalUrl: string;
3787
- applinkUrl?: string;
3788
- schemaUrl?: string;
3789
- isDestroy: boolean;
3790
- needReset: boolean;
3791
- };
3792
3780
  }
3793
3781
 
3794
3782
  declare interface ExpSupportBank {