@pisell/private-materials 3.0.136 → 3.0.138
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 +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/forms/single/index.js +3 -0
- package/es/components/eftpos/const.d.ts +26 -0
- package/es/components/eftpos/const.js +40 -8
- package/es/components/eftpos/device.d.ts +3 -2
- package/es/components/eftpos/device.js +6 -5
- package/es/components/eftpos/form/index.d.ts +5 -0
- package/es/components/eftpos/form/index.js +8 -0
- package/es/components/eftpos/hooks.d.ts +34 -0
- package/es/components/{eftposPay/windcave/hook.js → eftpos/hooks.js} +96 -122
- package/es/components/eftpos/icon/apiKey.d.ts +5 -0
- package/es/components/eftpos/icon/apiKey.js +17 -0
- package/es/components/eftpos/icon/device.d.ts +5 -0
- package/es/components/eftpos/icon/device.js +19 -0
- package/es/components/eftpos/index.d.ts +10 -0
- package/es/components/eftpos/index.js +329 -46
- package/es/components/eftpos/index.less +38 -1
- package/es/components/eftpos/locales.d.ts +12 -0
- package/es/components/eftpos/locales.js +15 -3
- package/es/components/eftpos/log.d.ts +8 -0
- package/es/components/eftpos/log.js +85 -0
- package/es/components/eftpos/pos.d.ts +1 -1
- package/es/components/eftpos/pos.js +8 -5
- package/es/components/eftpos/surcharge/index.d.ts +25 -2
- package/es/components/eftpos/surcharge/index.js +100 -16
- package/es/components/eftpos/table.d.ts +4 -0
- package/es/components/eftpos/table.js +102 -10
- package/es/components/eftposPay/amount.d.ts +7 -1
- package/es/components/eftposPay/amount.js +65 -38
- package/es/components/eftposPay/component/fail/failCustom.js +65 -20
- package/es/components/eftposPay/component/fail/index.js +60 -30
- package/es/components/eftposPay/component/fail/network.d.ts +5 -0
- package/es/components/eftposPay/component/fail/network.js +13 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +6 -0
- package/es/components/eftposPay/component/fail/unknow.js +18 -3
- package/es/components/eftposPay/component/header/index.d.ts +2 -1
- package/es/components/eftposPay/component/header/index.js +4 -1
- package/es/components/eftposPay/component/header/index.less +1 -10
- package/es/components/eftposPay/component/manual/index.d.ts +6 -1
- package/es/components/eftposPay/component/manual/index.js +174 -23
- package/es/components/eftposPay/component/manual/index.less +42 -14
- package/es/components/eftposPay/component/signature/index.d.ts +5 -0
- package/es/components/eftposPay/component/signature/index.js +20 -2
- package/es/components/eftposPay/component/step/index.d.ts +7 -7
- package/es/components/eftposPay/component/step/step.d.ts +4 -4
- package/es/components/eftposPay/const.d.ts +19 -4
- package/es/components/eftposPay/const.js +4 -2
- package/es/components/eftposPay/device.d.ts +7 -0
- package/es/components/eftposPay/device.js +22 -0
- package/es/components/eftposPay/helper.d.ts +54 -0
- package/es/components/eftposPay/helper.js +93 -1
- package/es/components/eftposPay/hooks.d.ts +30 -1
- package/es/components/eftposPay/hooks.js +181 -26
- package/es/components/eftposPay/index.d.ts +2 -4
- package/es/components/eftposPay/index.js +119 -31
- package/es/components/eftposPay/index.less +27 -19
- package/es/components/eftposPay/locales.d.ts +45 -0
- package/es/components/eftposPay/locales.js +348 -3
- package/es/components/eftposPay/manufacturer.d.ts +2 -2
- package/es/components/eftposPay/manufacturer.js +9 -10
- package/es/components/eftposPay/pay.d.ts +10 -1
- package/es/components/eftposPay/pay.js +112 -34
- package/es/components/eftposPay/payo/config.js +137 -270
- package/es/components/eftposPay/payo/const.d.ts +22 -2
- package/es/components/eftposPay/payo/const.js +83 -33
- package/es/components/eftposPay/payo/hooks.d.ts +5 -0
- package/es/components/eftposPay/payo/hooks.js +19 -2
- package/es/components/eftposPay/store/index.d.ts +154 -53
- package/es/components/eftposPay/store/index.js +112 -60
- package/es/components/eftposPay/tyro/const.d.ts +17 -0
- package/es/components/eftposPay/{eftpos → tyro}/const.js +71 -90
- package/es/components/eftposPay/tyro/hooks.d.ts +14 -0
- package/es/components/eftposPay/tyro/hooks.js +40 -0
- package/es/components/eftposPay/tyro/index.d.ts +9 -0
- package/es/components/eftposPay/tyro/index.js +575 -0
- package/es/components/eftposPay/windcave/const.d.ts +24 -9
- package/es/components/eftposPay/windcave/const.js +90 -81
- package/es/components/eftposPay/windcave/helper.d.ts +16 -2
- package/es/components/eftposPay/windcave/helper.js +175 -42
- package/es/components/eftposPay/windcave/receiptAction.d.ts +12 -0
- package/es/components/eftposPay/windcave/receiptAction.js +91 -43
- package/es/components/eftposPay/windcave/timer.d.ts +13 -1
- package/es/components/eftposPay/windcave/timer.js +18 -1
- package/es/components/eftposPay/windcave/windcave.d.ts +2 -1
- package/es/components/eftposPay/windcave/windcave.js +155 -139
- package/es/utils/load.d.ts +11 -0
- package/es/utils/load.js +85 -0
- package/lib/components/booking/forms/single/index.js +1 -0
- package/lib/components/eftpos/const.d.ts +26 -0
- package/lib/components/eftpos/const.js +13 -1
- package/lib/components/eftpos/device.d.ts +3 -2
- package/lib/components/eftpos/device.js +2 -2
- package/lib/components/eftpos/form/index.d.ts +5 -0
- package/lib/components/eftpos/hooks.d.ts +34 -0
- package/lib/components/eftpos/hooks.js +106 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +5 -0
- package/lib/components/eftpos/icon/apiKey.js +57 -0
- package/lib/components/eftpos/icon/device.d.ts +5 -0
- package/lib/components/eftpos/icon/device.js +57 -0
- package/lib/components/eftpos/index.d.ts +10 -0
- package/lib/components/eftpos/index.js +262 -97
- package/lib/components/eftpos/index.less +38 -1
- package/lib/components/eftpos/locales.d.ts +12 -0
- package/lib/components/eftpos/locales.js +15 -3
- package/lib/components/eftpos/log.d.ts +8 -0
- package/lib/components/eftpos/log.js +87 -0
- package/lib/components/eftpos/pos.d.ts +1 -1
- package/lib/components/eftpos/pos.js +5 -4
- package/lib/components/eftpos/surcharge/index.d.ts +25 -2
- package/lib/components/eftpos/surcharge/index.js +36 -6
- package/lib/components/eftpos/table.d.ts +4 -0
- package/lib/components/eftpos/table.js +40 -8
- package/lib/components/eftposPay/amount.d.ts +7 -1
- package/lib/components/eftposPay/amount.js +10 -33
- package/lib/components/eftposPay/component/fail/failCustom.js +27 -6
- package/lib/components/eftposPay/component/fail/index.js +39 -18
- package/lib/components/eftposPay/component/fail/network.d.ts +5 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +6 -0
- package/lib/components/eftposPay/component/fail/unknow.js +3 -3
- package/lib/components/eftposPay/component/header/index.d.ts +2 -1
- package/lib/components/eftposPay/component/header/index.js +2 -1
- package/lib/components/eftposPay/component/header/index.less +1 -10
- package/lib/components/eftposPay/component/manual/index.d.ts +6 -1
- package/lib/components/eftposPay/component/manual/index.js +122 -31
- package/lib/components/eftposPay/component/manual/index.less +42 -14
- package/lib/components/eftposPay/component/signature/index.d.ts +5 -0
- package/lib/components/eftposPay/component/signature/index.js +2 -2
- package/lib/components/eftposPay/component/step/index.d.ts +7 -7
- package/lib/components/eftposPay/component/step/step.d.ts +4 -4
- package/lib/components/eftposPay/const.d.ts +19 -4
- package/lib/components/eftposPay/const.js +3 -1
- package/lib/components/eftposPay/device.d.ts +7 -0
- package/lib/components/eftposPay/helper.d.ts +54 -0
- package/lib/components/eftposPay/helper.js +64 -0
- package/lib/components/eftposPay/hooks.d.ts +30 -1
- package/lib/components/eftposPay/hooks.js +182 -44
- package/lib/components/eftposPay/index.d.ts +2 -4
- package/lib/components/eftposPay/index.js +74 -27
- package/lib/components/eftposPay/index.less +27 -19
- package/lib/components/eftposPay/locales.d.ts +45 -0
- package/lib/components/eftposPay/locales.js +352 -3
- package/lib/components/eftposPay/manufacturer.d.ts +2 -2
- package/lib/components/eftposPay/manufacturer.js +13 -13
- package/lib/components/eftposPay/pay.d.ts +10 -1
- package/lib/components/eftposPay/pay.js +86 -25
- package/lib/components/eftposPay/payo/config.js +121 -268
- package/lib/components/eftposPay/payo/const.d.ts +22 -2
- package/lib/components/eftposPay/payo/const.js +55 -36
- package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
- package/lib/components/eftposPay/payo/hooks.js +1 -1
- package/lib/components/eftposPay/store/index.d.ts +154 -53
- package/lib/components/eftposPay/store/index.js +7 -66
- package/lib/components/eftposPay/tyro/const.d.ts +17 -0
- package/lib/components/eftposPay/tyro/const.js +114 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +14 -0
- package/lib/components/eftposPay/{eftpos/index.js → tyro/hooks.js} +31 -36
- package/lib/components/eftposPay/tyro/index.d.ts +9 -0
- package/lib/components/eftposPay/tyro/index.js +558 -0
- package/lib/components/eftposPay/windcave/const.d.ts +24 -9
- package/lib/components/eftposPay/windcave/const.js +53 -104
- package/lib/components/eftposPay/windcave/helper.d.ts +16 -2
- package/lib/components/eftposPay/windcave/helper.js +163 -48
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +12 -0
- package/lib/components/eftposPay/windcave/receiptAction.js +15 -47
- package/lib/components/eftposPay/windcave/timer.d.ts +13 -1
- package/lib/components/eftposPay/windcave/timer.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +2 -1
- package/lib/components/eftposPay/windcave/windcave.js +130 -130
- package/lib/utils/load.d.ts +11 -0
- package/lib/utils/load.js +100 -0
- package/lowcode/eftpos/meta.ts +202 -160
- package/lowcode/eftpos-pay/meta.ts +45 -12
- package/package.json +4 -4
- package/es/components/eftposPay/eftpos/config.d.ts +0 -11
- package/es/components/eftposPay/eftpos/config.js +0 -178
- package/es/components/eftposPay/eftpos/const.d.ts +0 -10
- package/es/components/eftposPay/eftpos/index.d.ts +0 -7
- package/es/components/eftposPay/eftpos/index.js +0 -35
- package/es/components/eftposPay/windcave/action.d.ts +0 -8
- package/es/components/eftposPay/windcave/action.js +0 -104
- package/es/components/eftposPay/windcave/hook.d.ts +0 -14
- package/es/components/eftposPay/windcave/index.d.ts +0 -8
- package/es/components/eftposPay/windcave/index.js +0 -49
- package/es/components/eftposPay/windcave/pos.d.ts +0 -8
- package/es/components/eftposPay/windcave/pos.js +0 -180
- package/es/components/eftposPay/windcave/pwd.d.ts +0 -8
- package/es/components/eftposPay/windcave/pwd.js +0 -124
- package/es/components/eftposPay/windcave/receipet.d.ts +0 -6
- package/es/components/eftposPay/windcave/receipet.js +0 -67
- package/es/components/eftposPay/windcave/wait.d.ts +0 -12
- package/es/components/eftposPay/windcave/wait.js +0 -139
- package/lib/components/eftposPay/eftpos/config.d.ts +0 -11
- package/lib/components/eftposPay/eftpos/config.js +0 -199
- package/lib/components/eftposPay/eftpos/const.d.ts +0 -10
- package/lib/components/eftposPay/eftpos/const.js +0 -165
- package/lib/components/eftposPay/eftpos/index.d.ts +0 -7
- package/lib/components/eftposPay/windcave/action.d.ts +0 -8
- package/lib/components/eftposPay/windcave/action.js +0 -143
- package/lib/components/eftposPay/windcave/hook.d.ts +0 -14
- package/lib/components/eftposPay/windcave/hook.js +0 -139
- package/lib/components/eftposPay/windcave/index.d.ts +0 -8
- package/lib/components/eftposPay/windcave/index.js +0 -78
- package/lib/components/eftposPay/windcave/pos.d.ts +0 -8
- package/lib/components/eftposPay/windcave/pos.js +0 -197
- package/lib/components/eftposPay/windcave/pwd.d.ts +0 -8
- package/lib/components/eftposPay/windcave/pwd.js +0 -143
- package/lib/components/eftposPay/windcave/receipet.d.ts +0 -6
- package/lib/components/eftposPay/windcave/receipet.js +0 -93
- package/lib/components/eftposPay/windcave/wait.d.ts +0 -12
- package/lib/components/eftposPay/windcave/wait.js +0 -163
|
@@ -38,16 +38,13 @@ __export(store_exports, {
|
|
|
38
38
|
updateCurrentCustomStemItem: () => updateCurrentCustomStemItem,
|
|
39
39
|
updateCurrentStemItem: () => updateCurrentStemItem,
|
|
40
40
|
updateCustom: () => updateCustom,
|
|
41
|
-
updateCustomStemItem: () => updateCustomStemItem,
|
|
42
41
|
updateDevice: () => updateDevice,
|
|
43
42
|
updateKey: () => updateKey,
|
|
44
43
|
updateNextStep: () => updateNextStep,
|
|
45
44
|
updateState: () => updateState,
|
|
46
45
|
updateStatus: () => updateStatus,
|
|
47
|
-
updateStep: () => updateStep,
|
|
48
46
|
updateStepKey: () => updateStepKey,
|
|
49
47
|
updateSteps: () => updateSteps,
|
|
50
|
-
updateWarn: () => updateWarn,
|
|
51
48
|
useContextData: () => useContextData,
|
|
52
49
|
useDispatch: () => useDispatch
|
|
53
50
|
});
|
|
@@ -60,7 +57,6 @@ var EActionTypes = /* @__PURE__ */ ((EActionTypes2) => {
|
|
|
60
57
|
EActionTypes2["UPDATE_INIT"] = "UPDATE_INIT";
|
|
61
58
|
EActionTypes2["UPDATE_CUSTOM"] = "UPDATE_CUSTOM";
|
|
62
59
|
EActionTypes2["UPDATE_KEY"] = "UPDATE_KEY";
|
|
63
|
-
EActionTypes2["UPDATE_STEP"] = "UPDATE_STEP";
|
|
64
60
|
EActionTypes2["UPDATE_STEP_KEY"] = "UPDATE_STEP_KEY";
|
|
65
61
|
EActionTypes2["UPDATE_DEVICE"] = "UPDATE_DEVICE";
|
|
66
62
|
EActionTypes2["UPDATE_NEXT_STEP"] = "UPDATE_NEXT_STEP";
|
|
@@ -69,9 +65,7 @@ var EActionTypes = /* @__PURE__ */ ((EActionTypes2) => {
|
|
|
69
65
|
EActionTypes2["UPDATE_LOADING"] = "UPDATE_LOADING";
|
|
70
66
|
EActionTypes2["UPDATE_COMPONENT"] = "UPDATE_COMPONENT";
|
|
71
67
|
EActionTypes2["UPDATE_STEPS"] = "UPDATE_STEPS";
|
|
72
|
-
EActionTypes2["UPDATE_WARN"] = "UPDATE_WARN";
|
|
73
68
|
EActionTypes2["UPDATE_STEP_CURRENT_ITEM_CUSTOM"] = "UPDATE_STEP_CURRENT_ITEM_CUSTOM";
|
|
74
|
-
EActionTypes2["UPDATE_STEP_ITEM_CUSTOM"] = "UPDATE_STEP_ITEM_CUSTOM";
|
|
75
69
|
EActionTypes2["UPDATE_STEP_ITEM"] = "UPDATE_STEP_ITEM";
|
|
76
70
|
EActionTypes2["BACKUP_PRODUCTION"] = "BACKUP_PRODUCTION";
|
|
77
71
|
EActionTypes2["BACKUP_FREE"] = "BACKUP_FREE";
|
|
@@ -95,10 +89,6 @@ var updateNextStep = (warn) => ({
|
|
|
95
89
|
type: "UPDATE_NEXT_STEP" /* UPDATE_NEXT_STEP */,
|
|
96
90
|
payload: warn ? { warn } : {}
|
|
97
91
|
});
|
|
98
|
-
var updateStep = (payload) => ({
|
|
99
|
-
type: "UPDATE_STEP" /* UPDATE_STEP */,
|
|
100
|
-
payload
|
|
101
|
-
});
|
|
102
92
|
var updateCustom = (payload) => ({
|
|
103
93
|
type: "UPDATE_CUSTOM" /* UPDATE_CUSTOM */,
|
|
104
94
|
payload
|
|
@@ -107,10 +97,6 @@ var updateStatus = (status) => ({
|
|
|
107
97
|
type: "UPDATE_LOADING" /* UPDATE_LOADING */,
|
|
108
98
|
payload: { status }
|
|
109
99
|
});
|
|
110
|
-
var updateWarn = (warn) => ({
|
|
111
|
-
type: "UPDATE_WARN" /* UPDATE_WARN */,
|
|
112
|
-
payload: { warn }
|
|
113
|
-
});
|
|
114
100
|
var updateComponent = (component, render) => ({
|
|
115
101
|
type: "UPDATE_COMPONENT" /* UPDATE_COMPONENT */,
|
|
116
102
|
payload: component ? {
|
|
@@ -134,10 +120,6 @@ var updateCurrentCustomStemItem = (payload) => ({
|
|
|
134
120
|
type: "UPDATE_STEP_CURRENT_ITEM_CUSTOM" /* UPDATE_STEP_CURRENT_ITEM_CUSTOM */,
|
|
135
121
|
payload
|
|
136
122
|
});
|
|
137
|
-
var updateCustomStemItem = (payload) => ({
|
|
138
|
-
type: "UPDATE_STEP_ITEM_CUSTOM" /* UPDATE_STEP_ITEM_CUSTOM */,
|
|
139
|
-
payload
|
|
140
|
-
});
|
|
141
123
|
var updateCurrentStemItem = (payload) => ({
|
|
142
124
|
type: "UPDATE_STEP_ITEM" /* UPDATE_STEP_ITEM */,
|
|
143
125
|
payload
|
|
@@ -153,12 +135,17 @@ var backUpFree = (payload) => ({
|
|
|
153
135
|
}
|
|
154
136
|
});
|
|
155
137
|
var initialState = {
|
|
138
|
+
name: "",
|
|
139
|
+
symbol: "",
|
|
140
|
+
amount: "",
|
|
141
|
+
order_id: "",
|
|
156
142
|
mode: import_const.ModeEnum.Pay,
|
|
157
143
|
eftpos: "",
|
|
158
144
|
key: 0,
|
|
159
145
|
step: 0,
|
|
160
146
|
type: import_const.PayRouteEnum.Step,
|
|
161
|
-
title: "
|
|
147
|
+
title: "",
|
|
148
|
+
net: true,
|
|
162
149
|
component: "",
|
|
163
150
|
status: import_const.StatusEnum.Loading,
|
|
164
151
|
steps: [],
|
|
@@ -199,27 +186,6 @@ function reducers(state, action) {
|
|
|
199
186
|
...state,
|
|
200
187
|
...action.payload
|
|
201
188
|
};
|
|
202
|
-
case "UPDATE_STEP" /* UPDATE_STEP */:
|
|
203
|
-
if (state.type === "unset") {
|
|
204
|
-
return state;
|
|
205
|
-
}
|
|
206
|
-
const { step } = action.payload;
|
|
207
|
-
state.steps.forEach((s2, index2) => {
|
|
208
|
-
if (index2 < step) {
|
|
209
|
-
s2.status = "success";
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
const current = step < state.steps.length - 1 ? step : state.steps.length - 1;
|
|
213
|
-
console.log("current ", current);
|
|
214
|
-
return {
|
|
215
|
-
...state,
|
|
216
|
-
...{
|
|
217
|
-
step: current,
|
|
218
|
-
warn: action.payload.warn || "",
|
|
219
|
-
status: state.steps[current].status,
|
|
220
|
-
steps: [...state.steps]
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
189
|
case "UPDATE_LOADING" /* UPDATE_LOADING */:
|
|
224
190
|
return {
|
|
225
191
|
...state,
|
|
@@ -229,7 +195,7 @@ function reducers(state, action) {
|
|
|
229
195
|
return {
|
|
230
196
|
...state,
|
|
231
197
|
...action.payload,
|
|
232
|
-
|
|
198
|
+
form: state.component
|
|
233
199
|
};
|
|
234
200
|
case "UPDATE_STEPS" /* UPDATE_STEPS */:
|
|
235
201
|
return {
|
|
@@ -245,11 +211,6 @@ function reducers(state, action) {
|
|
|
245
211
|
...state,
|
|
246
212
|
steps: [...state.steps]
|
|
247
213
|
};
|
|
248
|
-
case "UPDATE_WARN" /* UPDATE_WARN */:
|
|
249
|
-
return {
|
|
250
|
-
...state,
|
|
251
|
-
...action.payload
|
|
252
|
-
};
|
|
253
214
|
case "UPDATE_STEP_CURRENT_ITEM_CUSTOM" /* UPDATE_STEP_CURRENT_ITEM_CUSTOM */:
|
|
254
215
|
if (state.steps[state.step].custom) {
|
|
255
216
|
state.steps[state.step].custom = {
|
|
@@ -265,23 +226,6 @@ function reducers(state, action) {
|
|
|
265
226
|
...state,
|
|
266
227
|
steps: [...state.steps]
|
|
267
228
|
};
|
|
268
|
-
case "UPDATE_STEP_ITEM_CUSTOM" /* UPDATE_STEP_ITEM_CUSTOM */:
|
|
269
|
-
const index = action.payload.step;
|
|
270
|
-
const { custom } = action.payload;
|
|
271
|
-
if (state.steps[index].custom) {
|
|
272
|
-
state.steps[index].custom = {
|
|
273
|
-
...state.steps[index].custom,
|
|
274
|
-
...custom
|
|
275
|
-
};
|
|
276
|
-
} else {
|
|
277
|
-
state.steps[index].custom = {
|
|
278
|
-
...custom
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
return {
|
|
282
|
-
...state,
|
|
283
|
-
steps: [...state.steps]
|
|
284
|
-
};
|
|
285
229
|
case "UPDATE_STEP_KEY" /* UPDATE_STEP_KEY */:
|
|
286
230
|
state.steps[state.step].key = Date.now();
|
|
287
231
|
return {
|
|
@@ -356,16 +300,13 @@ function useDispatch() {
|
|
|
356
300
|
updateCurrentCustomStemItem,
|
|
357
301
|
updateCurrentStemItem,
|
|
358
302
|
updateCustom,
|
|
359
|
-
updateCustomStemItem,
|
|
360
303
|
updateDevice,
|
|
361
304
|
updateKey,
|
|
362
305
|
updateNextStep,
|
|
363
306
|
updateState,
|
|
364
307
|
updateStatus,
|
|
365
|
-
updateStep,
|
|
366
308
|
updateStepKey,
|
|
367
309
|
updateSteps,
|
|
368
|
-
updateWarn,
|
|
369
310
|
useContextData,
|
|
370
311
|
useDispatch
|
|
371
312
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Amount } from '../const';
|
|
2
|
+
import { State } from '../store';
|
|
3
|
+
/**
|
|
4
|
+
* @title: 初始化 tyro 数据
|
|
5
|
+
* @Author: hongbing.wang
|
|
6
|
+
* @Date: 2024-08-20 13:50
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: (params: any) => State;
|
|
9
|
+
export default _default;
|
|
10
|
+
/**
|
|
11
|
+
* @title: tyro 金额信息
|
|
12
|
+
* @description: 在 amount 页面设置则使用 pay ,如果有 setting 则使用 setting 信息 ,都没有则设置0
|
|
13
|
+
* @param {State} store : 全局store数据管理
|
|
14
|
+
* @Author: hongbing.wang
|
|
15
|
+
* @Date: 2024-08-12 10:24
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAmonunt(store: State): Amount;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/eftposPay/tyro/const.tsx
|
|
20
|
+
var const_exports = {};
|
|
21
|
+
__export(const_exports, {
|
|
22
|
+
default: () => const_default,
|
|
23
|
+
getAmonunt: () => getAmonunt
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(const_exports);
|
|
26
|
+
var import_utils = require("@pisell/utils");
|
|
27
|
+
var import_const = require("../const");
|
|
28
|
+
var const_default = (params) => {
|
|
29
|
+
const {
|
|
30
|
+
order_id,
|
|
31
|
+
name,
|
|
32
|
+
symbol,
|
|
33
|
+
amount,
|
|
34
|
+
mode,
|
|
35
|
+
number,
|
|
36
|
+
pay,
|
|
37
|
+
device,
|
|
38
|
+
net,
|
|
39
|
+
...other
|
|
40
|
+
} = params || {
|
|
41
|
+
mode: import_const.ModeEnum.Pay
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
name,
|
|
45
|
+
symbol,
|
|
46
|
+
amount,
|
|
47
|
+
order_id,
|
|
48
|
+
mode,
|
|
49
|
+
eftpos: import_const.EftposEnum.Tyro,
|
|
50
|
+
key: Date.now(),
|
|
51
|
+
warn: "",
|
|
52
|
+
step: 0,
|
|
53
|
+
type: import_const.PayRouteEnum.Step,
|
|
54
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
|
|
55
|
+
component: "",
|
|
56
|
+
status: import_const.StatusEnum.Loading,
|
|
57
|
+
steps: [],
|
|
58
|
+
render: true,
|
|
59
|
+
custom: other || {},
|
|
60
|
+
...typeof net !== "undefined" ? { net } : {},
|
|
61
|
+
...typeof number !== "undefined" ? { number } : {},
|
|
62
|
+
...typeof pay !== "undefined" ? { pay } : {},
|
|
63
|
+
...typeof device !== "undefined" ? { device } : {}
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
function getAmonunt(store) {
|
|
67
|
+
const { device, pay, custom, name, symbol, amount } = store;
|
|
68
|
+
if (!device || !custom) {
|
|
69
|
+
throw Error("device or custom is not defined");
|
|
70
|
+
}
|
|
71
|
+
const setting = device.setting;
|
|
72
|
+
if (pay) {
|
|
73
|
+
return {
|
|
74
|
+
name,
|
|
75
|
+
symbol,
|
|
76
|
+
money: Number(amount),
|
|
77
|
+
amount: Number(pay.amount),
|
|
78
|
+
surRate: Number(pay.surRate),
|
|
79
|
+
surMoney: Number(pay.surMoney),
|
|
80
|
+
surcharge: (setting == null ? void 0 : setting.surcharge) || false,
|
|
81
|
+
useOriginSurcharge: (pay == null ? void 0 : pay.useOriginSurcharge) || false
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (!setting) {
|
|
85
|
+
return {
|
|
86
|
+
name,
|
|
87
|
+
symbol,
|
|
88
|
+
money: Number(amount),
|
|
89
|
+
amount: Number(amount),
|
|
90
|
+
surRate: 0,
|
|
91
|
+
surMoney: 0,
|
|
92
|
+
surcharge: false,
|
|
93
|
+
useOriginSurcharge: false
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const surRate = setting.constant_rate || 0;
|
|
97
|
+
const surMoney = setting.constant_money || 0;
|
|
98
|
+
const surcharge = setting.surcharge;
|
|
99
|
+
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
100
|
+
return {
|
|
101
|
+
name,
|
|
102
|
+
symbol,
|
|
103
|
+
money: Number(amount),
|
|
104
|
+
amount: Number(amount),
|
|
105
|
+
surRate: useOriginSurcharge ? 0 : surcharge ? surRate : 0,
|
|
106
|
+
surMoney: useOriginSurcharge ? 0 : surcharge ? surMoney : 0,
|
|
107
|
+
surcharge,
|
|
108
|
+
useOriginSurcharge
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
112
|
+
0 && (module.exports = {
|
|
113
|
+
getAmonunt
|
|
114
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* @title: 获取 Tyro 资源
|
|
4
|
+
* @description:
|
|
5
|
+
* @param {Eftpos} type 类型
|
|
6
|
+
* @param {string} url 链接
|
|
7
|
+
* @return {*}
|
|
8
|
+
* @Author: hongbing.wang
|
|
9
|
+
* @Date: 2024-08-19 18:36
|
|
10
|
+
*/
|
|
11
|
+
export declare const useTyro: (params: {
|
|
12
|
+
url?: string | undefined;
|
|
13
|
+
version?: string | undefined;
|
|
14
|
+
}) => readonly [import("react").MutableRefObject<any>, boolean];
|
|
@@ -26,41 +26,36 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// src/components/eftposPay/
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
32
|
-
|
|
29
|
+
// src/components/eftposPay/tyro/hooks.tsx
|
|
30
|
+
var hooks_exports = {};
|
|
31
|
+
__export(hooks_exports, {
|
|
32
|
+
useTyro: () => useTyro
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var import_react =
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (idx === 5)
|
|
58
|
-
Comm = import_config.ReceipetAgain;
|
|
59
|
-
if (idx === 6)
|
|
60
|
-
Comm = import_config.Wait;
|
|
61
|
-
if (!Comm) {
|
|
62
|
-
throw new Error("no comm");
|
|
63
|
-
}
|
|
64
|
-
return /* @__PURE__ */ import_react.default.createElement(Comm, { key: `${data.key}-${item.key}-${idx}` });
|
|
65
|
-
}), children, data.status !== import_const.StatusEnum.Success ? /* @__PURE__ */ import_react.default.createElement(import_config.Action, { index: step }) : null);
|
|
34
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_load = __toESM(require("../../../utils/load"));
|
|
37
|
+
var useTyro = (params) => {
|
|
38
|
+
const ref = (0, import_react.useRef)();
|
|
39
|
+
const [load, setLoad] = (0, import_react.useState)(false);
|
|
40
|
+
const url = (0, import_react.useMemo)(() => {
|
|
41
|
+
return params && params.url && params.version ? `${params.url}/${params.version}` : "https://iclientsimulator.test.tyro.com/iclient-v1.js";
|
|
42
|
+
}, [params]);
|
|
43
|
+
(0, import_react.useEffect)(() => {
|
|
44
|
+
(0, import_load.default)(url, document.head).then(() => {
|
|
45
|
+
return window == null ? void 0 : window.TYRO;
|
|
46
|
+
}).then(
|
|
47
|
+
(res) => {
|
|
48
|
+
setLoad(true);
|
|
49
|
+
ref.current = res;
|
|
50
|
+
},
|
|
51
|
+
() => {
|
|
52
|
+
setLoad(true);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}, [url]);
|
|
56
|
+
return [ref, load];
|
|
66
57
|
};
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
useTyro
|
|
61
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: ({ api, onChange, children, url, version, }: {
|
|
3
|
+
api: any;
|
|
4
|
+
onChange: any;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
url?: string | undefined;
|
|
7
|
+
version?: string | undefined;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default _default;
|