@pisell/private-materials 3.4.84 → 3.4.86

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 (61) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  8. package/es/components/eftposPay/component/fail/failCustom.js +17 -12
  9. package/es/components/eftposPay/component/fail/index.js +12 -5
  10. package/es/components/eftposPay/const.d.ts +2 -0
  11. package/es/components/eftposPay/const.js +1 -0
  12. package/es/components/eftposPay/hooks.d.ts +1 -0
  13. package/es/components/eftposPay/hooks.js +12 -0
  14. package/es/components/eftposPay/index.js +5 -1
  15. package/es/components/eftposPay/linkly/const.js +1 -1
  16. package/es/components/eftposPay/payo/config.js +1 -0
  17. package/es/components/eftposPay/payo/const.js +1 -1
  18. package/es/components/eftposPay/store/index.d.ts +3 -0
  19. package/es/components/eftposPay/tyro/const.js +1 -1
  20. package/es/components/eftposPay/windcave/const.js +1 -1
  21. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  22. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  23. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  24. package/es/components/pay/toC/PaymentMethods/MWCreditCard/List/index.js +32 -16
  25. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +16 -10
  26. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  27. package/es/components/systemSettings/registry/components/ItemModal.js +121 -51
  28. package/es/components/systemSettings/registry/locales.d.ts +9 -0
  29. package/es/components/systemSettings/registry/locales.js +15 -3
  30. package/es/components/systemSettings/registry/types.d.ts +1 -0
  31. package/es/plus/pisellSalesManagement/config/booking.d.ts +0 -1
  32. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  33. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  34. package/lib/components/eftposPay/component/fail/failCustom.js +15 -9
  35. package/lib/components/eftposPay/component/fail/index.js +4 -1
  36. package/lib/components/eftposPay/const.d.ts +2 -0
  37. package/lib/components/eftposPay/const.js +1 -0
  38. package/lib/components/eftposPay/hooks.d.ts +1 -0
  39. package/lib/components/eftposPay/hooks.js +16 -0
  40. package/lib/components/eftposPay/index.js +5 -1
  41. package/lib/components/eftposPay/linkly/const.js +1 -1
  42. package/lib/components/eftposPay/payo/config.js +1 -0
  43. package/lib/components/eftposPay/payo/const.js +1 -1
  44. package/lib/components/eftposPay/store/index.d.ts +3 -0
  45. package/lib/components/eftposPay/tyro/const.js +1 -1
  46. package/lib/components/eftposPay/windcave/const.js +1 -1
  47. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  48. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  49. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  50. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/List/index.js +19 -11
  51. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +21 -22
  52. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  53. package/lib/components/systemSettings/registry/components/ItemModal.js +78 -24
  54. package/lib/components/systemSettings/registry/locales.d.ts +9 -0
  55. package/lib/components/systemSettings/registry/locales.js +15 -3
  56. package/lib/components/systemSettings/registry/types.d.ts +1 -0
  57. package/lib/plus/pisellSalesManagement/config/booking.d.ts +0 -1
  58. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  59. package/lowcode/eco-cup-list/meta.ts +1 -1
  60. package/lowcode/eco-customer-list/meta.ts +1 -1
  61. package/package.json +4 -4
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SendModalValues } from './index';
3
2
  declare const useSendModal: (bookingId?: number) => {
4
3
  open: boolean;
@@ -1,3 +1,9 @@
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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
7
  /* eslint-disable no-nested-ternary */
2
8
  import { locales } from '@pisell/utils';
3
9
  import { useMount } from 'ahooks';
@@ -23,7 +29,8 @@ export default (function (_ref) {
23
29
  order_id = _useContextData.order_id,
24
30
  number = _useContextData.number,
25
31
  device = _useContextData.device,
26
- client = _useContextData.client;
32
+ client = _useContextData.client,
33
+ originalParams = _useContextData.originalParams;
27
34
  var failCustom = custom === null || custom === void 0 ? void 0 : custom.failCustom;
28
35
  var dispatch = useDispatch();
29
36
 
@@ -34,20 +41,18 @@ export default (function (_ref) {
34
41
  */
35
42
  var onRetry = function onRetry() {
36
43
  onChange('page', 'pay');
37
- dispatch(updateState(getInitState(eftpos, mode === ModeEnum.Query ? {
44
+ var params = _objectSpread(_objectSpread({}, originalParams || {}), {}, {
38
45
  mode: mode,
39
46
  name: name,
40
47
  symbol: symbol,
41
48
  amount: amount,
42
49
  order_id: order_id
43
- } : {
44
- mode: mode,
45
- name: name,
46
- symbol: symbol,
47
- amount: amount,
48
- order_id: order_id,
49
- number: ''
50
- })));
50
+ });
51
+ // 非查询模式,清空支付流水号
52
+ if (mode !== ModeEnum.Query) {
53
+ params.number = '';
54
+ }
55
+ dispatch(updateState(getInitState(eftpos, params)));
51
56
  };
52
57
 
53
58
  /**
@@ -56,14 +61,14 @@ export default (function (_ref) {
56
61
  * @Date: 2024-08-20 11:30
57
62
  */
58
63
  var onModify = function onModify() {
59
- dispatch(updateState(getInitState(eftpos, {
64
+ dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, originalParams || {}), {}, {
60
65
  mode: mode,
61
66
  name: name,
62
67
  symbol: symbol,
63
68
  amount: amount,
64
69
  order_id: order_id,
65
70
  number: ''
66
- })));
71
+ }))));
67
72
  onChange('page', 'amount');
68
73
  };
