@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,143 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftposPay/windcave/action.tsx
|
|
30
|
+
var action_exports = {};
|
|
31
|
+
__export(action_exports, {
|
|
32
|
+
default: () => action_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(action_exports);
|
|
35
|
+
var import_utils = require("@pisell/utils");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_store = require("../store");
|
|
39
|
+
var action_default = ({
|
|
40
|
+
index,
|
|
41
|
+
api
|
|
42
|
+
}) => {
|
|
43
|
+
const [disabled, setDisabled] = (0, import_react.useState)(false);
|
|
44
|
+
const dispatch = (0, import_store.useDispatch)();
|
|
45
|
+
const data = (0, import_store.useContextData)();
|
|
46
|
+
const { custom } = (0, import_store.useContextData)();
|
|
47
|
+
const onCancel = () => {
|
|
48
|
+
setDisabled(true);
|
|
49
|
+
api.update({
|
|
50
|
+
type: "CANCEL",
|
|
51
|
+
number: custom == null ? void 0 : custom.number
|
|
52
|
+
}).then(() => {
|
|
53
|
+
dispatch((0, import_store.updateComponent)("Fail"));
|
|
54
|
+
data.steps[index].status = "fail";
|
|
55
|
+
data.steps[index].fail = import_utils.locales.getText("page.eftpos-pay.text.cancel");
|
|
56
|
+
dispatch((0, import_store.updateSteps)(data.steps));
|
|
57
|
+
setDisabled(false);
|
|
58
|
+
}).catch((res) => {
|
|
59
|
+
console.log(res);
|
|
60
|
+
setDisabled(false);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const onAccept = () => {
|
|
64
|
+
setDisabled(true);
|
|
65
|
+
api.update({
|
|
66
|
+
type: "YES",
|
|
67
|
+
number: custom == null ? void 0 : custom.number
|
|
68
|
+
}).then(() => {
|
|
69
|
+
setDisabled(false);
|
|
70
|
+
dispatch((0, import_store.updateNextStep)());
|
|
71
|
+
}).catch((res) => {
|
|
72
|
+
setDisabled(false);
|
|
73
|
+
console.log(res);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
const onDecline = () => {
|
|
77
|
+
dispatch((0, import_store.updateComponent)("Signature", true));
|
|
78
|
+
};
|
|
79
|
+
const onManually = () => {
|
|
80
|
+
dispatch(
|
|
81
|
+
(0, import_store.updateState)({
|
|
82
|
+
manual: {
|
|
83
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.request.title")(data.mode),
|
|
84
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.request.text")(data.mode)
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
dispatch((0, import_store.updateComponent)("Manual", true));
|
|
89
|
+
};
|
|
90
|
+
if (index === 0) {
|
|
91
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
|
|
92
|
+
import_antd.Button,
|
|
93
|
+
{
|
|
94
|
+
block: true,
|
|
95
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
96
|
+
onClick: onCancel,
|
|
97
|
+
disabled
|
|
98
|
+
},
|
|
99
|
+
import_utils.locales.getText("page.eftpos-pay.text.cancel")
|
|
100
|
+
));
|
|
101
|
+
}
|
|
102
|
+
if (index > 0 && index < 3) {
|
|
103
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
import_antd.Button,
|
|
105
|
+
{
|
|
106
|
+
block: true,
|
|
107
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
108
|
+
disabled: true
|
|
109
|
+
},
|
|
110
|
+
import_utils.locales.getText("page.eftpos-pay.text.leave")
|
|
111
|
+
));
|
|
112
|
+
}
|
|
113
|
+
if (index === 3) {
|
|
114
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
|
|
115
|
+
import_antd.Button,
|
|
116
|
+
{
|
|
117
|
+
block: true,
|
|
118
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
119
|
+
onClick: onDecline
|
|
120
|
+
},
|
|
121
|
+
import_utils.locales.getText("page.eftpos-pay.text.decline")
|
|
122
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
123
|
+
import_antd.Button,
|
|
124
|
+
{
|
|
125
|
+
block: true,
|
|
126
|
+
type: "primary",
|
|
127
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
128
|
+
onClick: onAccept,
|
|
129
|
+
disabled
|
|
130
|
+
},
|
|
131
|
+
import_utils.locales.getText("page.eftpos-pay.text.accept")
|
|
132
|
+
));
|
|
133
|
+
}
|
|
134
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
|
|
135
|
+
import_antd.Button,
|
|
136
|
+
{
|
|
137
|
+
block: true,
|
|
138
|
+
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
139
|
+
onClick: onManually
|
|
140
|
+
},
|
|
141
|
+
import_utils.locales.getText("page.eftpos-pay.text.manual.marking")
|
|
142
|
+
));
|
|
143
|
+
};
|
|
@@ -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,300 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftposPay/windcave/const.tsx
|
|
30
|
+
var const_exports = {};
|
|
31
|
+
__export(const_exports, {
|
|
32
|
+
StemTypeEnum: () => StemTypeEnum,
|
|
33
|
+
StepStatusEnum: () => StepStatusEnum,
|
|
34
|
+
default: () => const_default,
|
|
35
|
+
getAmonunt: () => getAmonunt,
|
|
36
|
+
getStep: () => getStep,
|
|
37
|
+
getStepMapping: () => getStepMapping
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(const_exports);
|
|
40
|
+
var import_utils = require("@pisell/utils");
|
|
41
|
+
var import_react = __toESM(require("react"));
|
|
42
|
+
var import_const = require("../const");
|
|
43
|
+
var getStep = ({
|
|
44
|
+
amount,
|
|
45
|
+
symbol,
|
|
46
|
+
mode
|
|
47
|
+
} = {
|
|
48
|
+
amount: "0",
|
|
49
|
+
symbol: "",
|
|
50
|
+
mode: import_const.ModeEnum.Pay
|
|
51
|
+
}) => [
|
|
52
|
+
{
|
|
53
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(
|
|
54
|
+
mode || import_const.ModeEnum.Pay
|
|
55
|
+
),
|
|
56
|
+
key: Date.now(),
|
|
57
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.wait")(symbol + amount, mode),
|
|
58
|
+
// 'Asked EFTPOS to accept payment for Purchase $100...',
|
|
59
|
+
warn: "",
|
|
60
|
+
tip: import_utils.locales.getText("page.eftpos-pay.text.processing"),
|
|
61
|
+
status: import_const.StatusEnum.Loading
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(
|
|
65
|
+
mode || import_const.ModeEnum.Pay
|
|
66
|
+
),
|
|
67
|
+
key: Date.now(),
|
|
68
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.pin"),
|
|
69
|
+
warn: "",
|
|
70
|
+
tip: import_utils.locales.getText("page.eftpos-pay.text.processing"),
|
|
71
|
+
status: import_const.StatusEnum.Loading
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(
|
|
75
|
+
mode || import_const.ModeEnum.Pay
|
|
76
|
+
),
|
|
77
|
+
key: Date.now(),
|
|
78
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.receipt"),
|
|
79
|
+
warn: "",
|
|
80
|
+
tip: import_utils.locales.getText("page.eftpos-pay.text.processing"),
|
|
81
|
+
status: import_const.StatusEnum.Loading
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(
|
|
85
|
+
mode || import_const.ModeEnum.Pay
|
|
86
|
+
),
|
|
87
|
+
key: Date.now(),
|
|
88
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.receipt.again.title"),
|
|
89
|
+
warn: import_utils.locales.getText("page.eftpos-pay.text.receipt.again.text"),
|
|
90
|
+
tip: "",
|
|
91
|
+
status: import_const.StatusEnum.Warn
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(
|
|
95
|
+
mode || import_const.ModeEnum.Pay
|
|
96
|
+
),
|
|
97
|
+
key: Date.now(),
|
|
98
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.waiting.processing"),
|
|
99
|
+
success: "Approade",
|
|
100
|
+
warn: "",
|
|
101
|
+
tip: import_utils.locales.getText("page.eftpos-pay.text.processing"),
|
|
102
|
+
status: import_const.StatusEnum.Loading
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
var getInitState = (params) => {
|
|
106
|
+
if (typeof params.number !== "undefined") {
|
|
107
|
+
params.isPay = true;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
mode: (params == null ? void 0 : params.mode) || import_const.ModeEnum.Pay,
|
|
111
|
+
eftpos: import_const.EftposEnum.Windcave,
|
|
112
|
+
key: Date.now(),
|
|
113
|
+
warn: "",
|
|
114
|
+
step: 0,
|
|
115
|
+
type: import_const.PayRouteEnum.Step,
|
|
116
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(
|
|
117
|
+
(params == null ? void 0 : params.mode) || import_const.ModeEnum.Pay
|
|
118
|
+
),
|
|
119
|
+
component: "",
|
|
120
|
+
status: import_const.StatusEnum.Loading,
|
|
121
|
+
steps: getStep(params),
|
|
122
|
+
custom: params ? { ...params, list: [], step: 2 } : { list: [], step: 2 },
|
|
123
|
+
render: true,
|
|
124
|
+
...params.device ? { device: params.device } : {}
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
var const_default = getInitState;
|
|
128
|
+
function getAmonunt(store) {
|
|
129
|
+
const { device, custom } = store;
|
|
130
|
+
if (!device || !custom) {
|
|
131
|
+
throw Error("device or custom is not defined");
|
|
132
|
+
}
|
|
133
|
+
const name = custom.name;
|
|
134
|
+
const symbol = custom.symbol;
|
|
135
|
+
const money = custom.amount;
|
|
136
|
+
const pay = custom.pay;
|
|
137
|
+
const setting = device.setting;
|
|
138
|
+
if (pay) {
|
|
139
|
+
return {
|
|
140
|
+
name,
|
|
141
|
+
symbol,
|
|
142
|
+
// format,
|
|
143
|
+
money,
|
|
144
|
+
amount: Number(pay.amount),
|
|
145
|
+
surRate: Number(pay.surRate),
|
|
146
|
+
surMoney: Number(pay.surMoney),
|
|
147
|
+
surcharge: (setting == null ? void 0 : setting.surcharge) || false
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (!setting) {
|
|
151
|
+
return {
|
|
152
|
+
name,
|
|
153
|
+
symbol,
|
|
154
|
+
// format,
|
|
155
|
+
money,
|
|
156
|
+
amount: money,
|
|
157
|
+
surRate: 0,
|
|
158
|
+
surMoney: 0,
|
|
159
|
+
surcharge: false
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const surRate = setting.constant_rate || 0;
|
|
163
|
+
const surMoney = setting.constant_money || 0;
|
|
164
|
+
const surcharge = setting.surcharge;
|
|
165
|
+
return {
|
|
166
|
+
name,
|
|
167
|
+
symbol,
|
|
168
|
+
// format,
|
|
169
|
+
money,
|
|
170
|
+
amount: money,
|
|
171
|
+
surRate: surcharge ? surRate : 0,
|
|
172
|
+
surMoney: surcharge ? surMoney : 0,
|
|
173
|
+
surcharge
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
var StepStatusEnum = /* @__PURE__ */ ((StepStatusEnum2) => {
|
|
177
|
+
StepStatusEnum2[StepStatusEnum2["Free"] = 1] = "Free";
|
|
178
|
+
StepStatusEnum2[StepStatusEnum2["Card"] = 2] = "Card";
|
|
179
|
+
StepStatusEnum2[StepStatusEnum2["Account"] = 3] = "Account";
|
|
180
|
+
StepStatusEnum2[StepStatusEnum2["Application"] = 4] = "Application";
|
|
181
|
+
StepStatusEnum2[StepStatusEnum2["Pin"] = 5] = "Pin";
|
|
182
|
+
StepStatusEnum2[StepStatusEnum2["Processing"] = 6] = "Processing";
|
|
183
|
+
StepStatusEnum2[StepStatusEnum2["Receipt"] = 7] = "Receipt";
|
|
184
|
+
StepStatusEnum2[StepStatusEnum2["Wait"] = 8] = "Wait";
|
|
185
|
+
return StepStatusEnum2;
|
|
186
|
+
})(StepStatusEnum || {});
|
|
187
|
+
var StemTypeEnum = /* @__PURE__ */ ((StemTypeEnum2) => {
|
|
188
|
+
StemTypeEnum2["Active"] = "active";
|
|
189
|
+
StemTypeEnum2["Passive"] = "passive";
|
|
190
|
+
return StemTypeEnum2;
|
|
191
|
+
})(StemTypeEnum || {});
|
|
192
|
+
var getStepMapping = (type, { money, mode = import_const.ModeEnum.Pay }) => {
|
|
193
|
+
switch (type) {
|
|
194
|
+
case 1 /* Free */:
|
|
195
|
+
return {
|
|
196
|
+
type: "active" /* Active */,
|
|
197
|
+
// passive active
|
|
198
|
+
status: "pedding",
|
|
199
|
+
// pedding reject resolve
|
|
200
|
+
pedding: import_utils.locales.getText("page.eftpos-pay.text.wait")(
|
|
201
|
+
money || "",
|
|
202
|
+
mode
|
|
203
|
+
),
|
|
204
|
+
resolve: "",
|
|
205
|
+
index: type,
|
|
206
|
+
peddingStyle: {}
|
|
207
|
+
};
|
|
208
|
+
case 2 /* Card */:
|
|
209
|
+
return {
|
|
210
|
+
type: "active" /* Active */,
|
|
211
|
+
// passive active
|
|
212
|
+
status: "pedding",
|
|
213
|
+
// pedding reject resolve
|
|
214
|
+
pedding: import_utils.locales.getText("page.eftpos-pay.text.card"),
|
|
215
|
+
resolve: "",
|
|
216
|
+
index: type,
|
|
217
|
+
peddingStyle: {}
|
|
218
|
+
};
|
|
219
|
+
case 3 /* Account */:
|
|
220
|
+
return {
|
|
221
|
+
type: "active" /* Active */,
|
|
222
|
+
// passive active
|
|
223
|
+
status: "pedding",
|
|
224
|
+
// pedding reject resolve
|
|
225
|
+
pedding: import_utils.locales.getText("page.eftpos-pay.text.account"),
|
|
226
|
+
resolve: "",
|
|
227
|
+
index: type,
|
|
228
|
+
peddingStyle: {}
|
|
229
|
+
};
|
|
230
|
+
case 4 /* Application */:
|
|
231
|
+
return {
|
|
232
|
+
type: "active" /* Active */,
|
|
233
|
+
// passive active
|
|
234
|
+
status: "pedding",
|
|
235
|
+
// pedding reject resolve
|
|
236
|
+
pedding: import_utils.locales.getText("page.eftpos-pay.text.application"),
|
|
237
|
+
// '等待客户选择应用', // Waiting for customer to select application/等待客户选择应用
|
|
238
|
+
resolve: "",
|
|
239
|
+
index: type,
|
|
240
|
+
peddingStyle: {}
|
|
241
|
+
};
|
|
242
|
+
case 5 /* Pin */:
|
|
243
|
+
return {
|
|
244
|
+
type: "active" /* Active */,
|
|
245
|
+
// passive active
|
|
246
|
+
status: "pedding",
|
|
247
|
+
// pedding reject resolve
|
|
248
|
+
pedding: import_utils.locales.getText("page.eftpos-pay.text.pin"),
|
|
249
|
+
resolve: "",
|
|
250
|
+
index: type,
|
|
251
|
+
peddingStyle: {}
|
|
252
|
+
};
|
|
253
|
+
case 6 /* Processing */:
|
|
254
|
+
return {
|
|
255
|
+
type: "active" /* Active */,
|
|
256
|
+
// passive active
|
|
257
|
+
status: "pedding",
|
|
258
|
+
// pedding reject resolve
|
|
259
|
+
pedding: import_utils.locales.getText("page.eftpos-pay.text.transaction.processing"),
|
|
260
|
+
// Processing/处理中
|
|
261
|
+
resolve: "",
|
|
262
|
+
index: type,
|
|
263
|
+
peddingStyle: {}
|
|
264
|
+
};
|
|
265
|
+
case 7 /* Receipt */:
|
|
266
|
+
return {
|
|
267
|
+
type: "passive" /* Passive */,
|
|
268
|
+
// passive active
|
|
269
|
+
status: "pedding",
|
|
270
|
+
//
|
|
271
|
+
pedding: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, import_utils.locales.getText("page.eftpos-pay.text.receipt.again.title"), /* @__PURE__ */ import_react.default.createElement("br", null), import_utils.locales.getText("page.eftpos-pay.text.receipt.again.text")),
|
|
272
|
+
resolve: import_utils.locales.getText("page.eftpos-pay.text.receipt.again.title"),
|
|
273
|
+
reject: import_utils.locales.getText("page.eftpos-pay.text.receipt.again.title"),
|
|
274
|
+
// locales.getText('page.eftpos-pay.text.waiting.decline'), // 'Wait for the Decline',
|
|
275
|
+
index: type,
|
|
276
|
+
peddingStyle: {}
|
|
277
|
+
};
|
|
278
|
+
case 8 /* Wait */:
|
|
279
|
+
return {
|
|
280
|
+
type: "active" /* Active */,
|
|
281
|
+
// passive active
|
|
282
|
+
status: "pedding",
|
|
283
|
+
// pedding reject resolve
|
|
284
|
+
pedding: import_utils.locales.getText("page.eftpos-pay.text.waiting.processing"),
|
|
285
|
+
resolve: import_utils.locales.getText("page.eftpos-pay.text.approved"),
|
|
286
|
+
index: type,
|
|
287
|
+
peddingStyle: {}
|
|
288
|
+
};
|
|
289
|
+
default:
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
294
|
+
0 && (module.exports = {
|
|
295
|
+
StemTypeEnum,
|
|
296
|
+
StepStatusEnum,
|
|
297
|
+
getAmonunt,
|
|
298
|
+
getStep,
|
|
299
|
+
getStepMapping
|
|
300
|
+
});
|
|
@@ -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>];
|