@feedmepos/mf-payment 1.3.3 → 1.3.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.
- package/dist/OnboardForm-DRfkDYKa.js +752 -0
- package/dist/{OnboardForm-C5nUtZO_.js → OnboardForm-DkQnOOE4.js} +4 -4
- package/dist/{OnboardSubmission-8tkTVlht.js → OnboardSubmission-CiSHMUCb.js} +5 -5
- package/dist/{OnboardSubmission-xPnZcrmA.js → OnboardSubmission-caChZGCD.js} +2 -2
- package/dist/{PayoutAccount-tO_wZfTt.js → PayoutAccount-DDJZLp5n.js} +5 -5
- package/dist/{PayoutAccount-CSOKcgIP.js → PayoutAccount-jRFibLN6.js} +5 -5
- package/dist/{PayoutAccountSetting-DfGw639O.js → PayoutAccountSetting-DcuumyW4.js} +3 -3
- package/dist/{Restaurant-BdDDrAsq.js → Restaurant-C8lLkTRk.js} +4 -4
- package/dist/RestaurantSetting-IW965gti.js +764 -0
- package/dist/{Settlement-Cfhafc8m.js → Settlement-BQPbR8m-.js} +3 -3
- package/dist/{Settlement-8RYgvfzf.js → Settlement-D18xsXRd.js} +3 -3
- package/dist/{SettlementTransactions-Bb54OlAj.js → SettlementTransactions-BQmJ_nZS.js} +3 -3
- package/dist/{SettlementTransactions-DrA8PAyd.js → SettlementTransactions-DhKWeuuo.js} +3 -3
- package/dist/{Status.vue_vue_type_script_setup_true_lang-BumKpo4s.js → Status.vue_vue_type_script_setup_true_lang-Cp3akQew.js} +1 -1
- package/dist/{Terminal-DoTJw-hl.js → Terminal-tg7f8Wue.js} +5 -5
- package/dist/TerminalSetting-B5VdUivg.js +1080 -0
- package/dist/{Transaction-C5DXkIjl.js → Transaction-CQF5lDAd.js} +5 -5
- package/dist/{Transaction-qKhaX4qv.js → Transaction-DFxizbZ7.js} +6 -6
- package/dist/{TransactionOld-DAoWcstb.js → TransactionOld-uFMnygUK.js} +4 -4
- package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-C5cEFUs2.js → TransactionTable.vue_vue_type_script_setup_true_lang-CFr-DduC.js} +3 -3
- package/dist/api/payment-gateway/index.d.ts +1 -3
- package/dist/{app-T_M9ajBn.js → app-JzZOIyxw.js} +22 -22
- package/dist/app.js +1 -1
- package/dist/{assets-C_H0OeWB.js → assets-R7Pf2tcC.js} +1 -1
- package/dist/{grafana-BK_sYlee.js → grafana-DLVFFmRO.js} +1 -1
- package/dist/{index-jsEyizHG.js → index-BRcPRBkm.js} +1 -1
- package/dist/{index-D4_YGL4B.js → index-BUXnw6w4.js} +1 -1
- package/dist/{index-BjqwgRyA.js → index-C4T0m6DM.js} +1 -1
- package/dist/{index-sgLhHJjg.js → index-C5B1WFHO.js} +2 -2
- package/dist/index-C_4l0JZj.js +58590 -0
- package/dist/{index-GsQWAnBk.js → index-Cpsfcvcu.js} +1 -1
- package/dist/{index-Dogc22BO.js → index-D7GUIvIW.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-CIxp2j06.js → index.vue_vue_type_script_setup_true_lang-BIGL3hMd.js} +1 -1
- package/dist/package.json +3 -3
- package/dist/{payout-account-59dfXB3Z.js → payout-account-BBRdCd9Q.js} +3 -3
- package/dist/{plugins-BTjb8IwB.js → plugins-DTPqcD09.js} +1 -1
- package/dist/stores/payoutAccount.d.ts +16 -16
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +24 -24
- package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +16 -16
- package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +20 -20
- package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +20 -20
- package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +16 -16
- package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +16 -16
- package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +20 -20
- package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
- package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +92 -8
- package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/Information.vue.d.ts +92 -8
- package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +92 -8
- package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +92 -8
- package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +174 -0
- package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +92 -8
- package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +32 -32
- package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +4 -4
- package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +2 -2
- package/package.json +3 -3
- package/dist/OnboardForm-DTRmaj9L.js +0 -708
- package/dist/RestaurantSetting-C-16ifI3.js +0 -834
- package/dist/TerminalSetting-DpePQHKW.js +0 -572
- package/dist/index-eNSd1RuW.js +0 -57995
- package/dist/views/admin/restaurant/tabs/LocalIntegration.vue.d.ts +0 -803
- package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +0 -90
- package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +0 -92
@@ -0,0 +1,1080 @@
|
|
1
|
+
import { defineComponent as N, openBlock as f, createElementBlock as V, Fragment as B, createElementVNode as I, createTextVNode as G, toDisplayString as D, ref as b, resolveComponent as y, createVNode as v, createCommentVNode as k, unref as x, computed as T, isRef as $, createBlock as F, resolveDynamicComponent as A, normalizeProps as Y, mergeProps as K, toRef as M, watch as C, onMounted as S, withCtx as q } from "vue";
|
2
|
+
import { u as z, e as U } from "./index-C_4l0JZj.js";
|
3
|
+
import { useRouter as h } from "vue-router";
|
4
|
+
import { t as R } from "./index-D7GUIvIW.js";
|
5
|
+
import { _ as W } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
6
|
+
import { u as j } from "./index-C4T0m6DM.js";
|
7
|
+
import { useSnackbar as H } from "@feedmepos/ui-library";
|
8
|
+
import { u as X } from "./error-K1CakhA9.js";
|
9
|
+
import { useCoreStore as L } from "@feedmepos/mf-common";
|
10
|
+
import { z as Z, a as ee } from "./validator-D5jtpt9A.js";
|
11
|
+
const ae = /* @__PURE__ */ N({
|
12
|
+
__name: "Information",
|
13
|
+
props: {
|
14
|
+
terminal: {
|
15
|
+
type: Object,
|
16
|
+
required: !0
|
17
|
+
}
|
18
|
+
},
|
19
|
+
setup(g) {
|
20
|
+
return (m, e) => (f(), V(B, null, [
|
21
|
+
e[0] || (e[0] = I("b", null, "Name", -1)),
|
22
|
+
G(": " + D(g.terminal.name), 1),
|
23
|
+
e[1] || (e[1] = I("br", null, null, -1)),
|
24
|
+
e[2] || (e[2] = I("b", null, "Status", -1)),
|
25
|
+
G(": " + D(g.terminal.status), 1),
|
26
|
+
e[3] || (e[3] = I("br", null, null, -1)),
|
27
|
+
e[4] || (e[4] = I("b", null, "Device ID", -1)),
|
28
|
+
G(": " + D(g.terminal.deviceId ?? "-"), 1),
|
29
|
+
e[5] || (e[5] = I("br", null, null, -1)),
|
30
|
+
e[6] || (e[6] = I("b", null, "Device Type", -1)),
|
31
|
+
G(": " + D(g.terminal.deviceType ?? "-"), 1),
|
32
|
+
e[7] || (e[7] = I("br", null, null, -1))
|
33
|
+
], 64));
|
34
|
+
}
|
35
|
+
}), te = { key: 0 }, ne = { class: "mt-6 space-x-6" }, le = /* @__PURE__ */ N({
|
36
|
+
__name: "KioskMode",
|
37
|
+
props: {
|
38
|
+
terminal: {
|
39
|
+
type: Object,
|
40
|
+
required: !0
|
41
|
+
}
|
42
|
+
},
|
43
|
+
setup(g) {
|
44
|
+
const { isLoading: m, startAsyncCall: e } = z(!1), p = H(), n = b({
|
45
|
+
enable: !1,
|
46
|
+
password: []
|
47
|
+
}), t = g;
|
48
|
+
function o() {
|
49
|
+
return n.value.enable && n.value.password.filter((c) => !!c).length !== 6 ? p.open({
|
50
|
+
type: "error",
|
51
|
+
message: "Unlock PIN is required when setting up kiosk mode for terminal."
|
52
|
+
}) : e(async () => {
|
53
|
+
const c = { enable: n.value.enable };
|
54
|
+
c.enable && Object.assign(c, {
|
55
|
+
password: n.value.password.join("")
|
56
|
+
});
|
57
|
+
const s = await R.kioskModeRequest(t.terminal._id, c);
|
58
|
+
if (s === "OK")
|
59
|
+
return p.open({ type: "info", message: "Kiosk mode applied successfully." });
|
60
|
+
let u = s;
|
61
|
+
return s === "client_not_connected" && (u = "Terminal not connected to the websocket server."), s.startsWith("terminal: ") && (u = s.replaceAll("terminal: ", "")), p.open({
|
62
|
+
type: "error",
|
63
|
+
message: u
|
64
|
+
});
|
65
|
+
});
|
66
|
+
}
|
67
|
+
return (c, s) => {
|
68
|
+
const u = y("FmSwitch"), a = y("FmPinField"), l = y("FmButton");
|
69
|
+
return f(), V(B, null, [
|
70
|
+
v(u, {
|
71
|
+
modelValue: n.value.enable,
|
72
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => n.value.enable = r),
|
73
|
+
label: "Enable Kiosk Mode?"
|
74
|
+
}, null, 8, ["modelValue"]),
|
75
|
+
n.value.enable ? (f(), V("div", te, [
|
76
|
+
s[2] || (s[2] = I("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
|
77
|
+
v(a, {
|
78
|
+
modelValue: n.value.password,
|
79
|
+
"onUpdate:modelValue": s[1] || (s[1] = (r) => n.value.password = r)
|
80
|
+
}, null, 8, ["modelValue"])
|
81
|
+
])) : k("", !0),
|
82
|
+
I("div", ne, [
|
83
|
+
v(l, {
|
84
|
+
variant: "primary",
|
85
|
+
label: "Send",
|
86
|
+
icon: "send",
|
87
|
+
loading: x(m),
|
88
|
+
onclick: o
|
89
|
+
}, null, 8, ["loading"])
|
90
|
+
])
|
91
|
+
], 64);
|
92
|
+
};
|
93
|
+
}
|
94
|
+
}), oe = /* @__PURE__ */ N({
|
95
|
+
__name: "SettingRequest",
|
96
|
+
props: {
|
97
|
+
terminal: {
|
98
|
+
type: Object,
|
99
|
+
required: !0
|
100
|
+
}
|
101
|
+
},
|
102
|
+
setup(g) {
|
103
|
+
const { settingTab: m } = j({
|
104
|
+
settingTab: "kiosk_mode"
|
105
|
+
}), e = [
|
106
|
+
{
|
107
|
+
label: "Kiosk Mode",
|
108
|
+
value: "kiosk_mode",
|
109
|
+
render: le
|
110
|
+
}
|
111
|
+
], p = g, n = T(() => e.find((t) => t.value === m.value));
|
112
|
+
return (t, o) => {
|
113
|
+
var s;
|
114
|
+
const c = y("FmTabs");
|
115
|
+
return f(), V(B, null, [
|
116
|
+
o[1] || (o[1] = I("p", { className: "mt-1 my-6 text-gray-600" }, [
|
117
|
+
I("b", null, "Note: "),
|
118
|
+
G(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
|
119
|
+
], -1)),
|
120
|
+
v(c, {
|
121
|
+
"model-value": x(m),
|
122
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => $(m) ? m.value = u : null),
|
123
|
+
class: "mb-6",
|
124
|
+
items: e
|
125
|
+
}, null, 8, ["model-value"]),
|
126
|
+
x(m) ? (f(), F(A((s = n.value) == null ? void 0 : s.render), Y(K({ key: 0 }, { terminal: p.terminal })), null, 16)) : k("", !0)
|
127
|
+
], 64);
|
128
|
+
};
|
129
|
+
}
|
130
|
+
}), re = {
|
131
|
+
key: 0,
|
132
|
+
class: "text-sm text-gray-500"
|
133
|
+
}, ue = { class: "flex mt-6 space-x-6" }, ie = /* @__PURE__ */ N({
|
134
|
+
__name: "SoftposGateway",
|
135
|
+
props: {
|
136
|
+
terminal: {
|
137
|
+
type: Object,
|
138
|
+
required: !0
|
139
|
+
},
|
140
|
+
onUpdate: {
|
141
|
+
type: Function,
|
142
|
+
required: !0
|
143
|
+
}
|
144
|
+
},
|
145
|
+
setup(g) {
|
146
|
+
const m = g, e = L().currentCountry, p = [
|
147
|
+
{
|
148
|
+
label: "Fiuu Malaysia",
|
149
|
+
value: "cc.feedme.payment.rms",
|
150
|
+
region: U.F_COUNTRY.enum.MY,
|
151
|
+
gateway: "Fiuu",
|
152
|
+
isLegacy: !0,
|
153
|
+
isOutdated: !0
|
154
|
+
},
|
155
|
+
{
|
156
|
+
label: "Fiuu Malaysia V2",
|
157
|
+
value: "cc.feedme.payment.fiuu_my",
|
158
|
+
region: U.F_COUNTRY.enum.MY,
|
159
|
+
gateway: "Fiuu",
|
160
|
+
isLegacy: !0
|
161
|
+
},
|
162
|
+
{
|
163
|
+
label: "Fiuu Singapore",
|
164
|
+
value: "cc.feedme.payment.fiuu_sg",
|
165
|
+
region: U.F_COUNTRY.enum.SG,
|
166
|
+
gateway: "Fiuu",
|
167
|
+
isLegacy: !0
|
168
|
+
},
|
169
|
+
{
|
170
|
+
label: "Softspace Malaysia",
|
171
|
+
value: "cc.feedme.payment.softspace_my",
|
172
|
+
gateway: "Softspace",
|
173
|
+
region: U.F_COUNTRY.enum.MY
|
174
|
+
},
|
175
|
+
{
|
176
|
+
label: "Digio Thailand",
|
177
|
+
value: "cc.feedme.payment.digio_th",
|
178
|
+
gateway: "Digio",
|
179
|
+
region: U.F_COUNTRY.enum.TH
|
180
|
+
}
|
181
|
+
], n = M(() => m.terminal), t = b(), o = b({
|
182
|
+
packageId: "",
|
183
|
+
uniqueId: "",
|
184
|
+
developerId: "",
|
185
|
+
isUat: !1
|
186
|
+
}), c = () => {
|
187
|
+
o.value.uniqueId = "", o.value.packageId = "", o.value.developerId = "";
|
188
|
+
}, s = () => {
|
189
|
+
if (!n.value.gateways || n.value.gateways.length === 0)
|
190
|
+
return c();
|
191
|
+
const r = n.value.gateways[0];
|
192
|
+
if (!r.config)
|
193
|
+
return c();
|
194
|
+
switch (r.gateway) {
|
195
|
+
case "Fiuu":
|
196
|
+
o.value = {
|
197
|
+
packageId: r.config.packageId,
|
198
|
+
uniqueId: r.config.uniqueId,
|
199
|
+
developerId: "",
|
200
|
+
isUat: !1
|
201
|
+
};
|
202
|
+
break;
|
203
|
+
case "Softspace":
|
204
|
+
case "Digio":
|
205
|
+
const i = JSON.parse(r.config.uniqueId);
|
206
|
+
o.value = {
|
207
|
+
packageId: r.config.packageId,
|
208
|
+
uniqueId: i.uniqueId,
|
209
|
+
developerId: i.developerId,
|
210
|
+
isUat: i.isUat
|
211
|
+
};
|
212
|
+
return;
|
213
|
+
}
|
214
|
+
};
|
215
|
+
C(n, s), S(s);
|
216
|
+
async function u(r) {
|
217
|
+
var i;
|
218
|
+
(i = n.value.gateways) == null || i.splice(r, 1), m.onUpdate(n.value);
|
219
|
+
}
|
220
|
+
const a = T(() => p.filter((r) => r.region === e.value)), l = T(() => a.value.find((r) => r.value === o.value.packageId));
|
221
|
+
return (r, i) => {
|
222
|
+
const d = y("FmSelect"), _ = y("FmTextField"), O = y("FmCheckbox"), P = y("FmButton"), E = y("FmForm");
|
223
|
+
return f(), F(E, {
|
224
|
+
ref: t.value,
|
225
|
+
class: "flex flex-col gap-16 w-[500px]",
|
226
|
+
onValidationSuccess: i[5] || (i[5] = () => {
|
227
|
+
const w = l.value;
|
228
|
+
if (!w)
|
229
|
+
return;
|
230
|
+
let Q = o.value.uniqueId;
|
231
|
+
w.isLegacy || (Q = JSON.stringify({ uniqueId: o.value.uniqueId, developerId: o.value.developerId, isUat: o.value.isUat }));
|
232
|
+
const J = {
|
233
|
+
gateway: w.gateway,
|
234
|
+
config: {
|
235
|
+
packageId: w.value,
|
236
|
+
uniqueId: Q
|
237
|
+
}
|
238
|
+
};
|
239
|
+
(!n.value.gateways || n.value.gateways.length > 1) && (n.value.gateways = []), n.value.gateways[0] = J, m.onUpdate(n.value);
|
240
|
+
})
|
241
|
+
}, {
|
242
|
+
default: q(() => [
|
243
|
+
v(d, {
|
244
|
+
modelValue: o.value.packageId,
|
245
|
+
"onUpdate:modelValue": i[0] || (i[0] = (w) => o.value.packageId = w),
|
246
|
+
label: "Package ID",
|
247
|
+
items: a.value
|
248
|
+
}, null, 8, ["modelValue", "items"]),
|
249
|
+
l.value && l.value.isLegacy ? (f(), V(B, { key: 0 }, [
|
250
|
+
v(_, {
|
251
|
+
modelValue: o.value.uniqueId,
|
252
|
+
"onUpdate:modelValue": i[1] || (i[1] = (w) => o.value.uniqueId = w),
|
253
|
+
label: "Unique ID (TID)"
|
254
|
+
}, null, 8, ["modelValue"]),
|
255
|
+
l.value.isOutdated ? (f(), V("span", re, " Note: For outdated gateway is no longer continued development, please use the new gateway instead. ")) : k("", !0)
|
256
|
+
], 64)) : (f(), V(B, { key: 1 }, [
|
257
|
+
v(_, {
|
258
|
+
modelValue: o.value.developerId,
|
259
|
+
"onUpdate:modelValue": i[2] || (i[2] = (w) => o.value.developerId = w),
|
260
|
+
label: "Developer ID (MID)"
|
261
|
+
}, null, 8, ["modelValue"]),
|
262
|
+
v(_, {
|
263
|
+
modelValue: o.value.uniqueId,
|
264
|
+
"onUpdate:modelValue": i[3] || (i[3] = (w) => o.value.uniqueId = w),
|
265
|
+
label: "Unique ID (TID)"
|
266
|
+
}, null, 8, ["modelValue"]),
|
267
|
+
v(O, {
|
268
|
+
modelValue: o.value.isUat,
|
269
|
+
"onUpdate:modelValue": i[4] || (i[4] = (w) => o.value.isUat = w),
|
270
|
+
label: "Is UAT (Test)",
|
271
|
+
value: "1"
|
272
|
+
}, null, 8, ["modelValue"])
|
273
|
+
], 64)),
|
274
|
+
I("div", ue, [
|
275
|
+
n.value.gateways && n.value.gateways.length > 0 ? (f(), F(P, {
|
276
|
+
key: 0,
|
277
|
+
class: "flex-1",
|
278
|
+
variant: "secondary",
|
279
|
+
label: "Delete",
|
280
|
+
onclick: () => u(0)
|
281
|
+
}, null, 8, ["onclick"])) : k("", !0),
|
282
|
+
v(P, {
|
283
|
+
type: "submit",
|
284
|
+
class: "flex-1",
|
285
|
+
variant: "primary",
|
286
|
+
label: "Save"
|
287
|
+
})
|
288
|
+
])
|
289
|
+
]),
|
290
|
+
_: 1
|
291
|
+
}, 512);
|
292
|
+
};
|
293
|
+
}
|
294
|
+
}), se = {
|
295
|
+
key: 0,
|
296
|
+
class: "flex items-center justify-center min-h-[80vh]"
|
297
|
+
}, ce = { class: "flex mt-6 space-x-6" }, me = /* @__PURE__ */ N({
|
298
|
+
__name: "TerminalGateway",
|
299
|
+
props: {
|
300
|
+
terminal: {
|
301
|
+
type: Object,
|
302
|
+
required: !0
|
303
|
+
},
|
304
|
+
onUpdate: {
|
305
|
+
type: Function,
|
306
|
+
required: !0
|
307
|
+
}
|
308
|
+
},
|
309
|
+
setup(g) {
|
310
|
+
const { isLoading: m, startAsyncCall: e } = z(), p = g, n = M(() => p.terminal), t = b(), o = b(), c = b(-1), s = b({
|
311
|
+
terminalId: ""
|
312
|
+
}), u = () => {
|
313
|
+
s.value.terminalId = "", c.value = -1;
|
314
|
+
}, a = () => {
|
315
|
+
if (e(async () => {
|
316
|
+
t.value = await R.getRestaurantTerminals(p.terminal.referenceId);
|
317
|
+
}), !p.terminal.ecrs)
|
318
|
+
return u();
|
319
|
+
const i = p.terminal.ecrs.findIndex((_) => _ && _.gateway && _.gateway === "FeedMe");
|
320
|
+
if (i === -1)
|
321
|
+
return u();
|
322
|
+
c.value = i;
|
323
|
+
const d = p.terminal.ecrs.at(i);
|
324
|
+
d.gateway === "FeedMe" && d.config && (s.value = {
|
325
|
+
terminalId: d.config.terminalId
|
326
|
+
});
|
327
|
+
};
|
328
|
+
C(n, a), S(a);
|
329
|
+
const l = T(() => (t.value ?? []).map((i) => ({
|
330
|
+
label: i.name ?? i._id,
|
331
|
+
value: i._id
|
332
|
+
})));
|
333
|
+
async function r(i) {
|
334
|
+
var d;
|
335
|
+
(d = p.terminal.ecrs) == null || d.splice(i, 1), p.onUpdate(p.terminal);
|
336
|
+
}
|
337
|
+
return (i, d) => {
|
338
|
+
const _ = y("FmCircularProgress"), O = y("FmSelect"), P = y("FmButton"), E = y("FmForm");
|
339
|
+
return x(m) ? (f(), V("div", se, [
|
340
|
+
v(_, { size: "xxl" })
|
341
|
+
])) : (f(), F(E, {
|
342
|
+
key: 1,
|
343
|
+
ref: o.value,
|
344
|
+
class: "flex flex-col gap-16 w-[500px]",
|
345
|
+
onValidationSuccess: d[1] || (d[1] = () => {
|
346
|
+
c.value > -1 ? n.value.ecrs[c.value] = { gateway: "FeedMe", config: s.value } : (n.value.ecrs || (n.value.ecrs = []), n.value.ecrs.push({ gateway: "FeedMe", config: s.value })), p.onUpdate(n.value);
|
347
|
+
})
|
348
|
+
}, {
|
349
|
+
default: q(() => [
|
350
|
+
v(O, {
|
351
|
+
modelValue: s.value.terminalId,
|
352
|
+
"onUpdate:modelValue": d[0] || (d[0] = (w) => s.value.terminalId = w),
|
353
|
+
label: "Terminal ID",
|
354
|
+
items: l.value,
|
355
|
+
rules: x(Z)(x(ee).string())
|
356
|
+
}, null, 8, ["modelValue", "items", "rules"]),
|
357
|
+
I("div", ce, [
|
358
|
+
c.value > -1 ? (f(), F(P, {
|
359
|
+
key: 0,
|
360
|
+
class: "flex-1",
|
361
|
+
variant: "secondary",
|
362
|
+
label: "Delete",
|
363
|
+
onclick: () => r(c.value)
|
364
|
+
}, null, 8, ["onclick"])) : k("", !0),
|
365
|
+
v(P, {
|
366
|
+
type: "submit",
|
367
|
+
class: "flex-1",
|
368
|
+
variant: "primary",
|
369
|
+
label: "Save"
|
370
|
+
})
|
371
|
+
])
|
372
|
+
]),
|
373
|
+
_: 1
|
374
|
+
}, 512));
|
375
|
+
};
|
376
|
+
}
|
377
|
+
}), de = { class: "flex mt-6 space-x-6" }, pe = /* @__PURE__ */ N({
|
378
|
+
__name: "GhlGateway",
|
379
|
+
props: {
|
380
|
+
terminal: {
|
381
|
+
type: Object,
|
382
|
+
required: !0
|
383
|
+
},
|
384
|
+
onUpdate: {
|
385
|
+
type: Function,
|
386
|
+
required: !0
|
387
|
+
}
|
388
|
+
},
|
389
|
+
setup(g) {
|
390
|
+
const m = g, e = M(() => m.terminal), p = b(), n = b(-1), t = b({
|
391
|
+
merchantId: "",
|
392
|
+
terminalId: "",
|
393
|
+
privateKey: ""
|
394
|
+
}), o = () => {
|
395
|
+
t.value.merchantId = "", t.value.terminalId = "", t.value.privateKey = "", n.value = -1;
|
396
|
+
}, c = () => {
|
397
|
+
if (!e.value.ecrs)
|
398
|
+
return o();
|
399
|
+
const u = e.value.ecrs.findIndex((l) => l && l.gateway && l.gateway === "Ghl");
|
400
|
+
if (u === -1)
|
401
|
+
return o();
|
402
|
+
n.value = u;
|
403
|
+
const a = e.value.ecrs.at(u);
|
404
|
+
a.gateway === "Ghl" && a.config && (t.value = {
|
405
|
+
merchantId: a.config.merchantId,
|
406
|
+
terminalId: a.config.terminalId,
|
407
|
+
privateKey: a.config.privateKey
|
408
|
+
});
|
409
|
+
};
|
410
|
+
C(e, c), S(c);
|
411
|
+
async function s(u) {
|
412
|
+
var a;
|
413
|
+
(a = e.value.ecrs) == null || a.splice(u, 1), m.onUpdate(e.value);
|
414
|
+
}
|
415
|
+
return (u, a) => {
|
416
|
+
const l = y("FmTextField"), r = y("FmTextarea"), i = y("FmButton"), d = y("FmForm");
|
417
|
+
return f(), F(d, {
|
418
|
+
ref: p.value,
|
419
|
+
class: "flex flex-col gap-16 w-[500px]",
|
420
|
+
onValidationSuccess: a[3] || (a[3] = () => {
|
421
|
+
n.value > -1 ? e.value.ecrs[n.value] = { gateway: "Ghl", config: t.value } : (e.value.ecrs || (e.value.ecrs = []), e.value.ecrs.push({ gateway: "Ghl", config: t.value })), m.onUpdate(e.value);
|
422
|
+
})
|
423
|
+
}, {
|
424
|
+
default: q(() => [
|
425
|
+
v(l, {
|
426
|
+
modelValue: t.value.merchantId,
|
427
|
+
"onUpdate:modelValue": a[0] || (a[0] = (_) => t.value.merchantId = _),
|
428
|
+
label: "Merchant ID"
|
429
|
+
}, null, 8, ["modelValue"]),
|
430
|
+
v(l, {
|
431
|
+
modelValue: t.value.terminalId,
|
432
|
+
"onUpdate:modelValue": a[1] || (a[1] = (_) => t.value.terminalId = _),
|
433
|
+
label: "Terminal ID"
|
434
|
+
}, null, 8, ["modelValue"]),
|
435
|
+
v(r, {
|
436
|
+
modelValue: t.value.privateKey,
|
437
|
+
"onUpdate:modelValue": a[2] || (a[2] = (_) => t.value.privateKey = _),
|
438
|
+
label: "Private Key"
|
439
|
+
}, null, 8, ["modelValue"]),
|
440
|
+
I("div", de, [
|
441
|
+
n.value > -1 ? (f(), F(i, {
|
442
|
+
key: 0,
|
443
|
+
class: "flex-1",
|
444
|
+
variant: "secondary",
|
445
|
+
label: "Delete",
|
446
|
+
onclick: () => s(n.value)
|
447
|
+
}, null, 8, ["onclick"])) : k("", !0),
|
448
|
+
v(i, {
|
449
|
+
type: "submit",
|
450
|
+
class: "flex-1",
|
451
|
+
variant: "primary",
|
452
|
+
label: "Save"
|
453
|
+
})
|
454
|
+
])
|
455
|
+
]),
|
456
|
+
_: 1
|
457
|
+
}, 512);
|
458
|
+
};
|
459
|
+
}
|
460
|
+
}), ve = { class: "flex mt-6 space-x-6" }, ye = /* @__PURE__ */ N({
|
461
|
+
__name: "MaybankGateway",
|
462
|
+
props: {
|
463
|
+
terminal: {
|
464
|
+
type: Object,
|
465
|
+
required: !0
|
466
|
+
},
|
467
|
+
onUpdate: {
|
468
|
+
type: Function,
|
469
|
+
required: !0
|
470
|
+
}
|
471
|
+
},
|
472
|
+
setup(g) {
|
473
|
+
const m = g, e = M(() => m.terminal), p = b(), n = b(-1), t = b({
|
474
|
+
ip: "",
|
475
|
+
receiptName: ""
|
476
|
+
}), o = () => {
|
477
|
+
t.value.ip = "", t.value.receiptName = "", n.value = -1;
|
478
|
+
}, c = () => {
|
479
|
+
if (!e.value.ecrIntegrations)
|
480
|
+
return o();
|
481
|
+
const u = e.value.ecrIntegrations, a = u.findIndex((r) => r && r.gateway && r.gateway === "Maybank");
|
482
|
+
if (a === -1)
|
483
|
+
return o();
|
484
|
+
n.value = a;
|
485
|
+
const l = u.at(a);
|
486
|
+
l.gateway === "Maybank" && l.config && (t.value = {
|
487
|
+
ip: l.config.ip ?? "",
|
488
|
+
receiptName: l.receiptName ?? ""
|
489
|
+
});
|
490
|
+
};
|
491
|
+
C(e, c), S(c);
|
492
|
+
async function s(u) {
|
493
|
+
var a;
|
494
|
+
(a = e.value.ecrIntegrations) == null || a.splice(u, 1), m.onUpdate(e.value);
|
495
|
+
}
|
496
|
+
return (u, a) => {
|
497
|
+
const l = y("FmTextField"), r = y("FmButton"), i = y("FmForm");
|
498
|
+
return f(), F(i, {
|
499
|
+
ref: p.value,
|
500
|
+
class: "flex flex-col gap-16 w-[500px]",
|
501
|
+
onValidationSuccess: a[2] || (a[2] = () => {
|
502
|
+
n.value > -1 ? e.value.ecrIntegrations[n.value] = { gateway: "Maybank", config: { ip: t.value.ip }, receiptName: t.value.receiptName } : (e.value.ecrIntegrations || (e.value.ecrIntegrations = []), e.value.ecrIntegrations.push({ gateway: "Maybank", config: { ip: t.value.ip }, receiptName: t.value.receiptName })), m.onUpdate(e.value);
|
503
|
+
})
|
504
|
+
}, {
|
505
|
+
default: q(() => [
|
506
|
+
v(l, {
|
507
|
+
modelValue: t.value.ip,
|
508
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => t.value.ip = d),
|
509
|
+
label: "IP Address"
|
510
|
+
}, null, 8, ["modelValue"]),
|
511
|
+
v(l, {
|
512
|
+
modelValue: t.value.receiptName,
|
513
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => t.value.receiptName = d),
|
514
|
+
label: "Receipt Payment Name",
|
515
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
516
|
+
}, null, 8, ["modelValue"]),
|
517
|
+
I("div", ve, [
|
518
|
+
n.value > -1 ? (f(), F(r, {
|
519
|
+
key: 0,
|
520
|
+
class: "flex-1",
|
521
|
+
variant: "secondary",
|
522
|
+
label: "Delete",
|
523
|
+
onclick: () => s(n.value)
|
524
|
+
}, null, 8, ["onclick"])) : k("", !0),
|
525
|
+
v(r, {
|
526
|
+
type: "submit",
|
527
|
+
class: "flex-1",
|
528
|
+
variant: "primary",
|
529
|
+
label: "Save"
|
530
|
+
})
|
531
|
+
])
|
532
|
+
]),
|
533
|
+
_: 1
|
534
|
+
}, 512);
|
535
|
+
};
|
536
|
+
}
|
537
|
+
}), fe = { class: "flex mt-6 space-x-6" }, ge = /* @__PURE__ */ N({
|
538
|
+
__name: "Maybank2Gateway",
|
539
|
+
props: {
|
540
|
+
terminal: {
|
541
|
+
type: Object,
|
542
|
+
required: !0
|
543
|
+
},
|
544
|
+
onUpdate: {
|
545
|
+
type: Function,
|
546
|
+
required: !0
|
547
|
+
}
|
548
|
+
},
|
549
|
+
setup(g) {
|
550
|
+
const m = g, e = M(() => m.terminal), p = b(), n = b(-1), t = b({
|
551
|
+
ip: "",
|
552
|
+
receiptName: ""
|
553
|
+
}), o = () => {
|
554
|
+
t.value.ip = "", t.value.receiptName = "", n.value = -1;
|
555
|
+
}, c = () => {
|
556
|
+
if (!e.value.ecrIntegrations)
|
557
|
+
return o();
|
558
|
+
const u = e.value.ecrIntegrations, a = u.findIndex((r) => r && r.gateway && r.gateway === "Maybank2");
|
559
|
+
if (a === -1)
|
560
|
+
return o();
|
561
|
+
n.value = a;
|
562
|
+
const l = u.at(a);
|
563
|
+
l.gateway === "Maybank2" && l.config && (t.value = {
|
564
|
+
ip: l.config.ip ?? "",
|
565
|
+
receiptName: l.receiptName ?? ""
|
566
|
+
});
|
567
|
+
};
|
568
|
+
C(e, c), S(c);
|
569
|
+
async function s(u) {
|
570
|
+
var a;
|
571
|
+
(a = e.value.ecrIntegrations) == null || a.splice(u, 1), m.onUpdate(e.value);
|
572
|
+
}
|
573
|
+
return (u, a) => {
|
574
|
+
const l = y("FmTextField"), r = y("FmButton"), i = y("FmForm");
|
575
|
+
return f(), F(i, {
|
576
|
+
ref: p.value,
|
577
|
+
class: "flex flex-col gap-16 w-[500px]",
|
578
|
+
onValidationSuccess: a[2] || (a[2] = () => {
|
579
|
+
n.value > -1 ? e.value.ecrIntegrations[n.value] = { gateway: "Maybank2", config: { ip: t.value.ip }, receiptName: t.value.receiptName } : (e.value.ecrIntegrations || (e.value.ecrIntegrations = []), e.value.ecrIntegrations.push({ gateway: "Maybank2", config: { ip: t.value.ip }, receiptName: t.value.receiptName })), m.onUpdate(e.value);
|
580
|
+
})
|
581
|
+
}, {
|
582
|
+
default: q(() => [
|
583
|
+
v(l, {
|
584
|
+
modelValue: t.value.ip,
|
585
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => t.value.ip = d),
|
586
|
+
label: "IP Address"
|
587
|
+
}, null, 8, ["modelValue"]),
|
588
|
+
v(l, {
|
589
|
+
modelValue: t.value.receiptName,
|
590
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => t.value.receiptName = d),
|
591
|
+
label: "Receipt Payment Name",
|
592
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
593
|
+
}, null, 8, ["modelValue"]),
|
594
|
+
I("div", fe, [
|
595
|
+
n.value > -1 ? (f(), F(r, {
|
596
|
+
key: 0,
|
597
|
+
class: "flex-1",
|
598
|
+
variant: "secondary",
|
599
|
+
label: "Delete",
|
600
|
+
onclick: () => s(n.value)
|
601
|
+
}, null, 8, ["onclick"])) : k("", !0),
|
602
|
+
v(r, {
|
603
|
+
type: "submit",
|
604
|
+
class: "flex-1",
|
605
|
+
variant: "primary",
|
606
|
+
label: "Save"
|
607
|
+
})
|
608
|
+
])
|
609
|
+
]),
|
610
|
+
_: 1
|
611
|
+
}, 512);
|
612
|
+
};
|
613
|
+
}
|
614
|
+
}), be = { class: "flex mt-6 space-x-6" }, Ie = /* @__PURE__ */ N({
|
615
|
+
__name: "Maybank3Gateway",
|
616
|
+
props: {
|
617
|
+
terminal: {
|
618
|
+
type: Object,
|
619
|
+
required: !0
|
620
|
+
},
|
621
|
+
onUpdate: {
|
622
|
+
type: Function,
|
623
|
+
required: !0
|
624
|
+
}
|
625
|
+
},
|
626
|
+
setup(g) {
|
627
|
+
const m = g, e = M(() => m.terminal), p = b(), n = b(-1), t = b({
|
628
|
+
ip: "",
|
629
|
+
receiptName: ""
|
630
|
+
}), o = () => {
|
631
|
+
t.value.ip = "", t.value.receiptName = "", n.value = -1;
|
632
|
+
}, c = () => {
|
633
|
+
if (!e.value.ecrIntegrations)
|
634
|
+
return o();
|
635
|
+
const u = e.value.ecrIntegrations, a = u.findIndex((r) => r && r.gateway && r.gateway === "Maybank3");
|
636
|
+
if (a === -1)
|
637
|
+
return o();
|
638
|
+
n.value = a;
|
639
|
+
const l = u.at(a);
|
640
|
+
l.gateway === "Maybank3" && l.config && (t.value = {
|
641
|
+
ip: l.config.ip ?? "",
|
642
|
+
receiptName: l.receiptName ?? ""
|
643
|
+
});
|
644
|
+
};
|
645
|
+
C(e, c), S(c);
|
646
|
+
async function s(u) {
|
647
|
+
var a;
|
648
|
+
(a = e.value.ecrIntegrations) == null || a.splice(u, 1), m.onUpdate(e.value);
|
649
|
+
}
|
650
|
+
return (u, a) => {
|
651
|
+
const l = y("FmTextField"), r = y("FmButton"), i = y("FmForm");
|
652
|
+
return f(), F(i, {
|
653
|
+
ref: p.value,
|
654
|
+
class: "flex flex-col gap-16 w-[500px]",
|
655
|
+
onValidationSuccess: a[2] || (a[2] = () => {
|
656
|
+
n.value > -1 ? e.value.ecrIntegrations[n.value] = { gateway: "Maybank3", config: { ip: t.value.ip }, receiptName: t.value.receiptName } : (e.value.ecrIntegrations || (e.value.ecrIntegrations = []), e.value.ecrIntegrations.push({ gateway: "Maybank3", config: { ip: t.value.ip }, receiptName: t.value.receiptName })), m.onUpdate(e.value);
|
657
|
+
})
|
658
|
+
}, {
|
659
|
+
default: q(() => [
|
660
|
+
v(l, {
|
661
|
+
modelValue: t.value.ip,
|
662
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => t.value.ip = d),
|
663
|
+
label: "IP Address"
|
664
|
+
}, null, 8, ["modelValue"]),
|
665
|
+
v(l, {
|
666
|
+
modelValue: t.value.receiptName,
|
667
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => t.value.receiptName = d),
|
668
|
+
label: "Receipt Payment Name",
|
669
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
670
|
+
}, null, 8, ["modelValue"]),
|
671
|
+
I("div", be, [
|
672
|
+
n.value > -1 ? (f(), F(r, {
|
673
|
+
key: 0,
|
674
|
+
class: "flex-1",
|
675
|
+
variant: "secondary",
|
676
|
+
label: "Delete",
|
677
|
+
onclick: () => s(n.value)
|
678
|
+
}, null, 8, ["onclick"])) : k("", !0),
|
679
|
+
v(r, {
|
680
|
+
type: "submit",
|
681
|
+
class: "flex-1",
|
682
|
+
variant: "primary",
|
683
|
+
label: "Save"
|
684
|
+
})
|
685
|
+
])
|
686
|
+
]),
|
687
|
+
_: 1
|
688
|
+
}, 512);
|
689
|
+
};
|
690
|
+
}
|
691
|
+
}), Fe = { class: "flex mt-6 space-x-6" }, _e = /* @__PURE__ */ N({
|
692
|
+
__name: "NetsGateway",
|
693
|
+
props: {
|
694
|
+
terminal: {
|
695
|
+
type: Object,
|
696
|
+
required: !0
|
697
|
+
},
|
698
|
+
onUpdate: {
|
699
|
+
type: Function,
|
700
|
+
required: !0
|
701
|
+
}
|
702
|
+
},
|
703
|
+
setup(g) {
|
704
|
+
const m = g, e = M(() => m.terminal), p = b(), n = b(-1), t = b({
|
705
|
+
ip: "",
|
706
|
+
receiptName: ""
|
707
|
+
}), o = () => {
|
708
|
+
t.value.ip = "", t.value.receiptName = "", n.value = -1;
|
709
|
+
}, c = () => {
|
710
|
+
if (!e.value.ecrIntegrations)
|
711
|
+
return o();
|
712
|
+
const u = e.value.ecrIntegrations, a = u.findIndex((r) => r && r.gateway && r.gateway === "Nets");
|
713
|
+
if (a === -1)
|
714
|
+
return o();
|
715
|
+
n.value = a;
|
716
|
+
const l = u.at(a);
|
717
|
+
l.gateway === "Nets" && l.config && (t.value = {
|
718
|
+
ip: l.config.ip ?? "",
|
719
|
+
receiptName: l.receiptName ?? ""
|
720
|
+
});
|
721
|
+
};
|
722
|
+
C(e, c), S(c);
|
723
|
+
async function s(u) {
|
724
|
+
var a;
|
725
|
+
(a = e.value.ecrIntegrations) == null || a.splice(u, 1), m.onUpdate(e.value);
|
726
|
+
}
|
727
|
+
return (u, a) => {
|
728
|
+
const l = y("FmTextField"), r = y("FmButton"), i = y("FmForm");
|
729
|
+
return f(), F(i, {
|
730
|
+
ref: p.value,
|
731
|
+
class: "flex flex-col gap-16 w-[500px]",
|
732
|
+
onValidationSuccess: a[2] || (a[2] = () => {
|
733
|
+
n.value > -1 ? e.value.ecrIntegrations[n.value] = { gateway: "Nets", config: t.value } : (e.value.ecrIntegrations || (e.value.ecrIntegrations = []), e.value.ecrIntegrations.push({ gateway: "Nets", config: t.value })), m.onUpdate(e.value);
|
734
|
+
})
|
735
|
+
}, {
|
736
|
+
default: q(() => [
|
737
|
+
v(l, {
|
738
|
+
modelValue: t.value.ip,
|
739
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => t.value.ip = d),
|
740
|
+
label: "IP Address"
|
741
|
+
}, null, 8, ["modelValue"]),
|
742
|
+
v(l, {
|
743
|
+
modelValue: t.value.receiptName,
|
744
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => t.value.receiptName = d),
|
745
|
+
label: "Receipt Payment Name",
|
746
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
747
|
+
}, null, 8, ["modelValue"]),
|
748
|
+
I("div", Fe, [
|
749
|
+
n.value > -1 ? (f(), F(r, {
|
750
|
+
key: 0,
|
751
|
+
class: "flex-1",
|
752
|
+
variant: "secondary",
|
753
|
+
label: "Delete",
|
754
|
+
onclick: () => s(n.value)
|
755
|
+
}, null, 8, ["onclick"])) : k("", !0),
|
756
|
+
v(r, {
|
757
|
+
type: "submit",
|
758
|
+
class: "flex-1",
|
759
|
+
variant: "primary",
|
760
|
+
label: "Save"
|
761
|
+
})
|
762
|
+
])
|
763
|
+
]),
|
764
|
+
_: 1
|
765
|
+
}, 512);
|
766
|
+
};
|
767
|
+
}
|
768
|
+
}), we = { class: "flex items-center" }, xe = { class: "w-[260px] self-start" }, ke = { class: "flex-1" }, Ne = /* @__PURE__ */ N({
|
769
|
+
__name: "EcrGateway",
|
770
|
+
props: {
|
771
|
+
terminal: {
|
772
|
+
type: Object,
|
773
|
+
required: !0
|
774
|
+
},
|
775
|
+
onUpdate: {
|
776
|
+
type: Function,
|
777
|
+
required: !0
|
778
|
+
}
|
779
|
+
},
|
780
|
+
setup(g) {
|
781
|
+
var c;
|
782
|
+
const m = g, e = [
|
783
|
+
{
|
784
|
+
label: "FeedMe Terminal",
|
785
|
+
value: "terminal",
|
786
|
+
render: me
|
787
|
+
},
|
788
|
+
{
|
789
|
+
label: "GHL Terminal (V2)",
|
790
|
+
value: "ghl",
|
791
|
+
render: pe,
|
792
|
+
region: [U.F_COUNTRY.enum.MY]
|
793
|
+
},
|
794
|
+
{
|
795
|
+
label: "Maybank Terminal (ITB)",
|
796
|
+
value: "mb-itb",
|
797
|
+
render: ye,
|
798
|
+
region: [U.F_COUNTRY.enum.MY]
|
799
|
+
},
|
800
|
+
{
|
801
|
+
label: "Maybank Terminal (PMA)",
|
802
|
+
value: "mb-pma",
|
803
|
+
render: ge,
|
804
|
+
region: [U.F_COUNTRY.enum.MY]
|
805
|
+
},
|
806
|
+
{
|
807
|
+
label: "Maybank Terminal (Paysys)",
|
808
|
+
value: "mb-paysys",
|
809
|
+
render: Ie,
|
810
|
+
region: [U.F_COUNTRY.enum.MY]
|
811
|
+
},
|
812
|
+
{
|
813
|
+
label: "Nets Terminal",
|
814
|
+
value: "nets",
|
815
|
+
render: _e,
|
816
|
+
region: [U.F_COUNTRY.enum.SG]
|
817
|
+
}
|
818
|
+
], p = T(() => e.find((s) => s.value === o.value)), n = L().currentCountry, t = T(() => e.filter((s) => !s.region || s.region.includes(n.value ?? U.F_COUNTRY.enum.MY))), { gatewayTab: o } = j({
|
819
|
+
gatewayTab: (c = t.value[0]) == null ? void 0 : c.value
|
820
|
+
});
|
821
|
+
return (s, u) => {
|
822
|
+
var l;
|
823
|
+
const a = y("FmTabs");
|
824
|
+
return f(), V("div", we, [
|
825
|
+
I("div", xe, [
|
826
|
+
v(a, {
|
827
|
+
"model-value": x(o),
|
828
|
+
"onUpdate:modelValue": u[0] || (u[0] = (r) => $(o) ? o.value = r : null),
|
829
|
+
class: "mb-6",
|
830
|
+
vertical: !0,
|
831
|
+
items: t.value
|
832
|
+
}, null, 8, ["model-value", "items"])
|
833
|
+
]),
|
834
|
+
I("div", ke, [
|
835
|
+
x(o) ? (f(), F(A((l = p.value) == null ? void 0 : l.render), Y(K({ key: 0 }, {
|
836
|
+
terminal: m.terminal,
|
837
|
+
onUpdate: m.onUpdate
|
838
|
+
})), null, 16)) : k("", !0)
|
839
|
+
])
|
840
|
+
]);
|
841
|
+
};
|
842
|
+
}
|
843
|
+
}), Ue = { class: "flex mt-6 space-x-6" }, Ve = /* @__PURE__ */ N({
|
844
|
+
__name: "PromptPayGateway",
|
845
|
+
props: {
|
846
|
+
terminal: {
|
847
|
+
type: Object,
|
848
|
+
required: !0
|
849
|
+
},
|
850
|
+
onUpdate: {
|
851
|
+
type: Function,
|
852
|
+
required: !0
|
853
|
+
}
|
854
|
+
},
|
855
|
+
setup(g) {
|
856
|
+
const m = g, e = M(() => m.terminal), p = b(), n = b(-1), t = b({
|
857
|
+
account: "",
|
858
|
+
receiptName: ""
|
859
|
+
}), o = () => {
|
860
|
+
t.value.account = "", t.value.receiptName = "", n.value = -1;
|
861
|
+
}, c = () => {
|
862
|
+
if (!e.value.qrIntegrations)
|
863
|
+
return o();
|
864
|
+
const u = e.value.qrIntegrations, a = u.findIndex((r) => r && r.gateway && r.gateway === "PromptPay");
|
865
|
+
if (a === -1)
|
866
|
+
return o();
|
867
|
+
n.value = a;
|
868
|
+
const l = u.at(a);
|
869
|
+
l.gateway === "PromptPay" && l.config && (t.value = {
|
870
|
+
account: l.config.account ?? "",
|
871
|
+
receiptName: l.receiptName ?? ""
|
872
|
+
});
|
873
|
+
};
|
874
|
+
C(e, c), S(c);
|
875
|
+
async function s(u) {
|
876
|
+
var a;
|
877
|
+
(a = e.value.qrIntegrations) == null || a.splice(u, 1), m.onUpdate(e.value);
|
878
|
+
}
|
879
|
+
return (u, a) => {
|
880
|
+
const l = y("FmTextField"), r = y("FmButton"), i = y("FmForm");
|
881
|
+
return f(), F(i, {
|
882
|
+
ref: p.value,
|
883
|
+
class: "flex flex-col gap-16 w-[500px]",
|
884
|
+
onValidationSuccess: a[2] || (a[2] = () => {
|
885
|
+
n.value > -1 ? e.value.qrIntegrations[n.value] = { gateway: "PromptPay", config: { account: t.value.account }, receiptName: t.value.receiptName } : (e.value.qrIntegrations || (e.value.qrIntegrations = []), e.value.qrIntegrations.push({ gateway: "PromptPay", config: { account: t.value.account }, receiptName: t.value.receiptName })), m.onUpdate(e.value);
|
886
|
+
})
|
887
|
+
}, {
|
888
|
+
default: q(() => [
|
889
|
+
v(l, {
|
890
|
+
modelValue: t.value.account,
|
891
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => t.value.account = d),
|
892
|
+
label: "Thai Account / Internal Number"
|
893
|
+
}, null, 8, ["modelValue"]),
|
894
|
+
v(l, {
|
895
|
+
modelValue: t.value.receiptName,
|
896
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => t.value.receiptName = d),
|
897
|
+
label: "Receipt Payment Name",
|
898
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
899
|
+
}, null, 8, ["modelValue"]),
|
900
|
+
I("div", Ue, [
|
901
|
+
n.value > -1 ? (f(), F(r, {
|
902
|
+
key: 0,
|
903
|
+
class: "flex-1",
|
904
|
+
variant: "secondary",
|
905
|
+
label: "Delete",
|
906
|
+
onclick: () => s(n.value)
|
907
|
+
}, null, 8, ["onclick"])) : k("", !0),
|
908
|
+
v(r, {
|
909
|
+
type: "submit",
|
910
|
+
class: "flex-1",
|
911
|
+
variant: "primary",
|
912
|
+
label: "Save"
|
913
|
+
})
|
914
|
+
])
|
915
|
+
]),
|
916
|
+
_: 1
|
917
|
+
}, 512);
|
918
|
+
};
|
919
|
+
}
|
920
|
+
}), Te = { class: "flex items-center" }, Se = { class: "w-[260px] self-start" }, qe = { class: "flex-1" }, Me = /* @__PURE__ */ N({
|
921
|
+
__name: "QrGateway",
|
922
|
+
props: {
|
923
|
+
terminal: {
|
924
|
+
type: Object,
|
925
|
+
required: !0
|
926
|
+
},
|
927
|
+
onUpdate: {
|
928
|
+
type: Function,
|
929
|
+
required: !0
|
930
|
+
}
|
931
|
+
},
|
932
|
+
setup(g) {
|
933
|
+
var c;
|
934
|
+
const m = g, e = [
|
935
|
+
{
|
936
|
+
label: "PromptPay",
|
937
|
+
value: "promptpay",
|
938
|
+
render: Ve,
|
939
|
+
region: [U.F_COUNTRY.enum.MY]
|
940
|
+
}
|
941
|
+
], p = T(() => e.find((s) => s.value === o.value)), n = L().currentCountry, t = T(() => e.filter((s) => !s.region || s.region.includes(n.value ?? U.F_COUNTRY.enum.MY))), { gatewayTab: o } = j({
|
942
|
+
gatewayTab: (c = t.value[0]) == null ? void 0 : c.value
|
943
|
+
});
|
944
|
+
return (s, u) => {
|
945
|
+
var l;
|
946
|
+
const a = y("FmTabs");
|
947
|
+
return f(), V("div", Te, [
|
948
|
+
I("div", Se, [
|
949
|
+
v(a, {
|
950
|
+
"model-value": x(o),
|
951
|
+
"onUpdate:modelValue": u[0] || (u[0] = (r) => $(o) ? o.value = r : null),
|
952
|
+
class: "mb-6",
|
953
|
+
vertical: !0,
|
954
|
+
items: t.value
|
955
|
+
}, null, 8, ["model-value", "items"])
|
956
|
+
]),
|
957
|
+
I("div", qe, [
|
958
|
+
x(o) ? (f(), F(A((l = p.value) == null ? void 0 : l.render), Y(K({ key: 0 }, {
|
959
|
+
terminal: m.terminal,
|
960
|
+
onUpdate: m.onUpdate
|
961
|
+
})), null, 16)) : k("", !0)
|
962
|
+
])
|
963
|
+
]);
|
964
|
+
};
|
965
|
+
}
|
966
|
+
}), Ke = /* @__PURE__ */ N({
|
967
|
+
__name: "TerminalSetting",
|
968
|
+
props: {
|
969
|
+
terminalId: {
|
970
|
+
type: String,
|
971
|
+
required: !0
|
972
|
+
}
|
973
|
+
},
|
974
|
+
setup(g) {
|
975
|
+
const m = g, { tab: e } = j({
|
976
|
+
tab: "information"
|
977
|
+
}), { isLoading: p, startAsyncCall: n } = z(!0), t = h(), o = H(), c = b();
|
978
|
+
async function s(i) {
|
979
|
+
n(async () => {
|
980
|
+
try {
|
981
|
+
await R.updateById(
|
982
|
+
m.terminalId,
|
983
|
+
{
|
984
|
+
name: i.name,
|
985
|
+
status: i.status,
|
986
|
+
ecrs: i.ecrs ?? [],
|
987
|
+
gateways: i.gateways ?? [],
|
988
|
+
ecrIntegrations: i.ecrIntegrations ?? [],
|
989
|
+
qrIntegrations: i.qrIntegrations ?? []
|
990
|
+
}
|
991
|
+
), c.value = await R.readById(m.terminalId), o.open({
|
992
|
+
type: "success",
|
993
|
+
message: "Terminal updated successfully"
|
994
|
+
});
|
995
|
+
} catch (d) {
|
996
|
+
o.open({
|
997
|
+
type: "error",
|
998
|
+
title: "Error occurs when update terminal",
|
999
|
+
message: X(d)
|
1000
|
+
});
|
1001
|
+
}
|
1002
|
+
});
|
1003
|
+
}
|
1004
|
+
const u = [
|
1005
|
+
{
|
1006
|
+
label: "Information",
|
1007
|
+
value: "information",
|
1008
|
+
icon: "overview",
|
1009
|
+
render: ae
|
1010
|
+
},
|
1011
|
+
{
|
1012
|
+
label: "Setting Request",
|
1013
|
+
value: "settings",
|
1014
|
+
icon: "settings",
|
1015
|
+
render: oe,
|
1016
|
+
onlyFor: ["TERMINAL"]
|
1017
|
+
},
|
1018
|
+
{
|
1019
|
+
label: "SoftPos Gateway",
|
1020
|
+
value: "softpos",
|
1021
|
+
icon: "payment",
|
1022
|
+
render: ie
|
1023
|
+
},
|
1024
|
+
{
|
1025
|
+
label: "ECR Gateway",
|
1026
|
+
value: "ecr",
|
1027
|
+
icon: "point_of_sale",
|
1028
|
+
render: Ne,
|
1029
|
+
onlyFor: ["POS", "KIOSK"]
|
1030
|
+
},
|
1031
|
+
{
|
1032
|
+
label: "QR Gateway",
|
1033
|
+
value: "qr",
|
1034
|
+
icon: "qr_code",
|
1035
|
+
render: Me,
|
1036
|
+
onlyFor: ["POS", "KIOSK"]
|
1037
|
+
}
|
1038
|
+
];
|
1039
|
+
L().currentCountry;
|
1040
|
+
const a = T(() => {
|
1041
|
+
var i;
|
1042
|
+
return (i = u.find((d) => d.value === e.value)) == null ? void 0 : i.render;
|
1043
|
+
});
|
1044
|
+
async function l() {
|
1045
|
+
n(async () => {
|
1046
|
+
c.value = await R.readById(m.terminalId);
|
1047
|
+
});
|
1048
|
+
}
|
1049
|
+
const r = T(() => u.filter((i) => {
|
1050
|
+
var d;
|
1051
|
+
return !i.onlyFor || i.onlyFor.includes(((d = c.value) == null ? void 0 : d.deviceType) ?? "");
|
1052
|
+
}));
|
1053
|
+
return S(l), (i, d) => {
|
1054
|
+
var O;
|
1055
|
+
const _ = y("FmTabs");
|
1056
|
+
return f(), F(W, {
|
1057
|
+
title: `Terminal (${(O = c.value) == null ? void 0 : O._id})`,
|
1058
|
+
loading: x(p),
|
1059
|
+
onBack: x(t).back
|
1060
|
+
}, {
|
1061
|
+
default: q(() => [
|
1062
|
+
v(_, {
|
1063
|
+
"model-value": x(e),
|
1064
|
+
"onUpdate:modelValue": d[0] || (d[0] = (P) => $(e) ? e.value = P : null),
|
1065
|
+
class: "mb-6",
|
1066
|
+
items: r.value
|
1067
|
+
}, null, 8, ["model-value", "items"]),
|
1068
|
+
x(e) ? (f(), F(A(a.value), Y(K({ key: 0 }, {
|
1069
|
+
terminal: c.value,
|
1070
|
+
onUpdate: s
|
1071
|
+
})), null, 16)) : k("", !0)
|
1072
|
+
]),
|
1073
|
+
_: 1
|
1074
|
+
}, 8, ["title", "loading", "onBack"]);
|
1075
|
+
};
|
1076
|
+
}
|
1077
|
+
});
|
1078
|
+
export {
|
1079
|
+
Ke as default
|
1080
|
+
};
|