69
74
 
@@ -1,3 +1,9 @@
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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
7
  /* eslint-disable no-nested-ternary */
2
8
  import { locales } from '@pisell/utils';
3
9
  import { Button } from 'antd';
@@ -25,7 +31,8 @@ export default (function (_ref) {
25
31
  order_id = _useContextData.order_id,
26
32
  number = _useContextData.number,
27
33
  device = _useContextData.device,
28
- client = _useContextData.client;
34
+ client = _useContextData.client,
35
+ originalParams = _useContextData.originalParams;
29
36
  var isPosNetworkError = ((_steps$step = steps[step]) === null || _steps$step === void 0 || (_steps$step = _steps$step.custom) === null || _steps$step === void 0 ? void 0 : _steps$step.isPosNetworkError) || false;
30
37
  var dispatch = useDispatch();
31
38
 
@@ -36,14 +43,14 @@ export default (function (_ref) {
36
43
  */
37
44
  var onRetry = function onRetry() {
38
45
  onChange('page', 'pay');
39
- dispatch(updateState(getInitState(eftpos, {
46
+ dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, originalParams || {}), {}, {
40
47
  mode: mode,
41
48
  name: name,
42
49
  symbol: symbol,
43
50
  amount: amount,
44
51
  order_id: order_id,
45
52
  number: ''
46
- })));
53
+ }))));
47
54
  };
48
55
 
49
56
  /**
@@ -52,14 +59,14 @@ export default (function (_ref) {
52
59
  * @Date: 2024-08-20 11:30
53
60
  */
54
61
  var onModify = function onModify() {
55
- dispatch(updateState(getInitState(eftpos, {
62
+ dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, originalParams || {}), {}, {
56
63
  mode: mode,
57
64
  name: name,
58
65
  symbol: symbol,
59
66
  amount: amount,
60
67
  order_id: order_id,
61
68
  number: ''
62
- })));
69
+ }))));
63
70
  onChange('page', 'amount');
64
71
  };
65
72
 
