@alipay/ams-checkout 0.0.1726046231-dev.3 → 0.0.1726046231-dev.6

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.
@@ -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,6 +386,8 @@ 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) {
391
393
  resolve(result);
@@ -410,6 +412,8 @@ export var ElementComponent = /*#__PURE__*/function () {
410
412
  envInfo: {
411
413
  locale: _this4._options.locale
412
414
  },
415
+ timeout: 300000,
416
+ // TODO dev环境接口超时
413
417
  'Operation-Type': 'com.ipay.iexpfront.one.account.query'
414
418
  }).then(function (result) {
415
419
  resolve(result);
@@ -475,7 +479,7 @@ export var ElementComponent = /*#__PURE__*/function () {
475
479
  // 发送初始化数据
476
480
  function sendRenderData() {
477
481
  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;
482
+ 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
483
  var baseData = {
480
484
  originActionQueryResult: this.sdkActionRes,
481
485
  originOneAccountQueryResult: this.oneAccountRes,
@@ -494,7 +498,9 @@ export var ElementComponent = /*#__PURE__*/function () {
494
498
  source: ElementPaymentMethod.CONTAINER_ELEMENT,
495
499
  params: _objectSpread({
496
500
  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
501
+ 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) || {
502
+ theme: ThemeType.Default
503
+ }
498
504
  }, baseData)
499
505
  }
500
506
  }, function () {});
@@ -506,7 +512,7 @@ export var ElementComponent = /*#__PURE__*/function () {
506
512
  params: _objectSpread({
507
513
  prefillValue: this.oneAccountRes.shippings || [],
508
514
  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']
515
+ 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
516
  },
511
517
  configParams: _objectSpread({
512
518
  needEditBackBtn: true,
@@ -522,7 +528,9 @@ export var ElementComponent = /*#__PURE__*/function () {
522
528
  target: ElementPaymentMethod.AUTH_ELEMENT,
523
529
  source: ElementPaymentMethod.CONTAINER_ELEMENT,
524
530
  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
531
+ 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) || {
532
+ theme: ThemeType.Default
533
+ }
526
534
  })
527
535
  }
528
536
  }, function () {});
@@ -582,8 +590,8 @@ export var ElementComponent = /*#__PURE__*/function () {
582
590
  var _this$_options$loadin4;
583
591
  var element = document.querySelector(sdkSelector);
584
592
  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, {
593
+ var _this$_options$onEven4, _this$_options7;
594
+ (_this$_options$onEven4 = (_this$_options7 = this._options).onEventCallback) === null || _this$_options$onEven4 === void 0 || _this$_options$onEven4.call(_this$_options7, {
587
595
  code: EventCallbackCode.Failed,
588
596
  message: 'Unable to obtain selector'
589
597
  });
@@ -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.3",
3
+ "version": "0.0.1726046231-dev.6",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",