@feedmepos/mf-payment 1.4.27 → 1.4.28
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/{Actions.vue_vue_type_script_setup_true_lang-zAszH-r3.js → Actions.vue_vue_type_script_setup_true_lang-CLMalWxE.js} +2 -2
- package/dist/{Chargeback-JEmRZ6hx.js → Chargeback-_-KfXEVv.js} +5 -5
- package/dist/{OnboardForm-DuxgDu-0.js → OnboardForm-OsCSZD51.js} +4 -4
- package/dist/{OnboardForm-D1Qw74UP.js → OnboardForm-hY9l_enH.js} +4 -4
- package/dist/{OnboardSubmission-BBELFk7w.js → OnboardSubmission-ByDceZ70.js} +5 -5
- package/dist/{OnboardSubmission-s5vKvUwj.js → OnboardSubmission-CttvUQ4D.js} +2 -2
- package/dist/{PayoutAccount-C2Im-5FU.js → PayoutAccount-BdasKqjH.js} +5 -5
- package/dist/{PayoutAccount-CjL1qAks.js → PayoutAccount-eW-MqpMH.js} +5 -5
- package/dist/{PayoutAccountSetting-BpmU8FGs.js → PayoutAccountSetting-LxWKmBOI.js} +3 -3
- package/dist/{Restaurant-D9M7PHlA.js → Restaurant-CiaK6wV9.js} +4 -4
- package/dist/{RestaurantSetting-CKb_KF5v.js → RestaurantSetting-DOcVGjiD.js} +3 -3
- package/dist/{Settlement-CvD9Q522.js → Settlement-0g10njYN.js} +3 -3
- package/dist/{Settlement-DD50OmCm.js → Settlement-CU8BlYx0.js} +3 -3
- package/dist/{SettlementTransactions-Bdm6r2gK.js → SettlementTransactions-DsWWADGe.js} +4 -4
- package/dist/{SettlementTransactions-IGbYWQQS.js → SettlementTransactions-G9Q6Bi0g.js} +4 -4
- package/dist/{Status.vue_vue_type_script_setup_true_lang-BR--E-L0.js → Status.vue_vue_type_script_setup_true_lang-COp6-_i4.js} +1 -1
- package/dist/{Terminal-Dh7-SYOx.js → Terminal-CetdabFy.js} +5 -5
- package/dist/TerminalSetting-MKI0jupT.js +1460 -0
- package/dist/{Transaction-B3dYL69B.js → Transaction-BBGFc7jF.js} +9 -9
- package/dist/{Transaction-a3yfy8Zj.js → Transaction-CL0kwjHI.js} +6 -6
- package/dist/{TransactionOld-D1ciU1RQ.js → TransactionOld-_tvyK7TV.js} +6 -6
- package/dist/{app-DIbDbLeP.js → app--H8J5dFW.js} +23 -23
- package/dist/app.js +1 -1
- package/dist/assets-DCTj0P5R.js +134 -0
- package/dist/{grafana-DDvZIL19.js → grafana-3qKGKghh.js} +1 -1
- package/dist/{index-Dy6ZENAg.js → index-BQwri7nC.js} +1 -1
- package/dist/{index-Cpy4IBFc.js → index-BsbqgL6x.js} +2 -2
- package/dist/{index-CG_mkFJ1.js → index-C3ZceSMT.js} +8255 -8114
- package/dist/{index-D-D10LpW.js → index-CElp-4g_.js} +1 -1
- package/dist/{index-CeGG2hCY.js → index-DOLajImh.js} +1 -1
- package/dist/{index-BV3uerRE.js → index-DrP0JZhQ.js} +1 -1
- package/dist/{index-D-8D8G8R.js → index-DvDscxQR.js} +1 -1
- package/dist/{index-BnoTSbLe.js → index-MQyL_1-a.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-69bFWx5Y.js → index.vue_vue_type_script_setup_true_lang-D__Vi_FK.js} +1 -1
- package/dist/package.json +2 -2
- package/dist/{payout-account-B_Go7Y66.js → payout-account-BQpkiil1.js} +3 -3
- package/dist/{plugins-Bxz6OiqC.js → plugins-CMp8J-MM.js} +1 -1
- 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/PaymentChannel.vue.d.ts +4 -4
- package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +4 -4
- package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +4 -4
- package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
- package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/Information.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +210 -0
- package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +18 -4
- package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +18 -4
- package/package.json +2 -2
- package/dist/TerminalSetting-ODh-KnL9.js +0 -1369
- package/dist/assets-BVxfu_q2.js +0 -133
|
@@ -0,0 +1,1460 @@
|
|
|
1
|
+
import { defineComponent as V, openBlock as g, createElementBlock as U, Fragment as O, createElementVNode as I, createTextVNode as $, toDisplayString as A, ref as _, resolveComponent as y, createVNode as v, createCommentVNode as N, unref as S, computed as R, isRef as B, createBlock as w, resolveDynamicComponent as Y, normalizeProps as K, mergeProps as L, toRef as G, watch as P, onMounted as M, withCtx as q, renderList as D } from "vue";
|
|
2
|
+
import { u as H, e as C } from "./index-C3ZceSMT.js";
|
|
3
|
+
import { useRouter as W } from "vue-router";
|
|
4
|
+
import { t as h } from "./index-BQwri7nC.js";
|
|
5
|
+
import { _ as X } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
|
6
|
+
import { u as E } from "./index-DrP0JZhQ.js";
|
|
7
|
+
import { useSnackbar as Q } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as Z } from "./error-K1CakhA9.js";
|
|
9
|
+
import { useCoreStore as j } from "@feedmepos/mf-common";
|
|
10
|
+
import { z as ee, a as ae } from "./validator-D5jtpt9A.js";
|
|
11
|
+
const te = /* @__PURE__ */ V({
|
|
12
|
+
__name: "Information",
|
|
13
|
+
props: {
|
|
14
|
+
terminal: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: !0
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(F) {
|
|
20
|
+
return (d, a) => (g(), U(O, null, [
|
|
21
|
+
a[0] || (a[0] = I("b", null, "Name", -1)),
|
|
22
|
+
$(": " + A(F.terminal.name), 1),
|
|
23
|
+
a[1] || (a[1] = I("br", null, null, -1)),
|
|
24
|
+
a[2] || (a[2] = I("b", null, "Status", -1)),
|
|
25
|
+
$(": " + A(F.terminal.status), 1),
|
|
26
|
+
a[3] || (a[3] = I("br", null, null, -1)),
|
|
27
|
+
a[4] || (a[4] = I("b", null, "Device ID", -1)),
|
|
28
|
+
$(": " + A(F.terminal.deviceId ?? "-"), 1),
|
|
29
|
+
a[5] || (a[5] = I("br", null, null, -1)),
|
|
30
|
+
a[6] || (a[6] = I("b", null, "Device Type", -1)),
|
|
31
|
+
$(": " + A(F.terminal.deviceType ?? "-"), 1),
|
|
32
|
+
a[7] || (a[7] = I("br", null, null, -1))
|
|
33
|
+
], 64));
|
|
34
|
+
}
|
|
35
|
+
}), le = { key: 0 }, ne = { class: "mt-6 space-x-6" }, oe = /* @__PURE__ */ V({
|
|
36
|
+
__name: "KioskMode",
|
|
37
|
+
props: {
|
|
38
|
+
terminal: {
|
|
39
|
+
type: Object,
|
|
40
|
+
required: !0
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(F) {
|
|
44
|
+
const { isLoading: d, startAsyncCall: a } = H(!1), b = Q(), l = _({
|
|
45
|
+
enable: !1,
|
|
46
|
+
password: []
|
|
47
|
+
}), o = F;
|
|
48
|
+
function e() {
|
|
49
|
+
return l.value.enable && l.value.password.filter((m) => !!m).length !== 6 ? b.open({
|
|
50
|
+
type: "error",
|
|
51
|
+
message: "Unlock PIN is required when setting up kiosk mode for terminal."
|
|
52
|
+
}) : a(async () => {
|
|
53
|
+
const m = { enable: l.value.enable };
|
|
54
|
+
m.enable && Object.assign(m, {
|
|
55
|
+
password: l.value.password.join("")
|
|
56
|
+
});
|
|
57
|
+
const c = await h.kioskModeRequest(o.terminal._id, m);
|
|
58
|
+
if (c === "OK")
|
|
59
|
+
return b.open({ type: "info", message: "Kiosk mode applied successfully." });
|
|
60
|
+
let p = c;
|
|
61
|
+
return c === "client_not_connected" && (p = "Terminal not connected to the websocket server."), c.startsWith("terminal: ") && (p = c.replaceAll("terminal: ", "")), b.open({
|
|
62
|
+
type: "error",
|
|
63
|
+
message: p
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return (m, c) => {
|
|
68
|
+
const p = y("FmSwitch"), r = y("FmPinField"), i = y("FmButton");
|
|
69
|
+
return g(), U(O, null, [
|
|
70
|
+
v(p, {
|
|
71
|
+
modelValue: l.value.enable,
|
|
72
|
+
"onUpdate:modelValue": c[0] || (c[0] = (t) => l.value.enable = t),
|
|
73
|
+
label: "Enable Kiosk Mode?"
|
|
74
|
+
}, null, 8, ["modelValue"]),
|
|
75
|
+
l.value.enable ? (g(), U("div", le, [
|
|
76
|
+
c[2] || (c[2] = I("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
|
|
77
|
+
v(r, {
|
|
78
|
+
modelValue: l.value.password,
|
|
79
|
+
"onUpdate:modelValue": c[1] || (c[1] = (t) => l.value.password = t)
|
|
80
|
+
}, null, 8, ["modelValue"])
|
|
81
|
+
])) : N("", !0),
|
|
82
|
+
I("div", ne, [
|
|
83
|
+
v(i, {
|
|
84
|
+
variant: "primary",
|
|
85
|
+
label: "Send",
|
|
86
|
+
icon: "send",
|
|
87
|
+
loading: S(d),
|
|
88
|
+
onclick: e
|
|
89
|
+
}, null, 8, ["loading"])
|
|
90
|
+
])
|
|
91
|
+
], 64);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}), re = /* @__PURE__ */ V({
|
|
95
|
+
__name: "SettingRequest",
|
|
96
|
+
props: {
|
|
97
|
+
terminal: {
|
|
98
|
+
type: Object,
|
|
99
|
+
required: !0
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
setup(F) {
|
|
103
|
+
const { settingTab: d } = E({
|
|
104
|
+
settingTab: "kiosk_mode"
|
|
105
|
+
}), a = [
|
|
106
|
+
{
|
|
107
|
+
label: "Kiosk Mode",
|
|
108
|
+
value: "kiosk_mode",
|
|
109
|
+
render: oe
|
|
110
|
+
}
|
|
111
|
+
], b = F, l = R(() => a.find((o) => o.value === d.value));
|
|
112
|
+
return (o, e) => {
|
|
113
|
+
var c;
|
|
114
|
+
const m = y("FmTabs");
|
|
115
|
+
return g(), U(O, null, [
|
|
116
|
+
e[1] || (e[1] = I("p", { className: "mt-1 my-6 text-gray-600" }, [
|
|
117
|
+
I("b", null, "Note: "),
|
|
118
|
+
$(" 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(m, {
|
|
121
|
+
"model-value": S(d),
|
|
122
|
+
"onUpdate:modelValue": e[0] || (e[0] = (p) => B(d) ? d.value = p : null),
|
|
123
|
+
class: "mb-6",
|
|
124
|
+
items: a
|
|
125
|
+
}, null, 8, ["model-value"]),
|
|
126
|
+
S(d) ? (g(), w(Y((c = l.value) == null ? void 0 : c.render), K(L({ key: 0 }, { terminal: b.terminal })), null, 16)) : N("", !0)
|
|
127
|
+
], 64);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}), ie = {
|
|
131
|
+
key: 0,
|
|
132
|
+
class: "text-sm text-gray-500"
|
|
133
|
+
}, ue = { class: "flex mt-6 space-x-6" }, se = /* @__PURE__ */ V({
|
|
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(F) {
|
|
146
|
+
const d = F, a = j().currentCountry, b = [
|
|
147
|
+
{
|
|
148
|
+
label: "Fiuu Malaysia",
|
|
149
|
+
value: "cc.feedme.payment.rms",
|
|
150
|
+
region: C.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: C.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: C.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: C.F_COUNTRY.enum.MY
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
label: "Digio Thailand",
|
|
177
|
+
value: "cc.feedme.payment.digio_th",
|
|
178
|
+
gateway: "Digio",
|
|
179
|
+
region: C.F_COUNTRY.enum.TH
|
|
180
|
+
}
|
|
181
|
+
], l = G(() => d.terminal), o = _(), e = _({
|
|
182
|
+
packageId: "",
|
|
183
|
+
uniqueId: "",
|
|
184
|
+
developerId: "",
|
|
185
|
+
isUat: !1
|
|
186
|
+
}), m = () => {
|
|
187
|
+
e.value.uniqueId = "", e.value.packageId = "", e.value.developerId = "";
|
|
188
|
+
}, c = () => {
|
|
189
|
+
if (!l.value.gateways || l.value.gateways.length === 0)
|
|
190
|
+
return m();
|
|
191
|
+
const t = l.value.gateways[0];
|
|
192
|
+
if (!t.config)
|
|
193
|
+
return m();
|
|
194
|
+
switch (t.gateway) {
|
|
195
|
+
case "Fiuu":
|
|
196
|
+
e.value = {
|
|
197
|
+
packageId: t.config.packageId,
|
|
198
|
+
uniqueId: t.config.uniqueId,
|
|
199
|
+
developerId: "",
|
|
200
|
+
isUat: !1
|
|
201
|
+
};
|
|
202
|
+
break;
|
|
203
|
+
case "Softspace":
|
|
204
|
+
case "Digio":
|
|
205
|
+
const n = JSON.parse(t.config.uniqueId);
|
|
206
|
+
e.value = {
|
|
207
|
+
packageId: t.config.packageId,
|
|
208
|
+
uniqueId: n.uniqueId,
|
|
209
|
+
developerId: n.developerId,
|
|
210
|
+
isUat: n.isUat
|
|
211
|
+
};
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
P(l, c), M(c);
|
|
216
|
+
async function p(t) {
|
|
217
|
+
var n;
|
|
218
|
+
(n = l.value.gateways) == null || n.splice(t, 1), d.onUpdate(l.value);
|
|
219
|
+
}
|
|
220
|
+
const r = R(() => b.filter((t) => t.region === a.value)), i = R(() => r.value.find((t) => t.value === e.value.packageId));
|
|
221
|
+
return (t, n) => {
|
|
222
|
+
const s = y("FmSelect"), f = y("FmTextField"), x = y("FmCheckbox"), u = y("FmButton"), T = y("FmForm");
|
|
223
|
+
return g(), w(T, {
|
|
224
|
+
ref: o.value,
|
|
225
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
226
|
+
onValidationSuccess: n[5] || (n[5] = () => {
|
|
227
|
+
const k = i.value;
|
|
228
|
+
if (!k)
|
|
229
|
+
return;
|
|
230
|
+
let z = e.value.uniqueId;
|
|
231
|
+
k.isLegacy || (z = JSON.stringify({ uniqueId: e.value.uniqueId, developerId: e.value.developerId, isUat: e.value.isUat }));
|
|
232
|
+
const J = {
|
|
233
|
+
gateway: k.gateway,
|
|
234
|
+
config: {
|
|
235
|
+
packageId: k.value,
|
|
236
|
+
uniqueId: z
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
(!l.value.gateways || l.value.gateways.length > 1) && (l.value.gateways = []), l.value.gateways[0] = J, d.onUpdate(l.value);
|
|
240
|
+
})
|
|
241
|
+
}, {
|
|
242
|
+
default: q(() => [
|
|
243
|
+
v(s, {
|
|
244
|
+
modelValue: e.value.packageId,
|
|
245
|
+
"onUpdate:modelValue": n[0] || (n[0] = (k) => e.value.packageId = k),
|
|
246
|
+
label: "Package ID",
|
|
247
|
+
items: r.value
|
|
248
|
+
}, null, 8, ["modelValue", "items"]),
|
|
249
|
+
i.value && i.value.isLegacy ? (g(), U(O, { key: 0 }, [
|
|
250
|
+
v(f, {
|
|
251
|
+
modelValue: e.value.uniqueId,
|
|
252
|
+
"onUpdate:modelValue": n[1] || (n[1] = (k) => e.value.uniqueId = k),
|
|
253
|
+
label: "Unique ID (TID)"
|
|
254
|
+
}, null, 8, ["modelValue"]),
|
|
255
|
+
i.value.isOutdated ? (g(), U("span", ie, " Note: For outdated gateway is no longer continued development, please use the new gateway instead. ")) : N("", !0)
|
|
256
|
+
], 64)) : (g(), U(O, { key: 1 }, [
|
|
257
|
+
v(f, {
|
|
258
|
+
modelValue: e.value.developerId,
|
|
259
|
+
"onUpdate:modelValue": n[2] || (n[2] = (k) => e.value.developerId = k),
|
|
260
|
+
label: "Developer ID (MID)"
|
|
261
|
+
}, null, 8, ["modelValue"]),
|
|
262
|
+
v(f, {
|
|
263
|
+
modelValue: e.value.uniqueId,
|
|
264
|
+
"onUpdate:modelValue": n[3] || (n[3] = (k) => e.value.uniqueId = k),
|
|
265
|
+
label: "Unique ID (TID)"
|
|
266
|
+
}, null, 8, ["modelValue"]),
|
|
267
|
+
v(x, {
|
|
268
|
+
modelValue: e.value.isUat,
|
|
269
|
+
"onUpdate:modelValue": n[4] || (n[4] = (k) => e.value.isUat = k),
|
|
270
|
+
label: "Is UAT (Test)",
|
|
271
|
+
value: "1"
|
|
272
|
+
}, null, 8, ["modelValue"])
|
|
273
|
+
], 64)),
|
|
274
|
+
I("div", ue, [
|
|
275
|
+
l.value.gateways && l.value.gateways.length > 0 ? (g(), w(u, {
|
|
276
|
+
key: 0,
|
|
277
|
+
class: "flex-1",
|
|
278
|
+
variant: "secondary",
|
|
279
|
+
label: "Delete",
|
|
280
|
+
onclick: () => p(0)
|
|
281
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
282
|
+
v(u, {
|
|
283
|
+
type: "submit",
|
|
284
|
+
class: "flex-1",
|
|
285
|
+
variant: "primary",
|
|
286
|
+
label: "Save"
|
|
287
|
+
})
|
|
288
|
+
])
|
|
289
|
+
]),
|
|
290
|
+
_: 1
|
|
291
|
+
}, 512);
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
}), ce = {
|
|
295
|
+
key: 0,
|
|
296
|
+
class: "flex items-center justify-center min-h-[80vh]"
|
|
297
|
+
}, de = { class: "flex mt-6 space-x-6" }, me = /* @__PURE__ */ V({
|
|
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(F) {
|
|
310
|
+
const { isLoading: d, startAsyncCall: a } = H(), b = F, l = G(() => b.terminal), o = _(), e = _(), m = _(-1), c = _({
|
|
311
|
+
terminalId: ""
|
|
312
|
+
}), p = () => {
|
|
313
|
+
c.value.terminalId = "", m.value = -1;
|
|
314
|
+
}, r = () => {
|
|
315
|
+
if (a(async () => {
|
|
316
|
+
o.value = await h.getRestaurantTerminals(b.terminal.referenceId);
|
|
317
|
+
}), !b.terminal.ecrs)
|
|
318
|
+
return p();
|
|
319
|
+
const n = b.terminal.ecrs.findIndex((f) => f && f.gateway && f.gateway === "FeedMe");
|
|
320
|
+
if (n === -1)
|
|
321
|
+
return p();
|
|
322
|
+
m.value = n;
|
|
323
|
+
const s = b.terminal.ecrs.at(n);
|
|
324
|
+
s.gateway === "FeedMe" && s.config && (c.value = {
|
|
325
|
+
terminalId: s.config.terminalId
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
P(l, r), M(r);
|
|
329
|
+
const i = R(() => (o.value ?? []).map((n) => ({
|
|
330
|
+
label: n.name ?? n._id,
|
|
331
|
+
value: n._id
|
|
332
|
+
})));
|
|
333
|
+
async function t(n) {
|
|
334
|
+
var s;
|
|
335
|
+
(s = b.terminal.ecrs) == null || s.splice(n, 1), b.onUpdate(b.terminal);
|
|
336
|
+
}
|
|
337
|
+
return (n, s) => {
|
|
338
|
+
const f = y("FmCircularProgress"), x = y("FmSelect"), u = y("FmButton"), T = y("FmForm");
|
|
339
|
+
return S(d) ? (g(), U("div", ce, [
|
|
340
|
+
v(f, { size: "xxl" })
|
|
341
|
+
])) : (g(), w(T, {
|
|
342
|
+
key: 1,
|
|
343
|
+
ref: e.value,
|
|
344
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
345
|
+
onValidationSuccess: s[1] || (s[1] = () => {
|
|
346
|
+
m.value > -1 ? l.value.ecrs[m.value] = { gateway: "FeedMe", config: c.value } : (l.value.ecrs || (l.value.ecrs = []), l.value.ecrs.push({ gateway: "FeedMe", config: c.value })), b.onUpdate(l.value);
|
|
347
|
+
})
|
|
348
|
+
}, {
|
|
349
|
+
default: q(() => [
|
|
350
|
+
v(x, {
|
|
351
|
+
modelValue: c.value.terminalId,
|
|
352
|
+
"onUpdate:modelValue": s[0] || (s[0] = (k) => c.value.terminalId = k),
|
|
353
|
+
label: "Terminal ID",
|
|
354
|
+
items: i.value,
|
|
355
|
+
rules: S(ee)(S(ae).string())
|
|
356
|
+
}, null, 8, ["modelValue", "items", "rules"]),
|
|
357
|
+
I("div", de, [
|
|
358
|
+
m.value > -1 ? (g(), w(u, {
|
|
359
|
+
key: 0,
|
|
360
|
+
class: "flex-1",
|
|
361
|
+
variant: "secondary",
|
|
362
|
+
label: "Delete",
|
|
363
|
+
onclick: () => t(m.value)
|
|
364
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
365
|
+
v(u, {
|
|
366
|
+
type: "submit",
|
|
367
|
+
class: "flex-1",
|
|
368
|
+
variant: "primary",
|
|
369
|
+
label: "Save"
|
|
370
|
+
})
|
|
371
|
+
])
|
|
372
|
+
]),
|
|
373
|
+
_: 1
|
|
374
|
+
}, 512));
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
}), pe = { class: "flex mt-6 space-x-6" }, ve = /* @__PURE__ */ V({
|
|
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(F) {
|
|
390
|
+
const d = F, a = G(() => d.terminal), b = _(), l = _(-1), o = _({
|
|
391
|
+
merchantId: "",
|
|
392
|
+
terminalId: "",
|
|
393
|
+
privateKey: ""
|
|
394
|
+
}), e = () => {
|
|
395
|
+
o.value.merchantId = "", o.value.terminalId = "", o.value.privateKey = "", l.value = -1;
|
|
396
|
+
}, m = () => {
|
|
397
|
+
if (!a.value.ecrs)
|
|
398
|
+
return e();
|
|
399
|
+
const p = a.value.ecrs.findIndex((i) => i && i.gateway && i.gateway === "Ghl");
|
|
400
|
+
if (p === -1)
|
|
401
|
+
return e();
|
|
402
|
+
l.value = p;
|
|
403
|
+
const r = a.value.ecrs.at(p);
|
|
404
|
+
r.gateway === "Ghl" && r.config && (o.value = {
|
|
405
|
+
merchantId: r.config.merchantId,
|
|
406
|
+
terminalId: r.config.terminalId,
|
|
407
|
+
privateKey: r.config.privateKey || ""
|
|
408
|
+
});
|
|
409
|
+
};
|
|
410
|
+
P(a, m), M(m);
|
|
411
|
+
async function c(p) {
|
|
412
|
+
var r;
|
|
413
|
+
(r = a.value.ecrs) == null || r.splice(p, 1), d.onUpdate(a.value);
|
|
414
|
+
}
|
|
415
|
+
return (p, r) => {
|
|
416
|
+
const i = y("FmTextField"), t = y("FmTextarea"), n = y("FmButton"), s = y("FmForm");
|
|
417
|
+
return g(), w(s, {
|
|
418
|
+
ref: b.value,
|
|
419
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
420
|
+
onValidationSuccess: r[3] || (r[3] = () => {
|
|
421
|
+
l.value > -1 ? a.value.ecrs[l.value] = { gateway: "Ghl", config: o.value } : (a.value.ecrs || (a.value.ecrs = []), a.value.ecrs.push({ gateway: "Ghl", config: o.value })), d.onUpdate(a.value);
|
|
422
|
+
})
|
|
423
|
+
}, {
|
|
424
|
+
default: q(() => [
|
|
425
|
+
v(i, {
|
|
426
|
+
modelValue: o.value.merchantId,
|
|
427
|
+
"onUpdate:modelValue": r[0] || (r[0] = (f) => o.value.merchantId = f),
|
|
428
|
+
label: "Merchant ID"
|
|
429
|
+
}, null, 8, ["modelValue"]),
|
|
430
|
+
v(i, {
|
|
431
|
+
modelValue: o.value.terminalId,
|
|
432
|
+
"onUpdate:modelValue": r[1] || (r[1] = (f) => o.value.terminalId = f),
|
|
433
|
+
label: "Terminal ID"
|
|
434
|
+
}, null, 8, ["modelValue"]),
|
|
435
|
+
v(t, {
|
|
436
|
+
modelValue: o.value.privateKey,
|
|
437
|
+
"onUpdate:modelValue": r[2] || (r[2] = (f) => o.value.privateKey = f),
|
|
438
|
+
label: "Private Key",
|
|
439
|
+
"label-mark": "optional",
|
|
440
|
+
"label-info": "Default will use FeedMe Private Key"
|
|
441
|
+
}, null, 8, ["modelValue"]),
|
|
442
|
+
I("div", pe, [
|
|
443
|
+
l.value > -1 ? (g(), w(n, {
|
|
444
|
+
key: 0,
|
|
445
|
+
class: "flex-1",
|
|
446
|
+
variant: "secondary",
|
|
447
|
+
label: "Delete",
|
|
448
|
+
onclick: () => c(l.value)
|
|
449
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
450
|
+
v(n, {
|
|
451
|
+
type: "submit",
|
|
452
|
+
class: "flex-1",
|
|
453
|
+
variant: "primary",
|
|
454
|
+
label: "Save"
|
|
455
|
+
})
|
|
456
|
+
])
|
|
457
|
+
]),
|
|
458
|
+
_: 1
|
|
459
|
+
}, 512);
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
}), fe = { class: "flex items-end" }, ye = { class: "flex flex-wrap gap-8 items-center mt-4" }, ge = { class: "flex mt-6 space-x-6" }, be = /* @__PURE__ */ V({
|
|
463
|
+
__name: "MaybankGateway",
|
|
464
|
+
props: {
|
|
465
|
+
terminal: {
|
|
466
|
+
type: Object,
|
|
467
|
+
required: !0
|
|
468
|
+
},
|
|
469
|
+
onUpdate: {
|
|
470
|
+
type: Function,
|
|
471
|
+
required: !0
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
setup(F) {
|
|
475
|
+
const d = F, a = G(() => d.terminal), b = _(), l = _(-1), o = _(), e = _({
|
|
476
|
+
ip: "",
|
|
477
|
+
receiptName: "",
|
|
478
|
+
cardTypes: []
|
|
479
|
+
}), m = () => {
|
|
480
|
+
e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
|
|
481
|
+
}, c = () => {
|
|
482
|
+
var s;
|
|
483
|
+
if (!a.value.ecrIntegrations)
|
|
484
|
+
return m();
|
|
485
|
+
const i = a.value.ecrIntegrations, t = i.findIndex((f) => f && f.gateway && f.gateway === "Maybank");
|
|
486
|
+
if (t === -1)
|
|
487
|
+
return m();
|
|
488
|
+
l.value = t;
|
|
489
|
+
const n = i.at(t);
|
|
490
|
+
n.gateway === "Maybank" && n.config && (e.value = {
|
|
491
|
+
ip: n.config.ip ?? "",
|
|
492
|
+
receiptName: n.receiptName ?? "",
|
|
493
|
+
cardTypes: ((s = n.dialogConfig) == null ? void 0 : s.cardTypes) ?? []
|
|
494
|
+
});
|
|
495
|
+
};
|
|
496
|
+
P(a, c), M(c);
|
|
497
|
+
async function p(i) {
|
|
498
|
+
var t;
|
|
499
|
+
(t = a.value.ecrIntegrations) == null || t.splice(i, 1), d.onUpdate(a.value);
|
|
500
|
+
}
|
|
501
|
+
async function r() {
|
|
502
|
+
e.value.cardTypes.push(o.value), o.value = "";
|
|
503
|
+
}
|
|
504
|
+
return (i, t) => {
|
|
505
|
+
const n = y("FmTextField"), s = y("FmButton"), f = y("FmChip"), x = y("FmForm");
|
|
506
|
+
return g(), w(x, {
|
|
507
|
+
ref: b.value,
|
|
508
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
509
|
+
onValidationSuccess: t[3] || (t[3] = () => {
|
|
510
|
+
var u, T;
|
|
511
|
+
l.value > -1 ? a.value.ecrIntegrations[l.value] = {
|
|
512
|
+
gateway: "Maybank",
|
|
513
|
+
config: { ip: e.value.ip },
|
|
514
|
+
receiptName: e.value.receiptName,
|
|
515
|
+
dialogConfig: {
|
|
516
|
+
...(T = (u = a.value.ecrIntegrations) == null ? void 0 : u[l.value]) == null ? void 0 : T.dialogConfig,
|
|
517
|
+
cardTypes: e.value.cardTypes
|
|
518
|
+
}
|
|
519
|
+
} : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
|
|
520
|
+
gateway: "Maybank",
|
|
521
|
+
config: { ip: e.value.ip },
|
|
522
|
+
receiptName: e.value.receiptName,
|
|
523
|
+
dialogConfig: {
|
|
524
|
+
cardTypes: e.value.cardTypes
|
|
525
|
+
}
|
|
526
|
+
})), d.onUpdate(a.value);
|
|
527
|
+
})
|
|
528
|
+
}, {
|
|
529
|
+
default: q(() => [
|
|
530
|
+
v(n, {
|
|
531
|
+
modelValue: e.value.ip,
|
|
532
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => e.value.ip = u),
|
|
533
|
+
label: "IP Address"
|
|
534
|
+
}, null, 8, ["modelValue"]),
|
|
535
|
+
v(n, {
|
|
536
|
+
modelValue: e.value.receiptName,
|
|
537
|
+
"onUpdate:modelValue": t[1] || (t[1] = (u) => e.value.receiptName = u),
|
|
538
|
+
label: "Receipt Payment Name",
|
|
539
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
540
|
+
}, null, 8, ["modelValue"]),
|
|
541
|
+
I("div", fe, [
|
|
542
|
+
v(n, {
|
|
543
|
+
modelValue: o.value,
|
|
544
|
+
"onUpdate:modelValue": t[2] || (t[2] = (u) => o.value = u),
|
|
545
|
+
label: "Fallback Card Types",
|
|
546
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
547
|
+
}, null, 8, ["modelValue"]),
|
|
548
|
+
v(s, {
|
|
549
|
+
class: "ml-4",
|
|
550
|
+
icon: "add",
|
|
551
|
+
onClick: r
|
|
552
|
+
})
|
|
553
|
+
]),
|
|
554
|
+
I("div", ye, [
|
|
555
|
+
(g(!0), U(O, null, D(e.value.cardTypes, (u) => (g(), w(f, {
|
|
556
|
+
key: u,
|
|
557
|
+
label: u,
|
|
558
|
+
removable: !0,
|
|
559
|
+
onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(u), 1)
|
|
560
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
561
|
+
]),
|
|
562
|
+
I("div", ge, [
|
|
563
|
+
l.value > -1 ? (g(), w(s, {
|
|
564
|
+
key: 0,
|
|
565
|
+
class: "flex-1",
|
|
566
|
+
variant: "secondary",
|
|
567
|
+
label: "Delete",
|
|
568
|
+
onclick: () => p(l.value)
|
|
569
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
570
|
+
v(s, {
|
|
571
|
+
type: "submit",
|
|
572
|
+
class: "flex-1",
|
|
573
|
+
variant: "primary",
|
|
574
|
+
label: "Save"
|
|
575
|
+
})
|
|
576
|
+
])
|
|
577
|
+
]),
|
|
578
|
+
_: 1
|
|
579
|
+
}, 512);
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
}), _e = { class: "flex items-end" }, Ie = { class: "flex flex-wrap gap-8 items-center mt-4" }, Fe = { class: "flex mt-6 space-x-6" }, we = /* @__PURE__ */ V({
|
|
583
|
+
__name: "Maybank2Gateway",
|
|
584
|
+
props: {
|
|
585
|
+
terminal: {
|
|
586
|
+
type: Object,
|
|
587
|
+
required: !0
|
|
588
|
+
},
|
|
589
|
+
onUpdate: {
|
|
590
|
+
type: Function,
|
|
591
|
+
required: !0
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
setup(F) {
|
|
595
|
+
const d = F, a = G(() => d.terminal), b = _(), l = _(-1), o = _(), e = _({
|
|
596
|
+
ip: "",
|
|
597
|
+
receiptName: "",
|
|
598
|
+
cardTypes: []
|
|
599
|
+
}), m = () => {
|
|
600
|
+
e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
|
|
601
|
+
}, c = () => {
|
|
602
|
+
var s;
|
|
603
|
+
if (!a.value.ecrIntegrations)
|
|
604
|
+
return m();
|
|
605
|
+
const i = a.value.ecrIntegrations, t = i.findIndex((f) => f && f.gateway && f.gateway === "Maybank2");
|
|
606
|
+
if (t === -1)
|
|
607
|
+
return m();
|
|
608
|
+
l.value = t;
|
|
609
|
+
const n = i.at(t);
|
|
610
|
+
n.gateway === "Maybank2" && n.config && (e.value = {
|
|
611
|
+
ip: n.config.ip ?? "",
|
|
612
|
+
receiptName: n.receiptName ?? "",
|
|
613
|
+
cardTypes: ((s = n.dialogConfig) == null ? void 0 : s.cardTypes) ?? []
|
|
614
|
+
});
|
|
615
|
+
};
|
|
616
|
+
P(a, c), M(c);
|
|
617
|
+
async function p(i) {
|
|
618
|
+
var t;
|
|
619
|
+
(t = a.value.ecrIntegrations) == null || t.splice(i, 1), d.onUpdate(a.value);
|
|
620
|
+
}
|
|
621
|
+
async function r() {
|
|
622
|
+
e.value.cardTypes.push(o.value), o.value = "";
|
|
623
|
+
}
|
|
624
|
+
return (i, t) => {
|
|
625
|
+
const n = y("FmTextField"), s = y("FmButton"), f = y("FmChip"), x = y("FmForm");
|
|
626
|
+
return g(), w(x, {
|
|
627
|
+
ref: b.value,
|
|
628
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
629
|
+
onValidationSuccess: t[3] || (t[3] = () => {
|
|
630
|
+
var u, T;
|
|
631
|
+
l.value > -1 ? a.value.ecrIntegrations[l.value] = {
|
|
632
|
+
gateway: "Maybank2",
|
|
633
|
+
config: { ip: e.value.ip },
|
|
634
|
+
receiptName: e.value.receiptName,
|
|
635
|
+
dialogConfig: {
|
|
636
|
+
...(T = (u = a.value.ecrIntegrations) == null ? void 0 : u[l.value]) == null ? void 0 : T.dialogConfig,
|
|
637
|
+
cardTypes: e.value.cardTypes
|
|
638
|
+
}
|
|
639
|
+
} : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
|
|
640
|
+
gateway: "Maybank2",
|
|
641
|
+
config: { ip: e.value.ip },
|
|
642
|
+
receiptName: e.value.receiptName,
|
|
643
|
+
dialogConfig: {
|
|
644
|
+
cardTypes: e.value.cardTypes
|
|
645
|
+
}
|
|
646
|
+
})), d.onUpdate(a.value);
|
|
647
|
+
})
|
|
648
|
+
}, {
|
|
649
|
+
default: q(() => [
|
|
650
|
+
v(n, {
|
|
651
|
+
modelValue: e.value.ip,
|
|
652
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => e.value.ip = u),
|
|
653
|
+
label: "IP Address"
|
|
654
|
+
}, null, 8, ["modelValue"]),
|
|
655
|
+
v(n, {
|
|
656
|
+
modelValue: e.value.receiptName,
|
|
657
|
+
"onUpdate:modelValue": t[1] || (t[1] = (u) => e.value.receiptName = u),
|
|
658
|
+
label: "Receipt Payment Name",
|
|
659
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
660
|
+
}, null, 8, ["modelValue"]),
|
|
661
|
+
I("div", _e, [
|
|
662
|
+
v(n, {
|
|
663
|
+
modelValue: o.value,
|
|
664
|
+
"onUpdate:modelValue": t[2] || (t[2] = (u) => o.value = u),
|
|
665
|
+
label: "Fallback Card Types",
|
|
666
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
667
|
+
}, null, 8, ["modelValue"]),
|
|
668
|
+
v(s, {
|
|
669
|
+
class: "ml-4",
|
|
670
|
+
icon: "add",
|
|
671
|
+
onClick: r
|
|
672
|
+
})
|
|
673
|
+
]),
|
|
674
|
+
I("div", Ie, [
|
|
675
|
+
(g(!0), U(O, null, D(e.value.cardTypes, (u) => (g(), w(f, {
|
|
676
|
+
key: u,
|
|
677
|
+
label: u,
|
|
678
|
+
removable: !0,
|
|
679
|
+
onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(u), 1)
|
|
680
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
681
|
+
]),
|
|
682
|
+
I("div", Fe, [
|
|
683
|
+
l.value > -1 ? (g(), w(s, {
|
|
684
|
+
key: 0,
|
|
685
|
+
class: "flex-1",
|
|
686
|
+
variant: "secondary",
|
|
687
|
+
label: "Delete",
|
|
688
|
+
onclick: () => p(l.value)
|
|
689
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
690
|
+
v(s, {
|
|
691
|
+
type: "submit",
|
|
692
|
+
class: "flex-1",
|
|
693
|
+
variant: "primary",
|
|
694
|
+
label: "Save"
|
|
695
|
+
})
|
|
696
|
+
])
|
|
697
|
+
]),
|
|
698
|
+
_: 1
|
|
699
|
+
}, 512);
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
}), Te = { class: "flex items-end" }, xe = { class: "flex flex-wrap gap-8 items-center mt-4" }, ke = { class: "flex mt-6 space-x-6" }, Ne = /* @__PURE__ */ V({
|
|
703
|
+
__name: "Maybank3Gateway",
|
|
704
|
+
props: {
|
|
705
|
+
terminal: {
|
|
706
|
+
type: Object,
|
|
707
|
+
required: !0
|
|
708
|
+
},
|
|
709
|
+
onUpdate: {
|
|
710
|
+
type: Function,
|
|
711
|
+
required: !0
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
setup(F) {
|
|
715
|
+
const d = F, a = G(() => d.terminal), b = _(), l = _(-1), o = _(), e = _({
|
|
716
|
+
receiptName: "",
|
|
717
|
+
config: {},
|
|
718
|
+
cardTypes: []
|
|
719
|
+
}), m = () => {
|
|
720
|
+
e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
|
|
721
|
+
}, c = () => {
|
|
722
|
+
var s;
|
|
723
|
+
if (!a.value.ecrIntegrations)
|
|
724
|
+
return m();
|
|
725
|
+
const i = a.value.ecrIntegrations, t = i.findIndex((f) => f && f.gateway && f.gateway === "Maybank3");
|
|
726
|
+
if (t === -1)
|
|
727
|
+
return m();
|
|
728
|
+
l.value = t;
|
|
729
|
+
const n = i.at(t);
|
|
730
|
+
n.gateway === "Maybank3" && n.config && (e.value = {
|
|
731
|
+
config: n.config,
|
|
732
|
+
receiptName: n.receiptName ?? "",
|
|
733
|
+
cardTypes: ((s = n.dialogConfig) == null ? void 0 : s.cardTypes) ?? []
|
|
734
|
+
});
|
|
735
|
+
};
|
|
736
|
+
P(a, c), M(c);
|
|
737
|
+
async function p(i) {
|
|
738
|
+
var t;
|
|
739
|
+
(t = a.value.ecrIntegrations) == null || t.splice(i, 1), d.onUpdate(a.value);
|
|
740
|
+
}
|
|
741
|
+
async function r() {
|
|
742
|
+
e.value.cardTypes.push(o.value), o.value = "";
|
|
743
|
+
}
|
|
744
|
+
return (i, t) => {
|
|
745
|
+
const n = y("FmTextField"), s = y("FmButton"), f = y("FmChip"), x = y("FmForm");
|
|
746
|
+
return g(), w(x, {
|
|
747
|
+
ref: b.value,
|
|
748
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
749
|
+
onValidationSuccess: t[2] || (t[2] = () => {
|
|
750
|
+
var u, T;
|
|
751
|
+
l.value > -1 ? a.value.ecrIntegrations[l.value] = {
|
|
752
|
+
gateway: "Maybank3",
|
|
753
|
+
config: e.value.config,
|
|
754
|
+
receiptName: e.value.receiptName,
|
|
755
|
+
dialogConfig: {
|
|
756
|
+
...(T = (u = a.value.ecrIntegrations) == null ? void 0 : u[l.value]) == null ? void 0 : T.dialogConfig,
|
|
757
|
+
cardTypes: e.value.cardTypes
|
|
758
|
+
}
|
|
759
|
+
} : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
|
|
760
|
+
gateway: "Maybank3",
|
|
761
|
+
config: e.value.config,
|
|
762
|
+
receiptName: e.value.receiptName,
|
|
763
|
+
dialogConfig: {
|
|
764
|
+
cardTypes: e.value.cardTypes
|
|
765
|
+
}
|
|
766
|
+
})), d.onUpdate(a.value);
|
|
767
|
+
})
|
|
768
|
+
}, {
|
|
769
|
+
default: q(() => [
|
|
770
|
+
v(n, {
|
|
771
|
+
modelValue: e.value.receiptName,
|
|
772
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => e.value.receiptName = u),
|
|
773
|
+
label: "Receipt Payment Name",
|
|
774
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
775
|
+
}, null, 8, ["modelValue"]),
|
|
776
|
+
I("div", Te, [
|
|
777
|
+
v(n, {
|
|
778
|
+
modelValue: o.value,
|
|
779
|
+
"onUpdate:modelValue": t[1] || (t[1] = (u) => o.value = u),
|
|
780
|
+
label: "Fallback Card Types",
|
|
781
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
782
|
+
}, null, 8, ["modelValue"]),
|
|
783
|
+
v(s, {
|
|
784
|
+
class: "ml-4",
|
|
785
|
+
icon: "add",
|
|
786
|
+
onClick: r
|
|
787
|
+
})
|
|
788
|
+
]),
|
|
789
|
+
I("div", xe, [
|
|
790
|
+
(g(!0), U(O, null, D(e.value.cardTypes, (u) => (g(), w(f, {
|
|
791
|
+
key: u,
|
|
792
|
+
label: u,
|
|
793
|
+
removable: !0,
|
|
794
|
+
onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(u), 1)
|
|
795
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
796
|
+
]),
|
|
797
|
+
I("div", ke, [
|
|
798
|
+
l.value > -1 ? (g(), w(s, {
|
|
799
|
+
key: 0,
|
|
800
|
+
class: "flex-1",
|
|
801
|
+
variant: "secondary",
|
|
802
|
+
label: "Delete",
|
|
803
|
+
onclick: () => p(l.value)
|
|
804
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
805
|
+
v(s, {
|
|
806
|
+
type: "submit",
|
|
807
|
+
class: "flex-1",
|
|
808
|
+
variant: "primary",
|
|
809
|
+
label: "Save"
|
|
810
|
+
})
|
|
811
|
+
])
|
|
812
|
+
]),
|
|
813
|
+
_: 1
|
|
814
|
+
}, 512);
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
}), Ve = { class: "flex items-end" }, Ce = { class: "flex flex-wrap gap-8 items-center mt-4" }, Ue = { class: "flex mt-6 space-x-6" }, Se = /* @__PURE__ */ V({
|
|
818
|
+
__name: "NetsGateway",
|
|
819
|
+
props: {
|
|
820
|
+
terminal: {
|
|
821
|
+
type: Object,
|
|
822
|
+
required: !0
|
|
823
|
+
},
|
|
824
|
+
onUpdate: {
|
|
825
|
+
type: Function,
|
|
826
|
+
required: !0
|
|
827
|
+
}
|
|
828
|
+
},
|
|
829
|
+
setup(F) {
|
|
830
|
+
const d = F, a = G(() => d.terminal), b = _(), l = _(-1), o = _(), e = _({
|
|
831
|
+
ip: "",
|
|
832
|
+
receiptName: "",
|
|
833
|
+
cardTypes: []
|
|
834
|
+
}), m = () => {
|
|
835
|
+
e.value.ip = "", e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
|
|
836
|
+
}, c = () => {
|
|
837
|
+
var s;
|
|
838
|
+
if (!a.value.ecrIntegrations)
|
|
839
|
+
return m();
|
|
840
|
+
const i = a.value.ecrIntegrations, t = i.findIndex((f) => f && f.gateway && f.gateway === "Nets");
|
|
841
|
+
if (t === -1)
|
|
842
|
+
return m();
|
|
843
|
+
l.value = t;
|
|
844
|
+
const n = i.at(t);
|
|
845
|
+
n.gateway === "Nets" && n.config && (e.value = {
|
|
846
|
+
ip: n.config.ip ?? "",
|
|
847
|
+
receiptName: n.receiptName ?? "",
|
|
848
|
+
cardTypes: ((s = n.dialogConfig) == null ? void 0 : s.cardTypes) ?? []
|
|
849
|
+
});
|
|
850
|
+
};
|
|
851
|
+
P(a, c), M(c);
|
|
852
|
+
async function p(i) {
|
|
853
|
+
var t;
|
|
854
|
+
(t = a.value.ecrIntegrations) == null || t.splice(i, 1), d.onUpdate(a.value);
|
|
855
|
+
}
|
|
856
|
+
async function r() {
|
|
857
|
+
e.value.cardTypes.push(o.value), o.value = "";
|
|
858
|
+
}
|
|
859
|
+
return (i, t) => {
|
|
860
|
+
const n = y("FmTextField"), s = y("FmButton"), f = y("FmChip"), x = y("FmForm");
|
|
861
|
+
return g(), w(x, {
|
|
862
|
+
ref: b.value,
|
|
863
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
864
|
+
onValidationSuccess: t[3] || (t[3] = () => {
|
|
865
|
+
var u, T;
|
|
866
|
+
l.value > -1 ? a.value.ecrIntegrations[l.value] = {
|
|
867
|
+
gateway: "Nets",
|
|
868
|
+
config: { ip: e.value.ip },
|
|
869
|
+
receiptName: e.value.receiptName,
|
|
870
|
+
dialogConfig: {
|
|
871
|
+
...(T = (u = a.value.ecrIntegrations) == null ? void 0 : u[l.value]) == null ? void 0 : T.dialogConfig,
|
|
872
|
+
cardTypes: e.value.cardTypes
|
|
873
|
+
}
|
|
874
|
+
} : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
|
|
875
|
+
gateway: "Nets",
|
|
876
|
+
config: { ip: e.value.ip },
|
|
877
|
+
receiptName: e.value.receiptName,
|
|
878
|
+
dialogConfig: {
|
|
879
|
+
cardTypes: e.value.cardTypes
|
|
880
|
+
}
|
|
881
|
+
})), d.onUpdate(a.value);
|
|
882
|
+
})
|
|
883
|
+
}, {
|
|
884
|
+
default: q(() => [
|
|
885
|
+
v(n, {
|
|
886
|
+
modelValue: e.value.ip,
|
|
887
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => e.value.ip = u),
|
|
888
|
+
label: "IP Address"
|
|
889
|
+
}, null, 8, ["modelValue"]),
|
|
890
|
+
v(n, {
|
|
891
|
+
modelValue: e.value.receiptName,
|
|
892
|
+
"onUpdate:modelValue": t[1] || (t[1] = (u) => e.value.receiptName = u),
|
|
893
|
+
label: "Receipt Payment Name",
|
|
894
|
+
"label-info": "Default receipt display will be 'TERMINAL_NETS'"
|
|
895
|
+
}, null, 8, ["modelValue"]),
|
|
896
|
+
I("div", Ve, [
|
|
897
|
+
v(n, {
|
|
898
|
+
modelValue: o.value,
|
|
899
|
+
"onUpdate:modelValue": t[2] || (t[2] = (u) => o.value = u),
|
|
900
|
+
label: "Fallback Card Types",
|
|
901
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
902
|
+
}, null, 8, ["modelValue"]),
|
|
903
|
+
v(s, {
|
|
904
|
+
class: "ml-4",
|
|
905
|
+
icon: "add",
|
|
906
|
+
onClick: r
|
|
907
|
+
})
|
|
908
|
+
]),
|
|
909
|
+
I("div", Ce, [
|
|
910
|
+
(g(!0), U(O, null, D(e.value.cardTypes, (u) => (g(), w(f, {
|
|
911
|
+
key: u,
|
|
912
|
+
label: u,
|
|
913
|
+
removable: !0,
|
|
914
|
+
onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(u), 1)
|
|
915
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
916
|
+
]),
|
|
917
|
+
I("div", Ue, [
|
|
918
|
+
l.value > -1 ? (g(), w(s, {
|
|
919
|
+
key: 0,
|
|
920
|
+
class: "flex-1",
|
|
921
|
+
variant: "secondary",
|
|
922
|
+
label: "Delete",
|
|
923
|
+
onclick: () => p(l.value)
|
|
924
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
925
|
+
v(s, {
|
|
926
|
+
type: "submit",
|
|
927
|
+
class: "flex-1",
|
|
928
|
+
variant: "primary",
|
|
929
|
+
label: "Save"
|
|
930
|
+
})
|
|
931
|
+
])
|
|
932
|
+
]),
|
|
933
|
+
_: 1
|
|
934
|
+
}, 512);
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
}), Me = { class: "flex items-end" }, qe = { class: "flex flex-wrap gap-8 items-center mt-4" }, Oe = { class: "flex mt-6 space-x-6" }, Re = /* @__PURE__ */ V({
|
|
938
|
+
__name: "KBankGateway",
|
|
939
|
+
props: {
|
|
940
|
+
terminal: {
|
|
941
|
+
type: Object,
|
|
942
|
+
required: !0
|
|
943
|
+
},
|
|
944
|
+
onUpdate: {
|
|
945
|
+
type: Function,
|
|
946
|
+
required: !0
|
|
947
|
+
}
|
|
948
|
+
},
|
|
949
|
+
setup(F) {
|
|
950
|
+
const d = F, a = G(() => d.terminal), b = _(), l = _(-1), o = _(), e = _({
|
|
951
|
+
receiptName: "",
|
|
952
|
+
cardTypes: []
|
|
953
|
+
}), m = () => {
|
|
954
|
+
e.value.receiptName = "", e.value.cardTypes = [], l.value = -1;
|
|
955
|
+
}, c = () => {
|
|
956
|
+
var s;
|
|
957
|
+
if (!a.value.ecrIntegrations)
|
|
958
|
+
return m();
|
|
959
|
+
const i = a.value.ecrIntegrations, t = i.findIndex((f) => f && f.gateway && f.gateway === "Kbank");
|
|
960
|
+
if (t === -1)
|
|
961
|
+
return m();
|
|
962
|
+
l.value = t;
|
|
963
|
+
const n = i.at(t);
|
|
964
|
+
n.gateway === "Kbank" && n.config && (e.value = {
|
|
965
|
+
receiptName: n.receiptName ?? "",
|
|
966
|
+
cardTypes: ((s = n.dialogConfig) == null ? void 0 : s.cardTypes) ?? []
|
|
967
|
+
});
|
|
968
|
+
};
|
|
969
|
+
P(a, c), M(c);
|
|
970
|
+
async function p(i) {
|
|
971
|
+
var t;
|
|
972
|
+
(t = a.value.ecrIntegrations) == null || t.splice(i, 1), d.onUpdate(a.value);
|
|
973
|
+
}
|
|
974
|
+
async function r() {
|
|
975
|
+
e.value.cardTypes.push(o.value), o.value = "";
|
|
976
|
+
}
|
|
977
|
+
return (i, t) => {
|
|
978
|
+
const n = y("FmTextField"), s = y("FmButton"), f = y("FmChip"), x = y("FmForm");
|
|
979
|
+
return g(), w(x, {
|
|
980
|
+
ref: b.value,
|
|
981
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
982
|
+
onValidationSuccess: t[2] || (t[2] = () => {
|
|
983
|
+
var u, T;
|
|
984
|
+
l.value > -1 ? a.value.ecrIntegrations[l.value] = {
|
|
985
|
+
gateway: "Kbank",
|
|
986
|
+
config: {},
|
|
987
|
+
receiptName: e.value.receiptName,
|
|
988
|
+
dialogConfig: {
|
|
989
|
+
...(T = (u = a.value.ecrIntegrations) == null ? void 0 : u[l.value]) == null ? void 0 : T.dialogConfig,
|
|
990
|
+
cardTypes: e.value.cardTypes
|
|
991
|
+
}
|
|
992
|
+
} : (a.value.ecrIntegrations || (a.value.ecrIntegrations = []), a.value.ecrIntegrations.push({
|
|
993
|
+
gateway: "Kbank",
|
|
994
|
+
config: {},
|
|
995
|
+
receiptName: e.value.receiptName,
|
|
996
|
+
dialogConfig: {
|
|
997
|
+
cardTypes: e.value.cardTypes
|
|
998
|
+
}
|
|
999
|
+
})), d.onUpdate(a.value);
|
|
1000
|
+
})
|
|
1001
|
+
}, {
|
|
1002
|
+
default: q(() => [
|
|
1003
|
+
v(n, {
|
|
1004
|
+
modelValue: e.value.receiptName,
|
|
1005
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => e.value.receiptName = u),
|
|
1006
|
+
label: "Receipt Payment Name",
|
|
1007
|
+
"label-info": "Default receipt display will be 'TERMINAL_KBANK'"
|
|
1008
|
+
}, null, 8, ["modelValue"]),
|
|
1009
|
+
I("div", Me, [
|
|
1010
|
+
v(n, {
|
|
1011
|
+
modelValue: o.value,
|
|
1012
|
+
"onUpdate:modelValue": t[1] || (t[1] = (u) => o.value = u),
|
|
1013
|
+
label: "Fallback Card Types",
|
|
1014
|
+
"label-info": "List of cards when fallback to reconcile dialog. Default VISA, MASTER"
|
|
1015
|
+
}, null, 8, ["modelValue"]),
|
|
1016
|
+
v(s, {
|
|
1017
|
+
class: "ml-4",
|
|
1018
|
+
icon: "add",
|
|
1019
|
+
onClick: r
|
|
1020
|
+
})
|
|
1021
|
+
]),
|
|
1022
|
+
I("div", qe, [
|
|
1023
|
+
(g(!0), U(O, null, D(e.value.cardTypes, (u) => (g(), w(f, {
|
|
1024
|
+
key: u,
|
|
1025
|
+
label: u,
|
|
1026
|
+
removable: !0,
|
|
1027
|
+
onChipClosed: () => e.value.cardTypes.splice(e.value.cardTypes.indexOf(u), 1)
|
|
1028
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
1029
|
+
]),
|
|
1030
|
+
I("div", Oe, [
|
|
1031
|
+
l.value > -1 ? (g(), w(s, {
|
|
1032
|
+
key: 0,
|
|
1033
|
+
class: "flex-1",
|
|
1034
|
+
variant: "secondary",
|
|
1035
|
+
label: "Delete",
|
|
1036
|
+
onclick: () => p(l.value)
|
|
1037
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
1038
|
+
v(s, {
|
|
1039
|
+
type: "submit",
|
|
1040
|
+
class: "flex-1",
|
|
1041
|
+
variant: "primary",
|
|
1042
|
+
label: "Save"
|
|
1043
|
+
})
|
|
1044
|
+
])
|
|
1045
|
+
]),
|
|
1046
|
+
_: 1
|
|
1047
|
+
}, 512);
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
}), Ge = { class: "flex mt-6 space-x-6" }, Pe = /* @__PURE__ */ V({
|
|
1051
|
+
__name: "Ghl2Gateway",
|
|
1052
|
+
props: {
|
|
1053
|
+
terminal: {
|
|
1054
|
+
type: Object,
|
|
1055
|
+
required: !0
|
|
1056
|
+
},
|
|
1057
|
+
onUpdate: {
|
|
1058
|
+
type: Function,
|
|
1059
|
+
required: !0
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
setup(F) {
|
|
1063
|
+
const d = F, a = G(() => d.terminal), b = _(), l = _(-1), o = _({
|
|
1064
|
+
ip: "",
|
|
1065
|
+
receiptName: ""
|
|
1066
|
+
}), e = () => {
|
|
1067
|
+
o.value.ip = "", o.value.receiptName = "", l.value = -1;
|
|
1068
|
+
}, m = () => {
|
|
1069
|
+
if (!a.value.ecrIntegrations)
|
|
1070
|
+
return e();
|
|
1071
|
+
const p = a.value.ecrIntegrations, r = p.findIndex((t) => t && t.gateway && t.gateway === "Ghl2");
|
|
1072
|
+
if (r === -1)
|
|
1073
|
+
return e();
|
|
1074
|
+
l.value = r;
|
|
1075
|
+
const i = p.at(r);
|
|
1076
|
+
i.gateway === "Ghl2" && i.config && (o.value = {
|
|
1077
|
+
ip: i.config.ip ?? "",
|
|
1078
|
+
receiptName: i.receiptName ?? ""
|
|
1079
|
+
});
|
|
1080
|
+
};
|
|
1081
|
+
P(a, m), M(m);
|
|
1082
|
+
async function c(p) {
|
|
1083
|
+
var r;
|
|
1084
|
+
(r = a.value.ecrIntegrations) == null || r.splice(p, 1), d.onUpdate(a.value);
|
|
1085
|
+
}
|
|
1086
|
+
return (p, r) => {
|
|
1087
|
+
const i = y("FmTextField"), t = y("FmButton"), n = y("FmForm");
|
|
1088
|
+
return g(), w(n, {
|
|
1089
|
+
ref: b.value,
|
|
1090
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1091
|
+
onValidationSuccess: r[2] || (r[2] = () => {
|
|
1092
|
+
a.value.ecrIntegrations || (a.value.ecrIntegrations = []), l.value > -1 ? a.value.ecrIntegrations[l.value] = {
|
|
1093
|
+
gateway: "Ghl2",
|
|
1094
|
+
config: { ip: o.value.ip },
|
|
1095
|
+
receiptName: o.value.receiptName
|
|
1096
|
+
} : a.value.ecrIntegrations.push({
|
|
1097
|
+
gateway: "Ghl2",
|
|
1098
|
+
config: { ip: o.value.ip },
|
|
1099
|
+
receiptName: o.value.receiptName
|
|
1100
|
+
}), d.onUpdate(a.value);
|
|
1101
|
+
})
|
|
1102
|
+
}, {
|
|
1103
|
+
default: q(() => [
|
|
1104
|
+
v(i, {
|
|
1105
|
+
modelValue: o.value.ip,
|
|
1106
|
+
"onUpdate:modelValue": r[0] || (r[0] = (s) => o.value.ip = s),
|
|
1107
|
+
label: "IP Address"
|
|
1108
|
+
}, null, 8, ["modelValue"]),
|
|
1109
|
+
v(i, {
|
|
1110
|
+
modelValue: o.value.receiptName,
|
|
1111
|
+
"onUpdate:modelValue": r[1] || (r[1] = (s) => o.value.receiptName = s),
|
|
1112
|
+
label: "Receipt Payment Name",
|
|
1113
|
+
"label-info": "Default receipt display will be 'TERMINAL_GHL_2'"
|
|
1114
|
+
}, null, 8, ["modelValue"]),
|
|
1115
|
+
I("div", Ge, [
|
|
1116
|
+
l.value > -1 ? (g(), w(t, {
|
|
1117
|
+
key: 0,
|
|
1118
|
+
class: "flex-1",
|
|
1119
|
+
variant: "secondary",
|
|
1120
|
+
label: "Delete",
|
|
1121
|
+
onclick: () => c(l.value)
|
|
1122
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
1123
|
+
v(t, {
|
|
1124
|
+
type: "submit",
|
|
1125
|
+
class: "flex-1",
|
|
1126
|
+
variant: "primary",
|
|
1127
|
+
label: "Save"
|
|
1128
|
+
})
|
|
1129
|
+
])
|
|
1130
|
+
]),
|
|
1131
|
+
_: 1
|
|
1132
|
+
}, 512);
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
}), $e = { class: "flex items-center" }, he = { class: "w-[260px] self-start" }, De = { class: "flex-1" }, Ae = /* @__PURE__ */ V({
|
|
1136
|
+
__name: "EcrGateway",
|
|
1137
|
+
props: {
|
|
1138
|
+
terminal: {
|
|
1139
|
+
type: Object,
|
|
1140
|
+
required: !0
|
|
1141
|
+
},
|
|
1142
|
+
onUpdate: {
|
|
1143
|
+
type: Function,
|
|
1144
|
+
required: !0
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
setup(F) {
|
|
1148
|
+
var m;
|
|
1149
|
+
const d = F, a = [
|
|
1150
|
+
{
|
|
1151
|
+
label: "FeedMe Terminal",
|
|
1152
|
+
value: "terminal",
|
|
1153
|
+
render: me
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
label: "GHL Terminal (V2)",
|
|
1157
|
+
value: "ghl",
|
|
1158
|
+
render: ve,
|
|
1159
|
+
region: [C.F_COUNTRY.enum.MY]
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
label: "GHL 2 Terminal",
|
|
1163
|
+
value: "ghl2",
|
|
1164
|
+
render: Pe,
|
|
1165
|
+
region: [C.F_COUNTRY.enum.MY]
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
label: "Maybank Terminal (ITB)",
|
|
1169
|
+
value: "mb-itb",
|
|
1170
|
+
render: be,
|
|
1171
|
+
region: [C.F_COUNTRY.enum.MY]
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
label: "Maybank Terminal (PMA)",
|
|
1175
|
+
value: "mb-pma",
|
|
1176
|
+
render: we,
|
|
1177
|
+
region: [C.F_COUNTRY.enum.MY]
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
label: "Maybank Terminal (Paysys)",
|
|
1181
|
+
value: "mb-paysys",
|
|
1182
|
+
render: Ne,
|
|
1183
|
+
region: [C.F_COUNTRY.enum.MY]
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
label: "Nets Terminal",
|
|
1187
|
+
value: "nets",
|
|
1188
|
+
render: Se,
|
|
1189
|
+
region: [C.F_COUNTRY.enum.SG]
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
label: "KBank Terminal",
|
|
1193
|
+
value: "kbank",
|
|
1194
|
+
render: Re,
|
|
1195
|
+
region: [C.F_COUNTRY.enum.TH]
|
|
1196
|
+
}
|
|
1197
|
+
], b = R(() => a.find((c) => c.value === e.value)), l = j().currentCountry, o = R(() => a.filter((c) => !c.region || c.region.includes(l.value ?? C.F_COUNTRY.enum.MY))), { gatewayTab: e } = E({
|
|
1198
|
+
gatewayTab: (m = o.value[0]) == null ? void 0 : m.value
|
|
1199
|
+
});
|
|
1200
|
+
return (c, p) => {
|
|
1201
|
+
var i;
|
|
1202
|
+
const r = y("FmTabs");
|
|
1203
|
+
return g(), U("div", $e, [
|
|
1204
|
+
I("div", he, [
|
|
1205
|
+
v(r, {
|
|
1206
|
+
"model-value": S(e),
|
|
1207
|
+
"onUpdate:modelValue": p[0] || (p[0] = (t) => B(e) ? e.value = t : null),
|
|
1208
|
+
class: "mb-6",
|
|
1209
|
+
vertical: !0,
|
|
1210
|
+
items: o.value
|
|
1211
|
+
}, null, 8, ["model-value", "items"])
|
|
1212
|
+
]),
|
|
1213
|
+
I("div", De, [
|
|
1214
|
+
S(e) ? (g(), w(Y((i = b.value) == null ? void 0 : i.render), K(L({ key: 0 }, {
|
|
1215
|
+
terminal: d.terminal,
|
|
1216
|
+
onUpdate: d.onUpdate
|
|
1217
|
+
})), null, 16)) : N("", !0)
|
|
1218
|
+
])
|
|
1219
|
+
]);
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
}), Be = { class: "flex mt-6 space-x-6" }, Ye = /* @__PURE__ */ V({
|
|
1223
|
+
__name: "PromptPayGateway",
|
|
1224
|
+
props: {
|
|
1225
|
+
terminal: {
|
|
1226
|
+
type: Object,
|
|
1227
|
+
required: !0
|
|
1228
|
+
},
|
|
1229
|
+
onUpdate: {
|
|
1230
|
+
type: Function,
|
|
1231
|
+
required: !0
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
setup(F) {
|
|
1235
|
+
const d = F, a = G(() => d.terminal), b = _(), l = _(-1), o = _({
|
|
1236
|
+
account: "",
|
|
1237
|
+
receiptName: ""
|
|
1238
|
+
}), e = () => {
|
|
1239
|
+
o.value.account = "", o.value.receiptName = "", l.value = -1;
|
|
1240
|
+
}, m = () => {
|
|
1241
|
+
if (!a.value.qrIntegrations)
|
|
1242
|
+
return e();
|
|
1243
|
+
const p = a.value.qrIntegrations, r = p.findIndex((t) => t && t.gateway && t.gateway === "PROMPTPAY");
|
|
1244
|
+
if (r === -1)
|
|
1245
|
+
return e();
|
|
1246
|
+
l.value = r;
|
|
1247
|
+
const i = p.at(r);
|
|
1248
|
+
i.gateway === "PROMPTPAY" && i.config && (o.value = {
|
|
1249
|
+
account: i.config.account ?? "",
|
|
1250
|
+
receiptName: i.receiptName ?? ""
|
|
1251
|
+
});
|
|
1252
|
+
};
|
|
1253
|
+
P(a, m), M(m);
|
|
1254
|
+
async function c(p) {
|
|
1255
|
+
var r;
|
|
1256
|
+
(r = a.value.qrIntegrations) == null || r.splice(p, 1), d.onUpdate(a.value);
|
|
1257
|
+
}
|
|
1258
|
+
return (p, r) => {
|
|
1259
|
+
const i = y("FmTextField"), t = y("FmButton"), n = y("FmForm");
|
|
1260
|
+
return g(), w(n, {
|
|
1261
|
+
ref: b.value,
|
|
1262
|
+
class: "flex flex-col gap-16 w-[500px]",
|
|
1263
|
+
onValidationSuccess: r[2] || (r[2] = () => {
|
|
1264
|
+
l.value > -1 ? a.value.qrIntegrations[l.value] = { gateway: "PROMPTPAY", config: { account: o.value.account }, receiptName: o.value.receiptName } : (a.value.qrIntegrations || (a.value.qrIntegrations = []), a.value.qrIntegrations.push({ gateway: "PROMPTPAY", config: { account: o.value.account }, receiptName: o.value.receiptName })), d.onUpdate(a.value);
|
|
1265
|
+
})
|
|
1266
|
+
}, {
|
|
1267
|
+
default: q(() => [
|
|
1268
|
+
v(i, {
|
|
1269
|
+
modelValue: o.value.account,
|
|
1270
|
+
"onUpdate:modelValue": r[0] || (r[0] = (s) => o.value.account = s),
|
|
1271
|
+
label: "Thai Phone Number / Thai Naitonal ID",
|
|
1272
|
+
"label-info": "Thai Phone Number can be prefixed with 66 or 0 will be fine both will works well."
|
|
1273
|
+
}, null, 8, ["modelValue"]),
|
|
1274
|
+
v(i, {
|
|
1275
|
+
modelValue: o.value.receiptName,
|
|
1276
|
+
"onUpdate:modelValue": r[1] || (r[1] = (s) => o.value.receiptName = s),
|
|
1277
|
+
label: "Receipt Payment Name",
|
|
1278
|
+
"label-info": "Default receipt display will be 'TERMINAL_MAYBANK'"
|
|
1279
|
+
}, null, 8, ["modelValue"]),
|
|
1280
|
+
I("div", Be, [
|
|
1281
|
+
l.value > -1 ? (g(), w(t, {
|
|
1282
|
+
key: 0,
|
|
1283
|
+
class: "flex-1",
|
|
1284
|
+
variant: "secondary",
|
|
1285
|
+
label: "Delete",
|
|
1286
|
+
onclick: () => c(l.value)
|
|
1287
|
+
}, null, 8, ["onclick"])) : N("", !0),
|
|
1288
|
+
v(t, {
|
|
1289
|
+
type: "submit",
|
|
1290
|
+
class: "flex-1",
|
|
1291
|
+
variant: "primary",
|
|
1292
|
+
label: "Save"
|
|
1293
|
+
})
|
|
1294
|
+
])
|
|
1295
|
+
]),
|
|
1296
|
+
_: 1
|
|
1297
|
+
}, 512);
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
}), Ke = { class: "flex items-center" }, Le = { class: "w-[260px] self-start" }, Ee = { class: "flex-1" }, je = /* @__PURE__ */ V({
|
|
1301
|
+
__name: "QrGateway",
|
|
1302
|
+
props: {
|
|
1303
|
+
terminal: {
|
|
1304
|
+
type: Object,
|
|
1305
|
+
required: !0
|
|
1306
|
+
},
|
|
1307
|
+
onUpdate: {
|
|
1308
|
+
type: Function,
|
|
1309
|
+
required: !0
|
|
1310
|
+
}
|
|
1311
|
+
},
|
|
1312
|
+
setup(F) {
|
|
1313
|
+
var m;
|
|
1314
|
+
const d = F, a = [
|
|
1315
|
+
{
|
|
1316
|
+
label: "PromptPay",
|
|
1317
|
+
value: "promptpay",
|
|
1318
|
+
render: Ye,
|
|
1319
|
+
region: [C.F_COUNTRY.enum.TH]
|
|
1320
|
+
}
|
|
1321
|
+
], b = R(() => a.find((c) => c.value === e.value)), l = j().currentCountry, o = R(() => a.filter((c) => !c.region || c.region.includes(l.value ?? C.F_COUNTRY.enum.MY))), { gatewayTab: e } = E({
|
|
1322
|
+
gatewayTab: (m = o.value[0]) == null ? void 0 : m.value
|
|
1323
|
+
});
|
|
1324
|
+
return (c, p) => {
|
|
1325
|
+
var i;
|
|
1326
|
+
const r = y("FmTabs");
|
|
1327
|
+
return g(), U("div", Ke, [
|
|
1328
|
+
I("div", Le, [
|
|
1329
|
+
v(r, {
|
|
1330
|
+
"model-value": S(e),
|
|
1331
|
+
"onUpdate:modelValue": p[0] || (p[0] = (t) => B(e) ? e.value = t : null),
|
|
1332
|
+
class: "mb-6",
|
|
1333
|
+
vertical: !0,
|
|
1334
|
+
items: o.value
|
|
1335
|
+
}, null, 8, ["model-value", "items"])
|
|
1336
|
+
]),
|
|
1337
|
+
I("div", Ee, [
|
|
1338
|
+
S(e) ? (g(), w(Y((i = b.value) == null ? void 0 : i.render), K(L({ key: 0 }, {
|
|
1339
|
+
terminal: d.terminal,
|
|
1340
|
+
onUpdate: d.onUpdate
|
|
1341
|
+
})), null, 16)) : N("", !0)
|
|
1342
|
+
])
|
|
1343
|
+
]);
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
}), la = /* @__PURE__ */ V({
|
|
1347
|
+
__name: "TerminalSetting",
|
|
1348
|
+
props: {
|
|
1349
|
+
terminalId: {
|
|
1350
|
+
type: String,
|
|
1351
|
+
required: !0
|
|
1352
|
+
}
|
|
1353
|
+
},
|
|
1354
|
+
setup(F) {
|
|
1355
|
+
const d = F, { tab: a } = E({
|
|
1356
|
+
tab: "information"
|
|
1357
|
+
}), { isLoading: b, startAsyncCall: l } = H(!0), o = W(), e = Q(), m = _();
|
|
1358
|
+
async function c(n) {
|
|
1359
|
+
l(async () => {
|
|
1360
|
+
try {
|
|
1361
|
+
await h.updateById(
|
|
1362
|
+
d.terminalId,
|
|
1363
|
+
{
|
|
1364
|
+
name: n.name,
|
|
1365
|
+
status: n.status,
|
|
1366
|
+
ecrs: n.ecrs ?? [],
|
|
1367
|
+
gateways: n.gateways ?? [],
|
|
1368
|
+
ecrIntegrations: n.ecrIntegrations ?? [],
|
|
1369
|
+
qrIntegrations: n.qrIntegrations ?? []
|
|
1370
|
+
}
|
|
1371
|
+
), m.value = await h.readById(d.terminalId), e.open({
|
|
1372
|
+
type: "success",
|
|
1373
|
+
message: "Terminal updated successfully"
|
|
1374
|
+
});
|
|
1375
|
+
} catch (s) {
|
|
1376
|
+
e.open({
|
|
1377
|
+
type: "error",
|
|
1378
|
+
title: "Error occurs when update terminal",
|
|
1379
|
+
message: Z(s)
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
const p = [
|
|
1385
|
+
{
|
|
1386
|
+
label: "Information",
|
|
1387
|
+
value: "information",
|
|
1388
|
+
icon: "overview",
|
|
1389
|
+
render: te
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
label: "Setting Request",
|
|
1393
|
+
value: "settings",
|
|
1394
|
+
icon: "settings",
|
|
1395
|
+
render: re,
|
|
1396
|
+
onlyFor: ["TERMINAL"]
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
label: "SoftPos Gateway",
|
|
1400
|
+
value: "softpos",
|
|
1401
|
+
icon: "payment",
|
|
1402
|
+
render: se
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
label: "ECR Gateway",
|
|
1406
|
+
value: "ecr",
|
|
1407
|
+
icon: "point_of_sale",
|
|
1408
|
+
render: Ae,
|
|
1409
|
+
onlyFor: ["POS", "KIOSK"]
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
label: "QR Gateway",
|
|
1413
|
+
value: "qr",
|
|
1414
|
+
icon: "qr_code",
|
|
1415
|
+
render: je,
|
|
1416
|
+
onlyFor: ["POS", "KIOSK"]
|
|
1417
|
+
}
|
|
1418
|
+
];
|
|
1419
|
+
j().currentCountry;
|
|
1420
|
+
const r = R(() => {
|
|
1421
|
+
var n;
|
|
1422
|
+
return (n = p.find((s) => s.value === a.value)) == null ? void 0 : n.render;
|
|
1423
|
+
});
|
|
1424
|
+
async function i() {
|
|
1425
|
+
l(async () => {
|
|
1426
|
+
m.value = await h.readById(d.terminalId);
|
|
1427
|
+
});
|
|
1428
|
+
}
|
|
1429
|
+
const t = R(() => p.filter((n) => {
|
|
1430
|
+
var s;
|
|
1431
|
+
return !n.onlyFor || n.onlyFor.includes(((s = m.value) == null ? void 0 : s.deviceType) ?? "");
|
|
1432
|
+
}));
|
|
1433
|
+
return M(i), (n, s) => {
|
|
1434
|
+
var x, u;
|
|
1435
|
+
const f = y("FmTabs");
|
|
1436
|
+
return g(), w(X, {
|
|
1437
|
+
title: `${(x = m.value) == null ? void 0 : x.deviceType} (${(u = m.value) == null ? void 0 : u._id})`,
|
|
1438
|
+
loading: S(b),
|
|
1439
|
+
onBack: S(o).back
|
|
1440
|
+
}, {
|
|
1441
|
+
default: q(() => [
|
|
1442
|
+
v(f, {
|
|
1443
|
+
"model-value": S(a),
|
|
1444
|
+
"onUpdate:modelValue": s[0] || (s[0] = (T) => B(a) ? a.value = T : null),
|
|
1445
|
+
class: "mb-6",
|
|
1446
|
+
items: t.value
|
|
1447
|
+
}, null, 8, ["model-value", "items"]),
|
|
1448
|
+
S(a) ? (g(), w(Y(r.value), K(L({ key: 0 }, {
|
|
1449
|
+
terminal: m.value,
|
|
1450
|
+
onUpdate: c
|
|
1451
|
+
})), null, 16)) : N("", !0)
|
|
1452
|
+
]),
|
|
1453
|
+
_: 1
|
|
1454
|
+
}, 8, ["title", "loading", "onBack"]);
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
export {
|
|
1459
|
+
la as default
|
|
1460
|
+
};
|