@alipay/ams-checkout 0.0.1730706734-dev.0 → 0.0.1730878287-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.
Files changed (126) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/config/index.d.ts +2 -2
  3. package/esm/config/index.js +5 -5
  4. package/esm/constant/index.d.ts +0 -6
  5. package/esm/constant/index.js +0 -8
  6. package/esm/core/bus/interface.d.ts +0 -12
  7. package/esm/core/bus/interface.js +2 -16
  8. package/esm/core/component/address.d.ts +2 -2
  9. package/esm/core/component/appPreloadProcessing.js +0 -2
  10. package/esm/core/component/ckp/index.d.ts +3 -3
  11. package/esm/core/component/ckp/index.js +3 -3
  12. package/esm/core/component/index.d.ts +5 -5
  13. package/esm/core/component/index.js +16 -20
  14. package/esm/core/drop-in/index.d.ts +2 -2
  15. package/esm/core/drop-in/index.js +2 -2
  16. package/esm/core/instance/index.d.ts +5 -5
  17. package/esm/core/instance/index.js +10 -11
  18. package/esm/index.d.ts +10 -16
  19. package/esm/index.js +59 -70
  20. package/esm/plugin/applepay/component.js +3 -3
  21. package/esm/plugin/applepay/service.d.ts +2 -2
  22. package/esm/plugin/applepay/service.js +2 -2
  23. package/esm/plugin/component/cashierApp.d.ts +5 -7
  24. package/esm/plugin/component/cashierApp.js +8 -16
  25. package/esm/plugin/component/channel.d.ts +4 -4
  26. package/esm/plugin/component/component.inline.style.d.ts +4 -4
  27. package/esm/plugin/component/component.inline.style.js +7 -10
  28. package/esm/plugin/component/component.popup.style.d.ts +6 -15
  29. package/esm/plugin/component/component.popup.style.js +15 -33
  30. package/esm/plugin/component/index.d.ts +7 -7
  31. package/esm/plugin/component/index.js +90 -113
  32. package/esm/plugin/const.js +5 -5
  33. package/esm/plugin/drop-in/index.d.ts +5 -5
  34. package/esm/plugin/drop-in/index.js +7 -7
  35. package/esm/plugin/payment-element/utils.d.ts +1 -1
  36. package/esm/plugin/payment-element/utils.js +1 -2
  37. package/esm/plugin/type.d.ts +4 -4
  38. package/esm/service/index.d.ts +0 -1
  39. package/esm/service/index.js +0 -2
  40. package/esm/types/index.d.ts +38 -240
  41. package/esm/types/index.js +59 -103
  42. package/esm/util/createIframeNode.d.ts +2 -2
  43. package/esm/util/createIframeNode.js +3 -3
  44. package/esm/util/index.d.ts +1 -1
  45. package/esm/util/index.js +4 -3
  46. package/esm/{foundation/service/security → util}/security.d.ts +2 -2
  47. package/esm/{foundation/service/security → util}/security.js +3 -3
  48. package/package.json +1 -2
  49. package/esm/core/bus/ability/globalData.d.ts +0 -10
  50. package/esm/core/bus/ability/globalData.js +0 -89
  51. package/esm/core/bus/ability/request.d.ts +0 -10
  52. package/esm/core/bus/ability/request.js +0 -151
  53. package/esm/core/component/element/components/address.d.ts +0 -19
  54. package/esm/core/component/element/components/address.js +0 -68
  55. package/esm/core/component/element/components/auth.d.ts +0 -17
  56. package/esm/core/component/element/components/auth.js +0 -59
  57. package/esm/core/component/element/components/payment.d.ts +0 -19
  58. package/esm/core/component/element/components/payment.js +0 -74
  59. package/esm/core/component/element/element-mock.d.ts +0 -2
  60. package/esm/core/component/element/element-mock.js +0 -263
  61. package/esm/core/component/element/index.d.ts +0 -47
  62. package/esm/core/component/element/index.js +0 -776
  63. package/esm/core/component/element/mock.d.ts +0 -3
  64. package/esm/core/component/element/mock.js +0 -1156
  65. package/esm/core/component/element/type.d.ts +0 -176
  66. package/esm/core/component/element/type.js +0 -34
  67. package/esm/core/component/element/utils.d.ts +0 -13
  68. package/esm/core/component/element/utils.js +0 -6
  69. package/esm/foundation/core/index.d.ts +0 -26
  70. package/esm/foundation/core/index.js +0 -301
  71. package/esm/foundation/index.d.ts +0 -72
  72. package/esm/foundation/index.js +0 -42
  73. package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -15
  74. package/esm/foundation/product-processor/easysafepay/deps.js +0 -9
  75. package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -26
  76. package/esm/foundation/product-processor/easysafepay/index.js +0 -536
  77. package/esm/foundation/service/container/index.d.ts +0 -28
  78. package/esm/foundation/service/container/index.js +0 -256
  79. package/esm/foundation/service/container/popup.d.ts +0 -17
  80. package/esm/foundation/service/container/popup.js +0 -103
  81. package/esm/foundation/service/container/utils.d.ts +0 -7
  82. package/esm/foundation/service/container/utils.js +0 -48
  83. package/esm/foundation/service/event-bus/ability/callback.d.ts +0 -9
  84. package/esm/foundation/service/event-bus/ability/callback.js +0 -55
  85. package/esm/foundation/service/event-bus/ability/globalData.d.ts +0 -10
  86. package/esm/foundation/service/event-bus/ability/globalData.js +0 -89
  87. package/esm/foundation/service/event-bus/ability/request.d.ts +0 -10
  88. package/esm/foundation/service/event-bus/ability/request.js +0 -151
  89. package/esm/foundation/service/event-bus/ability/security.d.ts +0 -12
  90. package/esm/foundation/service/event-bus/ability/security.js +0 -151
  91. package/esm/foundation/service/event-bus/ability/tracker.d.ts +0 -9
  92. package/esm/foundation/service/event-bus/ability/tracker.js +0 -80
  93. package/esm/foundation/service/event-bus/busManager.d.ts +0 -127
  94. package/esm/foundation/service/event-bus/busManager.js +0 -398
  95. package/esm/foundation/service/event-bus/index.d.ts +0 -20
  96. package/esm/foundation/service/event-bus/index.js +0 -88
  97. package/esm/foundation/service/event-center.d.ts +0 -75
  98. package/esm/foundation/service/event-center.js +0 -244
  99. package/esm/foundation/service/global-data/index.d.ts +0 -11
  100. package/esm/foundation/service/global-data/index.js +0 -69
  101. package/esm/foundation/service/index.d.ts +0 -19
  102. package/esm/foundation/service/index.js +0 -82
  103. package/esm/foundation/service/log/index.d.ts +0 -43
  104. package/esm/foundation/service/log/index.js +0 -235
  105. package/esm/foundation/service/log/types.d.ts +0 -32
  106. package/esm/foundation/service/log/types.js +0 -1
  107. package/esm/foundation/service/requester/deps.d.ts +0 -17
  108. package/esm/foundation/service/requester/deps.js +0 -11
  109. package/esm/foundation/service/requester/requester.d.ts +0 -22
  110. package/esm/foundation/service/requester/requester.js +0 -211
  111. package/esm/foundation/service/security/index.d.ts +0 -26
  112. package/esm/foundation/service/security/index.js +0 -216
  113. package/esm/foundation/types/index.d.ts +0 -4
  114. package/esm/foundation/types/index.js +0 -4
  115. package/esm/foundation/utils/gray_scale_utils.d.ts +0 -7
  116. package/esm/foundation/utils/gray_scale_utils.js +0 -40
  117. package/esm/foundation/utils/payment_context_utils.d.ts +0 -13
  118. package/esm/foundation/utils/payment_context_utils.js +0 -57
  119. package/esm/foundation/utils/redirect_utils.d.ts +0 -6
  120. package/esm/foundation/utils/redirect_utils.js +0 -99
  121. package/esm/foundation/utils/system_events.d.ts +0 -4
  122. package/esm/foundation/utils/system_events.js +0 -71
  123. package/esm/foundation/utils/web_app_url_utils.d.ts +0 -37
  124. package/esm/foundation/utils/web_app_url_utils.js +0 -97
  125. package/esm/service/element.d.ts +0 -4
  126. package/esm/service/element.js +0 -51
