@pisell/private-materials 6.8.76 → 6.8.78

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/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/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/checkout/PaymentModal.js +32 -8
  12. package/es/components/checkout/components/PaymentOptionsModule/index.js +1 -1
  13. package/es/components/eftposPay/amount.d.ts +1 -1
  14. package/es/components/eftposPay/app.d.ts +1 -1
  15. package/es/components/eftposPay/app.js +0 -5
  16. package/es/components/eftposPay/component/fail/failCustom.js +12 -16
  17. package/es/components/eftposPay/component/fail/index.js +5 -12
  18. package/es/components/eftposPay/const.d.ts +1 -6
  19. package/es/components/eftposPay/const.js +0 -3
  20. package/es/components/eftposPay/device.d.ts +1 -1
  21. package/es/components/eftposPay/hooks.d.ts +2 -3
  22. package/es/components/eftposPay/hooks.js +0 -12
  23. package/es/components/eftposPay/index.js +1 -5
  24. package/es/components/eftposPay/locales.d.ts +0 -36
  25. package/es/components/eftposPay/locales.js +3 -42
  26. package/es/components/eftposPay/manufacturer.d.ts +0 -1
  27. package/es/components/eftposPay/manufacturer.js +0 -5
  28. package/es/components/eftposPay/pay.js +2 -6
  29. package/es/components/eftposPay/store/index.d.ts +5 -12
  30. package/es/components/kioskSkuDetail/index.d.ts +0 -3
  31. package/es/components/kioskSkuDetail/index.js +173 -266
  32. package/es/components/kioskSkuDetail/index.less +7 -49
  33. package/es/components/kioskSkuDetail/locales.d.ts +0 -6
  34. package/es/components/kioskSkuDetail/locales.js +3 -9
  35. package/es/components/pay/toB/components/EFTPOS/index.js +1 -8
  36. package/es/components/pay/toB/types/index.d.ts +0 -1
  37. package/es/components/pay/toC/PaymentList/serve.js +0 -14
  38. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -7
  39. package/es/plus/skuOptionsSelection/components/VariantCard/index.js +1 -1
  40. package/es/plus/skuOptionsSelection/locales.d.ts +0 -3
  41. package/es/plus/skuOptionsSelection/locales.js +0 -3
  42. package/es/pro/Login2.0/components/LoginCodeInput.js +3 -36
  43. package/es/pro/Login2.0/steps/CodeInput.js +7 -37
  44. package/lib/components/checkout/PaymentModal.js +41 -24
  45. package/lib/components/checkout/components/PaymentOptionsModule/index.js +1 -2
  46. package/lib/components/eftposPay/amount.d.ts +1 -1
  47. package/lib/components/eftposPay/app.d.ts +1 -1
  48. package/lib/components/eftposPay/app.js +0 -5
  49. package/lib/components/eftposPay/component/fail/failCustom.js +9 -15
  50. package/lib/components/eftposPay/component/fail/index.js +1 -4
  51. package/lib/components/eftposPay/const.d.ts +1 -6
  52. package/lib/components/eftposPay/const.js +0 -3
  53. package/lib/components/eftposPay/device.d.ts +1 -1
  54. package/lib/components/eftposPay/hooks.d.ts +2 -3
  55. package/lib/components/eftposPay/hooks.js +0 -16
  56. package/lib/components/eftposPay/index.js +1 -5
  57. package/lib/components/eftposPay/locales.d.ts +0 -36
  58. package/lib/components/eftposPay/locales.js +3 -42
  59. package/lib/components/eftposPay/manufacturer.d.ts +0 -1
  60. package/lib/components/eftposPay/manufacturer.js +0 -7
  61. package/lib/components/eftposPay/pay.js +2 -3
  62. package/lib/components/eftposPay/store/index.d.ts +5 -12
  63. package/lib/components/kioskSkuDetail/index.d.ts +0 -3
  64. package/lib/components/kioskSkuDetail/index.js +113 -180
  65. package/lib/components/kioskSkuDetail/index.less +7 -49
  66. package/lib/components/kioskSkuDetail/locales.d.ts +0 -6
  67. package/lib/components/kioskSkuDetail/locales.js +3 -9
  68. package/lib/components/pay/toB/components/EFTPOS/index.js +1 -8
  69. package/lib/components/pay/toB/types/index.d.ts +0 -1
  70. package/lib/components/pay/toC/PaymentList/serve.js +0 -15
  71. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -7
  72. package/lib/plus/skuOptionsSelection/components/VariantCard/index.js +0 -2
  73. package/lib/plus/skuOptionsSelection/locales.d.ts +0 -3
  74. package/lib/plus/skuOptionsSelection/locales.js +0 -3
  75. package/lib/pro/Login2.0/components/LoginCodeInput.js +4 -26
  76. package/lib/pro/Login2.0/steps/CodeInput.js +5 -27
  77. package/lowcode/kiosk-sku-detail/meta.ts +94 -229
  78. package/package.json +8 -2
  79. package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +0 -7
  80. package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.js +0 -120
  81. package/es/components/eftposPay/aggregatePayment/index.d.ts +0 -3
  82. package/es/components/eftposPay/aggregatePayment/index.js +0 -3
  83. package/es/components/eftposPay/aggregatePayment/service.d.ts +0 -24
  84. package/es/components/eftposPay/aggregatePayment/service.js +0 -69
  85. package/es/components/eftposPay/aggregatePayment/types.d.ts +0 -106
  86. package/es/components/eftposPay/aggregatePayment/types.js +0 -65
  87. package/es/components/eftposPay/aggregatePayment/utils/logs.d.ts +0 -110
  88. package/es/components/eftposPay/aggregatePayment/utils/logs.js +0 -371
  89. package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +0 -139
  90. package/es/components/eftposPay/aggregatePayment/utils/payment.js +0 -1138
  91. package/es/components/eftposPay/huifu/Action.d.ts +0 -8
  92. package/es/components/eftposPay/huifu/Action.js +0 -146
  93. package/es/components/eftposPay/huifu/const.d.ts +0 -5
  94. package/es/components/eftposPay/huifu/const.js +0 -70
  95. package/es/components/eftposPay/huifu/hooks.d.ts +0 -25
  96. package/es/components/eftposPay/huifu/hooks.js +0 -184
  97. package/es/components/eftposPay/huifu/index.d.ts +0 -5
  98. package/es/components/eftposPay/huifu/index.js +0 -196
  99. package/es/components/eftposPay/huifu/index.less +0 -180
  100. package/es/components/eftposPay/huifu/types.d.ts +0 -14
  101. package/es/components/eftposPay/huifu/types.js +0 -1
  102. package/es/pro/skuDetailModal/index.d.ts +0 -5
  103. package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +0 -7
  104. package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.js +0 -133
  105. package/lib/components/eftposPay/aggregatePayment/index.d.ts +0 -3
  106. package/lib/components/eftposPay/aggregatePayment/index.js +0 -42
  107. package/lib/components/eftposPay/aggregatePayment/service.d.ts +0 -24
  108. package/lib/components/eftposPay/aggregatePayment/service.js +0 -81
  109. package/lib/components/eftposPay/aggregatePayment/types.d.ts +0 -106
  110. package/lib/components/eftposPay/aggregatePayment/types.js +0 -74
  111. package/lib/components/eftposPay/aggregatePayment/utils/logs.d.ts +0 -110
  112. package/lib/components/eftposPay/aggregatePayment/utils/logs.js +0 -294
  113. package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +0 -139
  114. package/lib/components/eftposPay/aggregatePayment/utils/payment.js +0 -752
  115. package/lib/components/eftposPay/huifu/Action.d.ts +0 -8
  116. package/lib/components/eftposPay/huifu/Action.js +0 -174
  117. package/lib/components/eftposPay/huifu/const.d.ts +0 -5
  118. package/lib/components/eftposPay/huifu/const.js +0 -86
  119. package/lib/components/eftposPay/huifu/hooks.d.ts +0 -25
  120. package/lib/components/eftposPay/huifu/hooks.js +0 -186
  121. package/lib/components/eftposPay/huifu/index.d.ts +0 -5
  122. package/lib/components/eftposPay/huifu/index.js +0 -200
  123. package/lib/components/eftposPay/huifu/index.less +0 -180
  124. package/lib/components/eftposPay/huifu/types.d.ts +0 -14
  125. package/lib/components/eftposPay/huifu/types.js +0 -17
  126. package/lib/pro/skuDetailModal/index.d.ts +0 -5
