@alipay/ams-checkout 1.5.9 → 1.5.10

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.
@@ -10,8 +10,8 @@ export var marmotMap = {
10
10
  dev: 'http://page.alipay.net/page/antom-web-checkout/src/component-app',
11
11
  sit: 'http://page.test.alipay.net/page/antom-web-checkout/src/component-app',
12
12
  pre: 'https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app',
13
- sandbox: 'https://cdn.marmot-cloud.com/page/antom-web-checkout/src/component-app',
14
- light_sandbox: 'https://cdn.marmot-cloud.com/page/antom-web-checkout/src/component-app',
15
- prod: 'https://cdn.marmot-cloud.com/page/antom-web-checkout/src/component-app'
13
+ sandbox: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app',
14
+ light_sandbox: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app',
15
+ prod: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app'
16
16
  };
17
17
  export var sdkVersion = json.version;
@@ -18,7 +18,10 @@ export declare const getIframeUrl: (iframeParams: {
18
18
  locale: string;
19
19
  instanceId: string;
20
20
  renderDisplayType: renderDisplayTypeEnum;
21
- }) => string;
21
+ }) => {
22
+ path: string;
23
+ locationSearch: string;
24
+ };
22
25
  /**
23
26
  * @description Create iframe
24
27
  */
@@ -99,7 +99,10 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
99
99
  if (environment === 'sandbox' || _sandbox === 'true') urlParams.shadow = 'true';
100
100
  if (_displayType) urlParams.displayType = _displayType;
101
101
  var locationSearch = serialize(urlParams);
102
- return "".concat(path, "?").concat(locationSearch);
102
+ return {
103
+ path: path,
104
+ locationSearch: locationSearch
105
+ };
103
106
  };
104
107
 
105
108
  /**
@@ -19,7 +19,7 @@ export default class ComponentApp {
19
19
  private _actionQueryPromise;
20
20
  private _renderParams;
21
21
  private _componentSign;
22
- private _clickEventName;
22
+ private _appLocationSearch;
23
23
  private _renderDisplayType;
24
24
  constructor();
25
25
  /**
@@ -14,12 +14,11 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
14
14
  * 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
15
15
  * 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.
16
16
  */
17
- /* eslint-disable no-console */
18
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
19
18
  import { marmotMap } from "../../config/index";
20
19
  import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID } from "../../constant";
21
20
  import { queryPaymentInfo } from "../../service";
22
- import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, renderDisplayTypeEnum, SecuritySceneEnum, targetEnum, RedirectType } from "../../types";
21
+ import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, RedirectType, renderDisplayTypeEnum, SecuritySceneEnum, targetEnum } from "../../types";
23
22
  import { getType, isJsonString, isPC } from "../../util";
24
23
  import { isLocalMock } from "../../util/mock";
25
24
  import { getApdidToken, getAppname, getSecurityHost, initSecuritySDK } from "../../util/security";
@@ -47,7 +46,7 @@ var ComponentApp = /*#__PURE__*/function () {
47
46
  _defineProperty(this, "_actionQueryPromise", null);
48
47
  _defineProperty(this, "_renderParams", null);
49
48
  _defineProperty(this, "_componentSign", componentSignEnum.NONE);
50
- _defineProperty(this, "_clickEventName", void 0);
49
+ _defineProperty(this, "_appLocationSearch", void 0);
51
50
  _defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
52
51
  this._appVersion = '1.5.9';
53
52
  this._isInitComponent = false;
@@ -56,8 +55,8 @@ var ComponentApp = /*#__PURE__*/function () {
56
55
  return Promise.resolve();
57
56
  };
58
57
  this.platform = isPC() ? platformEnum.desktop : platformEnum.mobile;
59
- this._clickEventName = this.platform === platformEnum.mobile ? 'touchend' : 'click';
60
58
  this._isRetention = true;
59
+ this._appLocationSearch = '';
61
60
  this._performanceData.push({
62
61
  key: 'sdk_init',
63
62
  value: Date.now()
@@ -479,17 +478,21 @@ var ComponentApp = /*#__PURE__*/function () {
479
478
  extendInfo: extendInfo
480
479
  });
481
480
  this.app = createIframe(this.AMSSDK.options.mode, this.platform);
482
- this.app.src = getIframeUrl({
483
- renderDisplayType: renderParams.renderDisplayType,
484
- componentSign: this._componentSign,
485
- analytics: this.AMSSDK.options.analytics,
486
- productSceneVersion: productSceneVersion,
487
- environment: environment,
488
- appVersion: this._appVersion,
489
- extendInfo: extendInfo,
490
- locale: this.AMSSDK.options.locale,
491
- instanceId: this.AMSSDK._instanceId
492
- });
481
+ var _getIframeUrl = getIframeUrl({
482
+ renderDisplayType: renderParams.renderDisplayType,
483
+ componentSign: this._componentSign,
484
+ analytics: this.AMSSDK.options.analytics,
485
+ productSceneVersion: productSceneVersion,
486
+ environment: environment,
487
+ appVersion: this._appVersion,
488
+ extendInfo: extendInfo,
489
+ locale: this.AMSSDK.options.locale,
490
+ instanceId: this.AMSSDK._instanceId
491
+ }),
492
+ path = _getIframeUrl.path,
493
+ locationSearch = _getIframeUrl.locationSearch;
494
+ this._appLocationSearch = locationSearch;
495
+ this.app.src = "".concat(path, "?").concat(locationSearch);
493
496
 
494
497
  // Subscribe to messages from iframe
495
498
  this.addEventListener();
@@ -535,7 +538,7 @@ var ComponentApp = /*#__PURE__*/function () {
535
538
  var _this$_renderParams3;
536
539
  this._threedData = data;
537
540
  var sessionData = encodeURIComponent((_this$_renderParams3 = this._renderParams) === null || _this$_renderParams3 === void 0 ? void 0 : _this$_renderParams3.sessionData);
538
- var threedPageUrl = "".concat(marmotMap[this.AMSSDK.options.env.environment], "/threedPage/index.html?scene=threedWrapperPage&sessionData=").concat(sessionData, "&instanceId=").concat(this.AMSSDK._instanceId);
541
+ var threedPageUrl = "".concat(marmotMap[this.AMSSDK.options.env.environment], "/threedPage/index.html?scene=threedWrapperPage&sessionData=").concat(sessionData, "&").concat(this._appLocationSearch);
539
542
  this.popupWindow = createModal({
540
543
  device: this.platform,
541
544
  url: threedPageUrl