@alipay/ams-checkout 0.0.1783663570-dev.6 → 0.0.1783663570-dev.8

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.
@@ -30,7 +30,7 @@ export var v2AppMarmotMap = {
30
30
  light_sandbox: 'https://checkout.antom.com',
31
31
  prod: 'https://checkout.antom.com'
32
32
  };
33
- export var sdkVersion = "0.0.1783663570-dev.6";
33
+ export var sdkVersion = "0.0.1783663570-dev.8";
34
34
 
35
35
  /**
36
36
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
@@ -6,13 +6,12 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
6
6
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
7
7
  import { EventCallbackCode } from "../type";
8
8
  export function adaptSubmitResult(result) {
9
- var _result$error;
10
9
  return {
11
10
  status: result.status || 'FAIL',
12
11
  error: result.error ? {
13
12
  code: result.error.code,
14
13
  message: result.error.message,
15
- needChangeSessionForRetry: (_result$error = result.error) === null || _result$error === void 0 ? void 0 : _result$error.needChangeSessionForRetry
14
+ needChangeSessionForRetry: result.error.needChangeSessionForRetry
16
15
  } : undefined,
17
16
  userCanceled3D: result.userCanceled3D,
18
17
  session: result.paymentSession ? {
@@ -41,8 +40,16 @@ export function adaptErrorToEventCallback(error) {
41
40
  * 4. layout: 直接透传
42
41
  */
43
42
  export function adaptAppearance(appearance, merchantAppointParam) {
44
- var _appearance$card, _merchantAppointParam, _appearance$accordion;
45
- if (!appearance) return undefined;
43
+ var _merchantAppointParam, _appearance$card, _appearance$accordion;
44
+ var merchantDisplaySetting = {
45
+ showCardCVV: !!(merchantAppointParam !== null && merchantAppointParam !== void 0 && (_merchantAppointParam = merchantAppointParam.storedCard) !== null && _merchantAppointParam !== void 0 && _merchantAppointParam.needCVV),
46
+ showPaymentMethodListWhenSingleOption: (merchantAppointParam === null || merchantAppointParam === void 0 ? void 0 : merchantAppointParam.singleOption) === 'list'
47
+ };
48
+ if (!appearance) {
49
+ return merchantAppointParam ? {
50
+ displaySetting: merchantDisplaySetting
51
+ } : undefined;
52
+ }
46
53
  var result = {};
47
54
 
48
55
  // Theme mapping: kebab-case → camelCase
@@ -57,17 +64,16 @@ export function adaptAppearance(appearance, merchantAppointParam) {
57
64
  result.variables = filtered;
58
65
  }
59
66
  }
60
- result.displaySetting = {
61
- showCardBrandIcon: !!((_appearance$card = appearance.card) !== null && _appearance$card !== void 0 && _appearance$card.showBrandIcon),
62
- showCardCVV: !!(merchantAppointParam !== null && merchantAppointParam !== void 0 && (_merchantAppointParam = merchantAppointParam.storedCard) !== null && _merchantAppointParam !== void 0 && _merchantAppointParam.needCVV),
63
- showPaymentMethodListWhenSingleOption: (merchantAppointParam === null || merchantAppointParam === void 0 ? void 0 : merchantAppointParam.singleOption) === 'list',
67
+ result.displaySetting = _objectSpread(_objectSpread({
68
+ showCardBrandIcon: !!((_appearance$card = appearance.card) !== null && _appearance$card !== void 0 && _appearance$card.showBrandIcon)
69
+ }, merchantDisplaySetting), {}, {
64
70
  showRadioWhenAccordionLayout: !!((_appearance$accordion = appearance.accordion) !== null && _appearance$accordion !== void 0 && _appearance$accordion.showRadio)
65
- };
71
+ });
66
72
 
67
73
  // Layout: 直接透传
68
74
  if (appearance.layout) {
69
75
  var _appearance$layout$ty;
70
76
  result.layout = ((_appearance$layout$ty = appearance.layout.type) === null || _appearance$layout$ty === void 0 ? void 0 : _appearance$layout$ty.toLowerCase()) || 'accordion';
71
77
  }
72
- return Object.keys(result).length > 0 ? result : undefined;
78
+ return result;
73
79
  }
@@ -31,12 +31,15 @@ export declare class ModernElementController implements IElementController {
31
31
  private notRedirectAfterComplete;
32
32
  private _sdkInitTime;
33
33
  private _mountStartTime;
34
+ private destroyCallbacks;
34
35
  /** 商户传入的金额覆盖(Apple Pay 弹窗展示用,实际扣款由服务端控制) */
35
36
  private _merchantAmount;
36
37
  /** 商户传入的币种覆盖(Apple Pay 弹窗展示用) */
37
38
  private _merchantCurrency;
38
39
  /** 当前选中的支付方式类型(如 'APPLEPAY', 'CARD'),通过 paymentMethodChanged 事件更新 */
39
40
  private currentPaymentMethodType;
41
+ /** 提交进行中标志:submitPayment 执行期间为 true,用于拒绝并发重入,避免旧闭包串扰/重复拉起钱包 */
42
+ private isSubmitting;
40
43
  constructor({ onStatusChange, ...options }: ModernElementControllerOptions);
41
44
  mount(renderOptions: PaymentMountOptions, sdkSelector: string): Promise<ICommonApiResponse>;
42
45
  /**
@@ -120,6 +123,8 @@ export declare class ModernElementController implements IElementController {
120
123
  destroy(): void;
121
124
  private cleanup;
122
125
  private setStatus;
126
+ private onDestroy;
127
+ private runDestroyCallbacks;
123
128
  /**
124
129
  * 带缓存的消息发送:当 status 不是 ready 时,缓存消息;ready 后由 flushCachedMessages 批量发送
125
130
  */