@alipay/ams-checkout 0.0.1733711101-dev.9 → 0.0.1734512813-dev.0

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.
@@ -5,10 +5,10 @@ export declare const sdkVersion: string;
5
5
  /**
6
6
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
7
7
  */
8
- export declare const AMSCheckoutAppVersion = "1.26.0";
9
- export declare const AMSAutoDebitAppVersion = "1.26.0";
10
- export declare const AMSEasyPayAppVersion = "1.26.0";
11
- export declare const AMSCashierPaymentAppVersion = "1.26.0";
12
- export declare const AMSVaultingAppVersion = "1.26.0";
13
- export declare const AMSPaymentElementAppVersion = "1.26.0";
14
- export declare const ADDRESSElementAppVersion = "1.26.0";
8
+ export declare const AMSCheckoutAppVersion = "1.27.0";
9
+ export declare const AMSAutoDebitAppVersion = "1.27.0";
10
+ export declare const AMSEasyPayAppVersion = "1.27.0";
11
+ export declare const AMSCashierPaymentAppVersion = "1.27.0";
12
+ export declare const AMSVaultingAppVersion = "1.27.0";
13
+ export declare const AMSPaymentElementAppVersion = "1.27.0";
14
+ export declare const ADDRESSElementAppVersion = "1.27.0";
@@ -35,10 +35,10 @@ export var sdkVersion = json.version;
35
35
  /**
36
36
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
37
37
  */
38
- export var AMSCheckoutAppVersion = '1.26.0'; // 兜底版本号
39
- export var AMSAutoDebitAppVersion = '1.26.0'; // 代扣
40
- export var AMSEasyPayAppVersion = '1.26.0'; // easypay
41
- export var AMSCashierPaymentAppVersion = '1.26.0'; // 收银台(卡、apm)
42
- export var AMSVaultingAppVersion = '1.26.0'; // 绑卡
43
- export var AMSPaymentElementAppVersion = '1.26.0'; // payment element
44
- export var ADDRESSElementAppVersion = '1.26.0'; // address element
38
+ export var AMSCheckoutAppVersion = '1.27.0'; // 兜底版本号
39
+ export var AMSAutoDebitAppVersion = '1.27.0'; // 代扣
40
+ export var AMSEasyPayAppVersion = '1.27.0'; // easypay
41
+ export var AMSCashierPaymentAppVersion = '1.27.0'; // 收银台(卡、apm)
42
+ export var AMSVaultingAppVersion = '1.27.0'; // 绑卡
43
+ export var AMSPaymentElementAppVersion = '1.27.0'; // payment element
44
+ export var ADDRESSElementAppVersion = '1.27.0'; // address element
@@ -302,6 +302,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
302
302
  var platform = this.paymentContext.displayInfo.platform;
303
303
  var payload = this.bizFlowStartBehavior.payload;
304
304
  var closeBtnCallbackForPopup = function closeBtnCallbackForPopup() {
305
+ var isOnCloseEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
305
306
  if (displayType === DisplayTypeEnum.inline) {
306
307
  return;
307
308
  }
@@ -309,13 +310,13 @@ export var AntomSDKCore = /*#__PURE__*/function () {
309
310
  showRetentionPopup();
310
311
  return;
311
312
  } else {
312
- _this2.handleClose();
313
+ _this2.handleClose(isOnCloseEvent);
313
314
  }
314
315
  };
315
316
 
316
317
  // TODO 感觉有死循环
317
318
  eventCenter.listen(EVENT.close.name, function () {
318
- closeBtnCallbackForPopup();
319
+ closeBtnCallbackForPopup(true);
319
320
  });
320
321
  eventCenter.listen(EVENT.setAllowRetention.name, function (data) {
321
322
  if (data === undefined || typeof data !== 'boolean') {
@@ -351,9 +352,10 @@ export var AntomSDKCore = /*#__PURE__*/function () {
351
352
  }, {
352
353
  key: "handleClose",
353
354
  value: function handleClose() {
355
+ var isOnCloseEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
354
356
  var eventCenter = ServiceProvider.getInstance(this.instanceId).getService('EventCenter');
355
357
  eventCenter.emit(EVENT.closeCallback.name, {});
356
- if (this.enablePopWindowEventCallback) {
358
+ if (this.enablePopWindowEventCallback && !isOnCloseEvent) {
357
359
  eventCenter.emit(EVENT.eventCallback.name, {
358
360
  code: eventCodeEnum.SDK_PAYMENT_CANCEL,
359
361
  result: {
@@ -61,7 +61,7 @@ export declare class EventCenter implements Service {
61
61
  * @param name - The name of the event to emit.
62
62
  * @param data - The event data to pass to the event listeners.
63
63
  */
64
- emit(name: string, data: any, EventPayload?: EventPayload): void;
64
+ emit(name: string, data: any, eventPayload?: EventPayload): void;
65
65
  /**
66
66
  * Registers a callback for an event and immediately dispatches the event to the app.
67
67
  * @param payloadContext - The context containing event information and callback ID.
@@ -77,6 +77,6 @@ export declare class EventCenter implements Service {
77
77
  isExist(name: string): boolean;
78
78
  }
79
79
  interface IListener {
80
- (data: any, EventPayload?: EventPayload): void;
80
+ (data: any, eventPayload?: EventPayload): void;
81
81
  }
82
82
  export {};
@@ -9,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
9
9
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
10
  import { v4 as uuid } from 'uuid';
11
11
  import { ERRORMESSAGE } from "../../constant";
12
- import { EventPayload, MessageName } from "../../types";
12
+ import { MessageName } from "../../types";
13
13
  import { isJsonString } from "../../util";
14
14
  import { getIframeOrigin, registerSystemEvents, unRegisterSystemEvents } from "../utils/system_events";
15
15
 
@@ -108,11 +108,11 @@ export var EventCenter = /*#__PURE__*/function () {
108
108
  }
109
109
  var isJson = isJsonString(e.data);
110
110
  if (isJson) {
111
- var eventPayload = JSON.parse(e.data);
112
- if (!this.checkEventCompliant(eventPayload)) {
111
+ var _eventPayload = JSON.parse(e.data);
112
+ if (!this.checkEventCompliant(_eventPayload)) {
113
113
  return;
114
114
  }
115
- this._handleAppMessage(eventPayload);
115
+ this._handleAppMessage(_eventPayload);
116
116
  } else {
117
117
  console.error(ERRORMESSAGE.NOT_JSON_FORMAT);
118
118
  }
@@ -196,11 +196,11 @@ export var EventCenter = /*#__PURE__*/function () {
196
196
  */
197
197
  }, {
198
198
  key: "emit",
199
- value: function emit(name, data, EventPayload) {
199
+ value: function emit(name, data, eventPayload) {
200
200
  if (this.events.has(name)) {
201
201
  var eventList = this.events.get(name);
202
202
  eventList.forEach(function (item) {
203
- item.func(data, EventPayload);
203
+ item.func(data, eventPayload);
204
204
  });
205
205
  }
206
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1733711101-dev.9",
3
+ "version": "0.0.1734512813-dev.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",