@alipay/ams-checkout 0.0.1710212811-dev.25 → 0.0.1710212811-dev.27

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.
@@ -26,9 +26,6 @@ export declare enum ComponentActiontEnum {
26
26
  export declare enum RequestActiontEnum {
27
27
  onDestory = "httpRequest"
28
28
  }
29
- export declare enum MonitorActiontEnum {
30
- reportAnalytics = "reportAnalytics"
31
- }
32
29
  export declare enum LoadingActiontEnum {
33
30
  showLoading = "showLoading",
34
31
  dismissLoading = "dismissLoading"
@@ -28,10 +28,6 @@ export var RequestActiontEnum = /*#__PURE__*/function (RequestActiontEnum) {
28
28
  RequestActiontEnum["onDestory"] = "httpRequest";
29
29
  return RequestActiontEnum;
30
30
  }({});
31
- export var MonitorActiontEnum = /*#__PURE__*/function (MonitorActiontEnum) {
32
- MonitorActiontEnum["reportAnalytics"] = "reportAnalytics";
33
- return MonitorActiontEnum;
34
- }({});
35
31
  export var LoadingActiontEnum = /*#__PURE__*/function (LoadingActiontEnum) {
36
32
  LoadingActiontEnum["showLoading"] = "showLoading";
37
33
  LoadingActiontEnum["dismissLoading"] = "dismissLoading";
@@ -30,7 +30,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
30
  import { v4 as uuid } from 'uuid';
31
31
  import { COMPONENTPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
32
32
  import ComponentApp from "../../plugin/component";
33
- import { componentSignEnum, environmentEnum, modeEnum, networkModeEnum, PaymentMethodTypeEnum, productSceneEnum, renderDisplayTypeEnum } from "../../types";
33
+ import { componentSignEnum, environmentEnum, modeEnum, networkModeEnum, productSceneEnum, renderDisplayTypeEnum } from "../../types";
34
34
  import { getOrSetStorageId, isPC, parseBase64ToString } from "../../util";
35
35
  import { createIframeNode, createPreloadIframeNode } from "../../util/createIframeNode";
36
36
  import { getSecurityConfigStorageKey } from "../../util/security";
@@ -210,8 +210,8 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
210
210
  BusManager.clear();
211
211
  BusManager.addInterceptor({
212
212
  onPublishException: function onPublishException(message, e) {
213
- _this2.logger.logInfo({
214
- title: 'onPublishException'
213
+ _this2.logger.logError({
214
+ title: 'onBusPublishException'
215
215
  }, _objectSpread(_objectSpread({}, message), {}, {
216
216
  errorMessage: JSON.stringify(e)
217
217
  }));
@@ -219,17 +219,17 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
219
219
  });
220
220
  // subscribe basic ablility
221
221
  BusManager.subscribe(new SDKCallbackBusSubscriber(function (state) {
222
- var _this2$originOptions;
223
- (_this2$originOptions = _this2.originOptions) === null || _this2$originOptions === void 0 || _this2$originOptions.onEventCallback(state);
222
+ var _this2$_componentApp;
223
+ (_this2$_componentApp = _this2._componentApp) === null || _this2$_componentApp === void 0 || (_this2$_componentApp = _this2$_componentApp.AMSSDK) === null || _this2$_componentApp === void 0 || _this2$_componentApp._eventCenter.emit(EVENT.eventCallback.name, state);
224
224
  }));
225
225
  BusManager.subscribe(new SecurityBusSubscriber(function (deviceIdParameter, isPolling) {
226
- var _this2$_componentApp;
227
- return (_this2$_componentApp = _this2._componentApp) === null || _this2$_componentApp === void 0 ? void 0 : _this2$_componentApp.getDeviceIdAndLog(deviceIdParameter, isPolling);
226
+ var _this2$_componentApp2;
227
+ return (_this2$_componentApp2 = _this2._componentApp) === null || _this2$_componentApp2 === void 0 ? void 0 : _this2$_componentApp2.getDeviceIdAndLog(deviceIdParameter, isPolling);
228
228
  }));
229
229
  BusManager.subscribe(new TrackerBusSubscriber(this.logger));
230
230
  // subscribe plugin
231
231
  BusManager.subscribe(new ApplePayBusSubscriber(this.logger));
232
- // publish devent
232
+ // publish event
233
233
  BusManager.publish(new BusMessage(PaymentActionEnum.optional_init, JSON.stringify(this.originOptions)));
234
234
  }
235
235
  }, {
@@ -238,7 +238,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
238
238
  var _this3 = this;
239
239
  // 判断支付方式是否可用
240
240
  return new Promise(function (resolve) {
241
- if (paymentMethod === PaymentMethodTypeEnum.ApplePay) {
241
+ if (paymentMethod === 'ApplePay') {
242
242
  BusManager.publishForResult(new BusMessage(ApplePayActionEnum.canMakePayments, JSON.stringify({
243
243
  subPaymentMethod: subPaymentMethod
244
244
  })), {
@@ -17,8 +17,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
17
17
  */
18
18
  /* eslint-disable @typescript-eslint/no-explicit-any */
19
19
  import { APPLE_PAY_VERSION, APPLE_PAY_RECURRING_VERSION } from "./interface";
20
- import { ApplePaySubTypeEnum } from "../../types";
21
-
22
20
  /**
23
21
  * Apple Pay Service
24
22
  */
@@ -217,7 +215,7 @@ var ApplePayService = /*#__PURE__*/function () {
217
215
  }], [{
218
216
  key: "canMakePayments",
219
217
  value: function canMakePayments(subTypeEnum) {
220
- if (ApplePaySubTypeEnum.ApplePayRecurringPayment === subTypeEnum) {
218
+ if ('ApplePayRecurringPayment' === subTypeEnum) {
221
219
  return window.ApplePaySession ? window.ApplePaySession.canMakePayments() && window.ApplePaySession.supportsVersion(APPLE_PAY_RECURRING_VERSION) : false;
222
220
  }
223
221
  return window.ApplePaySession ? window.ApplePaySession.canMakePayments() && window.ApplePaySession.supportsVersion(APPLE_PAY_VERSION) : false;
@@ -471,11 +471,7 @@ export interface CallbackEventInfo {
471
471
  export interface MultipleCallbackEvents {
472
472
  [key: string]: CallbackEventInfo;
473
473
  }
474
- export declare enum PaymentMethodTypeEnum {
475
- ApplePay = "ApplePay"
476
- }
477
- export declare enum ApplePaySubTypeEnum {
478
- ApplePayRecurringPayment = "ApplePayRecurringPayment"
479
- }
474
+ export type PaymentMethodTypeEnum = 'ApplePay';
475
+ export type ApplePaySubTypeEnum = 'ApplePayRecurringPayment';
480
476
  export type SubPaymentMethodTypeEnum = ApplePaySubTypeEnum;
481
477
  export {};
@@ -164,12 +164,4 @@ export var RedirectType = /*#__PURE__*/function (RedirectType) {
164
164
  RedirectType["NormalUrl"] = "NormalUrl";
165
165
  RedirectType["Unknown"] = "Unknown";
166
166
  return RedirectType;
167
- }({});
168
- export var PaymentMethodTypeEnum = /*#__PURE__*/function (PaymentMethodTypeEnum) {
169
- PaymentMethodTypeEnum["ApplePay"] = "ApplePay";
170
- return PaymentMethodTypeEnum;
171
- }({});
172
- export var ApplePaySubTypeEnum = /*#__PURE__*/function (ApplePaySubTypeEnum) {
173
- ApplePaySubTypeEnum["ApplePayRecurringPayment"] = "ApplePayRecurringPayment";
174
- return ApplePaySubTypeEnum;
175
167
  }({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1710212811-dev.25",
3
+ "version": "0.0.1710212811-dev.27",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",