@@ -32,6 +32,7 @@ import WalletPassModule from "./components/WalletPassModule";
32
32
  import PaymentOptionsModule, { SHOW_METHODS_CODE } from "./components/PaymentOptionsModule";
33
33
  import CashPaymentModule from "./components/CashPaymentModule";
34
34
  import AdditionalModule from "./components/AdditionalModule";
35
+ import { useOsKey } from "../ticketBooking/context/OsKeyContext";
35
36
  import { closePaymentResultToast, closeAllPaymentResultToasts, setTillButton } from "./components/PaymentResultToast";
36
37
  import { formatCurrency, calculateStatusClassName, calculateAutoCloseConfig, displayPaymentResultToast, createShowSuccessToast } from "./utils/PaymentResultToastUtils";
37
38
  import { Printer, FileCheck02, RefreshCw05, CreditCard02, MessageTextSquare02, ArrowLeft, DotsVertical } from '@pisell/icon';
@@ -147,6 +148,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
147
148
  _useState16 = _slicedToArray(_useState15, 2),
148
149
  paymentOptionsTitle = _useState16[0],
149
150
  setPaymentOptionsTitle = _useState16[1];
151
+ var osKey = useOsKey();
150
152
  var paymentOptionList = useMemo(function () {
151
153
  return paymentMethods.filter(function (item) {
152
154
  return !(item.type === 'app' && item.code === 'EFTPOS_LINKLY') && (['custom'].includes(item.type) || SHOW_METHODS_CODE.includes(item.code));
@@ -231,7 +233,11 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
231
233
  type: 'cash' // cash 不需要验证钱箱权限
232
234
  }
233
235
  });
234
- _context.next = 5;
236
+ if (!(osKey === 'food')) {
237
+ _context.next = 8;
238
+ break;
239
+ }
240
+ _context.next = 6;
235
241
  return checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.addPaymentItemAsync({
236
242
  amount: result.amount,
237
243
  // /** 支付类型,跟支付列表上对应的支付方式保持一致 */
@@ -250,7 +256,26 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
250
256
  voucher_id: 0,
251
257
  rounding_amount: result.roundingAmount
252
258
  });
253
- case 5:
259
+ case 6:
260
+ _context.next = 10;
261
+ break;
262
+ case 8:
263
+ _context.next = 10;
264
+ return checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.addPaymentItemAsync({
265
+ amount: result.amount,
266
+ /** 支付类型,跟支付列表上对应的支付方式保持一致 */
267
+ code: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.code,
268
+ /** 支付类型id,跟支付列表上对应的支付方式保持一致 */
269
+ custom_payment_id: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.id,
270
+ /** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
271
+ name: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.name,
272
+ /** 支付类型type,跟支付列表上对应的支付方式保持一致 */
273
+ type: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.type,
274
+ /** 代金券、充值卡、积分卡等wallet pass id */
275
+ voucher_id: 0,
276
+ rounding_amount: result.roundingAmount
277
+ });
278
+ case 10:
254
279
  case "end":
255
280
  return _context.stop();
256
281
  }
