@alipay/ams-checkout 0.0.1726046231-dev.4 → 0.0.1726046231-dev.7

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.
@@ -47,7 +47,7 @@ export var ElementAddressComponent = /*#__PURE__*/function () {
47
47
  key: "update",
48
48
  value: function update() {
49
49
  if (this.elementContainer) {
50
- this.elementContainer.style.display = 'initial';
50
+ this.elementContainer.style.display = '';
51
51
  }
52
52
  // 下发数据
53
53
  }
@@ -22,7 +22,7 @@ import { parseSessionData } from "../index";
22
22
  import { ElementAddressComponent } from "./components/address";
23
23
  import { ElementAuthComponent } from "./components/auth";
24
24
  import { ElementPaymentComponent } from "./components/payment";
25
- import { addressTheme } from "./type";
25
+ import { addressTheme, ThemeType } from "./type";
26
26
  var ElementProcessor = /*#__PURE__*/function () {
27
27
  function ElementProcessor() {
28
28
  _classCallCheck(this, ElementProcessor);
@@ -200,7 +200,7 @@ export var ElementComponent = /*#__PURE__*/function () {
200
200
  envInfo: {
201
201
  locale: _this._options.locale
202
202
  },
203
- timeout: 30000,
203
+ timeout: 300000,
204
204
  // TODO dev环境submit提交接口超时
205
205
  'Operation-Type': 'com.ipay.iexpcashier.cashier.submitPayByPaymentSession'
206
206
  }).then(function (result) {
@@ -386,8 +386,17 @@ export var ElementComponent = /*#__PURE__*/function () {
386
386
  locale: _this3._options.locale
387
387
  },
388
388
  hostSign: hostSign,
389
+ timeout: 300000,
390
+ // TODO dev环境接口超时
389
391
  'Operation-Type': 'com.ipay.iexpcashier.sdkAction.query'
390
392
  }).then(function (result) {
393
+ if (!result.success) {
394
+ var _this3$_options$onEve, _this3$_options;
395
+ (_this3$_options$onEve = (_this3$_options = _this3._options).onEventCallback) === null || _this3$_options$onEve === void 0 || _this3$_options$onEve.call(_this3$_options, {
396
+ code: EventCallbackCode.Failed,
397
+ message: 'sdkAction.query Request Error'
398
+ });
399
+ }
391
400
  resolve(result);
392
401
  });
393
402
  });