@@ -10,5 +10,5 @@ export declare const AMSAutoDebitAppVersion = "1.23.0";
10
10
  export declare const AMSEasyPayAppVersion = "1.23.0";
11
11
  export declare const AMSCashierPaymentAppVersion = "1.23.0";
12
12
  export declare const AMSVaultingAppVersion = "1.23.0";
13
- export declare const AMSPaymentElementAppVersion = "1.23.0";
14
- export declare const ADDRESSElementAppVersion = "1.23.0";
13
+ export declare const AMSPaymentElementAppVersion = "1.23.2";
14
+ export declare const ADDRESSElementAppVersion = "1.23.2";
@@ -26,9 +26,9 @@ export var elementAppMarmotMap = {
26
26
  dev: 'http://page.alipay.net/page/antom-web-checkout-v2',
27
27
  sit: 'http://page.test.alipay.net/page/antom-web-checkout-v2',
28
28
  pre: 'https://pre.ac.alipay.com/page/antom-web-checkout-v2',
29
- sandbox: 'https://ac.alipay.com/page/antom-web-checkout-v2',
30
- light_sandbox: 'https://ac.alipay.com/page/antom-web-checkout-v2',
31
- prod: 'https://ac.alipay.com/page/antom-web-checkout-v2'
29
+ sandbox: 'https://checkout.antom.com',
30
+ light_sandbox: 'https://checkout.antom.com',
31
+ prod: 'https://checkout.antom.com'
32
32
  };
33
33
  export var sdkVersion = json.version;
34
34
 