@@ -154,6 +154,8 @@ export declare enum PayStatus {
154
154
  'Unknown' = "701000",
155
155
  /** 交易请求超时 */
156
156
  'Timeout' = "701001",
157
+ /** 支付失败 */
158
+ 'PaymentFailed' = "701002",
157
159
  /** 繁忙 EFTPOS终端暂时不可用,因为EFTPOS正在处理另一个请求。 */
158
160
  'PayOtherEftposFailed' = "701003",
159
161
  /** 购物者没有出示卡片/卡片金额不足/在线拒绝/卡已过期/卡被锁定 */
@@ -68,6 +68,7 @@ export var PayStatus = /*#__PURE__*/function (PayStatus) {
68
68
  PayStatus["PairingFailure"] = "606020";
69
69
  PayStatus["Unknown"] = "701000";
70
70
  PayStatus["Timeout"] = "701001";
71
+ PayStatus["PaymentFailed"] = "701002";
71
72
  PayStatus["PayOtherEftposFailed"] = "701003";
72
73
  PayStatus["PayCardErrorFailed"] = "701004";
73
74
  PayStatus["NoNetWork"] = "701005";
@@ -32,4 +32,5 @@ export declare const useStoreRef: <T extends {
32
32
  */
33
33
  export declare const useFail: (index: number) => (res: {
34
34
  code?: `${PayStatus}`;
35
+ message?: string;
35
36
  }, isMark?: boolean) => void;
@@ -314,6 +314,18 @@ export var useFail = function useFail(index) {
314
314
  }));
315
315
  return;
316
316
  }
317
+ if (code === PayStatus.PaymentFailed) {
318
+ // 前往错误页 不可标记状态
319
+ steps[index].title = locales.getText('page.eftpos-pay.text.transaction.fail');
320
+ steps[index].fail = (res === null || res === void 0 ? void 0 : res.message) || locales.getText('page.eftpos-pay.text.failed')(modeRef.current);
321
+ steps[index].status = 'fail';
322
+ dispatch(updateSteps(steps));
323
+ dispatch(updateComponent('Fail'));
324
+ dispatch(updateCustom({
325
+ errorStatus: 'know' // unknow know
326
+ }));
327
+ return;
328
+ }
317
329
 
318
330
  // 其他场景前往未知错误页
319
331
  steps[index].title = locales.getText('page.eftpos-pay.text.failed')(modeRef.current);
