@feedmepos/mf-payment 1.2.2 → 1.2.5

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