@@ -410,6 +419,8 @@ export var ElementComponent = /*#__PURE__*/function () {
410
419
  envInfo: {
411
420
  locale: _this4._options.locale
412
421
  },
422
+ timeout: 300000,
423
+ // TODO dev环境接口超时
413
424
  'Operation-Type': 'com.ipay.iexpfront.one.account.query'
414
425
  }).then(function (result) {
415
426
  resolve(result);
@@ -475,7 +486,7 @@ export var ElementComponent = /*#__PURE__*/function () {
475
486
  // 发送初始化数据
476
487
  function sendRenderData() {
477
488
  if (this.launchSource.length === this.componentsCount && this.sdkActionRes && this.oneAccountRes) {
478
- var _this$_options$loadin, _this$mountOptions, _this$mountOptions2, _this$mountOptions3, _this$mountOptions4, _this$paymentBase, _this$addressBase, _this$authBase;
489
+ var _this$_options$loadin, _this$mountOptions, _this$_options4, _this$mountOptions2, _this$_options5, _this$mountOptions3, _this$mountOptions4, _this$_options6, _this$paymentBase, _this$addressBase, _this$authBase;
479
490
  var baseData = {
480
491
  originActionQueryResult: this.sdkActionRes,
481
492
  originOneAccountQueryResult: this.oneAccountRes,
@@ -494,7 +505,9 @@ export var ElementComponent = /*#__PURE__*/function () {
494
505
  source: ElementPaymentMethod.CONTAINER_ELEMENT,
495
506
  params: _objectSpread({
496
507
  queryResult: this.sdkActionRes,
497
- appearance: ((_this$mountOptions = this.mountOptions) === null || _this$mountOptions === void 0 || (_this$mountOptions = _this$mountOptions[ElementPaymentMethod.PAYMENT_ELEMENT]) === null || _this$mountOptions === void 0 ? void 0 : _this$mountOptions.appearance) || this._options.appearance
508
+ appearance: ((_this$mountOptions = this.mountOptions) === null || _this$mountOptions === void 0 || (_this$mountOptions = _this$mountOptions[ElementPaymentMethod.PAYMENT_ELEMENT]) === null || _this$mountOptions === void 0 ? void 0 : _this$mountOptions.appearance) || ((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.appearance) || {
509
+ theme: ThemeType.Default
510
+ }
498
511
  }, baseData)
499
512
  }
500
513
  }, function () {});
@@ -506,7 +519,7 @@ export var ElementComponent = /*#__PURE__*/function () {
506
519
  params: _objectSpread({
507
520
  prefillValue: this.oneAccountRes.shippings || [],
508
521
  appearance: {
509
- themeType: addressTheme[((_this$mountOptions2 = this.mountOptions) === null || _this$mountOptions2 === void 0 || (_this$mountOptions2 = _this$mountOptions2[ElementPaymentMethod.ADDRESS_ELEMENT]) === null || _this$mountOptions2 === void 0 || (_this$mountOptions2 = _this$mountOptions2.appearance) === null || _this$mountOptions2 === void 0 ? void 0 : _this$mountOptions2.theme) || this._options.appearance.theme || 'light']
522
+ themeType: addressTheme[((_this$mountOptions2 = this.mountOptions) === null || _this$mountOptions2 === void 0 || (_this$mountOptions2 = _this$mountOptions2[ElementPaymentMethod.ADDRESS_ELEMENT]) === null || _this$mountOptions2 === void 0 || (_this$mountOptions2 = _this$mountOptions2.appearance) === null || _this$mountOptions2 === void 0 ? void 0 : _this$mountOptions2.theme) || ((_this$_options5 = this._options) === null || _this$_options5 === void 0 || (_this$_options5 = _this$_options5.appearance) === null || _this$_options5 === void 0 ? void 0 : _this$_options5.theme) || ThemeType.Default]
510
523
  },
511
524
  configParams: _objectSpread({
512
525
  needEditBackBtn: true,
@@ -522,7 +535,9 @@ export var ElementComponent = /*#__PURE__*/function () {
522
535
  target: ElementPaymentMethod.AUTH_ELEMENT,
523
536
  source: ElementPaymentMethod.CONTAINER_ELEMENT,
524
537
  params: _objectSpread(_objectSpread({}, baseData), {}, {
525
- appearance: ((_this$mountOptions4 = this.mountOptions) === null || _this$mountOptions4 === void 0 || (_this$mountOptions4 = _this$mountOptions4[ElementPaymentMethod.AUTH_ELEMENT]) === null || _this$mountOptions4 === void 0 ? void 0 : _this$mountOptions4.appearance) || this._options.appearance
538
+ appearance: ((_this$mountOptions4 = this.mountOptions) === null || _this$mountOptions4 === void 0 || (_this$mountOptions4 = _this$mountOptions4[ElementPaymentMethod.AUTH_ELEMENT]) === null || _this$mountOptions4 === void 0 ? void 0 : _this$mountOptions4.appearance) || ((_this$_options6 = this._options) === null || _this$_options6 === void 0 ? void 0 : _this$_options6.appearance) || {
539
+ theme: ThemeType.Default
540
+ }
526
541
  })
527
542
  }
528
543
  }, function () {});
@@ -553,9 +568,12 @@ export var ElementComponent = /*#__PURE__*/function () {
553
568
  _this6 = this;
554
569
  this.mountOptions[ElementPaymentMethod.AUTH_ELEMENT] = renderOptions;
555
570
  var _selector = sdkSelector.indexOf('#') === 0 ? sdkSelector.slice(1) : sdkSelector;
571
+ var link = renderOptions === null || renderOptions === void 0 || (_renderOptions$debugP = renderOptions.debugProps) === null || _renderOptions$debugP === void 0 ? void 0 : _renderOptions$debugP.localLink;
572
+ var params = window.location.href.split('?')[1];
573
+ var url = link.indexOf('?') === -1 ? "".concat(link, "?").concat(params) : link;
556
574
  this.authBase.mount({
557
575
  selector: _selector,
558
- url: renderOptions === null || renderOptions === void 0 || (_renderOptions$debugP = renderOptions.debugProps) === null || _renderOptions$debugP === void 0 ? void 0 : _renderOptions$debugP.localLink
576
+ url: url
559
577
  }).then(function (result) {
560
578
  if (!result) {
561
579
  var _this6$_options$onEve, _this6$_options;
@@ -582,8 +600,8 @@ export var ElementComponent = /*#__PURE__*/function () {
582
600
  var _this$_options$loadin4;
583
601
  var element = document.querySelector(sdkSelector);
584
602
  if (!element) {
585
- var _this$_options$onEven4, _this$_options4;
586
- (_this$_options$onEven4 = (_this$_options4 = this._options).onEventCallback) === null || _this$_options$onEven4 === void 0 || _this$_options$onEven4.call(_this$_options4, {
603
+ var _this$_options$onEven4, _this$_options7;
604
+ (_this$_options$onEven4 = (_this$_options7 = this._options).onEventCallback) === null || _this$_options$onEven4 === void 0 || _this$_options$onEven4.call(_this$_options7, {
587
605
  code: EventCallbackCode.Failed,
588
606
  message: 'Unable to obtain selector'
589
607
  });
@@ -4,15 +4,15 @@ interface BaseMountOptions<T = void> {
4
4
  }
5
5
  export declare enum ThemeType {
6
6
  NostalgicGray = "nostalgicGray",
7
- Light = "light",
7
+ Default = "default",
8
8
  Night = "night",
9
9
  CherryBlossomPink = "cherryBlossomPink",
10
10
  GamingPurple = "gamingPurple",
11
11
  AgateGreen = "agateGreen"
12
12
  }
13
13
  export declare const addressTheme: {
14
+ default: string;
14
15
  night: string;
15
- light: string;
16
16
  };
17
17
  export declare enum EventCallbackCode {
18
18
  Failed = "Failed",
@@ -24,7 +24,7 @@ export interface IElementOptions {
24
24
  locale?: string;
25
25
  mode?: string;
26
26
  appearance?: {
27
- theme: ThemeType.Light | ThemeType.Night;
27
+ theme: ThemeType.Default | ThemeType.Night;
28
28
  };
29
29
  onEventCallback?: ({ code, message }: {
30
30
  code: EventCallbackCode;
@@ -50,7 +50,7 @@ export interface AddressMountOptions extends BaseMountOptions<{
50
50
  }> {
51
51
  type: 'address';
52
52
  appearance?: {
53
- theme: ThemeType.Light | ThemeType.Night;
53
+ theme: ThemeType.Default | ThemeType.Night;
54
54
  };
55
55
  debugProps?: {
56
56
  localLink: string;
@@ -1,16 +1,17 @@
1
+ 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); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
1
5
  export var ThemeType = /*#__PURE__*/function (ThemeType) {
2
6
  ThemeType["NostalgicGray"] = "nostalgicGray";
3
- ThemeType["Light"] = "light";
7
+ ThemeType["Default"] = "default";
4
8
  ThemeType["Night"] = "night";
5
9
  ThemeType["CherryBlossomPink"] = "cherryBlossomPink";
6
10
  ThemeType["GamingPurple"] = "gamingPurple";
7
11
  ThemeType["AgateGreen"] = "agateGreen";
8
12
  return ThemeType;
9
13
  }({});
10
- export var addressTheme = {
11
- night: 'NIGHT',
12
- light: 'LIGHT'
13
- };
14
+ export var addressTheme = _defineProperty(_defineProperty({}, ThemeType.Default, 'LIGHT'), ThemeType.Night, 'NIGHT');
14
15
  export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
15
16
  EventCallbackCode["Failed"] = "Failed";
16
17
  EventCallbackCode["Completed"] = "Completed";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1726046231-dev.4",
3
+ "version": "0.0.1726046231-dev.7",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",