@feedmepos/mf-payment 1.2.6 → 1.2.7
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/dist/{PayoutAccount-CFFgQ_65.js → PayoutAccount-90Fg0Eqb.js} +6 -6
- package/dist/{PayoutAccount-CSm0Ldg9.js → PayoutAccount-DS14d5_9.js} +5 -5
- package/dist/{PayoutAccountSetting-rO11Afiw.js → PayoutAccountSetting-PfKPX1B-.js} +3 -3
- package/dist/{Restaurant-CoNFB1rk.js → Restaurant-Dk0X2E1m.js} +4 -4
- package/dist/{RestaurantSetting-BQvg8S_p.js → RestaurantSetting-S0CcLhRS.js} +182 -185
- package/dist/{Settlement-DpmBq0V9.js → Settlement-DlFBQNQZ.js} +3 -3
- package/dist/{Settlement-DEKvU0zP.js → Settlement-DxI1z91R.js} +3 -3
- package/dist/{SettlementTransactions-3alZwucT.js → SettlementTransactions-CRFD0bFO.js} +3 -3
- package/dist/{SettlementTransactions-DugNdpd2.js → SettlementTransactions-DgOj_D8D.js} +3 -3
- package/dist/{Terminal-Dv7zS_te.js → Terminal-Ckx8vQ_3.js} +5 -5
- package/dist/TerminalSetting-DicoKPoS.js +572 -0
- package/dist/{Transaction-DCKhuoVw.js → Transaction-CF_sHrl6.js} +5 -5
- package/dist/{Transaction-CT8Be7FS.js → Transaction-Da1_AnWG.js} +7 -7
- package/dist/{TransactionOld-jkTy7Aeb.js → TransactionOld-6Nm8xhGh.js} +4 -4
- package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-B_By7BvK.js → TransactionTable.vue_vue_type_script_setup_true_lang-CaKdn0VN.js} +3 -3
- package/dist/{app-CiHNgoQY.js → app-C4_gin4V.js} +343 -343
- package/dist/app.js +1 -1
- package/dist/{assets-BqjaEXmB.js → assets-CkJwKbJo.js} +2 -2
- package/dist/{grafana-Bwx9Kj61.js → grafana-5rTce_2u.js} +1 -1
- package/dist/{index-CyMElhGL.js → index-B-dODLCP.js} +2 -2
- package/dist/{index-CZrwq9oF.js → index-B2K92QTs.js} +1 -1
- package/dist/{index-BIDuwnm_.js → index-CjFw5eYb.js} +1 -1
- package/dist/{index-1q4ZbRix.js → index-D_ZQysnD.js} +3909 -3907
- package/dist/{index-CN50SqVG.js → index-REZAHMM0.js} +1 -1
- package/dist/{index-C3fxBVdz.js → index-pQqLjJzo.js} +1 -1
- package/dist/{index-CCIVpogO.js → index-yHpeK6eL.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-DT8A92zR.js → index.vue_vue_type_script_setup_true_lang-B-LNPiqR.js} +1 -1
- package/dist/package.json +2 -2
- package/dist/{payout-account-cg0CKkbk.js → payout-account-DYhD0NF_.js} +3 -3
- package/dist/stores/payoutAccount.d.ts +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +2 -2
- package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +6 -6
- package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +6 -6
- package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +2 -2
- package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +2 -2
- package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +6 -6
- package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
- package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +2 -0
- package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +4 -4
- package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +4 -4
- package/dist/views/admin/terminal/tabs/Information.vue.d.ts +4 -4
- package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +4 -4
- package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +4 -4
- package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +4 -4
- package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +4 -4
- package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +4 -4
- package/package.json +2 -2
- package/dist/TerminalSetting-ChM9jB-O.js +0 -572
@@ -1,572 +0,0 @@
|
|
1
|
-
import { defineComponent as q, openBlock as y, createElementBlock as x, Fragment as D, createElementVNode as I, createTextVNode as M, toDisplayString as R, toRef as P, ref as w, watch as Y, onMounted as G, computed as O, resolveComponent as v, unref as T, createVNode as p, createBlock as U, withCtx as B, createCommentVNode as S, isRef as h, resolveDynamicComponent as A, normalizeProps as E, mergeProps as z } from "vue";
|
2
|
-
import { u as $, e as k } from "./index-1q4ZbRix.js";
|
3
|
-
import { useRouter as W } from "vue-router";
|
4
|
-
import { t as N } from "./index-CZrwq9oF.js";
|
5
|
-
import { _ as X } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
6
|
-
import { u as H } from "./index-C3fxBVdz.js";
|
7
|
-
import { useSnackbar as J } from "@feedmepos/ui-library";
|
8
|
-
import { u as Z } from "./error-K1CakhA9.js";
|
9
|
-
import { z as ee, a as ae } from "./validator-D5jtpt9A.js";
|
10
|
-
import { useCoreStore as Q } from "@feedmepos/mf-common";
|
11
|
-
const te = /* @__PURE__ */ q({
|
12
|
-
__name: "Information",
|
13
|
-
props: {
|
14
|
-
terminal: {
|
15
|
-
type: Object,
|
16
|
-
required: !0
|
17
|
-
}
|
18
|
-
},
|
19
|
-
setup(f) {
|
20
|
-
return (m, t) => (y(), x(D, null, [
|
21
|
-
t[0] || (t[0] = I("b", null, "Name", -1)),
|
22
|
-
M(": " + R(f.terminal.name), 1),
|
23
|
-
t[1] || (t[1] = I("br", null, null, -1)),
|
24
|
-
t[2] || (t[2] = I("b", null, "Status", -1)),
|
25
|
-
M(": " + R(f.terminal.status), 1),
|
26
|
-
t[3] || (t[3] = I("br", null, null, -1)),
|
27
|
-
t[4] || (t[4] = I("b", null, "Device ID", -1)),
|
28
|
-
M(": " + R(f.terminal.deviceId ?? "-"), 1),
|
29
|
-
t[5] || (t[5] = I("br", null, null, -1)),
|
30
|
-
t[6] || (t[6] = I("b", null, "Device Type", -1)),
|
31
|
-
M(": " + R(f.terminal.deviceType ?? "-"), 1),
|
32
|
-
t[7] || (t[7] = I("br", null, null, -1))
|
33
|
-
], 64));
|
34
|
-
}
|
35
|
-
}), ne = {
|
36
|
-
key: 0,
|
37
|
-
class: "flex items-center justify-center min-h-[80vh]"
|
38
|
-
}, le = { class: "flex mt-6 space-x-6" }, oe = /* @__PURE__ */ q({
|
39
|
-
__name: "TerminalGateway",
|
40
|
-
props: {
|
41
|
-
terminal: {
|
42
|
-
type: Object,
|
43
|
-
required: !0
|
44
|
-
},
|
45
|
-
onUpdate: {
|
46
|
-
type: Function,
|
47
|
-
required: !0
|
48
|
-
}
|
49
|
-
},
|
50
|
-
setup(f) {
|
51
|
-
const { isLoading: m, startAsyncCall: t } = $(), d = f, n = P(() => d.terminal), s = w(), c = w(), a = w(-1), l = w({
|
52
|
-
terminalId: ""
|
53
|
-
}), i = () => {
|
54
|
-
l.value.terminalId = "", a.value = -1;
|
55
|
-
}, r = () => {
|
56
|
-
if (t(async () => {
|
57
|
-
s.value = await N.getRestaurantTerminals(d.terminal.referenceId);
|
58
|
-
}), !d.terminal.ecrs)
|
59
|
-
return i();
|
60
|
-
const u = d.terminal.ecrs.findIndex((o) => o && o.gateway && o.gateway === "FeedMe");
|
61
|
-
if (u === -1)
|
62
|
-
return i();
|
63
|
-
a.value = u;
|
64
|
-
const e = d.terminal.ecrs.at(u);
|
65
|
-
e.gateway === "FeedMe" && e.config && (l.value = {
|
66
|
-
terminalId: e.config.terminalId
|
67
|
-
});
|
68
|
-
};
|
69
|
-
Y(n, r), G(r);
|
70
|
-
const g = O(() => (s.value ?? []).map((u) => ({
|
71
|
-
label: u.name ?? u._id,
|
72
|
-
value: u._id
|
73
|
-
})));
|
74
|
-
async function F(u) {
|
75
|
-
var e;
|
76
|
-
(e = d.terminal.ecrs) == null || e.splice(u, 1), d.onUpdate(d.terminal);
|
77
|
-
}
|
78
|
-
return (u, e) => {
|
79
|
-
const o = v("FmCircularProgress"), _ = v("FmSelect"), V = v("FmButton"), C = v("FmForm");
|
80
|
-
return T(m) ? (y(), x("div", ne, [
|
81
|
-
p(o, { size: "xxl" })
|
82
|
-
])) : (y(), U(C, {
|
83
|
-
key: 1,
|
84
|
-
ref: c.value,
|
85
|
-
class: "flex flex-col gap-16 w-[500px]",
|
86
|
-
onValidationSuccess: e[1] || (e[1] = () => {
|
87
|
-
a.value > -1 ? n.value.ecrs[a.value] = { gateway: "FeedMe", config: l.value } : (n.value.ecrs || (n.value.ecrs = []), n.value.ecrs.push({ gateway: "FeedMe", config: l.value })), d.onUpdate(n.value);
|
88
|
-
})
|
89
|
-
}, {
|
90
|
-
default: B(() => [
|
91
|
-
p(_, {
|
92
|
-
modelValue: l.value.terminalId,
|
93
|
-
"onUpdate:modelValue": e[0] || (e[0] = (K) => l.value.terminalId = K),
|
94
|
-
label: "Terminal ID",
|
95
|
-
items: g.value,
|
96
|
-
rules: T(ee)(T(ae).string())
|
97
|
-
}, null, 8, ["modelValue", "items", "rules"]),
|
98
|
-
I("div", le, [
|
99
|
-
a.value > -1 ? (y(), U(V, {
|
100
|
-
key: 0,
|
101
|
-
class: "flex-1",
|
102
|
-
variant: "secondary",
|
103
|
-
label: "Delete",
|
104
|
-
onclick: () => F(a.value)
|
105
|
-
}, null, 8, ["onclick"])) : S("", !0),
|
106
|
-
p(V, {
|
107
|
-
type: "submit",
|
108
|
-
class: "flex-1",
|
109
|
-
variant: "primary",
|
110
|
-
label: "Save"
|
111
|
-
})
|
112
|
-
])
|
113
|
-
]),
|
114
|
-
_: 1
|
115
|
-
}, 512));
|
116
|
-
};
|
117
|
-
}
|
118
|
-
}), re = { class: "flex mt-6 space-x-6" }, ue = /* @__PURE__ */ q({
|
119
|
-
__name: "GhlGateway",
|
120
|
-
props: {
|
121
|
-
terminal: {
|
122
|
-
type: Object,
|
123
|
-
required: !0
|
124
|
-
},
|
125
|
-
onUpdate: {
|
126
|
-
type: Function,
|
127
|
-
required: !0
|
128
|
-
}
|
129
|
-
},
|
130
|
-
setup(f) {
|
131
|
-
const m = f, t = P(() => m.terminal), d = w(), n = w(-1), s = w({
|
132
|
-
merchantId: "",
|
133
|
-
terminalId: "",
|
134
|
-
privateKey: ""
|
135
|
-
}), c = () => {
|
136
|
-
s.value.merchantId = "", s.value.terminalId = "", s.value.privateKey = "", n.value = -1;
|
137
|
-
}, a = () => {
|
138
|
-
if (!t.value.ecrs)
|
139
|
-
return c();
|
140
|
-
const i = t.value.ecrs.findIndex((g) => g && g.gateway && g.gateway === "Ghl");
|
141
|
-
if (i === -1)
|
142
|
-
return c();
|
143
|
-
n.value = i;
|
144
|
-
const r = t.value.ecrs.at(i);
|
145
|
-
r.gateway === "Ghl" && r.config && (s.value = {
|
146
|
-
merchantId: r.config.merchantId,
|
147
|
-
terminalId: r.config.terminalId,
|
148
|
-
privateKey: r.config.privateKey
|
149
|
-
});
|
150
|
-
};
|
151
|
-
Y(t, a), G(a);
|
152
|
-
async function l(i) {
|
153
|
-
var r;
|
154
|
-
(r = t.value.ecrs) == null || r.splice(i, 1), m.onUpdate(t.value);
|
155
|
-
}
|
156
|
-
return (i, r) => {
|
157
|
-
const g = v("FmTextField"), F = v("FmTextarea"), u = v("FmButton"), e = v("FmForm");
|
158
|
-
return y(), U(e, {
|
159
|
-
ref: d.value,
|
160
|
-
class: "flex flex-col gap-16 w-[500px]",
|
161
|
-
onValidationSuccess: r[3] || (r[3] = () => {
|
162
|
-
n.value > -1 ? t.value.ecrs[n.value] = { gateway: "Ghl", config: s.value } : (t.value.ecrs || (t.value.ecrs = []), t.value.ecrs.push({ gateway: "Ghl", config: s.value })), m.onUpdate(t.value);
|
163
|
-
})
|
164
|
-
}, {
|
165
|
-
default: B(() => [
|
166
|
-
p(g, {
|
167
|
-
modelValue: s.value.merchantId,
|
168
|
-
"onUpdate:modelValue": r[0] || (r[0] = (o) => s.value.merchantId = o),
|
169
|
-
label: "Merchant ID"
|
170
|
-
}, null, 8, ["modelValue"]),
|
171
|
-
p(g, {
|
172
|
-
modelValue: s.value.terminalId,
|
173
|
-
"onUpdate:modelValue": r[1] || (r[1] = (o) => s.value.terminalId = o),
|
174
|
-
label: "Terminal ID"
|
175
|
-
}, null, 8, ["modelValue"]),
|
176
|
-
p(F, {
|
177
|
-
modelValue: s.value.privateKey,
|
178
|
-
"onUpdate:modelValue": r[2] || (r[2] = (o) => s.value.privateKey = o),
|
179
|
-
label: "Private Key"
|
180
|
-
}, null, 8, ["modelValue"]),
|
181
|
-
I("div", re, [
|
182
|
-
n.value > -1 ? (y(), U(u, {
|
183
|
-
key: 0,
|
184
|
-
class: "flex-1",
|
185
|
-
variant: "secondary",
|
186
|
-
label: "Delete",
|
187
|
-
onclick: () => l(n.value)
|
188
|
-
}, null, 8, ["onclick"])) : S("", !0),
|
189
|
-
p(u, {
|
190
|
-
type: "submit",
|
191
|
-
class: "flex-1",
|
192
|
-
variant: "primary",
|
193
|
-
label: "Save"
|
194
|
-
})
|
195
|
-
])
|
196
|
-
]),
|
197
|
-
_: 1
|
198
|
-
}, 512);
|
199
|
-
};
|
200
|
-
}
|
201
|
-
}), se = { key: 0 }, ie = { class: "mt-6 space-x-6" }, me = /* @__PURE__ */ q({
|
202
|
-
__name: "KioskMode",
|
203
|
-
props: {
|
204
|
-
terminal: {
|
205
|
-
type: Object,
|
206
|
-
required: !0
|
207
|
-
}
|
208
|
-
},
|
209
|
-
setup(f) {
|
210
|
-
const { isLoading: m, startAsyncCall: t } = $(!1), d = J(), n = w({
|
211
|
-
enable: !1,
|
212
|
-
password: []
|
213
|
-
}), s = f;
|
214
|
-
function c() {
|
215
|
-
return n.value.enable && n.value.password.filter((a) => !!a).length !== 6 ? d.open({
|
216
|
-
type: "error",
|
217
|
-
message: "Unlock PIN is required when setting up kiosk mode for terminal."
|
218
|
-
}) : t(async () => {
|
219
|
-
const a = { enable: n.value.enable };
|
220
|
-
a.enable && Object.assign(a, {
|
221
|
-
password: n.value.password.join("")
|
222
|
-
});
|
223
|
-
const l = await N.kioskModeRequest(s.terminal._id, a);
|
224
|
-
if (l === "OK")
|
225
|
-
return d.open({ type: "info", message: "Kiosk mode applied successfully." });
|
226
|
-
let i = l;
|
227
|
-
return l === "client_not_connected" && (i = "Terminal not connected to the websocket server."), l.startsWith("terminal: ") && (i = l.replaceAll("terminal: ", "")), d.open({
|
228
|
-
type: "error",
|
229
|
-
message: i
|
230
|
-
});
|
231
|
-
});
|
232
|
-
}
|
233
|
-
return (a, l) => {
|
234
|
-
const i = v("FmSwitch"), r = v("FmPinField"), g = v("FmButton");
|
235
|
-
return y(), x(D, null, [
|
236
|
-
p(i, {
|
237
|
-
modelValue: n.value.enable,
|
238
|
-
"onUpdate:modelValue": l[0] || (l[0] = (F) => n.value.enable = F),
|
239
|
-
label: "Enable Kiosk Mode?"
|
240
|
-
}, null, 8, ["modelValue"]),
|
241
|
-
n.value.enable ? (y(), x("div", se, [
|
242
|
-
l[2] || (l[2] = I("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
|
243
|
-
p(r, {
|
244
|
-
modelValue: n.value.password,
|
245
|
-
"onUpdate:modelValue": l[1] || (l[1] = (F) => n.value.password = F)
|
246
|
-
}, null, 8, ["modelValue"])
|
247
|
-
])) : S("", !0),
|
248
|
-
I("div", ie, [
|
249
|
-
p(g, {
|
250
|
-
variant: "primary",
|
251
|
-
label: "Send",
|
252
|
-
icon: "send",
|
253
|
-
loading: T(m),
|
254
|
-
onclick: c
|
255
|
-
}, null, 8, ["loading"])
|
256
|
-
])
|
257
|
-
], 64);
|
258
|
-
};
|
259
|
-
}
|
260
|
-
}), de = /* @__PURE__ */ q({
|
261
|
-
__name: "SettingRequest",
|
262
|
-
props: {
|
263
|
-
terminal: {
|
264
|
-
type: Object,
|
265
|
-
required: !0
|
266
|
-
}
|
267
|
-
},
|
268
|
-
setup(f) {
|
269
|
-
const { settingTab: m } = H({
|
270
|
-
settingTab: "kiosk_mode"
|
271
|
-
}), t = [
|
272
|
-
{
|
273
|
-
label: "Kiosk Mode",
|
274
|
-
value: "kiosk_mode",
|
275
|
-
render: me
|
276
|
-
}
|
277
|
-
], d = f, n = O(() => t.find((s) => s.value === m.value));
|
278
|
-
return (s, c) => {
|
279
|
-
var l;
|
280
|
-
const a = v("FmTabs");
|
281
|
-
return y(), x(D, null, [
|
282
|
-
c[1] || (c[1] = I("p", { className: "mt-1 my-6 text-gray-600" }, [
|
283
|
-
I("b", null, "Note: "),
|
284
|
-
M(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
|
285
|
-
], -1)),
|
286
|
-
p(a, {
|
287
|
-
"model-value": T(m),
|
288
|
-
"onUpdate:modelValue": c[0] || (c[0] = (i) => h(m) ? m.value = i : null),
|
289
|
-
class: "mb-6",
|
290
|
-
items: t
|
291
|
-
}, null, 8, ["model-value"]),
|
292
|
-
T(m) ? (y(), U(A((l = n.value) == null ? void 0 : l.render), E(z({ key: 0 }, { terminal: d.terminal })), null, 16)) : S("", !0)
|
293
|
-
], 64);
|
294
|
-
};
|
295
|
-
}
|
296
|
-
}), ce = {
|
297
|
-
key: 0,
|
298
|
-
class: "text-sm text-gray-500"
|
299
|
-
}, pe = { class: "flex mt-6 space-x-6" }, ve = /* @__PURE__ */ q({
|
300
|
-
__name: "SoftposGateway",
|
301
|
-
props: {
|
302
|
-
terminal: {
|
303
|
-
type: Object,
|
304
|
-
required: !0
|
305
|
-
},
|
306
|
-
onUpdate: {
|
307
|
-
type: Function,
|
308
|
-
required: !0
|
309
|
-
}
|
310
|
-
},
|
311
|
-
setup(f) {
|
312
|
-
const m = f, t = Q().currentCountry, d = [
|
313
|
-
{
|
314
|
-
label: "Fiuu Malaysia",
|
315
|
-
value: "cc.feedme.payment.rms",
|
316
|
-
region: k.F_COUNTRY.enum.MY,
|
317
|
-
gateway: "Fiuu",
|
318
|
-
isLegacy: !0,
|
319
|
-
isOutdated: !0
|
320
|
-
},
|
321
|
-
{
|
322
|
-
label: "Fiuu Malaysia V2",
|
323
|
-
value: "cc.feedme.payment.fiuu_my",
|
324
|
-
region: k.F_COUNTRY.enum.MY,
|
325
|
-
gateway: "Fiuu",
|
326
|
-
isLegacy: !0
|
327
|
-
},
|
328
|
-
{
|
329
|
-
label: "Fiuu Singapore",
|
330
|
-
value: "cc.feedme.payment.fiuu_sg",
|
331
|
-
region: k.F_COUNTRY.enum.SG,
|
332
|
-
gateway: "Fiuu",
|
333
|
-
isLegacy: !0
|
334
|
-
},
|
335
|
-
{
|
336
|
-
label: "Softspace Malaysia",
|
337
|
-
value: "cc.feedme.payment.softspace_my",
|
338
|
-
gateway: "Softspace",
|
339
|
-
region: k.F_COUNTRY.enum.MY
|
340
|
-
},
|
341
|
-
{
|
342
|
-
label: "Digio Thailand",
|
343
|
-
value: "cc.feedme.payment.digio_th",
|
344
|
-
gateway: "Digio",
|
345
|
-
region: k.F_COUNTRY.enum.TH
|
346
|
-
}
|
347
|
-
], n = P(() => m.terminal), s = w(), c = w(-1), a = w({
|
348
|
-
packageId: "",
|
349
|
-
uniqueId: "",
|
350
|
-
developerId: "",
|
351
|
-
isUat: !1
|
352
|
-
}), l = () => {
|
353
|
-
a.value.uniqueId = "", a.value.packageId = "", a.value.developerId = "", c.value = -1;
|
354
|
-
}, i = () => {
|
355
|
-
if (!n.value.gateways)
|
356
|
-
return l();
|
357
|
-
const u = n.value.gateways.findIndex((_) => _ && _.gateway && _.gateway === "Softspace");
|
358
|
-
if (u === -1)
|
359
|
-
return l();
|
360
|
-
c.value = u;
|
361
|
-
const e = n.value.gateways.at(u);
|
362
|
-
if (!e.config)
|
363
|
-
return;
|
364
|
-
if (e.gateway === "Fiuu") {
|
365
|
-
a.value = {
|
366
|
-
packageId: e.config.packageId,
|
367
|
-
uniqueId: e.config.uniqueId,
|
368
|
-
developerId: "",
|
369
|
-
isUat: !1
|
370
|
-
};
|
371
|
-
return;
|
372
|
-
}
|
373
|
-
const o = JSON.parse(e.config.uniqueId);
|
374
|
-
a.value = {
|
375
|
-
packageId: e.config.packageId,
|
376
|
-
uniqueId: o.uniqueId,
|
377
|
-
developerId: o.developerId,
|
378
|
-
isUat: o.isUat
|
379
|
-
};
|
380
|
-
};
|
381
|
-
Y(n, i), G(i);
|
382
|
-
async function r(u) {
|
383
|
-
var e;
|
384
|
-
(e = n.value.gateways) == null || e.splice(u, 1), m.onUpdate(n.value);
|
385
|
-
}
|
386
|
-
const g = O(() => d.filter((u) => u.region === t.value)), F = O(() => g.value.find((u) => u.value === a.value.packageId));
|
387
|
-
return (u, e) => {
|
388
|
-
const o = v("FmSelect"), _ = v("FmTextField"), V = v("FmCheckbox"), C = v("FmButton"), K = v("FmForm");
|
389
|
-
return y(), U(K, {
|
390
|
-
ref: s.value,
|
391
|
-
class: "flex flex-col gap-16 w-[500px]",
|
392
|
-
onValidationSuccess: e[5] || (e[5] = () => {
|
393
|
-
const b = F.value;
|
394
|
-
if (!b)
|
395
|
-
return;
|
396
|
-
let L = a.value.uniqueId;
|
397
|
-
b.isLegacy || (L = JSON.stringify({ uniqueId: a.value.uniqueId, developerId: a.value.developerId, isUat: a.value.isUat }));
|
398
|
-
const j = {
|
399
|
-
gateway: b.gateway,
|
400
|
-
config: {
|
401
|
-
packageId: b.value,
|
402
|
-
uniqueId: L
|
403
|
-
}
|
404
|
-
};
|
405
|
-
c.value > -1 ? n.value.gateways[c.value] = j : (n.value.gateways || (n.value.gateways = []), n.value.gateways.push(j)), m.onUpdate(n.value);
|
406
|
-
})
|
407
|
-
}, {
|
408
|
-
default: B(() => [
|
409
|
-
p(o, {
|
410
|
-
modelValue: a.value.packageId,
|
411
|
-
"onUpdate:modelValue": e[0] || (e[0] = (b) => a.value.packageId = b),
|
412
|
-
label: "Package ID",
|
413
|
-
items: g.value
|
414
|
-
}, null, 8, ["modelValue", "items"]),
|
415
|
-
F.value && F.value.isLegacy ? (y(), x(D, { key: 0 }, [
|
416
|
-
p(_, {
|
417
|
-
modelValue: a.value.uniqueId,
|
418
|
-
"onUpdate:modelValue": e[1] || (e[1] = (b) => a.value.uniqueId = b),
|
419
|
-
label: "Unique ID (TID)"
|
420
|
-
}, null, 8, ["modelValue"]),
|
421
|
-
F.value.isOutdated ? (y(), x("span", ce, " Note: For outdated gateway is no longer continued development, please use the new gateway instead. ")) : S("", !0)
|
422
|
-
], 64)) : (y(), x(D, { key: 1 }, [
|
423
|
-
p(_, {
|
424
|
-
modelValue: a.value.developerId,
|
425
|
-
"onUpdate:modelValue": e[2] || (e[2] = (b) => a.value.developerId = b),
|
426
|
-
label: "Developer ID (MID)"
|
427
|
-
}, null, 8, ["modelValue"]),
|
428
|
-
p(_, {
|
429
|
-
modelValue: a.value.uniqueId,
|
430
|
-
"onUpdate:modelValue": e[3] || (e[3] = (b) => a.value.uniqueId = b),
|
431
|
-
label: "Unique ID (TID)"
|
432
|
-
}, null, 8, ["modelValue"]),
|
433
|
-
p(V, {
|
434
|
-
modelValue: a.value.isUat,
|
435
|
-
"onUpdate:modelValue": e[4] || (e[4] = (b) => a.value.isUat = b),
|
436
|
-
label: "Is UAT (Test)",
|
437
|
-
value: "1"
|
438
|
-
}, null, 8, ["modelValue"])
|
439
|
-
], 64)),
|
440
|
-
I("div", pe, [
|
441
|
-
c.value > -1 ? (y(), U(C, {
|
442
|
-
key: 0,
|
443
|
-
class: "flex-1",
|
444
|
-
variant: "secondary",
|
445
|
-
label: "Delete",
|
446
|
-
onclick: () => r(c.value)
|
447
|
-
}, null, 8, ["onclick"])) : S("", !0),
|
448
|
-
p(C, {
|
449
|
-
type: "submit",
|
450
|
-
class: "flex-1",
|
451
|
-
variant: "primary",
|
452
|
-
label: "Save"
|
453
|
-
})
|
454
|
-
])
|
455
|
-
]),
|
456
|
-
_: 1
|
457
|
-
}, 512);
|
458
|
-
};
|
459
|
-
}
|
460
|
-
}), Ue = /* @__PURE__ */ q({
|
461
|
-
__name: "TerminalSetting",
|
462
|
-
props: {
|
463
|
-
terminalId: {
|
464
|
-
type: String,
|
465
|
-
required: !0
|
466
|
-
}
|
467
|
-
},
|
468
|
-
setup(f) {
|
469
|
-
const m = f, { tab: t } = H({
|
470
|
-
tab: "information"
|
471
|
-
}), { isLoading: d, startAsyncCall: n } = $(!0), s = W(), c = J(), a = w();
|
472
|
-
async function l(e) {
|
473
|
-
n(async () => {
|
474
|
-
try {
|
475
|
-
await N.updateById(
|
476
|
-
m.terminalId,
|
477
|
-
{
|
478
|
-
name: e.name,
|
479
|
-
status: e.status,
|
480
|
-
ecrs: e.ecrs ?? [],
|
481
|
-
gateways: e.gateways ?? []
|
482
|
-
}
|
483
|
-
), a.value = await N.readById(m.terminalId), c.open({
|
484
|
-
type: "success",
|
485
|
-
message: "Terminal updated successfully"
|
486
|
-
});
|
487
|
-
} catch (o) {
|
488
|
-
c.open({
|
489
|
-
type: "error",
|
490
|
-
title: "Error occurs when update terminal",
|
491
|
-
message: Z(o)
|
492
|
-
});
|
493
|
-
}
|
494
|
-
});
|
495
|
-
}
|
496
|
-
const i = [
|
497
|
-
{
|
498
|
-
label: "Information",
|
499
|
-
value: "information",
|
500
|
-
icon: "overview",
|
501
|
-
render: te
|
502
|
-
},
|
503
|
-
{
|
504
|
-
label: "Setting Request",
|
505
|
-
value: "settings",
|
506
|
-
icon: "settings",
|
507
|
-
render: de,
|
508
|
-
onlyFor: ["TERMINAL"]
|
509
|
-
},
|
510
|
-
{
|
511
|
-
label: "SoftPos Gateway",
|
512
|
-
value: "softpos",
|
513
|
-
icon: "payment",
|
514
|
-
render: ve,
|
515
|
-
region: [k.F_COUNTRY.enum.MY, k.F_COUNTRY.enum.SG, k.F_COUNTRY.enum.TH]
|
516
|
-
},
|
517
|
-
{
|
518
|
-
label: "FeedMe Terminal",
|
519
|
-
value: "terminal",
|
520
|
-
icon: "shopping_cart_checkout",
|
521
|
-
render: oe,
|
522
|
-
onlyFor: ["POS", "KIOSK"]
|
523
|
-
},
|
524
|
-
{
|
525
|
-
label: "GHL Terminal (V2)",
|
526
|
-
value: "ghl",
|
527
|
-
icon: "shopping_cart_checkout",
|
528
|
-
render: ue,
|
529
|
-
onlyFor: ["POS", "KIOSK"],
|
530
|
-
region: [k.F_COUNTRY.enum.MY]
|
531
|
-
}
|
532
|
-
], r = Q().currentCountry, g = O(() => {
|
533
|
-
var e;
|
534
|
-
return (e = i.find((o) => o.value === t.value)) == null ? void 0 : e.render;
|
535
|
-
});
|
536
|
-
async function F() {
|
537
|
-
n(async () => {
|
538
|
-
a.value = await N.readById(m.terminalId);
|
539
|
-
});
|
540
|
-
}
|
541
|
-
const u = O(() => i.filter((e) => {
|
542
|
-
var o;
|
543
|
-
return !e.onlyFor || e.onlyFor.includes(((o = a.value) == null ? void 0 : o.deviceType) ?? "");
|
544
|
-
}).filter((e) => !e.region || e.region.includes(r.value ?? k.F_COUNTRY.enum.MY)));
|
545
|
-
return G(F), (e, o) => {
|
546
|
-
var V;
|
547
|
-
const _ = v("FmTabs");
|
548
|
-
return y(), U(X, {
|
549
|
-
title: `Terminal (${(V = a.value) == null ? void 0 : V._id})`,
|
550
|
-
loading: T(d),
|
551
|
-
onBack: T(s).back
|
552
|
-
}, {
|
553
|
-
default: B(() => [
|
554
|
-
p(_, {
|
555
|
-
"model-value": T(t),
|
556
|
-
"onUpdate:modelValue": o[0] || (o[0] = (C) => h(t) ? t.value = C : null),
|
557
|
-
class: "mb-6",
|
558
|
-
items: u.value
|
559
|
-
}, null, 8, ["model-value", "items"]),
|
560
|
-
T(t) ? (y(), U(A(g.value), E(z({ key: 0 }, {
|
561
|
-
terminal: a.value,
|
562
|
-
onUpdate: l
|
563
|
-
})), null, 16)) : S("", !0)
|
564
|
-
]),
|
565
|
-
_: 1
|
566
|
-
}, 8, ["title", "loading", "onBack"]);
|
567
|
-
};
|
568
|
-
}
|
569
|
-
});
|
570
|
-
export {
|
571
|
-
Ue as default
|
572
|
-
};
|