@@ -289,7 +314,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
289
314
  case 2:
290
315
  _ref4 = method || {}, id = _ref4.id, code = _ref4.code, name = _ref4.name, type = _ref4.type;
291
316
  finalAmount = (_method$totalAmount = method.totalAmount) !== null && _method$totalAmount !== void 0 ? _method$totalAmount : customAmount; // 这里需要根据支付方式来判断是 eftpos 还是 mx51
292
- eftposCodes = ['EFTPOS_LINKLY', 'EFTPOS_PAYO', 'EFTPOS_WINDCAVE', 'EFTPOS_TYRO', 'EFTPOS_HUIFU'];
317
+ eftposCodes = ['EFTPOS_LINKLY', 'EFTPOS_PAYO', 'EFTPOS_WINDCAVE', 'EFTPOS_TYRO'];
293
318
  mx51Code = 'EFTPOS';
294
319
  payType = '';
295
320
  if (eftposCodes.includes((method === null || method === void 0 ? void 0 : method.code) || '')) {
@@ -409,9 +434,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
409
434
  orderId: data.orderId,
410
435
  symbol: getData('shop_symbol'),
411
436
  amount: finalAmount,
412
- surcharge: processSurcharge(method.surcharge),
413
- operator_type: 'shop',
414
- platform: 'pos'
437
+ surcharge: processSurcharge(method.surcharge)
415
438
  },
416
439
  mode: 'pay'
417
440
  },
