@feedmepos/mf-payment 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PayoutAccount-C362ShA8.js → PayoutAccount-BAXvKwol.js} +5 -5
- package/dist/{PayoutAccount-CAdClj2Y.js → PayoutAccount-C9TC-nLW.js} +3 -3
- package/dist/{PayoutAccountSetting-Cbl5b1Jr.js → PayoutAccountSetting-CsY4Dr_E.js} +3 -3
- package/dist/{Restaurant-ClDu-bSv.js → Restaurant-C9GmwxpU.js} +4 -4
- package/dist/{RestaurantSetting-D5h5RoHf.js → RestaurantSetting-DaSalR0b.js} +3 -3
- package/dist/Settlement-BvUs3MyQ.js +454 -0
- package/dist/Settlement-C7oFzVbb.js +219 -0
- package/dist/{SettlementTransactions-Cpaq8K6x.js → SettlementTransactions-BRo_oigl.js} +75 -69
- package/dist/{SettlementTransactions-DIvLOEw6.js → SettlementTransactions-qSgW0VCV.js} +80 -78
- package/dist/{Terminal-Cmed6xrj.js → Terminal-DXGKrm3G.js} +5 -5
- package/dist/TerminalSetting-bLxGkMlN.js +497 -0
- package/dist/{Transaction-BQn5rvxe.js → Transaction-B7ICajHR.js} +6 -6
- package/dist/{Transaction-8m9pEyyX.js → Transaction-BI2ZRsxe.js} +52 -47
- package/dist/{TransactionOld-CX-Odthg.js → TransactionOld-GLsvtHyF.js} +5 -5
- package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-BX7YIl4i.js → TransactionTable.vue_vue_type_script_setup_true_lang-UjV7RID1.js} +12 -8
- package/dist/api/settlement/index.d.ts +1 -1
- package/dist/api/terminal/index.d.ts +4 -0
- package/dist/api/transaction/index.d.ts +1 -1
- package/dist/{app-QYQdqlqy.js → app-DVnyclnX.js} +327 -321
- package/dist/app.d.ts +6 -0
- package/dist/app.js +1 -1
- package/dist/{assets-Da-9jPqG.js → assets-BZmrImt4.js} +49 -52
- package/dist/{grafana-BDr-LF8O.js → grafana-DRnPxAqM.js} +1 -1
- package/dist/{index-0Dl-qVTd.js → index-BMF26WT4.js} +29 -29
- package/dist/{index-DFq7xhNQ.js → index-C1Hgyi3j.js} +1 -1
- package/dist/{index-Dg0Vf3qd.js → index-CD59SyVI.js} +1 -1
- package/dist/{index-DTH2dIPG.js → index-DZMn5Qjp.js} +796 -796
- package/dist/{index-Dq07OgOJ.js → index-a-Vqap7Z.js} +9 -1
- package/dist/{index-DbBsTEVS.js → index-gSE1T266.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-JHB8s5dZ.js → index.vue_vue_type_script_setup_true_lang-FgXpWvbs.js} +1 -1
- package/dist/model/transaction.d.ts +3 -0
- package/dist/package.json +1 -1
- package/dist/{payout-account--IA1DbB5.js → payout-account-B76ODsn2.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +87 -0
- package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +87 -0
- package/package.json +1 -1
- package/dist/Settlement-B06tIr4_.js +0 -445
- package/dist/Settlement-C2BVxmir.js +0 -219
- package/dist/TerminalSetting-BrTRbBF7.js +0 -389
@@ -1,219 +0,0 @@
|
|
1
|
-
import { defineComponent as Y, ref as h, computed as E, resolveComponent as d, openBlock as F, createBlock as V, h as L, watch as R, onMounted as N, unref as r, withCtx as k, createElementVNode as w, createVNode as i, isRef as A, createElementBlock as O, Fragment as P, renderList as U } from "vue";
|
2
|
-
import { u as M } from "./index-DTH2dIPG.js";
|
3
|
-
import { h as C } from "./moment-h96o7c8I.js";
|
4
|
-
import { s as _ } from "./index-0Dl-qVTd.js";
|
5
|
-
import { useSnackbar as q } from "@feedmepos/ui-library";
|
6
|
-
import { d as S } from "./dinero-CIVmXLL-.js";
|
7
|
-
import { _ as J } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
|
8
|
-
import { useRouter as j } from "vue-router";
|
9
|
-
import { _ as z } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
|
10
|
-
import { u as G } from "./index-DFq7xhNQ.js";
|
11
|
-
import { u as Q } from "./error-K1CakhA9.js";
|
12
|
-
import { _ as H } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
|
13
|
-
import { useCoreStore as W } from "@feedmepos/mf-common";
|
14
|
-
const X = /* @__PURE__ */ Y({
|
15
|
-
__name: "SettlementTable",
|
16
|
-
props: {
|
17
|
-
data: {
|
18
|
-
type: Array,
|
19
|
-
required: !0
|
20
|
-
},
|
21
|
-
loading: {
|
22
|
-
type: Boolean,
|
23
|
-
required: !0
|
24
|
-
}
|
25
|
-
},
|
26
|
-
emits: ["row-click"],
|
27
|
-
setup(D, { emit: p }) {
|
28
|
-
const m = D, f = p, v = h(""), l = [
|
29
|
-
{
|
30
|
-
header: () => "Settlement ID",
|
31
|
-
accessorKey: "id",
|
32
|
-
cell: ({ cell: o }) => L(J, { data: o.getValue() })
|
33
|
-
},
|
34
|
-
{
|
35
|
-
header: () => "Created At",
|
36
|
-
accessorKey: "transactionAt",
|
37
|
-
meta: {
|
38
|
-
width: "180px"
|
39
|
-
}
|
40
|
-
},
|
41
|
-
{
|
42
|
-
header: () => "Sales Amount",
|
43
|
-
accessorKey: "amount"
|
44
|
-
},
|
45
|
-
{
|
46
|
-
header: () => "Fee",
|
47
|
-
accessorKey: "fee"
|
48
|
-
},
|
49
|
-
{
|
50
|
-
header: () => "Settlement Amount",
|
51
|
-
accessorKey: "payout"
|
52
|
-
}
|
53
|
-
], s = E(() => m.data.map((o) => ({
|
54
|
-
id: o._id,
|
55
|
-
transactionAt: C(o.createdAt).format("YYYY-MM-DD"),
|
56
|
-
amount: S(o.totalAmount).toFormat("$0.00"),
|
57
|
-
fee: S(o.totalFee).toFormat("$0.00"),
|
58
|
-
payout: S(o.totalPayout).toFormat("$0.00")
|
59
|
-
})));
|
60
|
-
return (o, u) => {
|
61
|
-
const e = d("FmTable");
|
62
|
-
return F(), V(e, {
|
63
|
-
modelValue: v.value,
|
64
|
-
"onUpdate:modelValue": u[0] || (u[0] = (t) => v.value = t),
|
65
|
-
"row-data": s.value,
|
66
|
-
"shrink-at": !1,
|
67
|
-
"column-defs": l,
|
68
|
-
loading: m.loading,
|
69
|
-
onRowClick: u[1] || (u[1] = (t) => f("row-click", m.data.at(t.index)))
|
70
|
-
}, null, 8, ["modelValue", "row-data", "loading"]);
|
71
|
-
};
|
72
|
-
}
|
73
|
-
}), Z = { class: "flex justify-between items-center mb-6" }, ee = { class: "flex space-x-4 items-end" }, te = { class: "flex space-x-4" }, ye = /* @__PURE__ */ Y({
|
74
|
-
__name: "Settlement",
|
75
|
-
setup(D) {
|
76
|
-
const { isLoading: p, startAsyncCall: m } = M(!0), f = M(!1), v = W().currentCountry, l = h([]), s = h([]), o = j(), u = q(), { dateRange: e, searchKey: t } = G({
|
77
|
-
searchKey: "",
|
78
|
-
dateRange: {
|
79
|
-
startDate: C().startOf("day").format("YYYY-MM-DD"),
|
80
|
-
endDate: C().endOf("day").format("YYYY-MM-DD")
|
81
|
-
}
|
82
|
-
});
|
83
|
-
R(e, x);
|
84
|
-
let b;
|
85
|
-
R(t, async () => {
|
86
|
-
b && clearTimeout(b), b = setTimeout(() => {
|
87
|
-
var y = new RegExp(t.value, "i");
|
88
|
-
s.value = l.value.filter((n) => {
|
89
|
-
const c = JSON.stringify(n);
|
90
|
-
return y.test(c);
|
91
|
-
});
|
92
|
-
}, 700);
|
93
|
-
});
|
94
|
-
async function x() {
|
95
|
-
await m(async () => {
|
96
|
-
const y = await _.readByDate(
|
97
|
-
{
|
98
|
-
start: e.value.startDate,
|
99
|
-
end: e.value.endDate
|
100
|
-
}
|
101
|
-
);
|
102
|
-
if (l.value = y, s.value = l.value, t.value > "") {
|
103
|
-
var n = new RegExp(t.value, "i");
|
104
|
-
s.value = l.value.filter((c) => {
|
105
|
-
const g = JSON.stringify(c);
|
106
|
-
return n.test(g);
|
107
|
-
});
|
108
|
-
}
|
109
|
-
});
|
110
|
-
}
|
111
|
-
function B() {
|
112
|
-
x();
|
113
|
-
}
|
114
|
-
N(B);
|
115
|
-
const I = [
|
116
|
-
{
|
117
|
-
label: "Audit Report",
|
118
|
-
sublabel: "Full transactions details report from each payment providers.",
|
119
|
-
icon: "file_download",
|
120
|
-
value: "auditReport",
|
121
|
-
onClick: () => _.downloadSettlementReport({
|
122
|
-
start: e.value.startDate,
|
123
|
-
end: e.value.endDate
|
124
|
-
})
|
125
|
-
},
|
126
|
-
{
|
127
|
-
label: "Summary Report",
|
128
|
-
sublabel: "Summarized settlement information for each payout accounts.",
|
129
|
-
icon: "account_balance",
|
130
|
-
value: "summaryReport",
|
131
|
-
onClick: () => _.downloadSummaryReport(l.value, {
|
132
|
-
start: e.value.startDate,
|
133
|
-
end: e.value.endDate
|
134
|
-
})
|
135
|
-
},
|
136
|
-
{
|
137
|
-
label: "Bank Instruction File",
|
138
|
-
sublabel: "Generate bank instruction file based on bank formats.",
|
139
|
-
icon: "description",
|
140
|
-
value: "bankInstructionFile",
|
141
|
-
onClick: () => _.downloadBankInstructionFile(v.value, l.value)
|
142
|
-
}
|
143
|
-
];
|
144
|
-
return (y, n) => {
|
145
|
-
const c = d("FmSearch"), g = d("FmButton"), $ = d("FmMenuItem"), K = d("FmMenu");
|
146
|
-
return F(), V(z, {
|
147
|
-
title: "Settlements",
|
148
|
-
loading: r(p)
|
149
|
-
}, {
|
150
|
-
default: k(() => [
|
151
|
-
w("div", Z, [
|
152
|
-
w("div", ee, [
|
153
|
-
i(c, {
|
154
|
-
"model-value": r(t),
|
155
|
-
"onUpdate:modelValue": n[0] || (n[0] = (a) => A(t) ? t.value = a : null),
|
156
|
-
class: "mr-8",
|
157
|
-
label: "Search",
|
158
|
-
placeholder: "Search Settlements ..."
|
159
|
-
}, null, 8, ["model-value"]),
|
160
|
-
i(H, {
|
161
|
-
modelValue: r(e),
|
162
|
-
"onUpdate:modelValue": n[1] || (n[1] = (a) => A(e) ? e.value = a : null)
|
163
|
-
}, null, 8, ["modelValue"])
|
164
|
-
]),
|
165
|
-
w("div", te, [
|
166
|
-
i(K, { trigger: "click" }, {
|
167
|
-
"menu-button": k(() => [
|
168
|
-
i(g, {
|
169
|
-
variant: "primary",
|
170
|
-
"append-icon": "arrow_drop_down",
|
171
|
-
label: "Actions",
|
172
|
-
loading: r(f).isLoading.value
|
173
|
-
}, null, 8, ["loading"])
|
174
|
-
]),
|
175
|
-
default: k(() => [
|
176
|
-
(F(), O(P, null, U(I, (a) => i($, {
|
177
|
-
key: a.value,
|
178
|
-
label: a.label,
|
179
|
-
icon: a.icon,
|
180
|
-
sublabel: a.sublabel,
|
181
|
-
selectable: !0,
|
182
|
-
onClick: (ae) => {
|
183
|
-
r(f).startAsyncCall(async () => {
|
184
|
-
try {
|
185
|
-
await a.onClick();
|
186
|
-
} catch (T) {
|
187
|
-
r(u).open({
|
188
|
-
type: "error",
|
189
|
-
title: "Error",
|
190
|
-
message: r(Q)(T)
|
191
|
-
});
|
192
|
-
}
|
193
|
-
});
|
194
|
-
}
|
195
|
-
}, null, 8, ["label", "icon", "sublabel", "onClick"])), 64))
|
196
|
-
]),
|
197
|
-
_: 1
|
198
|
-
})
|
199
|
-
])
|
200
|
-
]),
|
201
|
-
i(X, {
|
202
|
-
loading: r(p),
|
203
|
-
data: s.value,
|
204
|
-
onRowClick: n[2] || (n[2] = (a) => r(o).push({
|
205
|
-
name: "mf-payment-admin.settlement-transaction",
|
206
|
-
params: {
|
207
|
-
settlementId: a._id
|
208
|
-
}
|
209
|
-
}))
|
210
|
-
}, null, 8, ["loading", "data"])
|
211
|
-
]),
|
212
|
-
_: 1
|
213
|
-
}, 8, ["loading"]);
|
214
|
-
};
|
215
|
-
}
|
216
|
-
});
|
217
|
-
export {
|
218
|
-
ye as default
|
219
|
-
};
|
@@ -1,389 +0,0 @@
|
|
1
|
-
import { defineComponent as T, openBlock as b, createElementBlock as N, Fragment as Y, createElementVNode as g, createTextVNode as V, toDisplayString as S, toRef as M, ref as F, watch as D, onMounted as G, computed as O, resolveComponent as f, unref as _, createVNode as I, createBlock as x, withCtx as q, createCommentVNode as B, isRef as h, resolveDynamicComponent as L, normalizeProps as j, mergeProps as z } from "vue";
|
2
|
-
import { u as R, e as U } from "./index-DTH2dIPG.js";
|
3
|
-
import { useRouter as E } from "vue-router";
|
4
|
-
import { t as C } from "./index-Dq07OgOJ.js";
|
5
|
-
import { _ as A } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
6
|
-
import { u as H } from "./index-DFq7xhNQ.js";
|
7
|
-
import { useSnackbar as Q } from "@feedmepos/ui-library";
|
8
|
-
import { u as J } from "./error-K1CakhA9.js";
|
9
|
-
import { z as W, a as X } from "./validator-D5jtpt9A.js";
|
10
|
-
import { useCoreStore as $ } from "@feedmepos/mf-common";
|
11
|
-
const Z = /* @__PURE__ */ T({
|
12
|
-
__name: "Information",
|
13
|
-
props: {
|
14
|
-
terminal: {
|
15
|
-
type: Object,
|
16
|
-
required: !0
|
17
|
-
}
|
18
|
-
},
|
19
|
-
setup(y) {
|
20
|
-
return (d, e) => (b(), N(Y, null, [
|
21
|
-
e[0] || (e[0] = g("b", null, "Name", -1)),
|
22
|
-
V(": " + S(y.terminal.name), 1),
|
23
|
-
e[1] || (e[1] = g("br", null, null, -1)),
|
24
|
-
e[2] || (e[2] = g("b", null, "Status", -1)),
|
25
|
-
V(": " + S(y.terminal.status), 1),
|
26
|
-
e[3] || (e[3] = g("br", null, null, -1)),
|
27
|
-
e[4] || (e[4] = g("b", null, "Device ID", -1)),
|
28
|
-
V(": " + S(y.terminal.deviceId ?? "-"), 1),
|
29
|
-
e[5] || (e[5] = g("br", null, null, -1)),
|
30
|
-
e[6] || (e[6] = g("b", null, "Device Type", -1)),
|
31
|
-
V(": " + S(y.terminal.deviceType ?? "-"), 1),
|
32
|
-
e[7] || (e[7] = g("br", null, null, -1))
|
33
|
-
], 64));
|
34
|
-
}
|
35
|
-
}), ee = {
|
36
|
-
key: 0,
|
37
|
-
class: "flex items-center justify-center min-h-[80vh]"
|
38
|
-
}, ae = { class: "flex mt-6 space-x-6" }, te = /* @__PURE__ */ T({
|
39
|
-
__name: "TerminalGateway",
|
40
|
-
props: {
|
41
|
-
terminal: {
|
42
|
-
type: Object,
|
43
|
-
required: !0
|
44
|
-
},
|
45
|
-
onUpdate: {
|
46
|
-
type: Function,
|
47
|
-
required: !0
|
48
|
-
}
|
49
|
-
},
|
50
|
-
setup(y) {
|
51
|
-
const { isLoading: d, startAsyncCall: e } = R(), c = y, a = M(() => c.terminal), o = F(), v = F(), n = F(-1), p = F({
|
52
|
-
terminalId: ""
|
53
|
-
}), i = () => {
|
54
|
-
p.value.terminalId = "", n.value = -1;
|
55
|
-
}, l = () => {
|
56
|
-
if (e(async () => {
|
57
|
-
o.value = await C.getRestaurantTerminals(c.terminal.referenceId);
|
58
|
-
}), !c.terminal.ecrs)
|
59
|
-
return i();
|
60
|
-
const t = c.terminal.ecrs.findIndex((m) => m && m.gateway && m.gateway === "FeedMe");
|
61
|
-
if (t === -1)
|
62
|
-
return i();
|
63
|
-
n.value = t;
|
64
|
-
const r = c.terminal.ecrs.at(t);
|
65
|
-
r.gateway === "FeedMe" && r.config && (p.value = {
|
66
|
-
terminalId: r.config.terminalId
|
67
|
-
});
|
68
|
-
};
|
69
|
-
D(a, l), G(l);
|
70
|
-
const s = O(() => (o.value ?? []).map((t) => ({
|
71
|
-
label: t.name ?? t._id,
|
72
|
-
value: t._id
|
73
|
-
})));
|
74
|
-
async function u(t) {
|
75
|
-
var r;
|
76
|
-
(r = c.terminal.ecrs) == null || r.splice(t, 1), c.onUpdate(c.terminal);
|
77
|
-
}
|
78
|
-
return (t, r) => {
|
79
|
-
const m = f("FmCircularProgress"), k = f("FmSelect"), w = f("FmButton"), K = f("FmForm");
|
80
|
-
return _(d) ? (b(), N("div", ee, [
|
81
|
-
I(m, { size: "xxl" })
|
82
|
-
])) : (b(), x(K, {
|
83
|
-
key: 1,
|
84
|
-
ref: v.value,
|
85
|
-
class: "flex flex-col gap-16 w-[500px]",
|
86
|
-
onValidationSuccess: r[1] || (r[1] = () => {
|
87
|
-
n.value > -1 ? a.value.ecrs[n.value] = { gateway: "FeedMe", config: p.value } : (a.value.ecrs || (a.value.ecrs = []), a.value.ecrs.push({ gateway: "FeedMe", config: p.value })), c.onUpdate(a.value);
|
88
|
-
})
|
89
|
-
}, {
|
90
|
-
default: q(() => [
|
91
|
-
I(k, {
|
92
|
-
modelValue: p.value.terminalId,
|
93
|
-
"onUpdate:modelValue": r[0] || (r[0] = (P) => p.value.terminalId = P),
|
94
|
-
label: "Terminal ID",
|
95
|
-
items: s.value,
|
96
|
-
rules: _(W)(_(X).string())
|
97
|
-
}, null, 8, ["modelValue", "items", "rules"]),
|
98
|
-
g("div", ae, [
|
99
|
-
n.value > -1 ? (b(), x(w, {
|
100
|
-
key: 0,
|
101
|
-
class: "flex-1",
|
102
|
-
variant: "secondary",
|
103
|
-
label: "Delete",
|
104
|
-
onclick: () => u(n.value)
|
105
|
-
}, null, 8, ["onclick"])) : B("", !0),
|
106
|
-
I(w, {
|
107
|
-
type: "submit",
|
108
|
-
class: "flex-1",
|
109
|
-
variant: "primary",
|
110
|
-
label: "Save"
|
111
|
-
})
|
112
|
-
])
|
113
|
-
]),
|
114
|
-
_: 1
|
115
|
-
}, 512));
|
116
|
-
};
|
117
|
-
}
|
118
|
-
}), ne = { class: "flex mt-6 space-x-6" }, le = /* @__PURE__ */ T({
|
119
|
-
__name: "FiuuGateway",
|
120
|
-
props: {
|
121
|
-
terminal: {
|
122
|
-
type: Object,
|
123
|
-
required: !0
|
124
|
-
},
|
125
|
-
onUpdate: {
|
126
|
-
type: Function,
|
127
|
-
required: !0
|
128
|
-
}
|
129
|
-
},
|
130
|
-
setup(y) {
|
131
|
-
const d = y, e = $().currentCountry, c = [
|
132
|
-
{
|
133
|
-
label: "Fiuu Malaysia",
|
134
|
-
value: "cc.feedme.payment.rms",
|
135
|
-
region: U.F_COUNTRY.enum.MY
|
136
|
-
},
|
137
|
-
{
|
138
|
-
label: "Fiuu Malaysia V2",
|
139
|
-
value: "cc.feedme.payment.fiuu_my",
|
140
|
-
region: U.F_COUNTRY.enum.MY
|
141
|
-
},
|
142
|
-
{
|
143
|
-
label: "Fiuu Singapore",
|
144
|
-
value: "cc.feedme.payment.fiuu_sg",
|
145
|
-
region: U.F_COUNTRY.enum.SG
|
146
|
-
}
|
147
|
-
], a = M(() => d.terminal), o = F(), v = F(-1), n = F({
|
148
|
-
packageId: "",
|
149
|
-
uniqueId: ""
|
150
|
-
}), p = () => {
|
151
|
-
n.value.uniqueId = "", n.value.packageId = "", v.value = -1;
|
152
|
-
}, i = () => {
|
153
|
-
if (!a.value.gateways)
|
154
|
-
return p();
|
155
|
-
const s = a.value.gateways.findIndex((t) => t && t.gateway && t.gateway === "Fiuu");
|
156
|
-
if (s === -1)
|
157
|
-
return p();
|
158
|
-
v.value = s;
|
159
|
-
const u = a.value.gateways.at(s);
|
160
|
-
u.gateway === "Fiuu" && u.config && (n.value = {
|
161
|
-
packageId: u.config.packageId,
|
162
|
-
uniqueId: u.config.uniqueId
|
163
|
-
});
|
164
|
-
};
|
165
|
-
D(a, i), G(i);
|
166
|
-
async function l(s) {
|
167
|
-
var u;
|
168
|
-
(u = a.value.gateways) == null || u.splice(s, 1), d.onUpdate(a.value);
|
169
|
-
}
|
170
|
-
return (s, u) => {
|
171
|
-
const t = f("FmSelect"), r = f("FmTextField"), m = f("FmButton"), k = f("FmForm");
|
172
|
-
return b(), x(k, {
|
173
|
-
ref: o.value,
|
174
|
-
class: "flex flex-col gap-16 w-[500px]",
|
175
|
-
onValidationSuccess: u[2] || (u[2] = () => {
|
176
|
-
v.value > -1 ? a.value.gateways[v.value] = { gateway: "Fiuu", config: n.value } : (a.value.gateways || (a.value.gateways = []), a.value.gateways.push({ gateway: "Fiuu", config: n.value })), d.onUpdate(a.value);
|
177
|
-
})
|
178
|
-
}, {
|
179
|
-
default: q(() => [
|
180
|
-
I(t, {
|
181
|
-
modelValue: n.value.packageId,
|
182
|
-
"onUpdate:modelValue": u[0] || (u[0] = (w) => n.value.packageId = w),
|
183
|
-
label: "Package ID",
|
184
|
-
items: c.filter((w) => w.region === _(e))
|
185
|
-
}, null, 8, ["modelValue", "items"]),
|
186
|
-
I(r, {
|
187
|
-
modelValue: n.value.uniqueId,
|
188
|
-
"onUpdate:modelValue": u[1] || (u[1] = (w) => n.value.uniqueId = w),
|
189
|
-
label: "Unique ID"
|
190
|
-
}, null, 8, ["modelValue"]),
|
191
|
-
g("div", ne, [
|
192
|
-
v.value > -1 ? (b(), x(m, {
|
193
|
-
key: 0,
|
194
|
-
class: "flex-1",
|
195
|
-
variant: "secondary",
|
196
|
-
label: "Delete",
|
197
|
-
onclick: () => l(v.value)
|
198
|
-
}, null, 8, ["onclick"])) : B("", !0),
|
199
|
-
I(m, {
|
200
|
-
type: "submit",
|
201
|
-
class: "flex-1",
|
202
|
-
variant: "primary",
|
203
|
-
label: "Save"
|
204
|
-
})
|
205
|
-
])
|
206
|
-
]),
|
207
|
-
_: 1
|
208
|
-
}, 512);
|
209
|
-
};
|
210
|
-
}
|
211
|
-
}), re = { class: "flex mt-6 space-x-6" }, ue = /* @__PURE__ */ T({
|
212
|
-
__name: "GhlGateway",
|
213
|
-
props: {
|
214
|
-
terminal: {
|
215
|
-
type: Object,
|
216
|
-
required: !0
|
217
|
-
},
|
218
|
-
onUpdate: {
|
219
|
-
type: Function,
|
220
|
-
required: !0
|
221
|
-
}
|
222
|
-
},
|
223
|
-
setup(y) {
|
224
|
-
const d = y, e = M(() => d.terminal), c = F(), a = F(-1), o = F({
|
225
|
-
merchantId: "",
|
226
|
-
terminalId: "",
|
227
|
-
privateKey: ""
|
228
|
-
}), v = () => {
|
229
|
-
o.value.merchantId = "", o.value.terminalId = "", o.value.privateKey = "", a.value = -1;
|
230
|
-
}, n = () => {
|
231
|
-
if (!e.value.ecrs)
|
232
|
-
return v();
|
233
|
-
const i = e.value.ecrs.findIndex((s) => s && s.gateway && s.gateway === "Ghl");
|
234
|
-
if (i === -1)
|
235
|
-
return v();
|
236
|
-
a.value = i;
|
237
|
-
const l = e.value.ecrs.at(i);
|
238
|
-
l.gateway === "Ghl" && l.config && (o.value = {
|
239
|
-
merchantId: l.config.merchantId,
|
240
|
-
terminalId: l.config.terminalId,
|
241
|
-
privateKey: l.config.privateKey
|
242
|
-
});
|
243
|
-
};
|
244
|
-
D(e, n), G(n);
|
245
|
-
async function p(i) {
|
246
|
-
var l;
|
247
|
-
(l = e.value.ecrs) == null || l.splice(i, 1), d.onUpdate(e.value);
|
248
|
-
}
|
249
|
-
return (i, l) => {
|
250
|
-
const s = f("FmTextField"), u = f("FmTextarea"), t = f("FmButton"), r = f("FmForm");
|
251
|
-
return b(), x(r, {
|
252
|
-
ref: c.value,
|
253
|
-
class: "flex flex-col gap-16 w-[500px]",
|
254
|
-
onValidationSuccess: l[3] || (l[3] = () => {
|
255
|
-
a.value > -1 ? e.value.ecrs[a.value] = { gateway: "Ghl", config: o.value } : (e.value.ecrs || (e.value.ecrs = []), e.value.ecrs.push({ gateway: "Ghl", config: o.value })), d.onUpdate(e.value);
|
256
|
-
})
|
257
|
-
}, {
|
258
|
-
default: q(() => [
|
259
|
-
I(s, {
|
260
|
-
modelValue: o.value.merchantId,
|
261
|
-
"onUpdate:modelValue": l[0] || (l[0] = (m) => o.value.merchantId = m),
|
262
|
-
label: "Merchant ID"
|
263
|
-
}, null, 8, ["modelValue"]),
|
264
|
-
I(s, {
|
265
|
-
modelValue: o.value.terminalId,
|
266
|
-
"onUpdate:modelValue": l[1] || (l[1] = (m) => o.value.terminalId = m),
|
267
|
-
label: "Terminal ID"
|
268
|
-
}, null, 8, ["modelValue"]),
|
269
|
-
I(u, {
|
270
|
-
modelValue: o.value.privateKey,
|
271
|
-
"onUpdate:modelValue": l[2] || (l[2] = (m) => o.value.privateKey = m),
|
272
|
-
label: "Private Key"
|
273
|
-
}, null, 8, ["modelValue"]),
|
274
|
-
g("div", re, [
|
275
|
-
a.value > -1 ? (b(), x(t, {
|
276
|
-
key: 0,
|
277
|
-
class: "flex-1",
|
278
|
-
variant: "secondary",
|
279
|
-
label: "Delete",
|
280
|
-
onclick: () => p(a.value)
|
281
|
-
}, null, 8, ["onclick"])) : B("", !0),
|
282
|
-
I(t, {
|
283
|
-
type: "submit",
|
284
|
-
class: "flex-1",
|
285
|
-
variant: "primary",
|
286
|
-
label: "Save"
|
287
|
-
})
|
288
|
-
])
|
289
|
-
]),
|
290
|
-
_: 1
|
291
|
-
}, 512);
|
292
|
-
};
|
293
|
-
}
|
294
|
-
}), ge = /* @__PURE__ */ T({
|
295
|
-
__name: "TerminalSetting",
|
296
|
-
props: {
|
297
|
-
terminalId: {
|
298
|
-
type: String,
|
299
|
-
required: !0
|
300
|
-
}
|
301
|
-
},
|
302
|
-
setup(y) {
|
303
|
-
const d = y, { tab: e } = H({
|
304
|
-
tab: "information"
|
305
|
-
}), { isLoading: c, startAsyncCall: a } = R(!0), o = E(), v = Q(), n = F();
|
306
|
-
async function p(t) {
|
307
|
-
a(async () => {
|
308
|
-
try {
|
309
|
-
await C.updateById(
|
310
|
-
d.terminalId,
|
311
|
-
{
|
312
|
-
name: t.name,
|
313
|
-
status: t.status,
|
314
|
-
ecrs: t.ecrs ?? [],
|
315
|
-
gateways: t.gateways ?? []
|
316
|
-
}
|
317
|
-
), n.value = await C.readById(d.terminalId), v.open({
|
318
|
-
type: "success",
|
319
|
-
message: "Terminal updated successfully"
|
320
|
-
});
|
321
|
-
} catch (r) {
|
322
|
-
v.open({
|
323
|
-
type: "error",
|
324
|
-
title: "Error occurs when update terminal",
|
325
|
-
message: J(r)
|
326
|
-
});
|
327
|
-
}
|
328
|
-
});
|
329
|
-
}
|
330
|
-
const i = [
|
331
|
-
{
|
332
|
-
label: "Information",
|
333
|
-
value: "information",
|
334
|
-
icon: "overview",
|
335
|
-
render: Z
|
336
|
-
},
|
337
|
-
{
|
338
|
-
label: "Fiuu",
|
339
|
-
value: "fiuu",
|
340
|
-
icon: "payment",
|
341
|
-
render: le
|
342
|
-
}
|
343
|
-
], l = $().currentCountry, s = O(() => {
|
344
|
-
var t;
|
345
|
-
return (t = i.find((r) => r.value === e.value)) == null ? void 0 : t.render;
|
346
|
-
});
|
347
|
-
async function u() {
|
348
|
-
a(async () => {
|
349
|
-
n.value = await C.readById(d.terminalId), n.value.deviceType !== "TERMINAL" && (i.push({
|
350
|
-
label: "FeedMe Terminal",
|
351
|
-
value: "terminal",
|
352
|
-
icon: "shopping_cart_checkout",
|
353
|
-
render: te
|
354
|
-
}), l.value === U.F_COUNTRY.enum.MY && i.push({
|
355
|
-
label: "GHL Terminal (V2)",
|
356
|
-
value: "ghl",
|
357
|
-
icon: "shopping_cart_checkout",
|
358
|
-
render: ue
|
359
|
-
}));
|
360
|
-
});
|
361
|
-
}
|
362
|
-
return G(u), (t, r) => {
|
363
|
-
var k;
|
364
|
-
const m = f("FmTabs");
|
365
|
-
return b(), x(A, {
|
366
|
-
title: `Terminal (${(k = n.value) == null ? void 0 : k._id})`,
|
367
|
-
loading: _(c),
|
368
|
-
onBack: _(o).back
|
369
|
-
}, {
|
370
|
-
default: q(() => [
|
371
|
-
I(m, {
|
372
|
-
"model-value": _(e),
|
373
|
-
"onUpdate:modelValue": r[0] || (r[0] = (w) => h(e) ? e.value = w : null),
|
374
|
-
class: "mb-6",
|
375
|
-
items: i
|
376
|
-
}, null, 8, ["model-value"]),
|
377
|
-
_(e) ? (b(), x(L(s.value), j(z({ key: 0 }, {
|
378
|
-
terminal: n.value,
|
379
|
-
onUpdate: p
|
380
|
-
})), null, 16)) : B("", !0)
|
381
|
-
]),
|
382
|
-
_: 1
|
383
|
-
}, 8, ["title", "loading", "onBack"]);
|
384
|
-
};
|
385
|
-
}
|
386
|
-
});
|
387
|
-
export {
|
388
|
-
ge as default
|
389
|
-
};
|