@@ -40,5 +40,5 @@ export var AMSAutoDebitAppVersion = '1.23.0'; // 代扣
40
40
  export var AMSEasyPayAppVersion = '1.23.0'; // easypay
41
41
  export var AMSCashierPaymentAppVersion = '1.23.0'; // 收银台(卡、apm)
42
42
  export var AMSVaultingAppVersion = '1.23.0'; // 绑卡
43
- export var AMSPaymentElementAppVersion = '1.23.0'; // payment element
44
- export var ADDRESSElementAppVersion = '1.23.0'; // address element
43
+ export var AMSPaymentElementAppVersion = '1.23.2'; // payment element
44
+ export var ADDRESSElementAppVersion = '1.23.2'; // address element
@@ -161,12 +161,6 @@ export declare const EVENT: {
161
161
  receiveMuitiAppFromSdk: {
162
162
  name: string;
163
163
  };
164
- sendBroadcast: {
165
- name: string;
166
- };
167
- receiveBroadcast: {
168
- name: string;
169
- };
170
164
  getUserAgentFromSdk: {
171
165
  name: string;
172
166
  };
@@ -155,20 +155,12 @@ export var EVENT = {
155
155
  getGlobalData: {
156
156
  name: 'getGlobalData'
157
157
  },
158
- // deprecated
159
158
  sendMuitiAppEventToSdk: {
160
159
  name: 'sendMuitiAppEventToSdk'
161
160
  },
162
- // deprecated
163
161
  receiveMuitiAppFromSdk: {
164
162
  name: 'receiveMuitiAppFromSdk'
165
163
  },
166
- sendBroadcast: {
167
- name: 'sendBroadcast'
168
- },
169
- receiveBroadcast: {
170
- name: 'receiveBroadcast'
171
- },
172
164
  getUserAgentFromSdk: {
173
165
  name: 'getUserAgentFromSdk'
174
166
  },
@@ -13,19 +13,7 @@ export declare enum PaypalActionEnum {
13
13
  export declare enum SDKCallbackActionEnum {
14
14
  onEventCallback = "onEventCallback"
15
15
  }
16
- export declare enum RequestActiontEnum {
17
- request = "request",
18
- getEnvInfo = "getEnvInfo",
19
- getUserAgent = "getUserAgent"
20
- }
21
- export declare enum DataActiontEnum {
22
- getGlobalData = "getGlobalData",
23
- setGlobalData = "setGlobalData",
24
- clearGlobalData = "clearGlobalData"
25
- }
26
16
  export declare enum SecuritySDKActionEnum {
27
- preInitSecurity = "preInitSecurity",
28
- initSecurity = "initSecurity",
29
17
  getSecurityDeviceId = "getSecurityDeviceId"
30
18
  }
31
19
  export declare enum TrackerActionEnum {
@@ -17,21 +17,7 @@ export var SDKCallbackActionEnum = /*#__PURE__*/function (SDKCallbackActionEnum)
17
17
  SDKCallbackActionEnum["onEventCallback"] = "onEventCallback";
18
18
  return SDKCallbackActionEnum;
19
19
  }({});
20
- export var RequestActiontEnum = /*#__PURE__*/function (RequestActiontEnum) {
21
- RequestActiontEnum["request"] = "request";
22
- RequestActiontEnum["getEnvInfo"] = "getEnvInfo";
23
- RequestActiontEnum["getUserAgent"] = "getUserAgent";
24
- return RequestActiontEnum;
25
- }({});
26
- export var DataActiontEnum = /*#__PURE__*/function (DataActiontEnum) {
27
- DataActiontEnum["getGlobalData"] = "getGlobalData";
28
- DataActiontEnum["setGlobalData"] = "setGlobalData";
29
- DataActiontEnum["clearGlobalData"] = "clearGlobalData";
30
- return DataActiontEnum;
31
- }({});
32
20
  export var SecuritySDKActionEnum = /*#__PURE__*/function (SecuritySDKActionEnum) {
33
- SecuritySDKActionEnum["preInitSecurity"] = "preInitSecurity";
34
- SecuritySDKActionEnum["initSecurity"] = "initSecurity";
35
21
  SecuritySDKActionEnum["getSecurityDeviceId"] = "getSecurityDeviceId";
36
22
  return SecuritySDKActionEnum;
37
23
  }({});
@@ -43,10 +29,10 @@ export var ComponentActiontEnum = /*#__PURE__*/function (ComponentActiontEnum) {
43
29
  ComponentActiontEnum["onDestory"] = "onDestory";
44
30
  return ComponentActiontEnum;
45
31
  }({});
46
- RequestActiontEnum = /*#__PURE__*/function (RequestActiontEnum) {
32
+ export var RequestActiontEnum = /*#__PURE__*/function (RequestActiontEnum) {
47
33
  RequestActiontEnum["onDestory"] = "httpRequest";
48
34
  return RequestActiontEnum;
49
- }(RequestActiontEnum || {});
35
+ }({});
50
36
  export var LoadingActiontEnum = /*#__PURE__*/function (LoadingActiontEnum) {
51
37
  LoadingActiontEnum["showLoading"] = "showLoading";
52
38
  LoadingActiontEnum["dismissLoading"] = "dismissLoading";
@@ -1,7 +1,7 @@
1
- import { IOptionsParams } from '../../types';
1
+ import { IoptionsParams } from '../../types';
2
2
  import { AMSComponent } from './index';
3
3
  export declare class AddressComponent extends AMSComponent {
4
- constructor(options: IOptionsParams & {
4
+ constructor(options: IoptionsParams & {
5
5
  appVersion: string;
6
6
  });
7
7
  getValue(hasValidate?: boolean): Promise<unknown>;
@@ -3,8 +3,6 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
3
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
4
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
5
  import { loadSDKScript } from "../../util";
6
-
7
- // 收银台卡支付
8
6
  export function loadChannelPneumaticControl(_x, _x2) {
9
7
  return _loadChannelPneumaticControl.apply(this, arguments);
10
8
  }
@@ -1,16 +1,16 @@
1
- import { IcreateComponent, IOptionsParams } from '../../../types';
1
+ import { IcreateComponent, IoptionsParams } from '../../../types';
2
2
  import { Logger } from '../../../util/logger';
3
3
  type LOCAL_URL = string;
4
4
  export type CKPEmbeddedAppEnv = 'dev' | 'sit' | 'pre' | 'prod';
5
5
  export type CKPEmbeddedEventType = 'SDK_PAYMENT_SUCCESSFUL' | 'SDK_PAYMENT_FAIL' | 'SDK_PAYMENT_CANCEL' | 'SDK_PAYMENT_CLICK_BACK_TO_MERCHANT';
6
- export declare const getCKPPageAddress: (env: IOptionsParams['environment'] | LOCAL_URL) => string;
6
+ export declare const getCKPPageAddress: (env: IoptionsParams['environment'] | LOCAL_URL) => string;
7
7
  export declare class AMSCheckoutPage {
8
8
  logger: Logger;
9
9
  private _instanceId;
10
10
  private originOptions;
11
11
  private readonly APP_IFRAME_ID;
12
12
  private eventListener?;
13
- constructor(options: Pick<IOptionsParams, 'environment' | 'locale' | 'onEventCallback'>);
13
+ constructor(options: Pick<IoptionsParams, 'environment' | 'locale' | 'onEventCallback'>);
14
14
  private generateIframeSrc;
15
15
  private eventListenerWrapper;
16
16
  private addListener;
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
6
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
7
  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); }
8
8
  import { v4 as uuid } from 'uuid';
9
- import { EnvironmentEnum } from "../../../types";
9
+ import { environmentEnum } from "../../../types";
10
10
  import { queryParse } from "../../../util";
11
11
  import { LogConfig, Logger } from "../../../util/logger";
12
12
  var CKP_PAYMENT_PAGE_HOST = {
@@ -87,11 +87,11 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
87
87
  _defineProperty(this, "removeListener", function () {
88
88
  window.removeEventListener('message', _this.eventListenerWrapper);
89
89
  });
90
- options.environment = options.environment || EnvironmentEnum.prod;
90
+ options.environment = options.environment || environmentEnum.prod;
91
91
  this._instanceId = uuid();
92
92
  this.originOptions = options;
93
93
  this.eventListener = options.onEventCallback;
94
- this.logger = new Logger(LogConfig, ![EnvironmentEnum.prod, EnvironmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment));
94
+ this.logger = new Logger(LogConfig, ![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment));
95
95
  Logger.setInstance(this.logger);
96
96
  this.logger.setMedta({
97
97
  instanceId: this._instanceId
@@ -1,14 +1,14 @@
1
1
  import ComponentApp from '../../plugin/component';
2
- import { ComponentSignEnum, IcreateComponent, IOptionsParams, IPaymentSessionMetaData, Iselector, Isubmit, PaymentMethodTypeEnum, SubPaymentMethodTypeEnum } from '../../types';
2
+ import { componentSignEnum, IcreateComponent, IoptionsParams, IpaymentSessionMetaData, Iselector, Isubmit, PaymentMethodTypeEnum, SubPaymentMethodTypeEnum } from '../../types';
3
3
  import CoreInstance from '../instance/index';
4
- export declare const getComponentSign: (params: IPaymentSessionMetaData) => ComponentSignEnum;
5
- export declare const parseSessionData: (sessionData: string) => [IPaymentSessionMetaData, string];
6
- export type IAMSComponentOptions = IOptionsParams & {
4
+ export declare const getComponentSign: (params: IpaymentSessionMetaData) => componentSignEnum;
5
+ export declare const parseSessionData: (sessionData: string) => [IpaymentSessionMetaData, string];
6
+ export type IAMSComponentOptions = IoptionsParams & {
7
7
  appVersion: string;
8
8
  };
9
9
  export declare class AMSComponent extends CoreInstance {
10
10
  _componentApp: ComponentApp;
11
- channelType: ComponentSignEnum[];
11
+ channelType: componentSignEnum[];
12
12
  productSceneVersion: string;
13
13
  timer: any;
14
14
  constructor(options: IAMSComponentOptions);
@@ -40,10 +40,10 @@ import { ApplePayBusSubscriber } from "../../plugin/applepay";
40
40
  import ComponentApp from "../../plugin/component";
41
41
  import { ExtendPlugin } from "../../plugin/const";
42
42
  import { PaypalBusSubscriber } from "../../plugin/paypal";
43
- import { ComponentSignEnum, ComponentSignEnumV2, EnvironmentEnum, modeEnum, networkModeEnum, ProductSceneEnum, DisplayTypeEnum } from "../../types";
43
+ import { componentSignEnum, ComponentSignEnumV2, environmentEnum, modeEnum, networkModeEnum, productSceneEnum, renderDisplayTypeEnum } from "../../types";
44
44
  import { getOrSetStorageId, isPC, parseBase64ToString } from "../../util";
45
45
  import { createIframeNode, createPreloadIframeNode } from "../../util/createIframeNode";
46
- import { getSecurityConfigStorageKey } from "../../foundation/service/security/security";
46
+ import { getSecurityConfigStorageKey } from "../../util/security";
47
47
  import { BusManager, BusMessage } from "../bus";
48
48
  import { SDKCallbackBusSubscriber } from "../bus/ability/callback";
49
49
  import { SecurityBusSubscriber } from "../bus/ability/security";
@@ -59,7 +59,7 @@ export var getComponentSign = function getComponentSign(params) {
59
59
  paymentMethodCategoryType = _params$paymentSessio4 === void 0 ? '' : _params$paymentSessio4;
60
60
  if (productScene && paymentMethodCategoryType) return "".concat(productScene, "_").concat(paymentMethodCategoryType);
61
61
  if (productScene) return "".concat(productScene);
62
- return ComponentSignEnum.NONE;
62
+ return componentSignEnum.NONE;
63
63
  };
64
64
  export var parseSessionData = function parseSessionData(sessionData) {
65
65
  try {
@@ -74,7 +74,7 @@ export var parseSessionData = function parseSessionData(sessionData) {
74
74
  var resetEasyPaySceneVersion = function resetEasyPaySceneVersion(parseData) {
75
75
  if (isPC() && parseData !== null && parseData !== void 0 && parseData.paymentSessionConfig) {
76
76
  var productScene = parseData.paymentSessionConfig.productScene;
77
- if (productScene === ProductSceneEnum.EASY_PAY) {
77
+ if (productScene === productSceneEnum.EASY_PAY) {
78
78
  var _parseData$paymentMet;
79
79
  // 非TOSS渠道,在PC场景需要改成1.0
80
80
  if ('BANKTRANSFER_QUICKPAY' !== (parseData === null || parseData === void 0 || (_parseData$paymentMet = parseData.paymentMethodInfoView) === null || _parseData$paymentMet === void 0 ? void 0 : _parseData$paymentMet.paymentMethodType)) {
@@ -92,26 +92,25 @@ var handleSessionData = function handleSessionData(originSessionData) {
92
92
  return [parseData !== null && parseData !== void 0 ? parseData : {}, sessionData];
93
93
  };
94
94
  var handleParams = function handleParams(params, _this) {
95
- var _parseData$connectFac;
96
95
  var _params = Object.assign({
97
96
  paymentSessionMetaData: {},
98
- renderDisplayType: DisplayTypeEnum.popup
97
+ renderDisplayType: renderDisplayTypeEnum.popup
99
98
  }, params);
100
99
  var _handleSessionData = handleSessionData(_params.sessionData || (_params === null || _params === void 0 ? void 0 : _params.paymentSessionData)),
101
100
  _handleSessionData2 = _slicedToArray(_handleSessionData, 2),
102
101
  parseData = _handleSessionData2[0],
103
102
  sessionData = _handleSessionData2[1];
104
103
  var componentSign = getComponentSign(parseData);
105
- if (_toConsumableArray(Object.values(ComponentSignEnumV2)).includes(componentSign) && _params.renderDisplayType === DisplayTypeEnum.popup) {
104
+ if (_toConsumableArray(Object.values(ComponentSignEnumV2)).includes(componentSign) && _params.renderDisplayType === renderDisplayTypeEnum.popup) {
106
105
  return Promise.reject({
107
106
  code: ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR.code,
108
107
  message: "unsupported payment method"
109
108
  });
110
109
  }
111
- if (_this.options.product === ProductSceneEnum.ELEMENT_ADDRESS) {
112
- componentSign = ComponentSignEnum.ELEMENT_ADDRESS;
110
+ if (_this.options.product === productSceneEnum.ELEMENT_ADDRESS) {
111
+ componentSign = componentSignEnum.ELEMENT_ADDRESS;
113
112
  }
114
- if (componentSign === ComponentSignEnum.NONE) {
113
+ if (componentSign === componentSignEnum.NONE) {
115
114
  // eslint-disable-next-line prefer-promise-reject-errors
116
115
  return Promise.reject({
117
116
  code: ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR.code,
@@ -125,9 +124,6 @@ var handleParams = function handleParams(params, _this) {
125
124
  }
126
125
  _params.sessionData = sessionData;
127
126
  _params.paymentSessionMetaData = parseData;
128
- if (parseData.paymentSessionConfig.productScene === "ELEMENT_PAYMENT" && parseData !== null && parseData !== void 0 && (_parseData$connectFac = parseData.connectFactor) !== null && _parseData$connectFac !== void 0 && _parseData$connectFac.enableConnect) {
129
- console.log('截断处理payment render数据---------------');
130
- }
131
127
  return Promise.resolve({
132
128
  iframeNodesParams: _params,
133
129
  componentSign: componentSign
@@ -167,7 +163,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
167
163
  selector: selector,
168
164
  renderDisplayType: renderDisplayType
169
165
  }, params);
170
- if (this.options.product !== ProductSceneEnum.ELEMENT_ADDRESS && _params && !_params.sessionData && !(_params !== null && _params !== void 0 && _params.paymentSessionData)) {
166
+ if (this.options.product !== productSceneEnum.ELEMENT_ADDRESS && _params && !_params.sessionData && !(_params !== null && _params !== void 0 && _params.paymentSessionData)) {
171
167
  return Promise.reject(ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR);
172
168
  }
173
169
  if (this.options.networkMode === networkModeEnum.proxy) {
@@ -205,7 +201,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
205
201
  return _pluginAppendIframe.apply(this, arguments);
206
202
  }
207
203
  return pluginAppendIframe;
208
- }() // 保存服务端下发的支付信息,用于下次预加载
204
+ }()
209
205
  }, {
210
206
  key: "savePreviousChannel",
211
207
  value: function savePreviousChannel(iframeNodesParams) {
@@ -239,7 +235,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
239
235
  });
240
236
  }
241
237
  var previousChannel = {
242
- channelType: channelType === ComponentSignEnum.VAULTING_CARD ? ComponentSignEnum.CASHIER_PAYMENT_CARD : channelType,
238
+ channelType: channelType === componentSignEnum.VAULTING_CARD ? componentSignEnum.CASHIER_PAYMENT_CARD : channelType,
243
239
  productSceneVersion: productSceneVersion
244
240
  };
245
241
  localStorage.setItem('antom_checkout_previousChannel', JSON.stringify(previousChannel));
@@ -253,7 +249,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
253
249
  value: function registerBusAbility() {
254
250
  var _this$originOptions,
255
251
  _this3 = this;
256
- BusManager.debugTrace(((_this$originOptions = this.originOptions) === null || _this$originOptions === void 0 ? void 0 : _this$originOptions.environment) !== EnvironmentEnum.prod, this.logger);
252
+ BusManager.debugTrace(((_this$originOptions = this.originOptions) === null || _this$originOptions === void 0 ? void 0 : _this$originOptions.environment) !== environmentEnum.prod, this.logger);
257
253
  BusManager.clear();
258
254
  BusManager.addInterceptor({
259
255
  onPublishException: function onPublishException(message, e) {
@@ -357,7 +353,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
357
353
  this.logger.setComponentStartTime(Date.now());
358
354
  return this.parameterInitAndCheck({
359
355
  params: params,
360
- renderDisplayType: DisplayTypeEnum.popup
356
+ renderDisplayType: renderDisplayTypeEnum.popup
361
357
  }).then(function (_params) {
362
358
  return handleParams(_params, _this5);
363
359
  }).catch(function (error) {
@@ -448,7 +444,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
448
444
  this.logger.setComponentStartTime(Date.now());
449
445
  return this.parameterInitAndCheck({
450
446
  params: params,
451
- renderDisplayType: DisplayTypeEnum.inline,
447
+ renderDisplayType: renderDisplayTypeEnum.inline,
452
448
  selector: selector
453
449
  }).then(function (_params) {
454
450
  return handleParams(_params, _this7);
@@ -481,7 +477,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
481
477
  return Promise.resolve();
482
478
  }
483
479
  var iframeNodesParams = appendParams.iframeNodesParams;
484
- if (this.options.product !== ProductSceneEnum.ELEMENT_ADDRESS) {
480
+ if (this.options.product !== productSceneEnum.ELEMENT_ADDRESS) {
485
481
  this.savePreviousChannel(iframeNodesParams);
486
482
  }
487
483
  return this.pluginAppendIframe(appendParams);
@@ -1,5 +1,5 @@
1
- import { IcreatePaymentParams, IOptionsParams } from '../../types';
2
- export declare const mixinDropInConstructor: (options: IOptionsParams, context: any) => void;
1
+ import { IcreatePaymentParams, IoptionsParams } from '../../types';
2
+ export declare const mixinDropInConstructor: (options: IoptionsParams, context: any) => void;
3
3
  /**
4
4
  * @description Create checkout application
5
5
  * @description drop-in
@@ -11,7 +11,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  /* eslint-disable @typescript-eslint/no-explicit-any */
12
12
  import { BASEPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
13
13
  import CheckoutApp from "../../plugin/drop-in";
14
- import { MessageName, networkModeEnum } from "../../types";
14
+ import { messageName, networkModeEnum } from "../../types";
15
15
  import { createIframeNode } from "../../util/createIframeNode";
16
16
  export var mixinDropInConstructor = function mixinDropInConstructor(options, context) {
17
17
  // Instantiate the plug-in and set render
@@ -57,7 +57,7 @@ export var confirmPayment = function confirmPayment(result) {
57
57
  });
58
58
  });
59
59
  _this2.eventCenter.emit("".concat(BASEPLUGINID, "-handleRequestPayment"), {
60
- name: MessageName.SDK_TO_APP,
60
+ name: messageName.SDK_TO_APP,
61
61
  mode: _this2.options.mode,
62
62
  appId: BASEPLUGINID,
63
63
  instanceId: _this2._instanceId,
@@ -5,15 +5,15 @@
5
5
  * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
6
6
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
7
7
  */
8
- import { ComponentActionNamesType } from "../../plugin/type";
8
+ import { ComponentActionNamesType } from 'src/plugin/type';
9
9
  import ComponentApp from '../../plugin/component';
10
- import type { AMSCheckoutOptions, IAppendParams, InitSecurityConfig, IOptionsParams } from '../../types/index';
10
+ import type { AMSCheckoutOptions, IAppendParams, InitSecurityConfig, IoptionsParams } from '../../types/index';
11
11
  import { EventCenter } from '../../util/index';
12
12
  import { Logger } from '../../util/logger';
13
- import { Security } from '../../foundation/service/security/security';
13
+ import { Security } from '../../util/security';
14
14
  export default class AMSSDK {
15
15
  options: AMSCheckoutOptions;
16
- originOptions: IOptionsParams;
16
+ originOptions: IoptionsParams;
17
17
  logger: Logger;
18
18
  _eventCenter: EventCenter;
19
19
  _instanceId: string;
@@ -22,7 +22,7 @@ export default class AMSSDK {
22
22
  _componentApp: ComponentApp;
23
23
  protected securitySdkMap: Map<string, Security>;
24
24
  protected plugins: Map<string, any>;
25
- constructor(options: IOptionsParams);
25
+ constructor(options: IoptionsParams);
26
26
  private preInitSecurity;
27
27
  /**
28
28
  * @description Destroy and process some contents of the plug-in
@@ -24,11 +24,11 @@ import { v4 as uuid } from 'uuid';
24
24
  import { sdkVersion } from "../../config/index";
25
25
  import { ERRORMESSAGE, EVENT } from "../../constant";
26
26
  import { antomConfig } from "../../service";
27
- import { EnvironmentEnum, modeEnum, networkModeEnum, osTypeEnum, ProductSceneEnum, terminalTypeEnum } from "../../types/index";
27
+ import { environmentEnum, modeEnum, networkModeEnum, osTypeEnum, productSceneEnum, terminalTypeEnum } from "../../types/index";
28
28
  import { checkTimeElapsed, device, EventCenter, getOrSetStorageId, getType, queryParse, safeJson } from "../../util/index";
29
29
  import CallApp from "../../util/intl-callapp/es/main";
30
30
  import { LogConfig, Logger } from "../../util/logger";
31
- import { getSecurityConfigStorageKey, getSecurityHost, getSecurityScene, Security, SecurityRegionEnum } from "../../foundation/service/security/security";
31
+ import { getSecurityConfigStorageKey, getSecurityHost, getSecurityScene, Security, SecurityRegionEnum } from "../../util/security";
32
32
  import { compareVersion } from "../../util/versionCompare";
33
33
  import { BusManager, BusMessage } from "../bus";
34
34
  var AMSSDK = /*#__PURE__*/function () {
@@ -61,8 +61,7 @@ var AMSSDK = /*#__PURE__*/function () {
61
61
  this._storageId = _storageId;
62
62
 
63
63
  // TODO Consumption data analysis control parameters
64
- // Move to LoggerService
65
- this.logger = new Logger(LogConfig, ![EnvironmentEnum.prod, EnvironmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment));
64
+ this.logger = new Logger(LogConfig, ![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment));
66
65
  Logger.setInstance(this.logger);
67
66
  this.logger.setMedta({
68
67
  instanceId: this._instanceId
@@ -82,7 +81,7 @@ var AMSSDK = /*#__PURE__*/function () {
82
81
  var _this$options;
83
82
  var antomSDKConfigKey = 'antomSDKConfigKey';
84
83
  var config = safeJson(getOrSetStorageId(antomSDKConfigKey), {});
85
- if (![EnvironmentEnum.prod, EnvironmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment)) return;
84
+ if (![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment)) return;
86
85
  if (checkTimeElapsed()) {
87
86
  antomConfig({
88
87
  env: this.options.env.environment
@@ -90,7 +89,7 @@ var AMSSDK = /*#__PURE__*/function () {
90
89
  getOrSetStorageId(antomSDKConfigKey, JSON.stringify(res));
91
90
  });
92
91
  }
93
- var product = ((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.product) || ProductSceneEnum.EASY_PAY;
92
+ var product = ((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.product) || productSceneEnum.EASY_PAY;
94
93
  var enable = true;
95
94
  try {
96
95
  var matchingConfig = config['pl_sec'].find(function (item) {
@@ -158,9 +157,9 @@ var AMSSDK = /*#__PURE__*/function () {
158
157
  value: function initSecurity(_ref) {
159
158
  var _this = this;
160
159
  var _ref$product = _ref.product,
161
- product = _ref$product === void 0 ? ProductSceneEnum.EASY_PAY : _ref$product,
160
+ product = _ref$product === void 0 ? productSceneEnum.EASY_PAY : _ref$product,
162
161
  _ref$scene = _ref.scene,
163
- scene = _ref$scene === void 0 ? ProductSceneEnum.EASY_PAY : _ref$scene;
162
+ scene = _ref$scene === void 0 ? productSceneEnum.EASY_PAY : _ref$scene;
164
163
  this.logger.logInfo({
165
164
  title: 'sdk_event_securitySdkPreInit'
166
165
  }, {
@@ -259,7 +258,7 @@ var AMSSDK = /*#__PURE__*/function () {
259
258
  value: function _setEnv(options) {
260
259
  var _queryParse = queryParse(),
261
260
  _moreEnv = _queryParse._moreEnv;
262
- if (options !== null && options !== void 0 && options.environment && !((options === null || options === void 0 ? void 0 : options.environment) in EnvironmentEnum) && _moreEnv !== 'true') {
261
+ if (options !== null && options !== void 0 && options.environment && !((options === null || options === void 0 ? void 0 : options.environment) in environmentEnum) && _moreEnv !== 'true') {
263
262
  console.warn(ERRORMESSAGE.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message);
264
263
  options.environment = 'prod';
265
264
  }
@@ -489,8 +488,8 @@ var AMSSDK = /*#__PURE__*/function () {
489
488
  }
490
489
  actionNames = this._getPlugin(pluginKey);
491
490
  }
492
- if (this.options.product === ProductSceneEnum.ELEMENT_ADDRESS) {
493
- actionNames = this._getPlugin(ProductSceneEnum.ELEMENT_ADDRESS);
491
+ if (this.options.product === productSceneEnum.ELEMENT_ADDRESS) {
492
+ actionNames = this._getPlugin(productSceneEnum.ELEMENT_ADDRESS);
494
493
  }
495
494
  return actionNames;
496
495
  }
package/esm/index.d.ts CHANGED
@@ -1,36 +1,30 @@
1
- import { AddressComponent } from './core/component/address';
2
- import { ElementComponent } from './core/component/element';
3
1
  import { AMSComponent } from './core/component/index';
4
- import { ComponentSignEnum, IcreateComponent, IElementOptions, IoptionsAddressParams, IOptionsParams } from './types';
2
+ import { AddressComponent } from './core/component/address';
3
+ import { IoptionsParams, componentSignEnum, IoptionsAddressParams } from './types';
5
4
  export { AMSCheckoutPage } from './core/component/ckp';
6
5
  export * from './types';
7
6
  export declare class AMSCheckout extends AMSComponent {
8
- constructor(_options: IOptionsParams, channelType?: ComponentSignEnum[], productSceneVersion?: string);
7
+ constructor(_options: IoptionsParams, channelType?: componentSignEnum[], productSceneVersion?: string);
9
8
  }
10
9
  export declare class AMSAutoDebit extends AMSCheckout {
11
- constructor(options: IOptionsParams);
10
+ constructor(options: IoptionsParams);
12
11
  }
13
12
  export declare class AMSAutoDebitPay extends AMSCheckout {
14
- constructor(options: IOptionsParams);
13
+ constructor(options: IoptionsParams);
15
14
  }
16
- export declare class AMSEasyPay {
17
- private core;
18
- constructor(options: IOptionsParams);
19
- createComponent(params: IcreateComponent): void;
15
+ export declare class AMSEasyPay extends AMSCheckout {
16
+ constructor(options: IoptionsParams);
20
17
  }
21
18
  export declare class AMSCashierPayment extends AMSCheckout {
22
- constructor(options: IOptionsParams);
19
+ constructor(options: IoptionsParams);
23
20
  }
24
21
  export declare class AMSVaulting extends AMSCheckout {
25
- constructor(options: IOptionsParams);
22
+ constructor(options: IoptionsParams);
26
23
  }
27
24
  export declare class AntomElement extends AMSCheckout {
28
- constructor(options: IOptionsParams);
25
+ constructor(options: IoptionsParams);
29
26
  }
30
27
  export declare class AddressElement extends AddressComponent {
31
28
  constructor(options: IoptionsAddressParams);
32
29
  }
33
- export declare class Element extends ElementComponent {
34
- constructor(options: IElementOptions);
35
- }
36
30
  export default AMSCheckout;