@@ -2451,7 +2474,7 @@ var PaymentModal = function PaymentModal(_ref19) {
2451
2474
  var handleDetailsClick = /*#__PURE__*/function () {
2452
2475
  var _ref31 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
2453
2476
  var _context$appHelper2;
2454
- var _context$appHelper$ut9, isTerminal, isWebPos, NativePage, checkout, orderId;
2477
+ var _context$appHelper$ut9, isTerminal, isWebPos, NativePage, checkout, orderId, nativePage;
2455
2478
  return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2456
2479
  while (1) switch (_context24.prev = _context24.next) {
2457
2480
  case 0:
@@ -2480,7 +2503,8 @@ var PaymentModal = function PaymentModal(_ref19) {
2480
2503
  }));
2481
2504
  case 8:
2482
2505
  if (isWebPos) {
2483
- NativePage.open({
2506
+ nativePage = NativePage === null || NativePage === void 0 ? void 0 : NativePage();
2507
+ nativePage.open({
2484
2508
  page: "/native/order/detail",
2485
2509
  params: {
2486
2510
  order_id: orderId
@@ -10,7 +10,7 @@ import checkoutLocales from "../../locales";
10
10
 
11
11
  // 扩展 PaymentOptionsModule Props 接口
12
12
 
13
- export var SHOW_METHODS_CODE = ['EFTPOS_LINKLY', 'EFTPOS', 'EFTPOS_TYRO', 'EFTPOS_WINDCAVE', 'EFTPOS_PAYO', 'EFTPOS_HUIFU'];
13
+ export var SHOW_METHODS_CODE = ['EFTPOS_LINKLY', 'EFTPOS', 'EFTPOS_TYRO', 'EFTPOS_WINDCAVE', 'EFTPOS_PAYO'];
14
14
  function PaymentOptionsModule(_ref) {
15
15
  var _context$appHelper, _context$appHelper$ge, _context$appHelper$ge2, _context$appHelper$ut;
16
16
  var amountSymbol = _ref.amountSymbol,
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "fail" | "success" | "page" | "print" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PosProps, RouteType } from './const';
3
- declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
3
+ declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "getApi" | "type" | "mode"> & {
4
4
  action: RouteType;
5
5
  device_number: string | number;
6
6
  api: ReturnType<PosProps['getApi']>;
@@ -21,8 +21,6 @@ import { RouteEnum, ClientEnum, RestoreEumn } from "./const";
21
21
  import Device from "./device";
22
22
  import Pay from "./pay";
23
23
  import { useContextData, useDispatch, updateState, updateClient } from "./store";
24
- import useEngineContext from "../../hooks/useEngineContext";
25
- import { request } from "../../utils";
26
24
  var App = function App(_ref) {
27
25
  var action = _ref.action,
28
26
  api = _ref.api,
@@ -44,9 +42,6 @@ var App = function App(_ref) {
44
42
  _useState2 = _slicedToArray(_useState, 2),
45
43
  current = _useState2[0],
46
44
  setCurrent = _useState2[1];
47
- var engineContext = useEngineContext();
48
- var utils = engineContext.appHelper.utils || {};
49
- request.setRequest(utils === null || utils === void 0 ? void 0 : utils.request);
50
45
  var statusRef = useRef(data.status);
51
46
 
52
47
  // 外部网络数据
@@ -1,9 +1,3 @@
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); }
7
1
  /* eslint-disable no-nested-ternary */
8
2
  import { locales } from '@pisell/utils';
9
3
  import { useMount } from 'ahooks';
@@ -29,8 +23,7 @@ export default (function (_ref) {
29
23
  order_id = _useContextData.order_id,
30
24
  number = _useContextData.number,
31
25
  device = _useContextData.device,
32
- client = _useContextData.client,
33
- originalParams = _useContextData.originalParams;
26
+ client = _useContextData.client;
34
27
  var failCustom = custom === null || custom === void 0 ? void 0 : custom.failCustom;
35
28
  var dispatch = useDispatch();
36
29
 
@@ -41,17 +34,20 @@ export default (function (_ref) {
41
34
  */
42
35
  var onRetry = function onRetry() {
43
36
  onChange('page', 'pay');
44
- var params = _objectSpread(_objectSpread({}, originalParams || {}), {}, {
37
+ dispatch(updateState(getInitState(eftpos, mode === ModeEnum.Query ? {
45
38
  mode: mode,
46
39
  name: name,
47
40
  symbol: symbol,
48
41
  amount: amount,
49
42
  order_id: order_id
50
- });
51
- if (mode === ModeEnum.Query) {
52
- params.number = '';
53
- }
54
- dispatch(updateState(getInitState(eftpos, params)));
43
+ } : {
44
+ mode: mode,
45
+ name: name,
46
+ symbol: symbol,
47
+ amount: amount,
48
+ order_id: order_id,
49
+ number: ''
50
+ })));
55
51
  };
56
52
 
57
53
  /**
@@ -60,14 +56,14 @@ export default (function (_ref) {
60
56
  * @Date: 2024-08-20 11:30
61
57
  */
62
58
  var onModify = function onModify() {
63
- dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, originalParams || {}), {}, {
59
+ dispatch(updateState(getInitState(eftpos, {
64
60
  mode: mode,
65
61
  name: name,
66
62
  symbol: symbol,
67
63
  amount: amount,
68
64
  order_id: order_id,
69
65
  number: ''
70
- }))));
66
+ })));
71
67
  onChange('page', 'amount');
72
68
  };
73
69
 
@@ -1,9 +1,3 @@
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); }
7
1
  /* eslint-disable no-nested-ternary */
8
2
  import { locales } from '@pisell/utils';
9
3
  import { Button } from 'antd';
@@ -31,8 +25,7 @@ export default (function (_ref) {
31
25
  order_id = _useContextData.order_id,
32
26
  number = _useContextData.number,
33
27
  device = _useContextData.device,
34
- client = _useContextData.client,
35
- originalParams = _useContextData.originalParams;
28
+ client = _useContextData.client;
36
29
  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;
37
30
  var dispatch = useDispatch();
38
31
 
@@ -43,14 +36,14 @@ export default (function (_ref) {
43
36
  */
44
37
  var onRetry = function onRetry() {
45
38
  onChange('page', 'pay');
46
- dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, originalParams || {}), {}, {
39
+ dispatch(updateState(getInitState(eftpos, {
47
40
  mode: mode,
48
41
  name: name,
49
42
  symbol: symbol,
50
43
  amount: amount,
51
44
  order_id: order_id,
52
45
  number: ''
53
- }))));
46
+ })));
54
47
  };
55
48
 
56
49
  /**
@@ -59,14 +52,14 @@ export default (function (_ref) {
59
52
  * @Date: 2024-08-20 11:30
60
53
  */
61
54
  var onModify = function onModify() {
62
- dispatch(updateState(getInitState(eftpos, _objectSpread(_objectSpread({}, originalParams || {}), {}, {
55
+ dispatch(updateState(getInitState(eftpos, {
63
56
  mode: mode,
64
57
  name: name,
65
58
  symbol: symbol,
66
59
  amount: amount,
67
60
  order_id: order_id,
68
61
  number: ''
69
- }))));
62
+ })));
70
63
  onChange('page', 'amount');
71
64
  };
72
65
 
@@ -7,12 +7,9 @@ export declare enum EftposEnum {
7
7
  /** 后端支付 - 支付 + 退款 */
8
8
  Windcave = "windcave",
9
9
  Stripe = "stripe",
10
- Linkly = "linkly",
11
- /** 汇付天下 */
12
- Huifu = "huifu"
10
+ Linkly = "linkly"
13
11
  }
14
12
  export declare enum StatusEnum {
15
- Init = "init",
16
13
  Loading = "loading",
17
14
  Warn = "warn",
18
15
  Fail = "fail",
@@ -163,8 +160,6 @@ export declare enum PayStatus {
163
160
  'Unknown' = "701000",
164
161
  /** 交易请求超时 */
165
162
  'Timeout' = "701001",
166
- /** 支付失败(汇付天下) */
167
- 'PaymentFailed' = "701002",
168
163
  /** 繁忙 EFTPOS终端暂时不可用,因为EFTPOS正在处理另一个请求。 */
169
164
  'PayOtherEftposFailed' = "701003",
170
165
  /** 购物者没有出示卡片/卡片金额不足/在线拒绝/卡已过期/卡被锁定 */
@@ -4,11 +4,9 @@ export var EftposEnum = /*#__PURE__*/function (EftposEnum) {
4
4
  EftposEnum["Windcave"] = "windcave";
5
5
  EftposEnum["Stripe"] = "stripe";
6
6
  EftposEnum["Linkly"] = "linkly";
7
- EftposEnum["Huifu"] = "huifu";
8
7
  return EftposEnum;
9
8
  }({});
10
9
  export var StatusEnum = /*#__PURE__*/function (StatusEnum) {
11
- StatusEnum["Init"] = "init";
12
10
  StatusEnum["Loading"] = "loading";
13
11
  StatusEnum["Warn"] = "warn";
14
12
  StatusEnum["Fail"] = "fail";
@@ -70,7 +68,6 @@ export var PayStatus = /*#__PURE__*/function (PayStatus) {
70
68
  PayStatus["PairingFailure"] = "606020";
71
69
  PayStatus["Unknown"] = "701000";
72
70
  PayStatus["Timeout"] = "701001";
73
- PayStatus["PaymentFailed"] = "701002";
74
71
  PayStatus["PayOtherEftposFailed"] = "701003";
75
72
  PayStatus["PayCardErrorFailed"] = "701004";
76
73
  PayStatus["NoNetWork"] = "701005";
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "fail" | "success" | "page" | "print" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "init" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "warn" | "fail" | "success" | "pedding" | "resove" | "reject" | "question">;
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly" | "huifu">;
22
+ readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -32,5 +32,4 @@ export declare const useStoreRef: <T extends {
32
32
  */
33
33
  export declare const useFail: (index: number) => (res: {
34
34
  code?: `${PayStatus}`;
35
- message?: string;
36
35
  }, isMark?: boolean) => void;
@@ -314,18 +314,6 @@ 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
- }
329
317
 
330
318
  // 其他场景前往未知错误页
331
319
  steps[index].title = locales.getText('page.eftpos-pay.text.failed')(modeRef.current);
@@ -119,7 +119,7 @@ export default (function (props) {
119
119
  if (props.source === RestoreEumn.Restore) {
120
120
  return props.params;
121
121
  }
122
- var initState = getInitState(props.type, props.params ? _objectSpread(_objectSpread({
122
+ return getInitState(props.type, props.params ? _objectSpread(_objectSpread({
123
123
  mode: mode
124
124
  }, props.params), {}, {
125
125
  symbol: current
@@ -127,10 +127,6 @@ export default (function (props) {
127
127
  mode: mode,
128
128
  symbol: current
129
129
  });
130
- // 手动将 originalParams 添加到 State 根级别
131
- return _objectSpread(_objectSpread({}, initState), {}, {
132
- originalParams: props.params || undefined
133
- });
134
130
  }, [mode, props.params, props.type, symbol]);
135
131
  var stateRef = useRef(state);
136
132
  useEffect(function () {
@@ -107,18 +107,6 @@ declare const _default: {
107
107
  'page.eftpos-pay.text.not.connected': string;
108
108
  'page.eftpos-pay.text.tyro-btn': (key: string) => string;
109
109
  'page.eftpos-pay.text.tyro': (key: string) => string;
110
- 'page.eftpos-pay.text.huifu.scan.title': string;
111
- 'page.eftpos-pay.text.huifu.scan.gun.connected': string;
112
- 'page.eftpos-pay.text.huifu.scan.gun.connected-desc': string;
113
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected': string;
114
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': string;
115
- 'page.eftpos-pay.text.huifu.scan.camera-title': string;
116
- 'page.eftpos-pay.text.huifu.scan.camera-desc': string;
117
- 'page.eftpos-pay.text.huifu.scan.input-title': string;
118
- 'page.eftpos-pay.text.huifu.scan.input-placeholder': string;
119
- 'page.eftpos-pay.text.huifu.scan.input-tip': string;
120
- 'page.eftpos-pay.text.huifu.scan.cancel': string;
121
- 'page.eftpos-pay.text.huifu.scan.confirm': string;
122
110
  };
123
111
  'zh-CN': {
124
112
  'page.eftpos-pay.text.loading': (mode: string) => string;
@@ -228,18 +216,6 @@ declare const _default: {
228
216
  'page.eftpos-pay.text.not.connected': string;
229
217
  'page.eftpos-pay.text.tyro-btn': (key: string) => string;
230
218
  'page.eftpos-pay.text.tyro': (key: string) => string | string[];
231
- 'page.eftpos-pay.text.huifu.scan.title': string;
232
- 'page.eftpos-pay.text.huifu.scan.gun.connected': string;
233
- 'page.eftpos-pay.text.huifu.scan.gun.connected-desc': string;
234
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected': string;
235
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': string;
236
- 'page.eftpos-pay.text.huifu.scan.camera-title': string;
237
- 'page.eftpos-pay.text.huifu.scan.camera-desc': string;
238
- 'page.eftpos-pay.text.huifu.scan.input-title': string;
239
- 'page.eftpos-pay.text.huifu.scan.input-placeholder': string;
240
- 'page.eftpos-pay.text.huifu.scan.input-tip': string;
241
- 'page.eftpos-pay.text.huifu.scan.cancel': string;
242
- 'page.eftpos-pay.text.huifu.scan.confirm': string;
243
219
  };
244
220
  'zh-HK': {
245
221
  'page.eftpos-pay.text.loading': (mode: string) => string;
@@ -349,18 +325,6 @@ declare const _default: {
349
325
  'page.eftpos-pay.text.not.connected': string;
350
326
  'page.eftpos-pay.text.tyro-btn': (key: string) => string;
351
327
  'page.eftpos-pay.text.tyro': (key: string) => string | string[];
352
- 'page.eftpos-pay.text.huifu.scan.title': string;
353
- 'page.eftpos-pay.text.huifu.scan.gun.connected': string;
354
- 'page.eftpos-pay.text.huifu.scan.gun.connected-desc': string;
355
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected': string;
356
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': string;
357
- 'page.eftpos-pay.text.huifu.scan.camera-title': string;
358
- 'page.eftpos-pay.text.huifu.scan.camera-desc': string;
359
- 'page.eftpos-pay.text.huifu.scan.input-title': string;
360
- 'page.eftpos-pay.text.huifu.scan.input-placeholder': string;
361
- 'page.eftpos-pay.text.huifu.scan.input-tip': string;
362
- 'page.eftpos-pay.text.huifu.scan.cancel': string;
363
- 'page.eftpos-pay.text.huifu.scan.confirm': string;
364
328
  };
365
329
  };
366
330
  export default _default;
@@ -149,20 +149,7 @@ export default {
149
149
  },
150
150
  'page.eftpos-pay.text.tyro': function pageEftposPayTextTyro(key) {
151
151
  return key;
152
- },
153
- // 汇付天下定制文案
154
- 'page.eftpos-pay.text.huifu.scan.title': 'Scan to Pay (Alipay · WeChat Pay · UnionPay)',
155
- 'page.eftpos-pay.text.huifu.scan.gun.connected': 'Scanner Connected',
156
- 'page.eftpos-pay.text.huifu.scan.gun.connected-desc': 'Scan the customer’s payment code to collect payment',
157
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected': 'Scanner Not Connected',
158
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': 'Connect the scanner to scan the customer’s payment code',
159
- 'page.eftpos-pay.text.huifu.scan.camera-title': 'Click to use the camera',
160
- 'page.eftpos-pay.text.huifu.scan.camera-desc': 'Align the customer’s payment code within the frame',
161
- 'page.eftpos-pay.text.huifu.scan.input-title': 'Or enter the payment code manually',
162
- 'page.eftpos-pay.text.huifu.scan.input-placeholder': 'Enter payment code',
163
- 'page.eftpos-pay.text.huifu.scan.input-tip': 'Tip: The payment code is 18 digits',
164
- 'page.eftpos-pay.text.huifu.scan.cancel': 'Cancel',
165
- 'page.eftpos-pay.text.huifu.scan.confirm': 'Confirm Payment'
152
+ }
166
153
  },
167
154
  'zh-CN': {
168
155
  'page.eftpos-pay.text.loading': function pageEftposPayTextLoading(mode) {
@@ -460,20 +447,7 @@ export default {
460
447
  return '请使用以下选项之一回答此问题';
461
448
  }
462
449
  return key;
463
- },
464
- // 汇付天下定制文案
465
- 'page.eftpos-pay.text.huifu.scan.title': '扫码支付(支付宝 · 微信支付 · 银联)',
466
- 'page.eftpos-pay.text.huifu.scan.gun.connected': '扫码枪已连接',
467
- 'page.eftpos-pay.text.huifu.scan.gun.connected-desc': '直接扫描消费者付款码即可',
468
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected': '未连接扫码枪',
469
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': '连接扫码枪后可直接扫码消费者付款码',
470
- 'page.eftpos-pay.text.huifu.scan.camera-title': '点击可使用设备摄像头',
471
- 'page.eftpos-pay.text.huifu.scan.camera-desc': '将消费者付款码对准扫描框',
472
- 'page.eftpos-pay.text.huifu.scan.input-title': '或手动输入付款码',
473
- 'page.eftpos-pay.text.huifu.scan.input-placeholder': '请输入',
474
- 'page.eftpos-pay.text.huifu.scan.input-tip': '提示:付款码为18位数字',
475
- 'page.eftpos-pay.text.huifu.scan.cancel': '取消',
476
- 'page.eftpos-pay.text.huifu.scan.confirm': '确认支付'
450
+ }
477
451
  },
478
452
  'zh-HK': {
479
453
  'page.eftpos-pay.text.loading': function pageEftposPayTextLoading(mode) {
@@ -771,19 +745,6 @@ export default {
771
745
  return '請使用以下選項之一回答此問題';
772
746
  }
773
747
  return key;
774
- },
775
- // 汇付天下定制文案
776
- 'page.eftpos-pay.text.huifu.scan.title': '掃碼支付(支付寶 · 微信支付 · 銀聯)',
777
- 'page.eftpos-pay.text.huifu.scan.gun.connected': '掃碼槍已連接',
778
- 'page.eftpos-pay.text.huifu.scan.gun.connected-desc': '直接掃描消費者付款碼即可',
779
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected': '未連接掃碼槍',
780
- 'page.eftpos-pay.text.huifu.scan.gun.not-connected-desc': '連接掃碼槍後可直接掃碼消費者付款碼',
781
- 'page.eftpos-pay.text.huifu.scan.camera-title': '點擊可使用設備攝像頭',
782
- 'page.eftpos-pay.text.huifu.scan.camera-desc': '將消費者付款碼對準掃描框',
783
- 'page.eftpos-pay.text.huifu.scan.input-title': '或手動輸入付款碼',
784
- 'page.eftpos-pay.text.huifu.scan.input-placeholder': '請輸入',
785
- 'page.eftpos-pay.text.huifu.scan.input-tip': '提示:付款碼為18位數字',
786
- 'page.eftpos-pay.text.huifu.scan.cancel': '取消',
787
- 'page.eftpos-pay.text.huifu.scan.confirm': '確認支付'
748
+ }
788
749
  }
789
750
  };
@@ -4,5 +4,4 @@ export { default as Payo } from './payo';
4
4
  export { default as Windcave } from './windcave/windcave';
5
5
  export { default as Tyro } from './tyro';
6
6
  export { default as Linkly } from './linkly';
7
- export { default as Huifu } from './huifu';
8
7
  export declare const getInitState: (type: string, params?: any) => State;
@@ -3,15 +3,12 @@ import getPayoInitState from "./payo/const";
3
3
  import getTyroInitState from "./tyro/const";
4
4
  import getWindcaveInitState from "./windcave/const";
5
5
  import getLinklyInitState from "./linkly/const";
6
- import getHuifuInitState from "./huifu/const";
7
6
  export { getAmonunt } from "./helper";
8
7
  export { default as Payo } from "./payo";
9
8
  export { default as Windcave } from "./windcave/windcave";
10
9
  export { default as Tyro } from "./tyro";
11
10
  export { default as Linkly } from "./linkly";
12
- export { default as Huifu } from "./huifu";
13
11
  export var getInitState = function getInitState(type, params) {
14
- console.log('type = ', type);
15
12
  switch (type) {
16
13
  case EftposEnum.Payo:
17
14
  return getPayoInitState(params);
@@ -21,8 +18,6 @@ export var getInitState = function getInitState(type, params) {
21
18
  return getTyroInitState(params);
22
19
  case EftposEnum.Linkly:
23
20
  return getLinklyInitState(params);
24
- case EftposEnum.Huifu:
25
- return getHuifuInitState(params);
26
21
  default:
27
22
  throw new Error('未知的厂商类型');
28
23
  }
@@ -10,7 +10,7 @@ import { getPayParams } from "./helper";
10
10
  import Manual from "./component/manual";
11
11
  import Signature from "./component/signature";
12
12
  import { StatusEnum, PayRouteEnum, ClientEnum } from "./const";
13
- import { Payo, Windcave, Tyro, Linkly, Huifu } from "./manufacturer";
13
+ import { Payo, Windcave, Tyro, Linkly } from "./manufacturer";
14
14
  import { useContextData, useDispatch, updateStatus, backUpProduction, updateComponent, backUpFree, updateState } from "./store";
15
15
  import "./index.less";
16
16
 
@@ -156,7 +156,7 @@ var Pay = function Pay(_ref) {
156
156
  style: data.type === 'step' ? {} : {
157
157
  display: 'none'
158
158
  }
159
- }, data.status !== StatusEnum.Init && /*#__PURE__*/React.createElement(Header, {
159
+ }, /*#__PURE__*/React.createElement(Header, {
160
160
  status: data.status,
161
161
  title: data.title,
162
162
  subTitle: data.subTitle
@@ -182,10 +182,6 @@ var Pay = function Pay(_ref) {
182
182
  key: data.key,
183
183
  api: api,
184
184
  onChange: onChange
185
- }) : null, data.eftpos === 'huifu' ? /*#__PURE__*/React.createElement(Huifu, {
186
- key: data.key,
187
- onChange: onChange,
188
- isNativeApp: isMobile
189
185
  }) : null) : null, data.type === PayRouteEnum.Unset && Comm ? /*#__PURE__*/React.createElement(Comm, {
190
186
  onChange: onChange,
191
187
  api: api,
@@ -91,10 +91,6 @@ export declare type State = {
91
91
  };
92
92
  backup?: Omit<State, 'backup'>;
93
93
  client: ClientEnum;
94
- /** 原始参数 - 用于 retry 时完整恢复 */
95
- originalParams?: {
96
- [key: string]: unknown;
97
- };
98
94
  };
99
95
  export declare type Action = {
100
96
  type: EActionTypes;
@@ -178,7 +174,7 @@ export declare const updateCustom: (payload: {
178
174
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
179
175
  type: EActionTypes;
180
176
  payload: {
181
- status: "loading" | "success" | "warn" | "fail" | "question";
177
+ status: "loading" | "warn" | "fail" | "success" | "question";
182
178
  };
183
179
  };
184
180
  /**
@@ -299,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
299
295
  name?: string | undefined;
300
296
  symbol?: string | undefined;
301
297
  amount?: string | number | undefined;
302
- mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
298
+ mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
303
299
  order_id?: string | number | undefined;
304
- eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | "huifu" | undefined;
305
- action?: "deviceList" | "amount" | "pay" | undefined;
300
+ eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
301
+ action?: "pay" | "amount" | "deviceList" | undefined;
306
302
  key?: number | undefined;
307
303
  step?: number | undefined;
308
304
  title?: string | undefined;
@@ -312,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
312
308
  net?: boolean | undefined;
313
309
  component?: string | undefined;
314
310
  form?: string | undefined;
315
- status?: "loading" | "success" | "warn" | "init" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "loading" | "warn" | "fail" | "success" | "pedding" | "resove" | "reject" | "question" | undefined;
316
312
  warn?: string | undefined;
317
313
  steps?: {
318
314
  /** 用于重置当前步骤 */
@@ -348,9 +344,6 @@ export declare const backUpFree: (payload: Partial<State>) => {
348
344
  } | undefined;
349
345
  backup?: Omit<State, "backup"> | undefined;
350
346
  client?: ClientEnum | undefined;
351
- originalParams?: {
352
- [key: string]: unknown;
353
- } | undefined;
354
347
  };
355
348
  };
356
349
  export declare function reducers(state: State, action: Action): State;
@@ -9,9 +9,6 @@ import './index.less';
9
9
  */
10
10
  declare function KioskSkuDetail(props: KioskSkuDetailProps): React.JSX.Element;
11
11
  export default KioskSkuDetail;
12
- /**
13
- * @description 从原生回调 payload 中提取 productId
14
- */
15
12
  export interface KioskSkuDetailProps {
16
13
  /** 商品 id(可选:目前默认从 URL 读取,props 仅作为兜底以兼容老用法) */
17
14
  productId?: number | string;