@pisell/private-materials 3.0.96 → 3.0.97
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 +16 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -8
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/eftpos/const.d.ts +38 -0
- package/es/components/eftpos/const.js +79 -0
- package/es/components/eftpos/device.d.ts +8 -0
- package/es/components/eftpos/device.js +30 -0
- package/es/components/eftpos/form/index.d.ts +16 -0
- package/es/components/eftpos/form/index.js +113 -0
- package/es/components/eftpos/index.d.ts +37 -0
- package/es/components/eftpos/index.js +274 -0
- package/es/components/eftpos/index.less +153 -0
- package/es/components/eftpos/locales.d.ts +75 -0
- package/es/components/eftpos/locales.js +98 -0
- package/es/components/eftpos/pos.d.ts +9 -0
- package/es/components/eftpos/pos.js +33 -0
- package/es/components/eftpos/surcharge/index.css +17 -0
- package/es/components/eftpos/surcharge/index.d.ts +8 -0
- package/es/components/eftpos/surcharge/index.js +111 -0
- package/es/components/eftpos/table.d.ts +17 -0
- package/es/components/eftpos/table.js +236 -0
- package/es/components/eftposPay/amount.d.ts +14 -0
- package/es/components/eftposPay/amount.js +253 -0
- package/es/components/eftposPay/component/alert/index.d.ts +6 -0
- package/es/components/eftposPay/component/alert/index.js +11 -0
- package/es/components/eftposPay/component/alert/index.less +29 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +3 -0
- package/es/components/eftposPay/component/alert/warn.js +45 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +4 -0
- package/es/components/eftposPay/component/fail/failCustom.js +95 -0
- package/es/components/eftposPay/component/fail/index.d.ts +4 -0
- package/es/components/eftposPay/component/fail/index.js +105 -0
- package/es/components/eftposPay/component/fail/network.d.ts +4 -0
- package/es/components/eftposPay/component/fail/network.js +48 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +4 -0
- package/es/components/eftposPay/component/fail/unknow.js +43 -0
- package/es/components/eftposPay/component/header/index.d.ts +9 -0
- package/es/components/eftposPay/component/header/index.js +66 -0
- package/es/components/eftposPay/component/header/index.less +44 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +13 -0
- package/es/components/eftposPay/component/header/titlebar.js +39 -0
- package/es/components/eftposPay/component/header/titlebar.less +17 -0
- package/es/components/eftposPay/component/manual/index.d.ts +5 -0
- package/es/components/eftposPay/component/manual/index.js +91 -0
- package/es/components/eftposPay/component/manual/index.less +96 -0
- package/es/components/eftposPay/component/signature/index.d.ts +4 -0
- package/es/components/eftposPay/component/signature/index.js +63 -0
- package/es/components/eftposPay/component/step/index.d.ts +12 -0
- package/es/components/eftposPay/component/step/index.js +31 -0
- package/es/components/eftposPay/component/step/step.d.ts +9 -0
- package/es/components/eftposPay/component/step/step.js +23 -0
- package/es/components/eftposPay/const.d.ts +131 -0
- package/es/components/eftposPay/const.js +48 -0
- package/es/components/eftposPay/device.d.ts +14 -0
- package/es/components/eftposPay/device.js +124 -0
- package/es/components/eftposPay/device.less +61 -0
- package/es/components/eftposPay/eftpos/config.d.ts +11 -0
- package/es/components/eftposPay/eftpos/config.js +178 -0
- package/es/components/eftposPay/eftpos/const.d.ts +10 -0
- package/es/components/eftposPay/eftpos/const.js +139 -0
- package/es/components/eftposPay/eftpos/index.d.ts +7 -0
- package/es/components/eftposPay/eftpos/index.js +35 -0
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +35 -0
- package/es/components/eftposPay/hooks.d.ts +4 -0
- package/es/components/eftposPay/hooks.js +153 -0
- package/es/components/eftposPay/index.d.ts +7 -0
- package/es/components/eftposPay/index.js +188 -0
- package/es/components/eftposPay/index.less +273 -0
- package/es/components/eftposPay/locales.d.ts +264 -0
- package/es/components/eftposPay/locales.js +384 -0
- package/es/components/eftposPay/manufacturer.d.ts +6 -0
- package/es/components/eftposPay/manufacturer.js +32 -0
- package/es/components/eftposPay/pay.d.ts +10 -0
- package/es/components/eftposPay/pay.js +108 -0
- package/es/components/eftposPay/payo/config.d.ts +11 -0
- package/es/components/eftposPay/payo/config.js +357 -0
- package/es/components/eftposPay/payo/const.d.ts +6 -0
- package/es/components/eftposPay/payo/const.js +93 -0
- package/es/components/eftposPay/payo/hooks.d.ts +5 -0
- package/es/components/eftposPay/payo/hooks.js +84 -0
- package/es/components/eftposPay/payo/index.d.ts +7 -0
- package/es/components/eftposPay/payo/index.js +35 -0
- package/es/components/eftposPay/store/index.d.ts +239 -0
- package/es/components/eftposPay/store/index.js +304 -0
- package/es/components/eftposPay/store/useThunkReducer.d.ts +9 -0
- package/es/components/eftposPay/store/useThunkReducer.js +31 -0
- package/es/components/eftposPay/windcave/action.d.ts +8 -0
- package/es/components/eftposPay/windcave/action.js +104 -0
- package/es/components/eftposPay/windcave/const.d.ts +104 -0
- package/es/components/eftposPay/windcave/const.js +253 -0
- package/es/components/eftposPay/windcave/helper.d.ts +9 -0
- package/es/components/eftposPay/windcave/helper.js +314 -0
- package/es/components/eftposPay/windcave/hook.d.ts +14 -0
- package/es/components/eftposPay/windcave/hook.js +144 -0
- package/es/components/eftposPay/windcave/index.d.ts +8 -0
- package/es/components/eftposPay/windcave/index.js +49 -0
- package/es/components/eftposPay/windcave/pos.d.ts +8 -0
- package/es/components/eftposPay/windcave/pos.js +180 -0
- package/es/components/eftposPay/windcave/pwd.d.ts +8 -0
- package/es/components/eftposPay/windcave/pwd.js +124 -0
- package/es/components/eftposPay/windcave/receipet.d.ts +6 -0
- package/es/components/eftposPay/windcave/receipet.js +67 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +11 -0
- package/es/components/eftposPay/windcave/receiptAction.js +326 -0
- package/es/components/eftposPay/windcave/timer.d.ts +17 -0
- package/es/components/eftposPay/windcave/timer.js +181 -0
- package/es/components/eftposPay/windcave/wait.d.ts +12 -0
- package/es/components/eftposPay/windcave/wait.js +139 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +6 -0
- package/es/components/eftposPay/windcave/windcave.js +283 -0
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/es/hooks/usePrefix.d.ts +1 -0
- package/es/hooks/usePrefix.js +10 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/eftpos/const.d.ts +38 -0
- package/lib/components/eftpos/const.js +108 -0
- package/lib/components/eftpos/device.d.ts +8 -0
- package/lib/components/eftpos/device.js +55 -0
- package/lib/components/eftpos/form/index.d.ts +16 -0
- package/lib/components/eftpos/form/index.js +124 -0
- package/lib/components/eftpos/index.d.ts +37 -0
- package/lib/components/eftpos/index.js +279 -0
- package/lib/components/eftpos/index.less +153 -0
- package/lib/components/eftpos/locales.d.ts +75 -0
- package/lib/components/eftpos/locales.js +116 -0
- package/lib/components/eftpos/pos.d.ts +9 -0
- package/lib/components/eftpos/pos.js +55 -0
- package/lib/components/eftpos/surcharge/index.css +17 -0
- package/lib/components/eftpos/surcharge/index.d.ts +8 -0
- package/lib/components/eftpos/surcharge/index.js +125 -0
- package/lib/components/eftpos/table.d.ts +17 -0
- package/lib/components/eftpos/table.js +235 -0
- package/lib/components/eftposPay/amount.d.ts +14 -0
- package/lib/components/eftposPay/amount.js +239 -0
- package/lib/components/eftposPay/component/alert/index.d.ts +6 -0
- package/lib/components/eftposPay/component/alert/index.js +38 -0
- package/lib/components/eftposPay/component/alert/index.less +29 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +3 -0
- package/lib/components/eftposPay/component/alert/warn.js +80 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +117 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/index.js +121 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/network.js +65 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/unknow.js +72 -0
- package/lib/components/eftposPay/component/header/index.d.ts +9 -0
- package/lib/components/eftposPay/component/header/index.js +92 -0
- package/lib/components/eftposPay/component/header/index.less +44 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +13 -0
- package/lib/components/eftposPay/component/header/titlebar.js +55 -0
- package/lib/components/eftposPay/component/header/titlebar.less +17 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +5 -0
- package/lib/components/eftposPay/component/manual/index.js +101 -0
- package/lib/components/eftposPay/component/manual/index.less +96 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +4 -0
- package/lib/components/eftposPay/component/signature/index.js +80 -0
- package/lib/components/eftposPay/component/step/index.d.ts +12 -0
- package/lib/components/eftposPay/component/step/index.js +71 -0
- package/lib/components/eftposPay/component/step/step.d.ts +9 -0
- package/lib/components/eftposPay/component/step/step.js +59 -0
- package/lib/components/eftposPay/const.d.ts +131 -0
- package/lib/components/eftposPay/const.js +86 -0
- package/lib/components/eftposPay/device.d.ts +14 -0
- package/lib/components/eftposPay/device.js +127 -0
- package/lib/components/eftposPay/device.less +61 -0
- package/lib/components/eftposPay/eftpos/config.d.ts +11 -0
- package/lib/components/eftposPay/eftpos/config.js +199 -0
- package/lib/components/eftposPay/eftpos/const.d.ts +10 -0
- package/lib/components/eftposPay/eftpos/const.js +165 -0
- package/lib/components/eftposPay/eftpos/index.d.ts +7 -0
- package/lib/components/eftposPay/eftpos/index.js +66 -0
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +62 -0
- package/lib/components/eftposPay/hooks.d.ts +4 -0
- package/lib/components/eftposPay/hooks.js +237 -0
- package/lib/components/eftposPay/index.d.ts +7 -0
- package/lib/components/eftposPay/index.js +189 -0
- package/lib/components/eftposPay/index.less +273 -0
- package/lib/components/eftposPay/locales.d.ts +264 -0
- package/lib/components/eftposPay/locales.js +304 -0
- package/lib/components/eftposPay/manufacturer.d.ts +6 -0
- package/lib/components/eftposPay/manufacturer.js +77 -0
- package/lib/components/eftposPay/pay.d.ts +10 -0
- package/lib/components/eftposPay/pay.js +120 -0
- package/lib/components/eftposPay/payo/config.d.ts +11 -0
- package/lib/components/eftposPay/payo/config.js +377 -0
- package/lib/components/eftposPay/payo/const.d.ts +6 -0
- package/lib/components/eftposPay/payo/const.js +112 -0
- package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
- package/lib/components/eftposPay/payo/hooks.js +80 -0
- package/lib/components/eftposPay/payo/index.d.ts +7 -0
- package/lib/components/eftposPay/payo/index.js +63 -0
- package/lib/components/eftposPay/store/index.d.ts +239 -0
- package/lib/components/eftposPay/store/index.js +371 -0
- package/lib/components/eftposPay/store/useThunkReducer.d.ts +9 -0
- package/lib/components/eftposPay/store/useThunkReducer.js +53 -0
- package/lib/components/eftposPay/windcave/action.d.ts +8 -0
- package/lib/components/eftposPay/windcave/action.js +143 -0
- package/lib/components/eftposPay/windcave/const.d.ts +104 -0
- package/lib/components/eftposPay/windcave/const.js +300 -0
- package/lib/components/eftposPay/windcave/helper.d.ts +9 -0
- package/lib/components/eftposPay/windcave/helper.js +378 -0
- package/lib/components/eftposPay/windcave/hook.d.ts +14 -0
- package/lib/components/eftposPay/windcave/hook.js +139 -0
- package/lib/components/eftposPay/windcave/index.d.ts +8 -0
- package/lib/components/eftposPay/windcave/index.js +78 -0
- package/lib/components/eftposPay/windcave/pos.d.ts +8 -0
- package/lib/components/eftposPay/windcave/pos.js +197 -0
- package/lib/components/eftposPay/windcave/pwd.d.ts +8 -0
- package/lib/components/eftposPay/windcave/pwd.js +143 -0
- package/lib/components/eftposPay/windcave/receipet.d.ts +6 -0
- package/lib/components/eftposPay/windcave/receipet.js +93 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +11 -0
- package/lib/components/eftposPay/windcave/receiptAction.js +386 -0
- package/lib/components/eftposPay/windcave/timer.d.ts +17 -0
- package/lib/components/eftposPay/windcave/timer.js +126 -0
- package/lib/components/eftposPay/windcave/wait.d.ts +12 -0
- package/lib/components/eftposPay/windcave/wait.js +163 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +6 -0
- package/lib/components/eftposPay/windcave/windcave.js +283 -0
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/lib/hooks/usePrefix.d.ts +1 -0
- package/lib/hooks/usePrefix.js +44 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/eftpos/meta.ts +187 -0
- package/lowcode/eftpos-pay/meta.ts +122 -0
- package/package.json +4 -3
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { locales } from '@pisell/utils';
|
|
8
|
+
import { Button } from 'antd';
|
|
9
|
+
import React, { useState } from 'react';
|
|
10
|
+
import { useContextData, useDispatch, updateNextStep, updateComponent, updateSteps, updateState } from "../store";
|
|
11
|
+
export default (function (_ref) {
|
|
12
|
+
var index = _ref.index,
|
|
13
|
+
api = _ref.api;
|
|
14
|
+
var _useState = useState(false),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
disabled = _useState2[0],
|
|
17
|
+
setDisabled = _useState2[1];
|
|
18
|
+
var dispatch = useDispatch();
|
|
19
|
+
var data = useContextData();
|
|
20
|
+
var _useContextData = useContextData(),
|
|
21
|
+
custom = _useContextData.custom;
|
|
22
|
+
var onCancel = function onCancel() {
|
|
23
|
+
setDisabled(true);
|
|
24
|
+
api.update({
|
|
25
|
+
type: 'CANCEL',
|
|
26
|
+
number: custom === null || custom === void 0 ? void 0 : custom.number
|
|
27
|
+
}).then(function () {
|
|
28
|
+
dispatch(updateComponent('Fail'));
|
|
29
|
+
data.steps[index].status = 'fail';
|
|
30
|
+
data.steps[index].fail = locales.getText('page.eftpos-pay.text.cancel');
|
|
31
|
+
dispatch(updateSteps(data.steps));
|
|
32
|
+
setDisabled(false);
|
|
33
|
+
}).catch(function (res) {
|
|
34
|
+
console.log(res);
|
|
35
|
+
setDisabled(false);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var onAccept = function onAccept() {
|
|
39
|
+
setDisabled(true);
|
|
40
|
+
api.update({
|
|
41
|
+
type: 'YES',
|
|
42
|
+
number: custom === null || custom === void 0 ? void 0 : custom.number
|
|
43
|
+
}).then(function () {
|
|
44
|
+
setDisabled(false);
|
|
45
|
+
dispatch(updateNextStep());
|
|
46
|
+
}).catch(function (res) {
|
|
47
|
+
setDisabled(false);
|
|
48
|
+
console.log(res);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
var onDecline = function onDecline() {
|
|
52
|
+
dispatch(updateComponent('Signature', true));
|
|
53
|
+
};
|
|
54
|
+
var onManually = function onManually() {
|
|
55
|
+
dispatch(updateState({
|
|
56
|
+
manual: {
|
|
57
|
+
title: locales.getText('page.eftpos-pay.text.request.title')(data.mode),
|
|
58
|
+
text: locales.getText('page.eftpos-pay.text.request.text')(data.mode)
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
61
|
+
dispatch(updateComponent('Manual', true));
|
|
62
|
+
};
|
|
63
|
+
if (index === 0) {
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
67
|
+
block: true,
|
|
68
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
69
|
+
onClick: onCancel,
|
|
70
|
+
disabled: disabled
|
|
71
|
+
}, locales.getText('page.eftpos-pay.text.cancel')));
|
|
72
|
+
}
|
|
73
|
+
if (index > 0 && index < 3) {
|
|
74
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
76
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
77
|
+
block: true,
|
|
78
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
79
|
+
disabled: true
|
|
80
|
+
}, locales.getText('page.eftpos-pay.text.leave')));
|
|
81
|
+
}
|
|
82
|
+
if (index === 3) {
|
|
83
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
85
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
86
|
+
block: true,
|
|
87
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
88
|
+
onClick: onDecline
|
|
89
|
+
}, locales.getText('page.eftpos-pay.text.decline')), /*#__PURE__*/React.createElement(Button, {
|
|
90
|
+
block: true,
|
|
91
|
+
type: "primary",
|
|
92
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
93
|
+
onClick: onAccept,
|
|
94
|
+
disabled: disabled
|
|
95
|
+
}, locales.getText('page.eftpos-pay.text.accept')));
|
|
96
|
+
}
|
|
97
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
100
|
+
block: true,
|
|
101
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
102
|
+
onClick: onManually
|
|
103
|
+
}, locales.getText('page.eftpos-pay.text.manual.marking')));
|
|
104
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Amount } from '../const';
|
|
3
|
+
import { State } from '../store';
|
|
4
|
+
export declare const getStep: ({ amount, symbol, mode, }?: {
|
|
5
|
+
amount?: string | undefined;
|
|
6
|
+
symbol: string;
|
|
7
|
+
mode?: string | undefined;
|
|
8
|
+
}) => State['steps'];
|
|
9
|
+
declare const getInitState: (params: any) => State;
|
|
10
|
+
export default getInitState;
|
|
11
|
+
export declare function getAmonunt(store: State): Amount;
|
|
12
|
+
export declare enum StepStatusEnum {
|
|
13
|
+
/** 空闲 */
|
|
14
|
+
Free = 1,
|
|
15
|
+
/** 提交或插入卡 */
|
|
16
|
+
Card = 2,
|
|
17
|
+
/** 选择账户 */
|
|
18
|
+
Account = 3,
|
|
19
|
+
/** 选择应用 */
|
|
20
|
+
Application = 4,
|
|
21
|
+
/** 输入PIN码 */
|
|
22
|
+
Pin = 5,
|
|
23
|
+
/** 处理中 */
|
|
24
|
+
Processing = 6,
|
|
25
|
+
/** 验证签名 */
|
|
26
|
+
Receipt = 7,
|
|
27
|
+
/** 显示结果 */
|
|
28
|
+
Wait = 8
|
|
29
|
+
}
|
|
30
|
+
export declare enum StemTypeEnum {
|
|
31
|
+
/** 主动查询 */
|
|
32
|
+
Active = "active",
|
|
33
|
+
/** 被动提交 */
|
|
34
|
+
Passive = "passive"
|
|
35
|
+
}
|
|
36
|
+
export declare const getStepMapping: (type: StepStatusEnum, { money, mode }: {
|
|
37
|
+
money?: string | undefined;
|
|
38
|
+
mode?: string | undefined;
|
|
39
|
+
}) => {
|
|
40
|
+
type: StemTypeEnum;
|
|
41
|
+
status: string;
|
|
42
|
+
pedding: any;
|
|
43
|
+
resolve: string;
|
|
44
|
+
index: StepStatusEnum.Free;
|
|
45
|
+
peddingStyle: {};
|
|
46
|
+
reject?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
type: StemTypeEnum;
|
|
49
|
+
status: string;
|
|
50
|
+
pedding: any;
|
|
51
|
+
resolve: string;
|
|
52
|
+
index: StepStatusEnum.Card;
|
|
53
|
+
peddingStyle: {};
|
|
54
|
+
reject?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
type: StemTypeEnum;
|
|
57
|
+
status: string;
|
|
58
|
+
pedding: any;
|
|
59
|
+
resolve: string;
|
|
60
|
+
index: StepStatusEnum.Account;
|
|
61
|
+
peddingStyle: {};
|
|
62
|
+
reject?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
type: StemTypeEnum;
|
|
65
|
+
status: string;
|
|
66
|
+
pedding: any;
|
|
67
|
+
resolve: string;
|
|
68
|
+
index: StepStatusEnum.Application;
|
|
69
|
+
peddingStyle: {};
|
|
70
|
+
reject?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
type: StemTypeEnum;
|
|
73
|
+
status: string;
|
|
74
|
+
pedding: any;
|
|
75
|
+
resolve: string;
|
|
76
|
+
index: StepStatusEnum.Pin;
|
|
77
|
+
peddingStyle: {};
|
|
78
|
+
reject?: undefined;
|
|
79
|
+
} | {
|
|
80
|
+
type: StemTypeEnum;
|
|
81
|
+
status: string;
|
|
82
|
+
pedding: any;
|
|
83
|
+
resolve: string;
|
|
84
|
+
index: StepStatusEnum.Processing;
|
|
85
|
+
peddingStyle: {};
|
|
86
|
+
reject?: undefined;
|
|
87
|
+
} | {
|
|
88
|
+
type: StemTypeEnum;
|
|
89
|
+
status: string;
|
|
90
|
+
pedding: React.JSX.Element;
|
|
91
|
+
resolve: any;
|
|
92
|
+
reject: any;
|
|
93
|
+
index: StepStatusEnum.Receipt;
|
|
94
|
+
peddingStyle: {};
|
|
95
|
+
} | {
|
|
96
|
+
type: StemTypeEnum;
|
|
97
|
+
status: string;
|
|
98
|
+
pedding: any;
|
|
99
|
+
resolve: any;
|
|
100
|
+
index: StepStatusEnum.Wait;
|
|
101
|
+
peddingStyle: {};
|
|
102
|
+
reject?: undefined;
|
|
103
|
+
} | null;
|
|
104
|
+
export declare type StepType = NonNullable<ReturnType<typeof getStepMapping>>;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import { locales } from '@pisell/utils';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { EftposEnum, StatusEnum, PayRouteEnum, ModeEnum } from "../const";
|
|
10
|
+
export var getStep = function getStep() {
|
|
11
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
12
|
+
amount: '0',
|
|
13
|
+
symbol: '',
|
|
14
|
+
mode: ModeEnum.Pay
|
|
15
|
+
},
|
|
16
|
+
amount = _ref.amount,
|
|
17
|
+
symbol = _ref.symbol,
|
|
18
|
+
mode = _ref.mode;
|
|
19
|
+
return [{
|
|
20
|
+
title: locales.getText('page.eftpos-pay.text.loading')(mode || ModeEnum.Pay),
|
|
21
|
+
key: Date.now(),
|
|
22
|
+
text: locales.getText('page.eftpos-pay.text.wait')(symbol + amount, mode),
|
|
23
|
+
// 'Asked EFTPOS to accept payment for Purchase $100...',
|
|
24
|
+
warn: '',
|
|
25
|
+
tip: locales.getText('page.eftpos-pay.text.processing'),
|
|
26
|
+
status: StatusEnum.Loading
|
|
27
|
+
}, {
|
|
28
|
+
title: locales.getText('page.eftpos-pay.text.loading')(mode || ModeEnum.Pay),
|
|
29
|
+
key: Date.now(),
|
|
30
|
+
text: locales.getText('page.eftpos-pay.text.pin'),
|
|
31
|
+
warn: '',
|
|
32
|
+
tip: locales.getText('page.eftpos-pay.text.processing'),
|
|
33
|
+
status: StatusEnum.Loading
|
|
34
|
+
}, {
|
|
35
|
+
title: locales.getText('page.eftpos-pay.text.loading')(mode || ModeEnum.Pay),
|
|
36
|
+
key: Date.now(),
|
|
37
|
+
text: locales.getText('page.eftpos-pay.text.receipt'),
|
|
38
|
+
warn: '',
|
|
39
|
+
tip: locales.getText('page.eftpos-pay.text.processing'),
|
|
40
|
+
status: StatusEnum.Loading
|
|
41
|
+
}, {
|
|
42
|
+
title: locales.getText('page.eftpos-pay.text.loading')(mode || ModeEnum.Pay),
|
|
43
|
+
key: Date.now(),
|
|
44
|
+
text: locales.getText('page.eftpos-pay.text.receipt.again.title'),
|
|
45
|
+
warn: locales.getText('page.eftpos-pay.text.receipt.again.text'),
|
|
46
|
+
tip: '',
|
|
47
|
+
status: StatusEnum.Warn
|
|
48
|
+
}, {
|
|
49
|
+
title: locales.getText('page.eftpos-pay.text.loading')(mode || ModeEnum.Pay),
|
|
50
|
+
key: Date.now(),
|
|
51
|
+
text: locales.getText('page.eftpos-pay.text.waiting.processing'),
|
|
52
|
+
success: 'Approade',
|
|
53
|
+
warn: '',
|
|
54
|
+
tip: locales.getText('page.eftpos-pay.text.processing'),
|
|
55
|
+
status: StatusEnum.Loading
|
|
56
|
+
}];
|
|
57
|
+
};
|
|
58
|
+
var getInitState = function getInitState(params) {
|
|
59
|
+
if (typeof params.number !== 'undefined') {
|
|
60
|
+
params.isPay = true;
|
|
61
|
+
}
|
|
62
|
+
return _objectSpread({
|
|
63
|
+
mode: (params === null || params === void 0 ? void 0 : params.mode) || ModeEnum.Pay,
|
|
64
|
+
eftpos: EftposEnum.Windcave,
|
|
65
|
+
key: Date.now(),
|
|
66
|
+
warn: '',
|
|
67
|
+
step: 0,
|
|
68
|
+
type: PayRouteEnum.Step,
|
|
69
|
+
title: locales.getText('page.eftpos-pay.text.loading')((params === null || params === void 0 ? void 0 : params.mode) || ModeEnum.Pay),
|
|
70
|
+
component: '',
|
|
71
|
+
status: StatusEnum.Loading,
|
|
72
|
+
steps: getStep(params),
|
|
73
|
+
custom: params ? _objectSpread(_objectSpread({}, params), {}, {
|
|
74
|
+
list: [],
|
|
75
|
+
step: 2
|
|
76
|
+
}) : {
|
|
77
|
+
list: [],
|
|
78
|
+
step: 2
|
|
79
|
+
},
|
|
80
|
+
render: true
|
|
81
|
+
}, params.device ? {
|
|
82
|
+
device: params.device
|
|
83
|
+
} : {});
|
|
84
|
+
};
|
|
85
|
+
export default getInitState;
|
|
86
|
+
export function getAmonunt(store) {
|
|
87
|
+
var device = store.device,
|
|
88
|
+
custom = store.custom;
|
|
89
|
+
if (!device || !custom) {
|
|
90
|
+
throw Error('device or custom is not defined');
|
|
91
|
+
}
|
|
92
|
+
var name = custom.name;
|
|
93
|
+
var symbol = custom.symbol;
|
|
94
|
+
// const format = custom.format as string;
|
|
95
|
+
var money = custom.amount;
|
|
96
|
+
var pay = custom.pay;
|
|
97
|
+
var setting = device.setting;
|
|
98
|
+
if (pay) {
|
|
99
|
+
return {
|
|
100
|
+
name: name,
|
|
101
|
+
symbol: symbol,
|
|
102
|
+
// format,
|
|
103
|
+
money: money,
|
|
104
|
+
amount: Number(pay.amount),
|
|
105
|
+
surRate: Number(pay.surRate),
|
|
106
|
+
surMoney: Number(pay.surMoney),
|
|
107
|
+
surcharge: (setting === null || setting === void 0 ? void 0 : setting.surcharge) || false
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (!setting) {
|
|
111
|
+
return {
|
|
112
|
+
name: name,
|
|
113
|
+
symbol: symbol,
|
|
114
|
+
// format,
|
|
115
|
+
money: money,
|
|
116
|
+
amount: money,
|
|
117
|
+
surRate: 0,
|
|
118
|
+
surMoney: 0,
|
|
119
|
+
surcharge: false
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
var surRate = setting.constant_rate || 0;
|
|
123
|
+
var surMoney = setting.constant_money || 0;
|
|
124
|
+
var surcharge = setting.surcharge;
|
|
125
|
+
return {
|
|
126
|
+
name: name,
|
|
127
|
+
symbol: symbol,
|
|
128
|
+
// format,
|
|
129
|
+
money: money,
|
|
130
|
+
amount: money,
|
|
131
|
+
surRate: surcharge ? surRate : 0,
|
|
132
|
+
surMoney: surcharge ? surMoney : 0,
|
|
133
|
+
surcharge: surcharge
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export var StepStatusEnum;
|
|
137
|
+
(function (StepStatusEnum) {
|
|
138
|
+
StepStatusEnum[StepStatusEnum["Free"] = 1] = "Free";
|
|
139
|
+
StepStatusEnum[StepStatusEnum["Card"] = 2] = "Card";
|
|
140
|
+
StepStatusEnum[StepStatusEnum["Account"] = 3] = "Account";
|
|
141
|
+
StepStatusEnum[StepStatusEnum["Application"] = 4] = "Application";
|
|
142
|
+
StepStatusEnum[StepStatusEnum["Pin"] = 5] = "Pin";
|
|
143
|
+
StepStatusEnum[StepStatusEnum["Processing"] = 6] = "Processing";
|
|
144
|
+
StepStatusEnum[StepStatusEnum["Receipt"] = 7] = "Receipt";
|
|
145
|
+
StepStatusEnum[StepStatusEnum["Wait"] = 8] = "Wait";
|
|
146
|
+
})(StepStatusEnum || (StepStatusEnum = {}));
|
|
147
|
+
export var StemTypeEnum;
|
|
148
|
+
(function (StemTypeEnum) {
|
|
149
|
+
StemTypeEnum["Active"] = "active";
|
|
150
|
+
StemTypeEnum["Passive"] = "passive";
|
|
151
|
+
})(StemTypeEnum || (StemTypeEnum = {}));
|
|
152
|
+
export var getStepMapping = function getStepMapping(type, _ref2) {
|
|
153
|
+
var money = _ref2.money,
|
|
154
|
+
_ref2$mode = _ref2.mode,
|
|
155
|
+
mode = _ref2$mode === void 0 ? ModeEnum.Pay : _ref2$mode;
|
|
156
|
+
switch (type) {
|
|
157
|
+
case StepStatusEnum.Free:
|
|
158
|
+
return {
|
|
159
|
+
type: StemTypeEnum.Active,
|
|
160
|
+
// passive active
|
|
161
|
+
status: 'pedding',
|
|
162
|
+
// pedding reject resolve
|
|
163
|
+
pedding: locales.getText('page.eftpos-pay.text.wait')(money || '', mode),
|
|
164
|
+
resolve: '',
|
|
165
|
+
index: type,
|
|
166
|
+
peddingStyle: {}
|
|
167
|
+
};
|
|
168
|
+
case StepStatusEnum.Card:
|
|
169
|
+
return {
|
|
170
|
+
type: StemTypeEnum.Active,
|
|
171
|
+
// passive active
|
|
172
|
+
status: 'pedding',
|
|
173
|
+
// pedding reject resolve
|
|
174
|
+
pedding: locales.getText('page.eftpos-pay.text.card'),
|
|
175
|
+
resolve: '',
|
|
176
|
+
index: type,
|
|
177
|
+
peddingStyle: {}
|
|
178
|
+
};
|
|
179
|
+
case StepStatusEnum.Account:
|
|
180
|
+
return {
|
|
181
|
+
type: StemTypeEnum.Active,
|
|
182
|
+
// passive active
|
|
183
|
+
status: 'pedding',
|
|
184
|
+
// pedding reject resolve
|
|
185
|
+
pedding: locales.getText('page.eftpos-pay.text.account'),
|
|
186
|
+
resolve: '',
|
|
187
|
+
index: type,
|
|
188
|
+
peddingStyle: {}
|
|
189
|
+
};
|
|
190
|
+
case StepStatusEnum.Application:
|
|
191
|
+
return {
|
|
192
|
+
type: StemTypeEnum.Active,
|
|
193
|
+
// passive active
|
|
194
|
+
status: 'pedding',
|
|
195
|
+
// pedding reject resolve
|
|
196
|
+
pedding: locales.getText('page.eftpos-pay.text.application'),
|
|
197
|
+
// '等待客户选择应用', // Waiting for customer to select application/等待客户选择应用
|
|
198
|
+
resolve: '',
|
|
199
|
+
index: type,
|
|
200
|
+
peddingStyle: {}
|
|
201
|
+
};
|
|
202
|
+
case StepStatusEnum.Pin:
|
|
203
|
+
return {
|
|
204
|
+
type: StemTypeEnum.Active,
|
|
205
|
+
// passive active
|
|
206
|
+
status: 'pedding',
|
|
207
|
+
// pedding reject resolve
|
|
208
|
+
pedding: locales.getText('page.eftpos-pay.text.pin'),
|
|
209
|
+
resolve: '',
|
|
210
|
+
index: type,
|
|
211
|
+
peddingStyle: {}
|
|
212
|
+
};
|
|
213
|
+
case StepStatusEnum.Processing:
|
|
214
|
+
return {
|
|
215
|
+
type: StemTypeEnum.Active,
|
|
216
|
+
// passive active
|
|
217
|
+
status: 'pedding',
|
|
218
|
+
// pedding reject resolve
|
|
219
|
+
pedding: locales.getText('page.eftpos-pay.text.transaction.processing'),
|
|
220
|
+
// Processing/处理中
|
|
221
|
+
resolve: '',
|
|
222
|
+
index: type,
|
|
223
|
+
peddingStyle: {}
|
|
224
|
+
};
|
|
225
|
+
case StepStatusEnum.Receipt:
|
|
226
|
+
return {
|
|
227
|
+
type: StemTypeEnum.Passive,
|
|
228
|
+
// passive active
|
|
229
|
+
status: 'pedding',
|
|
230
|
+
//
|
|
231
|
+
pedding: /*#__PURE__*/React.createElement(React.Fragment, null, locales.getText('page.eftpos-pay.text.receipt.again.title'), /*#__PURE__*/React.createElement("br", null), locales.getText('page.eftpos-pay.text.receipt.again.text')),
|
|
232
|
+
resolve: locales.getText('page.eftpos-pay.text.receipt.again.title'),
|
|
233
|
+
reject: locales.getText('page.eftpos-pay.text.receipt.again.title'),
|
|
234
|
+
// locales.getText('page.eftpos-pay.text.waiting.decline'), // 'Wait for the Decline',
|
|
235
|
+
index: type,
|
|
236
|
+
peddingStyle: {}
|
|
237
|
+
};
|
|
238
|
+
case StepStatusEnum.Wait:
|
|
239
|
+
return {
|
|
240
|
+
type: StemTypeEnum.Active,
|
|
241
|
+
// passive active
|
|
242
|
+
status: 'pedding',
|
|
243
|
+
// pedding reject resolve
|
|
244
|
+
pedding: locales.getText('page.eftpos-pay.text.waiting.processing'),
|
|
245
|
+
resolve: locales.getText('page.eftpos-pay.text.approved'),
|
|
246
|
+
index: type,
|
|
247
|
+
peddingStyle: {}
|
|
248
|
+
};
|
|
249
|
+
default:
|
|
250
|
+
// throw Error('');
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PayStatus } from '../const';
|
|
3
|
+
import XhrTimer from './timer';
|
|
4
|
+
export declare const useFail: () => (res: {
|
|
5
|
+
code?: "200" | "4004" | "701000" | "701001" | "701003" | "701004" | "701005" | "701006" | "701007" | undefined;
|
|
6
|
+
}, isMark?: boolean) => void;
|
|
7
|
+
export declare const useValidate: (check: (...agrn: unknown[]) => Promise<unknown>, num: number, onChange: (params: {
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}) => unknown) => readonly [(timeout?: number) => void, React.MutableRefObject<XhrTimer | undefined>];
|