@@ -114,7 +114,7 @@ export default (function (props) {
114
114
  if (props.source === RestoreEumn.Restore) {
115
115
  return props.params;
116
116
  }
117
- return getInitState(props.type, props.params ? _objectSpread(_objectSpread({
117
+ var initState = getInitState(props.type, props.params ? _objectSpread(_objectSpread({
118
118
  mode: mode
119
119
  }, props.params), {}, {
120
120
  symbol: current
@@ -122,6 +122,10 @@ export default (function (props) {
122
122
  mode: mode,
123
123
  symbol: current
124
124
  });
125
+ // 手动将 originalParams 添加到 State 根级别
126
+ return _objectSpread(_objectSpread({}, initState || {}), {}, {
127
+ originalParams: props.params || {}
128
+ });
125
129
  }, [mode, props.params, props.type, symbol]);
126
130
  var stateRef = useRef(state);
127
131
  useEffect(function () {
@@ -54,7 +54,7 @@ export default (function (params) {
54
54
  status: StatusEnum.Loading,
55
55
  steps: getStep(mode),
56
56
  render: true,
57
- client: client !== 'undefined' ? client : ClientEnum.Merchant,
57
+ client: client !== 'undefined' && client !== undefined ? client : ClientEnum.Merchant,
58
58
  warn: '',
59
59
  custom: other || {}
60
60
  }, typeof net !== 'undefined' ? {
@@ -188,6 +188,7 @@ export var POS = function POS(_ref) {
188
188
  card_reader_type: eftposRef.current,
189
189
  card_reader_id: (_deviceRef$current3 = deviceRef.current) === null || _deviceRef$current3 === void 0 ? void 0 : _deviceRef$current3.id,
190
190
  number: numRef.current,
191
+ original_payment_number: custom === null || custom === void 0 ? void 0 : custom.original_payment_number,
191
192
  pay_param_base64: encodeURIComponent(btoa(encodeURIComponent(JSON.stringify(_objectSpread(_objectSpread({}, dataRef.current), {}, {
192
193
  number: numRef.current
193
194
  })))))
@@ -68,7 +68,7 @@ export default (function (params) {
68
68
  status: StatusEnum.Loading,
69
69
  steps: getStep(mode),
70
70
  render: true,
71
- client: client !== 'undefined' ? client : ClientEnum.Merchant,
71
+ client: client !== 'undefined' && client !== undefined ? client : ClientEnum.Merchant,
72
72
  custom: other || {}
73
73
  }, typeof net !== 'undefined' ? {
74
74
  net: net
@@ -91,6 +91,8 @@ export declare type State = {
91
91
  };
92
92
  backup?: Omit<State, 'backup'>;
93
93
  client: ClientEnum;
94
+ /** 支付原始参数 */
95
+ originalParams?: Record<string, any>;
94
96
  };
95
97
  export declare type Action = {
96
98
  type: EActionTypes;
@@ -344,6 +346,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
344
346
  } | undefined;
345
347
  backup?: Omit<State, "backup"> | undefined;
346
348
  client?: ClientEnum | undefined;
349
+ originalParams?: Record<string, any> | undefined;
347
350
  };
348
351
  };
349
352
  export declare function reducers(state: State, action: Action): State;
@@ -45,7 +45,7 @@ export default (function (params) {
45
45
  status: StatusEnum.Loading,
46
46
  steps: [],
47
47
  render: true,
48
- client: client !== 'undefined' ? client : ClientEnum.Merchant,
48
+ client: client !== 'undefined' && client !== undefined ? client : ClientEnum.Merchant,
49
49
  custom: other || {}
50
50
  }, typeof net !== 'undefined' ? {
51
51
  net: net
@@ -46,7 +46,7 @@ export default (function (params) {
46
46
  status: StatusEnum.Loading,
47
47
  steps: [],
48
48
  render: true,
49
- client: client !== 'undefined' ? client : ClientEnum.Merchant,
49
+ client: client !== 'undefined' && client !== undefined ? client : ClientEnum.Merchant,
50
50
  custom: other ? _objectSpread(_objectSpread({}, other), {}, {
51
51
  list: [],
52
52
  step: StepStatusEnum.Free
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ErrorTip: ({ text }: any) => import("react").JSX.Element;
4
3
  export default ErrorTip;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const WeekItem: (props: any) => import("react").JSX.Element;
4
3
  export default WeekItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare type CalenDateWeekProps = {
4
3
  currentDate: string;
@@ -15,6 +15,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  import React, { useState, useImperativeHandle, forwardRef, useMemo, useContext } from 'react';
16
16
  import { Button } from 'antd';
17
17
  import { locales } from '@pisell/utils';
18
+ import { useDebounceFn } from 'ahooks';
18
19
  import { PisellModal, Iconfont, PisellCheckboxGroup, PisellRow, getBankCardTypeImg, PisellLoading, PisellText } from '@pisell/materials';
19
20
  import classNames from 'classnames';
20
21
  import { Context } from "../../../model";
@@ -126,12 +127,15 @@ var MWCreditCardList = function MWCreditCardList(props, ref) {
126
127
  // 关闭管理卡模式
127
128
  setManage(false);
128
129
 
130
+ // 重置确认按钮loading状态
131
+ setOkLoading(false);
132
+
129
133
  // 选中第一个卡
130
134
  setCurrentCard(0);
131
135
 
132
136
  // 异步 获取信用卡列表
133
137
  _getCreditCardList();
134
- case 6:
138
+ case 7:
135
139
  case "end":
136
140
  return _context2.stop();
137
141
  }
@@ -266,21 +270,32 @@ var MWCreditCardList = function MWCreditCardList(props, ref) {
266
270
  * @Author: zhiwei.Wang
267
271
  * @Date: 2024-08-16 11:11
268
272
  */
269
- var onOk = function onOk() {
270
- var _props$onChange;
271
- // 管理卡模式下, 则执行删除卡操作
272
- if (manage) {
273
- setManage(false);
274
- handleBatchDeleteCards();
275
- return;
276
- }
273
+ // 确认按钮loading状态
274
+ var _useState13 = useState(false),
275
+ _useState14 = _slicedToArray(_useState13, 2),
276
+ okLoading = _useState14[0],
277
+ setOkLoading = _useState14[1];
278
+ var _useDebounceFn = useDebounceFn(function () {
279
+ var _props$onChange;
280
+ // 管理卡模式下, 则执行删除卡操作
281
+ if (manage) {
282
+ setManage(false);
283
+ handleBatchDeleteCards();
284
+ return;
285
+ }
277
286
 
278
- // 否则回调到外部
279
- var cur = creditCardList.find(function (d) {
280
- return d.id === currentCard;
281
- });
282
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, cur);
283
- };
287
+ // 展示loading, 防止重复点击
288
+ setOkLoading(true);
289
+
290
+ // 否则回调到外部
291
+ var cur = creditCardList.find(function (d) {
292
+ return d.id === currentCard;
293
+ });
294
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, cur);
295
+ }, {
296
+ wait: 300
297
+ }),
298
+ onOk = _useDebounceFn.run;
284
299
 
285
300
  // 渲染列表
286
301
  var renderList = useMemo(function () {
@@ -330,7 +345,8 @@ var MWCreditCardList = function MWCreditCardList(props, ref) {
330
345
  okText: manage ? locales.getText('tocPay.text.done') : okText,
331
346
  onOk: onOk,
332
347
  okButtonProps: {
333
- disabled: !currentCard
348
+ disabled: !currentCard,
349
+ loading: okLoading
334
350
  },
335
351
  bodyStyle: {
336
352
  padding: 24
@@ -367,15 +367,7 @@ export var createThreeDSMethodIframe = /*#__PURE__*/function () {
367
367
  timer = null; // 返回promise
368
368
  return _context3.abrupt("return", new Promise(function (res, rej) {
369
369
  var _threeDSMethodData$pa7;
370
- // 10秒内没有成功则走N逻辑
371
- timer = setTimeout(function () {
372
- res(defaultReturnParams);
373
- log({
374
- msg: '第三步: 10秒超时则走N逻辑',
375
- data: threeDSMethodData
376
- });
377
- }, (threeDSMethodData === null || threeDSMethodData === void 0 || (_threeDSMethodData$pa7 = threeDSMethodData.pay_info) === null || _threeDSMethodData$pa7 === void 0 ? void 0 : _threeDSMethodData$pa7.tdsMethodTimeoutMS) || 10000);
378
- window.addEventListener('message', function (event) {
370
+ var handleMessage = function handleMessage(event) {
379
371
  // 判断域名
380
372
  if (event.origin.indexOf(postmessageUrl) !== -1 || event.origin.indexOf('securesuite') !== -1) {
381
373
  // 返回 threeDSServerTransID 则 res
@@ -388,6 +380,8 @@ export var createThreeDSMethodIframe = /*#__PURE__*/function () {
388
380
  if (timer) {
389
381
  clearTimeout(timer);
390
382
  }
383
+ // 移除监听器,防止重复触发
384
+ window.removeEventListener('message', handleMessage);
391
385
  // 10秒内成功则走Y逻辑
392
386
  res({
393
387
  threeDSServerTransID: event.data.threeDSServerTransID,
@@ -395,7 +389,19 @@ export var createThreeDSMethodIframe = /*#__PURE__*/function () {
395
389
  });
396
390
  }
397
391
  }
398
- }, false);
392
+ };
393
+
394
+ // 10秒内没有成功则走N逻辑
395
+ timer = setTimeout(function () {
396
+ // 超时也要移除监听器
397
+ window.removeEventListener('message', handleMessage);
398
+ res(defaultReturnParams);
399
+ log({
400
+ msg: '第三步: 10秒超时则走N逻辑',
401
+ data: threeDSMethodData
402
+ });
403
+ }, (threeDSMethodData === null || threeDSMethodData === void 0 || (_threeDSMethodData$pa7 = threeDSMethodData.pay_info) === null || _threeDSMethodData$pa7 === void 0 ? void 0 : _threeDSMethodData$pa7.tdsMethodTimeoutMS) || 10000);
404
+ window.addEventListener('message', handleMessage, false);
399
405
  }));
400
406
  case 28:
401
407
  case "end":
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Empty: (props: any) => import("react").JSX.Element;
4
3
  export default Empty;