@pisell/private-materials 6.6.62 → 6.6.63
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/utils.js +10 -3
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/booking/info2/service/editService/index.js +76 -8
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +16 -0
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/es/components/eftpos/PairModal/hooks.js +67 -0
- package/es/components/eftpos/PairModal/index.d.ts +11 -0
- package/es/components/eftpos/PairModal/index.js +246 -0
- package/es/components/eftpos/PairModal/index.less +70 -0
- package/es/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/Action.js +141 -0
- package/es/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/index.js +135 -0
- package/es/components/eftpos/SettlementModal/index.less +33 -0
- package/es/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/es/components/eftpos/SettlementModal/serve.js +171 -0
- package/es/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/es/components/eftpos/SettlementModal/types.js +35 -0
- package/es/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/es/components/eftpos/SettlementModal/utils.js +351 -0
- package/es/components/eftpos/assets/mx51SCI.svg +15 -0
- package/es/components/eftpos/const.d.ts +3 -1
- package/es/components/eftpos/const.js +2 -0
- package/es/components/eftpos/device.d.ts +3 -1
- package/es/components/eftpos/device.js +14 -3
- package/es/components/eftpos/hooks.d.ts +13 -0
- package/es/components/eftpos/hooks.js +35 -0
- package/es/components/eftpos/index.js +198 -24
- package/es/components/eftpos/index.less +32 -1
- package/es/components/eftpos/locales.d.ts +80 -0
- package/es/components/eftpos/locales.js +205 -25
- package/es/components/eftpos/table.js +47 -3
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +145 -0
- package/es/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/es/components/eftposPay/aggregatePayment/index.js +2 -1
- package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
- package/es/components/eftposPay/aggregatePayment/service.js +1 -0
- package/es/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/es/components/eftposPay/aggregatePayment/types.js +4 -8
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +231 -168
- package/es/components/eftposPay/amount.js +15 -1
- package/es/components/eftposPay/app.js +2 -3
- package/es/components/eftposPay/component/fail/failCustom.js +13 -4
- package/es/components/eftposPay/component/fail/index.js +12 -5
- package/es/components/eftposPay/component/fail/network.js +3 -0
- package/es/components/eftposPay/component/fail/unknow.js +8 -0
- package/es/components/eftposPay/component/manual/index.js +17 -3
- package/es/components/eftposPay/component/signature/index.js +3 -0
- package/es/components/eftposPay/const.d.ts +8 -3
- package/es/components/eftposPay/const.js +2 -0
- package/es/components/eftposPay/device.js +225 -38
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +2 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.js +50 -13
- package/es/components/eftposPay/linkly/const.js +1 -1
- package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
- package/es/components/eftposPay/linkly/index.js +11 -23
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +30 -15
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/mx51/Action.d.ts +6 -0
- package/es/components/eftposPay/mx51/Action.js +144 -0
- package/es/components/eftposPay/mx51/const.d.ts +5 -0
- package/es/components/eftposPay/mx51/const.js +69 -0
- package/es/components/eftposPay/mx51/index.d.ts +6 -0
- package/es/components/eftposPay/mx51/index.js +498 -0
- package/es/components/eftposPay/mx51/types.d.ts +142 -0
- package/es/components/eftposPay/mx51/types.js +35 -0
- package/es/components/eftposPay/mx51/utils.d.ts +10 -0
- package/es/components/eftposPay/mx51/utils.js +121 -0
- package/es/components/eftposPay/pay.js +21 -9
- package/es/components/eftposPay/payo/config.js +39 -5
- package/es/components/eftposPay/payo/const.js +1 -1
- package/es/components/eftposPay/payo/hooks.js +3 -12
- package/es/components/eftposPay/payo/payment.js +69 -136
- package/es/components/eftposPay/store/index.d.ts +4 -8
- package/es/components/eftposPay/tip.js +5 -0
- package/es/components/eftposPay/tyro/const.js +1 -1
- package/es/components/eftposPay/tyro/index.js +44 -11
- package/es/components/eftposPay/utils/payLog.d.ts +81 -0
- package/es/components/eftposPay/utils/payLog.js +458 -0
- package/es/components/eftposPay/windcave/const.js +1 -1
- package/es/components/eftposPay/windcave/receiptAction.js +5 -0
- package/es/components/eftposPay/windcave/windcave.js +37 -38
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +12 -5
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/booking/info2/service/editService/index.js +56 -5
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +16 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/lib/components/eftpos/PairModal/hooks.js +70 -0
- package/lib/components/eftpos/PairModal/index.d.ts +11 -0
- package/lib/components/eftpos/PairModal/index.js +197 -0
- package/lib/components/eftpos/PairModal/index.less +70 -0
- package/lib/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/Action.js +153 -0
- package/lib/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/index.js +170 -0
- package/lib/components/eftpos/SettlementModal/index.less +33 -0
- package/lib/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/lib/components/eftpos/SettlementModal/serve.js +45 -0
- package/lib/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/lib/components/eftpos/SettlementModal/types.js +43 -0
- package/lib/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/lib/components/eftpos/SettlementModal/utils.js +248 -0
- package/lib/components/eftpos/assets/mx51SCI.svg +15 -0
- package/lib/components/eftpos/const.d.ts +3 -1
- package/lib/components/eftpos/const.js +2 -0
- package/lib/components/eftpos/device.d.ts +3 -1
- package/lib/components/eftpos/device.js +13 -3
- package/lib/components/eftpos/hooks.d.ts +13 -0
- package/lib/components/eftpos/hooks.js +30 -0
- package/lib/components/eftpos/index.js +121 -8
- package/lib/components/eftpos/index.less +32 -1
- package/lib/components/eftpos/locales.d.ts +80 -0
- package/lib/components/eftpos/locales.js +231 -21
- package/lib/components/eftpos/table.js +30 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +171 -0
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/lib/components/eftposPay/aggregatePayment/index.js +5 -2
- package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +173 -123
- package/lib/components/eftposPay/amount.js +13 -1
- package/lib/components/eftposPay/app.js +4 -5
- package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
- package/lib/components/eftposPay/component/fail/index.js +10 -2
- package/lib/components/eftposPay/component/fail/network.js +3 -0
- package/lib/components/eftposPay/component/fail/unknow.js +8 -0
- package/lib/components/eftposPay/component/manual/index.js +16 -2
- package/lib/components/eftposPay/component/signature/index.js +3 -0
- package/lib/components/eftposPay/const.d.ts +8 -3
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/device.js +114 -25
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +2 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.js +38 -13
- package/lib/components/eftposPay/linkly/const.js +1 -1
- package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
- package/lib/components/eftposPay/linkly/index.js +8 -10
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +30 -15
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
- package/lib/components/eftposPay/mx51/Action.js +154 -0
- package/lib/components/eftposPay/mx51/const.d.ts +5 -0
- package/lib/components/eftposPay/mx51/const.js +85 -0
- package/lib/components/eftposPay/mx51/index.d.ts +6 -0
- package/lib/components/eftposPay/mx51/index.js +433 -0
- package/lib/components/eftposPay/mx51/types.d.ts +142 -0
- package/lib/components/eftposPay/mx51/types.js +43 -0
- package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
- package/lib/components/eftposPay/mx51/utils.js +115 -0
- package/lib/components/eftposPay/pay.js +13 -3
- package/lib/components/eftposPay/payo/config.js +16 -8
- package/lib/components/eftposPay/payo/const.js +1 -1
- package/lib/components/eftposPay/payo/hooks.js +12 -10
- package/lib/components/eftposPay/payo/payment.js +31 -65
- package/lib/components/eftposPay/store/index.d.ts +4 -8
- package/lib/components/eftposPay/tip.js +5 -0
- package/lib/components/eftposPay/tyro/const.js +1 -1
- package/lib/components/eftposPay/tyro/index.js +21 -17
- package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
- package/lib/components/eftposPay/utils/payLog.js +321 -0
- package/lib/components/eftposPay/windcave/const.js +1 -1
- package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.js +27 -29
- package/package.json +2 -2
- package/es/components/eftposPay/utils/log/index.d.ts +0 -110
- package/es/components/eftposPay/utils/log/index.js +0 -371
- package/lib/components/eftposPay/utils/log/index.d.ts +0 -110
- package/lib/components/eftposPay/utils/log/index.js +0 -294
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
14
|
+
import { Button, Input } from 'antd';
|
|
15
|
+
import { EButtonKeyType } from "./types";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @title 渲染动态内容
|
|
19
|
+
* @description 用于渲染从接口解析出来的元素
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
var Action = function Action(props) {
|
|
23
|
+
var _data$layouts2, _data$layouts3;
|
|
24
|
+
var data = props.data,
|
|
25
|
+
_props$showMessage = props.showMessage,
|
|
26
|
+
showMessage = _props$showMessage === void 0 ? true : _props$showMessage,
|
|
27
|
+
_props$cancelDisabled = props.cancelDisabled,
|
|
28
|
+
cancelDisabled = _props$cancelDisabled === void 0 ? false : _props$cancelDisabled;
|
|
29
|
+
var _useState = useState({}),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
inputValues = _useState2[0],
|
|
32
|
+
setInputValues = _useState2[1];
|
|
33
|
+
var inputValuesRef = useRef(inputValues);
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
var _data$layouts;
|
|
36
|
+
if (!data) return;
|
|
37
|
+
var inputObj = {};
|
|
38
|
+
data === null || data === void 0 || (_data$layouts = data.layouts) === null || _data$layouts === void 0 || _data$layouts.forEach(function (item) {
|
|
39
|
+
var _item$elements;
|
|
40
|
+
item === null || item === void 0 || (_item$elements = item.elements) === null || _item$elements === void 0 || _item$elements.forEach(function (element) {
|
|
41
|
+
if ((element === null || element === void 0 ? void 0 : element.type) === 'input' && element !== null && element !== void 0 && element.name) {
|
|
42
|
+
inputObj[element === null || element === void 0 ? void 0 : element.name] = inputValuesRef.current[element === null || element === void 0 ? void 0 : element.name] || '';
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
setInputValues(inputObj);
|
|
47
|
+
}, [data]);
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
inputValuesRef.current = inputValues;
|
|
50
|
+
}, [inputValues]);
|
|
51
|
+
var handleInputChange = function handleInputChange(key, value) {
|
|
52
|
+
setInputValues(function (prev) {
|
|
53
|
+
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, key, value));
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, showMessage && (data === null || data === void 0 ? void 0 : data.message) && /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
58
|
+
}, data === null || data === void 0 ? void 0 : data.message), (data === null || data === void 0 || (_data$layouts2 = data.layouts) === null || _data$layouts2 === void 0 ? void 0 : _data$layouts2.length) > 0 && (data === null || data === void 0 || (_data$layouts3 = data.layouts) === null || _data$layouts3 === void 0 ? void 0 : _data$layouts3.map(function (item, index) {
|
|
59
|
+
var _item$elements2;
|
|
60
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
key: index,
|
|
62
|
+
className: "pisell-lowcode__eft-pay-step-item-btns",
|
|
63
|
+
style: {
|
|
64
|
+
marginTop: '20px',
|
|
65
|
+
width: '100%',
|
|
66
|
+
display: 'flex',
|
|
67
|
+
justifyContent: 'center'
|
|
68
|
+
}
|
|
69
|
+
}, item === null || item === void 0 || (_item$elements2 = item.elements) === null || _item$elements2 === void 0 ? void 0 : _item$elements2.map(function (element) {
|
|
70
|
+
var key = element.key,
|
|
71
|
+
label = element.label,
|
|
72
|
+
type = element.type,
|
|
73
|
+
text = element.text,
|
|
74
|
+
name = element.name;
|
|
75
|
+
if (type === 'button') {
|
|
76
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
77
|
+
key: key + label,
|
|
78
|
+
block: true,
|
|
79
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
80
|
+
onClick: function onClick() {
|
|
81
|
+
var _props$onClick;
|
|
82
|
+
return props === null || props === void 0 || (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, element, {
|
|
83
|
+
inputValues: inputValues
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
disabled: key === EButtonKeyType.CancelTransaction ? cancelDisabled : false
|
|
87
|
+
}, element.label);
|
|
88
|
+
} else if (type === 'text') {
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
key: key + label,
|
|
91
|
+
className: "pisell-lowcode__eft-pay-step-item-tip"
|
|
92
|
+
}, label ? "".concat(label, ": ") : '', text || '');
|
|
93
|
+
} else if (type === 'image') {
|
|
94
|
+
var _ref = (element === null || element === void 0 ? void 0 : element.image) || {},
|
|
95
|
+
_name = _ref.name,
|
|
96
|
+
_data = _ref.data,
|
|
97
|
+
encoding = _ref.encoding;
|
|
98
|
+
var imageUrl = _data ? "data:".concat(_name || 'image/png', ";").concat(encoding || 'base64', ",").concat(_data) : '';
|
|
99
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
style: {
|
|
101
|
+
width: '100%',
|
|
102
|
+
display: 'flex',
|
|
103
|
+
justifyContent: 'center'
|
|
104
|
+
}
|
|
105
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
106
|
+
key: key + label,
|
|
107
|
+
src: imageUrl,
|
|
108
|
+
alt: label
|
|
109
|
+
}));
|
|
110
|
+
} else if (type === 'input') {
|
|
111
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
style: {
|
|
113
|
+
width: '100%',
|
|
114
|
+
display: 'flex',
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
flexWrap: 'wrap'
|
|
117
|
+
}
|
|
118
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
119
|
+
style: {
|
|
120
|
+
marginRight: '10px'
|
|
121
|
+
}
|
|
122
|
+
}, "".concat(label ? "".concat(label, " ") : '')), /*#__PURE__*/React.createElement(Input, {
|
|
123
|
+
key: key + label,
|
|
124
|
+
alt: label,
|
|
125
|
+
style: {
|
|
126
|
+
flex: 1,
|
|
127
|
+
minWidth: '200px'
|
|
128
|
+
},
|
|
129
|
+
value: inputValues[name] || '',
|
|
130
|
+
onChange: function onChange(e) {
|
|
131
|
+
return handleInputChange(name, e.target.value);
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}));
|
|
137
|
+
})), (data === null || data === void 0 ? void 0 : data.detailsText) && /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip",
|
|
139
|
+
style: {
|
|
140
|
+
marginTop: '24px'
|
|
141
|
+
}
|
|
142
|
+
}, data === null || data === void 0 ? void 0 : data.detailsText));
|
|
143
|
+
};
|
|
144
|
+
export default Action;
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net", "client"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
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); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { locales } from '@pisell/utils';
|
|
11
|
+
import { ClientEnum, EftposEnum, ModeEnum, PayRouteEnum, StatusEnum } from "../const";
|
|
12
|
+
export var getStep = function getStep() {
|
|
13
|
+
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ModeEnum.Pay;
|
|
14
|
+
return [{
|
|
15
|
+
key: Date.now(),
|
|
16
|
+
title: locales.getText('page.eftpos-pay.text.loading')(mode),
|
|
17
|
+
// 'Payment in process...',
|
|
18
|
+
text: locales.getText('page.eftpos-pay.text.waiting.processing'),
|
|
19
|
+
// 'Waiting for the processing...',
|
|
20
|
+
warn: '',
|
|
21
|
+
tip: locales.getText('page.eftpos-pay.text.processing'),
|
|
22
|
+
// 'processing...',
|
|
23
|
+
status: StatusEnum.Loading
|
|
24
|
+
}];
|
|
25
|
+
};
|
|
26
|
+
export default (function (params) {
|
|
27
|
+
var _ref = params || {
|
|
28
|
+
mode: ModeEnum.Pay
|
|
29
|
+
},
|
|
30
|
+
order_id = _ref.order_id,
|
|
31
|
+
name = _ref.name,
|
|
32
|
+
symbol = _ref.symbol,
|
|
33
|
+
amount = _ref.amount,
|
|
34
|
+
mode = _ref.mode,
|
|
35
|
+
number = _ref.number,
|
|
36
|
+
pay = _ref.pay,
|
|
37
|
+
device = _ref.device,
|
|
38
|
+
net = _ref.net,
|
|
39
|
+
client = _ref.client,
|
|
40
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
console.log('params =>>>>>> ', params);
|
|
42
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
43
|
+
order_id: order_id,
|
|
44
|
+
name: name,
|
|
45
|
+
symbol: symbol,
|
|
46
|
+
amount: amount,
|
|
47
|
+
mode: mode,
|
|
48
|
+
eftpos: EftposEnum.MX51,
|
|
49
|
+
key: Date.now(),
|
|
50
|
+
step: 0,
|
|
51
|
+
type: PayRouteEnum.Step,
|
|
52
|
+
title: locales.getText('page.eftpos-pay.text.loading')(mode),
|
|
53
|
+
component: '',
|
|
54
|
+
status: StatusEnum.Loading,
|
|
55
|
+
steps: getStep(mode),
|
|
56
|
+
render: true,
|
|
57
|
+
client: client !== 'undefined' ? client : ClientEnum.Merchant,
|
|
58
|
+
warn: '',
|
|
59
|
+
custom: other || {}
|
|
60
|
+
}, typeof net !== 'undefined' ? {
|
|
61
|
+
net: net
|
|
62
|
+
} : {}), typeof number !== 'undefined' ? {
|
|
63
|
+
number: number
|
|
64
|
+
} : {}), typeof pay !== 'undefined' ? {
|
|
65
|
+
pay: pay
|
|
66
|
+
} : {}), typeof device !== 'undefined' ? {
|
|
67
|
+
device: device
|
|
68
|
+
} : {});
|
|
69
|
+
});
|