@feedmepos/mf-payment 1.5.79-dev → 1.5.81-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-B1k6lqk9.js → Actions.vue_vue_type_script_setup_true_lang-arxXJc-r.js} +1 -1
  2. package/dist/{Chargeback-DDW6Z35O.js → Chargeback-DCBPi5nd.js} +7 -7
  3. package/dist/{DateRangePicker.vue_vue_type_script_setup_true_lang-BNVnvrVY.js → DateRangePicker.vue_vue_type_script_setup_true_lang-CDjdQf-E.js} +1 -1
  4. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-0t7PrKly.js → DocumentViewer.vue_vue_type_script_setup_true_lang-CmWaoyuX.js} +3 -3
  5. package/dist/{OnboardForm-CMiPKEAD.js → OnboardForm-C6lqjMgj.js} +6 -6
  6. package/dist/{OnboardForm-UvHyCi9w.js → OnboardForm-DSMui3AP.js} +6 -6
  7. package/dist/{OnboardSubmission-faKhsdmy.js → OnboardSubmission-DGlLp3NF.js} +3 -3
  8. package/dist/{OnboardSubmission-BWv_zw6C.js → OnboardSubmission-VW-cpEb5.js} +5 -5
  9. package/dist/{PayoutAccount-mNPnD2h1.js → PayoutAccount-CQsohYCY.js} +425 -413
  10. package/dist/{PayoutAccount-DHFs5gyw.js → PayoutAccount-ScwlPbDO.js} +5 -5
  11. package/dist/PayoutAccountSetting-4S54z0zZ.js +1814 -0
  12. package/dist/{Restaurant-jkwyYKCC.js → Restaurant-BdeRl1K3.js} +4 -4
  13. package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-DG3iyjkK.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-ClyF3x4z.js} +10 -10
  14. package/dist/{RestaurantSetting-D6uSwnZI.js → RestaurantSetting-DoveWDBU.js} +4 -4
  15. package/dist/{Settlement-COK5hned.js → Settlement-Db5-8Rwp.js} +106 -106
  16. package/dist/{Settlement-CPLwwE2V.js → Settlement-tznVotsa.js} +4 -4
  17. package/dist/{SettlementTransactions-Coc4SIYf.js → SettlementTransactions-CZ05tjy5.js} +4 -4
  18. package/dist/{SettlementTransactions-BaD7Xzc_.js → SettlementTransactions-kaD_BDBE.js} +4 -4
  19. package/dist/{Status.vue_vue_type_script_setup_true_lang-COmSmTD-.js → Status.vue_vue_type_script_setup_true_lang-DcOt2SeU.js} +1 -1
  20. package/dist/{Terminal-Bi-pgpLy.js → Terminal-C5bZbtLm.js} +6 -6
  21. package/dist/{TerminalSetting-Bn7dMb8m.js → TerminalSetting-B81ova2B.js} +5 -5
  22. package/dist/{TextInputDialog.vue_vue_type_script_setup_true_lang-D8W8_SO2.js → TextInputDialog.vue_vue_type_script_setup_true_lang-BvGYVca0.js} +1 -1
  23. package/dist/{Transaction-C0tvyLUP.js → Transaction-9RnGbv_s.js} +9 -9
  24. package/dist/{Transaction-Dc3ppbQO.js → Transaction-DYAV_0Eo.js} +12 -12
  25. package/dist/{TransactionOld-0b8NDOAr.js → TransactionOld-cVtzUA4m.js} +9 -9
  26. package/dist/{app-DLOPYVQT.js → app-COmipvpd.js} +841 -813
  27. package/dist/app.js +1 -1
  28. package/dist/{assets-CHl9dRwW.js → assets-Cz4q39pl.js} +1 -1
  29. package/dist/{grafana-W-wciFnf.js → grafana-DPozfK2x.js} +1 -1
  30. package/dist/{index-BXl4SMxF.js → index-B0DzMdAx.js} +1 -1
  31. package/dist/{index-DGyTvHj8.js → index-BP3TUn8a.js} +1 -1
  32. package/dist/{index-oz80FaA5.js → index-Bd1QespN.js} +2 -2
  33. package/dist/{index-Dic547vC.js → index-BzyAnnC6.js} +1 -1
  34. package/dist/{index-Bz9betjL.js → index-CFPa37b9.js} +1 -1
  35. package/dist/{index-BUvHMo4V.js → index-CH3OMdWw.js} +1 -1
  36. package/dist/{index-C_13hvar.js → index-DT7xGHxI.js} +1 -1
  37. package/dist/{index-c2WIf6FM.js → index-DZkJCRc2.js} +1 -1
  38. package/dist/{index-7WseRv3u.js → index-xAxcFMD3.js} +1 -1
  39. package/dist/{index.vue_vue_type_script_setup_true_lang-Cj6xgRBA.js → index.vue_vue_type_script_setup_true_lang-zcEAdlF2.js} +1 -1
  40. package/dist/package.json +2 -2
  41. package/dist/{payout-account-CygV7FSk.js → payout-account-Bf74kiQM.js} +3 -3
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/{validator-DzjyJnvv.js → validator-CTlVogBQ.js} +1 -0
  44. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +9 -0
  45. package/dist/views/admin/payout-account/tabs/SettlementEditDialog.vue.d.ts +56 -0
  46. package/package.json +2 -2
  47. package/dist/PayoutAccountSetting-DFOPZ5Lh.js +0 -1502
@@ -1,1502 +0,0 @@
1
- import { defineComponent as k, resolveComponent as p, openBlock as g, createElementBlock as N, Fragment as E, createElementVNode as r, createVNode as a, withCtx as F, createTextVNode as T, toDisplayString as I, unref as u, ref as U, watch as Z, createBlock as V, computed as O, isRef as j, createCommentVNode as D, h as B, onMounted as ne, resolveDynamicComponent as J, normalizeProps as Q, mergeProps as W } from "vue";
2
- import { p as $ } from "./index-c2WIf6FM.js";
3
- import { u as Y, e as S } from "./index-DGyTvHj8.js";
4
- import { _ as oe } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
5
- import { useRouter as ue } from "vue-router";
6
- import { u as z } from "./index-Dic547vC.js";
7
- import { _ as L } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-0t7PrKly.js";
8
- import { h as se } from "./moment-h96o7c8I.js";
9
- import { P as te } from "./PDFViewer-CIPPbzWD.js";
10
- import { useSnackbar as H, useDialog as re, components as ie } from "@feedmepos/ui-library";
11
- import { u as q } from "./error-K1CakhA9.js";
12
- import { _ as ce } from "./TextInputDialog.vue_vue_type_script_setup_true_lang-D8W8_SO2.js";
13
- import { z as w, a as A } from "./validator-DzjyJnvv.js";
14
- import { useCoreStore as ae } from "@feedmepos/mf-common";
15
- const me = { class: "flex gap-16 mb-6" }, de = { class: "flex gap-16 mb-6" }, pe = /* @__PURE__ */ k({
16
- __name: "Information",
17
- props: {
18
- payoutAccount: {
19
- type: Object,
20
- required: !0
21
- }
22
- },
23
- setup(n) {
24
- return (f, e) => {
25
- var s, v;
26
- const d = p("FmCardHeader"), o = p("FmCardSection"), t = p("FmCard");
27
- return g(), N(E, null, [
28
- r("div", me, [
29
- a(t, {
30
- horizontal: "",
31
- class: "flex-1 p-6",
32
- variant: "elevated"
33
- }, {
34
- default: F(() => [
35
- a(o, { class: "flex flex-col gap-16 justify-between" }, {
36
- default: F(() => [
37
- a(d, {
38
- class: "p-0",
39
- title: "Account Info",
40
- subtitle: ""
41
- }),
42
- a(o, { class: "p-0" }, {
43
- default: F(() => {
44
- var i, l, y, m, c;
45
- return [
46
- e[0] || (e[0] = r("b", null, "For", -1)),
47
- T(": " + I((l = (i = n.payoutAccount) == null ? void 0 : i.store) == null ? void 0 : l.event) + " ", 1),
48
- e[1] || (e[1] = r("br", null, null, -1)),
49
- e[2] || (e[2] = r("b", null, "Reference", -1)),
50
- T(": " + I((m = (y = n.payoutAccount) == null ? void 0 : y.store) == null ? void 0 : m.id), 1),
51
- e[3] || (e[3] = r("br", null, null, -1)),
52
- e[4] || (e[4] = r("b", null, "Business", -1)),
53
- T(": " + I((c = n.payoutAccount) == null ? void 0 : c.businessId), 1),
54
- e[5] || (e[5] = r("br", null, null, -1))
55
- ];
56
- }),
57
- _: 1
58
- })
59
- ]),
60
- _: 1
61
- })
62
- ]),
63
- _: 1
64
- }),
65
- a(t, {
66
- horizontal: "",
67
- class: "flex-1 p-6",
68
- variant: "elevated"
69
- }, {
70
- default: F(() => [
71
- a(o, { class: "flex flex-col gap-16 justify-between" }, {
72
- default: F(() => [
73
- a(d, {
74
- class: "p-0",
75
- title: "Key Person",
76
- subtitle: ""
77
- }),
78
- a(o, { class: "p-0" }, {
79
- default: F(() => {
80
- var i, l, y, m, c, b, x, C;
81
- return [
82
- e[6] || (e[6] = r("b", null, "Email", -1)),
83
- T(": " + I((y = (l = (i = n.payoutAccount) == null ? void 0 : i.store) == null ? void 0 : l.keyPerson) == null ? void 0 : y.email) + " ", 1),
84
- e[7] || (e[7] = r("br", null, null, -1)),
85
- e[8] || (e[8] = r("b", null, "Name", -1)),
86
- T(": " + I((b = (c = (m = n.payoutAccount) == null ? void 0 : m.store) == null ? void 0 : c.keyPerson) == null ? void 0 : b.name), 1),
87
- e[9] || (e[9] = r("br", null, null, -1)),
88
- e[10] || (e[10] = r("b", null, "Phone", -1)),
89
- T(": " + I((C = (x = n.payoutAccount) == null ? void 0 : x.store.keyPerson) == null ? void 0 : C.phone), 1),
90
- e[11] || (e[11] = r("br", null, null, -1))
91
- ];
92
- }),
93
- _: 1
94
- })
95
- ]),
96
- _: 1
97
- })
98
- ]),
99
- _: 1
100
- })
101
- ]),
102
- r("div", de, [
103
- a(t, {
104
- horizontal: "",
105
- class: "flex-1 p-6",
106
- variant: "elevated"
107
- }, {
108
- default: F(() => [
109
- a(o, { class: "flex flex-col gap-16 justify-between" }, {
110
- default: F(() => [
111
- a(d, {
112
- class: "p-0",
113
- title: "Status Info",
114
- subtitle: ""
115
- }),
116
- a(o, { class: "p-0" }, {
117
- default: F(() => {
118
- var i, l, y;
119
- return [
120
- e[12] || (e[12] = r("b", null, "Submission Date", -1)),
121
- T(": " + I((i = n.payoutAccount) != null && i.submissionDate ? u(se)(n.payoutAccount.submissionDate).format(
122
- "YYYY-MM-DD HH:mm:ss"
123
- ) : "—"), 1),
124
- e[13] || (e[13] = r("br", null, null, -1)),
125
- e[14] || (e[14] = r("b", null, "Status By", -1)),
126
- T(": " + I(((l = n.payoutAccount) == null ? void 0 : l.statusBy) ?? "—"), 1),
127
- e[15] || (e[15] = r("br", null, null, -1)),
128
- e[16] || (e[16] = r("b", null, "Status Reason", -1)),
129
- T(": " + I(((y = n.payoutAccount) == null ? void 0 : y.statusReason) ?? "—"), 1),
130
- e[17] || (e[17] = r("br", null, null, -1))
131
- ];
132
- }),
133
- _: 1
134
- })
135
- ]),
136
- _: 1
137
- })
138
- ]),
139
- _: 1
140
- })
141
- ]),
142
- e[18] || (e[18] = r("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
143
- a(L, {
144
- document: n.payoutAccount.store.exteriorPhoto,
145
- "business-id": n.payoutAccount.businessId,
146
- "restaurant-id": ((v = (s = n.payoutAccount) == null ? void 0 : s.store) == null ? void 0 : v.event) === "ORDERING" ? n.payoutAccount.store.id : void 0
147
- }, null, 8, ["document", "business-id", "restaurant-id"])
148
- ], 64);
149
- };
150
- }
151
- }), ye = { class: "flex gap-16 mb-6" }, fe = { class: "flex gap-16" }, ve = { class: "flex-1" }, be = { class: "flex-1" }, ge = /* @__PURE__ */ k({
152
- __name: "Settlement",
153
- props: {
154
- payoutAccount: {
155
- type: Object,
156
- required: !0
157
- }
158
- },
159
- setup(n) {
160
- return (f, e) => {
161
- var s, v, i, l;
162
- const d = p("FmCardHeader"), o = p("FmCardSection"), t = p("FmCard");
163
- return g(), N(E, null, [
164
- r("div", ye, [
165
- a(t, {
166
- horizontal: "",
167
- class: "flex-1 p-6",
168
- variant: "elevated"
169
- }, {
170
- default: F(() => [
171
- a(o, { class: "flex flex-col gap-16 justify-between" }, {
172
- default: F(() => [
173
- a(d, {
174
- class: "p-0",
175
- title: "Company Info",
176
- subtitle: ""
177
- }),
178
- a(o, { class: "p-0" }, {
179
- default: F(() => {
180
- var y, m;
181
- return [
182
- e[0] || (e[0] = r("b", null, "Name", -1)),
183
- T(": " + I((y = n.payoutAccount) == null ? void 0 : y.store.companyName), 1),
184
- e[1] || (e[1] = r("br", null, null, -1)),
185
- e[2] || (e[2] = r("b", null, "Registration Number", -1)),
186
- T(": " + I((m = n.payoutAccount) == null ? void 0 : m.store.regNo), 1),
187
- e[3] || (e[3] = r("br", null, null, -1))
188
- ];
189
- }),
190
- _: 1
191
- })
192
- ]),
193
- _: 1
194
- })
195
- ]),
196
- _: 1
197
- }),
198
- a(t, {
199
- horizontal: "",
200
- class: "flex-1 p-6",
201
- variant: "elevated"
202
- }, {
203
- default: F(() => [
204
- a(o, { class: "flex flex-col gap-16 justify-between" }, {
205
- default: F(() => [
206
- a(d, {
207
- class: "p-0",
208
- title: "Bank Info",
209
- subtitle: ""
210
- }),
211
- a(o, { class: "p-0" }, {
212
- default: F(() => {
213
- var y, m, c, b, x, C;
214
- return [
215
- e[4] || (e[4] = r("b", null, "Bank", -1)),
216
- T(": " + I((m = (y = n.payoutAccount) == null ? void 0 : y.store.bank) == null ? void 0 : m.name), 1),
217
- e[5] || (e[5] = r("br", null, null, -1)),
218
- e[6] || (e[6] = r("b", null, "Name", -1)),
219
- T(": " + I((b = (c = n.payoutAccount) == null ? void 0 : c.store.bank) == null ? void 0 : b.holderName), 1),
220
- e[7] || (e[7] = r("br", null, null, -1)),
221
- e[8] || (e[8] = r("b", null, "Number", -1)),
222
- T(": " + I((C = (x = n.payoutAccount) == null ? void 0 : x.store.bank) == null ? void 0 : C.accountNumber), 1)
223
- ];
224
- }),
225
- _: 1
226
- })
227
- ]),
228
- _: 1
229
- })
230
- ]),
231
- _: 1
232
- })
233
- ]),
234
- r("div", fe, [
235
- r("div", ve, [
236
- e[9] || (e[9] = r("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
237
- a(L, {
238
- "business-id": n.payoutAccount.businessId,
239
- "restaurant-id": ((v = (s = n.payoutAccount) == null ? void 0 : s.store) == null ? void 0 : v.event) === "ORDERING" ? n.payoutAccount.store.id : void 0,
240
- document: n.payoutAccount.store.ssm
241
- }, {
242
- default: F(({ src: y }) => [
243
- a(te, {
244
- pdf: y,
245
- "disable-text-layer": !0,
246
- "disable-annotation-layer": !0
247
- }, null, 8, ["pdf"])
248
- ]),
249
- _: 1
250
- }, 8, ["business-id", "restaurant-id", "document"])
251
- ]),
252
- r("div", be, [
253
- e[10] || (e[10] = r("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
254
- a(L, {
255
- "business-id": n.payoutAccount.businessId,
256
- "restaurant-id": ((l = (i = n.payoutAccount) == null ? void 0 : i.store) == null ? void 0 : l.event) === "ORDERING" ? n.payoutAccount.store.id : void 0,
257
- document: n.payoutAccount.store.bankStatement
258
- }, {
259
- default: F(({ src: y }) => [
260
- a(te, {
261
- pdf: y,
262
- "disable-text-layer": !0,
263
- "disable-annotation-layer": !0
264
- }, null, 8, ["pdf"])
265
- ]),
266
- _: 1
267
- }, 8, ["business-id", "restaurant-id", "document"])
268
- ])
269
- ])
270
- ], 64);
271
- };
272
- }
273
- }), Fe = /* @__PURE__ */ k({
274
- __name: "RateInput",
275
- props: {
276
- data: {},
277
- onChange: { type: Function }
278
- },
279
- setup(n) {
280
- const f = n, e = U(f.data.toString());
281
- return Z(e, (d) => {
282
- f.onChange(parseFloat(d));
283
- }), (d, o) => {
284
- const t = p("FmTextField");
285
- return g(), V(t, {
286
- inputmode: "decimal",
287
- modelValue: e.value,
288
- "onUpdate:modelValue": o[0] || (o[0] = (s) => e.value = s)
289
- }, {
290
- append: F(() => [...o[1] || (o[1] = [
291
- T("%", -1)
292
- ])]),
293
- _: 1
294
- }, 8, ["modelValue"]);
295
- };
296
- }
297
- }), xe = /* @__PURE__ */ k({
298
- __name: "TPlusInput",
299
- props: {
300
- data: {},
301
- onChange: { type: Function }
302
- },
303
- setup(n) {
304
- const f = n, e = U(f.data.toString());
305
- return Z(e, (d) => {
306
- f.onChange(parseInt(d));
307
- }), (d, o) => {
308
- const t = p("FmTextField");
309
- return g(), V(t, {
310
- inputmode: "numeric",
311
- modelValue: e.value,
312
- "onUpdate:modelValue": o[0] || (o[0] = (s) => e.value = s)
313
- }, null, 8, ["modelValue"]);
314
- };
315
- }
316
- }), Ve = /* @__PURE__ */ k({
317
- __name: "MinimumFeeInput",
318
- props: {
319
- data: {},
320
- onChange: { type: Function }
321
- },
322
- setup(n) {
323
- const f = n, e = U(f.data.toString());
324
- return Z(e, (d) => {
325
- f.onChange(parseFloat(d));
326
- }), (d, o) => {
327
- const t = p("FmTextField");
328
- return g(), V(t, {
329
- inputmode: "numeric",
330
- modelValue: e.value,
331
- "onUpdate:modelValue": o[0] || (o[0] = (s) => e.value = s)
332
- }, {
333
- prepend: F(() => [...o[1] || (o[1] = [
334
- T("$", -1)
335
- ])]),
336
- _: 1
337
- }, 8, ["modelValue"]);
338
- };
339
- }
340
- }), we = { class: "flex gap-16 mt-6" }, Ae = { class: "flex-1" }, Ce = { class: "flex-1" }, ke = { class: "my-6 w-full flex justify-end" }, Te = { class: "w-[320px]" }, Ue = /* @__PURE__ */ k({
341
- __name: "PaymentStatus",
342
- props: {
343
- onUpdate: {
344
- type: Function,
345
- required: !0
346
- },
347
- payoutAccount: {
348
- type: Object,
349
- required: !0
350
- }
351
- },
352
- setup(n) {
353
- const f = n, e = U(!1), d = H(), o = re(), t = async (m) => {
354
- try {
355
- e.value = !0, await f.onUpdate(m), d.open({
356
- type: "success",
357
- title: "Payout account update succesfully"
358
- });
359
- } catch (c) {
360
- d.open({
361
- type: "error",
362
- title: "Error occurs when updating payout account",
363
- message: q(c)
364
- });
365
- } finally {
366
- e.value = !1;
367
- }
368
- }, s = async () => {
369
- o.close(), o.open({
370
- title: "Rejection Reason",
371
- closeButton: !0,
372
- overlay: !0,
373
- contentComponent: ce,
374
- contentComponentProps: {
375
- label: "Reason",
376
- placeholder: "Enter reason for rejection..."
377
- }
378
- }).onPrimary((m) => {
379
- f.payoutAccount.enable = !1, f.payoutAccount.status = "REJECTED", f.payoutAccount.statusReason = m, t(f.payoutAccount), o.close();
380
- });
381
- }, { search: v } = z({
382
- search: ""
383
- }), i = O(() => {
384
- const { ssm: m, bank: c, bankStatement: b } = f.payoutAccount.store;
385
- return m && c && c.name && c.accountNumber && c.holderName && b;
386
- }), l = U(""), y = [
387
- {
388
- header: () => "Payment Method",
389
- accessorKey: "issuer",
390
- cell: (m) => `${m.row.original.issuer} (${m.row.original.variant})`
391
- },
392
- {
393
- header: () => "Rate",
394
- accessorKey: "rate",
395
- cell: ({ row: m }) => {
396
- let c = 0;
397
- return m.original.rate && (c = m.original.rate.amount / Math.pow(10, m.original.rate.precision)), B(Fe, {
398
- data: c,
399
- onChange: (b) => {
400
- const x = f.payoutAccount.methods.at(m.index);
401
- x.rate || (x.rate = {
402
- amount: 0,
403
- precision: 4
404
- }), x.rate.amount = b * Math.pow(10, x.rate.precision);
405
- }
406
- });
407
- }
408
- },
409
- {
410
- header: () => "Minimum Fee",
411
- accessorKey: "minimumFee",
412
- cell: ({ row: m }) => {
413
- let c = 0;
414
- return m.original.minimumFee && (c = m.original.minimumFee.amount / Math.pow(10, m.original.minimumFee.precision)), B(Ve, {
415
- data: c,
416
- onChange: (b) => {
417
- const x = f.payoutAccount.methods.at(m.index);
418
- x.minimumFee || (x.minimumFee = {
419
- amount: 0,
420
- precision: 2
421
- }), x.minimumFee.amount = b * Math.pow(10, x.minimumFee.precision);
422
- }
423
- });
424
- }
425
- },
426
- {
427
- header: () => "T plus",
428
- accessorKey: "tPlus",
429
- cell: ({ row: m }) => B(xe, {
430
- data: m.original.tPlus ?? 0,
431
- onChange: (c) => {
432
- const b = f.payoutAccount.methods.at(m.index);
433
- b.tPlus = c;
434
- }
435
- })
436
- }
437
- ];
438
- return (m, c) => {
439
- const b = p("FmRadio"), x = p("FmRadioGroup"), C = p("FmSwitch"), _ = p("FmSearch"), P = p("FmTable"), R = p("FmButton");
440
- return g(), N(E, null, [
441
- r("div", we, [
442
- r("div", Ae, [
443
- a(x, {
444
- modelValue: n.payoutAccount.status,
445
- "onUpdate:modelValue": c[0] || (c[0] = (M) => n.payoutAccount.status = M),
446
- label: "Account Status"
447
- }, {
448
- default: F(() => [
449
- a(b, {
450
- value: "PENDING",
451
- label: "Pending"
452
- }),
453
- a(b, {
454
- value: "APPROVED",
455
- label: "Approved"
456
- }),
457
- a(b, {
458
- value: "REJECTED",
459
- label: "Rejected",
460
- onClick: s
461
- })
462
- ]),
463
- _: 1
464
- }, 8, ["modelValue"])
465
- ]),
466
- r("div", Ce, [
467
- a(C, {
468
- modelValue: n.payoutAccount.enable,
469
- "onUpdate:modelValue": c[1] || (c[1] = (M) => n.payoutAccount.enable = M),
470
- disabled: !i.value,
471
- label: "Enabled",
472
- sublabel: "Merchant can use online features such as e-payment, settlement"
473
- }, null, 8, ["modelValue", "disabled"])
474
- ])
475
- ]),
476
- n.payoutAccount.enable ? (g(), N(E, { key: 0 }, [
477
- r("div", ke, [
478
- r("div", Te, [
479
- a(_, {
480
- modelValue: u(v),
481
- "onUpdate:modelValue": c[2] || (c[2] = (M) => j(v) ? v.value = M : null),
482
- placeholder: "Search Method ..."
483
- }, null, 8, ["modelValue"])
484
- ])
485
- ]),
486
- a(P, {
487
- class: "mt-6",
488
- modelValue: l.value,
489
- "onUpdate:modelValue": c[3] || (c[3] = (M) => l.value = M),
490
- "shrink-at": !1,
491
- "search-value": u(v),
492
- "row-data": n.payoutAccount.methods,
493
- "column-defs": y
494
- }, null, 8, ["modelValue", "search-value", "row-data"])
495
- ], 64)) : D("", !0),
496
- a(R, {
497
- class: "w-full mt-6",
498
- variant: "primary",
499
- label: "Save",
500
- loading: e.value,
501
- onclick: () => t(n.payoutAccount)
502
- }, null, 8, ["loading", "onclick"])
503
- ], 64);
504
- };
505
- }
506
- }), Ie = { class: "flex" }, Se = /* @__PURE__ */ k({
507
- __name: "Actions",
508
- emits: ["edit", "delete"],
509
- setup(n, { emit: f }) {
510
- const e = f;
511
- return (d, o) => {
512
- const t = p("FmButton");
513
- return g(), N("div", Ie, [
514
- a(t, {
515
- variant: "plain",
516
- "prepend-icon": "delete",
517
- onClick: o[0] || (o[0] = (s) => {
518
- s.stopPropagation(), e("delete");
519
- })
520
- })
521
- ]);
522
- };
523
- }
524
- }), De = { class: "flex justify-end px-6 pb-6" }, _e = /* @__PURE__ */ k({
525
- __name: "PaymentChannel",
526
- props: {
527
- payoutAccount: {
528
- type: Object,
529
- required: !0
530
- }
531
- },
532
- setup(n) {
533
- const f = H(), e = n, { isLoading: d, startAsyncCall: o } = Y(), t = U([]);
534
- function s() {
535
- o(async () => {
536
- t.value = await $.getChannels(e.payoutAccount._id);
537
- });
538
- }
539
- ne(s);
540
- function v() {
541
- o(async () => {
542
- try {
543
- await $.updateChannels(e.payoutAccount._id, t.value), f.open({
544
- type: "success",
545
- title: "Payout account channels update succesfully"
546
- });
547
- } catch (y) {
548
- f.open({
549
- type: "error",
550
- title: "Error occurs when updating payout account channels",
551
- message: q(y)
552
- });
553
- }
554
- });
555
- }
556
- function i() {
557
- o(async () => {
558
- try {
559
- await $.resetChannels(e.payoutAccount._id), t.value = await $.getChannels(e.payoutAccount._id), f.open({
560
- type: "success",
561
- title: "Payout account channels reset succesfully"
562
- });
563
- } catch (y) {
564
- f.open({
565
- type: "error",
566
- title: "Error occurs when reset payout account channels",
567
- message: q(y)
568
- });
569
- }
570
- });
571
- }
572
- const l = [
573
- {
574
- header: () => "Gateway",
575
- accessorKey: "gateway"
576
- },
577
- {
578
- header: () => "Payment Type",
579
- accessorKey: "type"
580
- },
581
- {
582
- header: () => "Display",
583
- accessorKey: "icon",
584
- cell: ({ row: y }) => B("img", { src: y.original.icon, width: 32, height: 32 })
585
- },
586
- {
587
- header: () => "Label",
588
- accessorKey: "label",
589
- cell: ({ row: y }) => B(ie.FmTextField, {
590
- modelValue: y.original.label,
591
- "onUpdate:modelValue": (m) => y.original.label = m
592
- })
593
- },
594
- {
595
- id: "actions",
596
- header: () => "Actions",
597
- cell: ({ row: y }) => B(Se, {
598
- onDelete: () => t.value.splice(y.index, 1)
599
- })
600
- }
601
- ];
602
- return (y, m) => {
603
- const c = p("FmButton"), b = p("FmTable");
604
- return g(), N(E, null, [
605
- r("div", De, [
606
- a(c, {
607
- class: "mx-4",
608
- variant: "destructive",
609
- size: "md",
610
- icon: "history",
611
- label: "Reset",
612
- onClick: i
613
- }),
614
- a(c, {
615
- variant: "primary",
616
- size: "md",
617
- icon: "save",
618
- label: "Save",
619
- onClick: v
620
- })
621
- ]),
622
- a(b, {
623
- loading: u(d),
624
- "row-data": t.value,
625
- "column-defs": l,
626
- "shrink-at": !1
627
- }, null, 8, ["loading", "row-data"])
628
- ], 64);
629
- };
630
- }
631
- }), Pe = { class: "flex mt-6 space-x-6" }, Re = /* @__PURE__ */ k({
632
- __name: "FiuuGateway",
633
- props: {
634
- gateway: {
635
- type: Object,
636
- required: !0
637
- },
638
- onUpdate: {
639
- type: Function,
640
- required: !0
641
- },
642
- onDelete: {
643
- type: Function,
644
- required: !0
645
- }
646
- },
647
- setup(n) {
648
- var d;
649
- const e = U(((d = n.gateway) == null ? void 0 : d.config) || {
650
- merchantId: "",
651
- verifyKey: "",
652
- secretKey: ""
653
- });
654
- return (o, t) => {
655
- const s = p("FmTextField"), v = p("FmButton"), i = p("FmForm");
656
- return g(), V(i, {
657
- ref: "form",
658
- class: "flex flex-col gap-16",
659
- onValidationSuccess: t[3] || (t[3] = () => n.onUpdate(e.value))
660
- }, {
661
- default: F(() => [
662
- a(s, {
663
- modelValue: e.value.merchantId,
664
- "onUpdate:modelValue": t[0] || (t[0] = (l) => e.value.merchantId = l),
665
- label: "Merchant ID",
666
- rules: u(w)(u(A).string())
667
- }, null, 8, ["modelValue", "rules"]),
668
- a(s, {
669
- modelValue: e.value.verifyKey,
670
- "onUpdate:modelValue": t[1] || (t[1] = (l) => e.value.verifyKey = l),
671
- label: "Verify Key",
672
- rules: u(w)(u(A).string())
673
- }, null, 8, ["modelValue", "rules"]),
674
- a(s, {
675
- modelValue: e.value.secretKey,
676
- "onUpdate:modelValue": t[2] || (t[2] = (l) => e.value.secretKey = l),
677
- label: "Secret Key",
678
- rules: u(w)(u(A).string())
679
- }, null, 8, ["modelValue", "rules"]),
680
- r("div", Pe, [
681
- n.gateway ? (g(), V(v, {
682
- key: 0,
683
- class: "flex-1",
684
- variant: "secondary",
685
- label: "Delete",
686
- onclick: () => n.onDelete()
687
- }, null, 8, ["onclick"])) : D("", !0),
688
- a(v, {
689
- type: "submit",
690
- class: "flex-1",
691
- variant: "primary",
692
- label: "Save"
693
- })
694
- ])
695
- ]),
696
- _: 1
697
- }, 512);
698
- };
699
- }
700
- }), Ne = { class: "flex mt-6 space-x-6" }, Me = /* @__PURE__ */ k({
701
- __name: "MacauPassGateway",
702
- props: {
703
- gateway: {
704
- type: Object,
705
- required: !0
706
- },
707
- onUpdate: {
708
- type: Function,
709
- required: !0
710
- },
711
- onDelete: {
712
- type: Function,
713
- required: !0
714
- }
715
- },
716
- setup(n) {
717
- var d;
718
- const e = U(((d = n.gateway) == null ? void 0 : d.config) || {
719
- merchantId: "",
720
- merchantName: "",
721
- merchantCategoryCode: "",
722
- storeID: "",
723
- storeName: ""
724
- });
725
- return (o, t) => {
726
- const s = p("FmTextField"), v = p("FmButton"), i = p("FmForm");
727
- return g(), V(i, {
728
- ref: "form",
729
- class: "flex flex-col gap-16",
730
- onValidationSuccess: t[5] || (t[5] = () => n.onUpdate(e.value))
731
- }, {
732
- default: F(() => [
733
- a(s, {
734
- modelValue: e.value.merchantId,
735
- "onUpdate:modelValue": t[0] || (t[0] = (l) => e.value.merchantId = l),
736
- label: "Merchant ID",
737
- rules: u(w)(u(A).string())
738
- }, null, 8, ["modelValue", "rules"]),
739
- a(s, {
740
- modelValue: e.value.merchantName,
741
- "onUpdate:modelValue": t[1] || (t[1] = (l) => e.value.merchantName = l),
742
- label: "Merchant Name",
743
- rules: u(w)(u(A).string())
744
- }, null, 8, ["modelValue", "rules"]),
745
- a(s, {
746
- modelValue: e.value.merchantCategoryCode,
747
- "onUpdate:modelValue": t[2] || (t[2] = (l) => e.value.merchantCategoryCode = l),
748
- label: "Merchant MCC",
749
- rules: u(w)(u(A).string())
750
- }, null, 8, ["modelValue", "rules"]),
751
- a(s, {
752
- modelValue: e.value.storeID,
753
- "onUpdate:modelValue": t[3] || (t[3] = (l) => e.value.storeID = l),
754
- label: "Store ID",
755
- rules: u(w)(u(A).string())
756
- }, null, 8, ["modelValue", "rules"]),
757
- a(s, {
758
- modelValue: e.value.storeName,
759
- "onUpdate:modelValue": t[4] || (t[4] = (l) => e.value.storeName = l),
760
- label: "Store Name",
761
- rules: u(w)(u(A).string())
762
- }, null, 8, ["modelValue", "rules"]),
763
- r("div", Ne, [
764
- n.gateway ? (g(), V(v, {
765
- key: 0,
766
- class: "flex-1",
767
- variant: "secondary",
768
- label: "Delete",
769
- onclick: () => n.onDelete()
770
- }, null, 8, ["onclick"])) : D("", !0),
771
- a(v, {
772
- type: "submit",
773
- class: "flex-1",
774
- variant: "primary",
775
- label: "Save"
776
- })
777
- ])
778
- ]),
779
- _: 1
780
- }, 512);
781
- };
782
- }
783
- }), he = { class: "flex mt-6 space-x-6" }, $e = /* @__PURE__ */ k({
784
- __name: "DigioGateway",
785
- props: {
786
- gateway: {
787
- type: Object,
788
- required: !0
789
- },
790
- onUpdate: {
791
- type: Function,
792
- required: !0
793
- },
794
- onDelete: {
795
- type: Function,
796
- required: !0
797
- }
798
- },
799
- setup(n) {
800
- var d;
801
- const e = U(((d = n.gateway) == null ? void 0 : d.config) || {
802
- merchantId: "",
803
- cardMerchantId: ""
804
- });
805
- return (o, t) => {
806
- const s = p("FmTextField"), v = p("FmButton"), i = p("FmForm");
807
- return g(), V(i, {
808
- ref: "form",
809
- class: "flex flex-col gap-16",
810
- onValidationSuccess: t[2] || (t[2] = () => n.onUpdate(e.value))
811
- }, {
812
- default: F(() => [
813
- a(s, {
814
- modelValue: e.value.merchantId,
815
- "onUpdate:modelValue": t[0] || (t[0] = (l) => e.value.merchantId = l),
816
- label: "Merchant ID",
817
- rules: u(w)(u(A).string())
818
- }, null, 8, ["modelValue", "rules"]),
819
- a(s, {
820
- modelValue: e.value.cardMerchantId,
821
- "onUpdate:modelValue": t[1] || (t[1] = (l) => e.value.cardMerchantId = l),
822
- label: "Card Merchant ID",
823
- rules: u(w)(u(A).string())
824
- }, null, 8, ["modelValue", "rules"]),
825
- r("div", he, [
826
- n.gateway ? (g(), V(v, {
827
- key: 0,
828
- class: "flex-1",
829
- variant: "secondary",
830
- label: "Delete",
831
- onclick: () => n.onDelete()
832
- }, null, 8, ["onclick"])) : D("", !0),
833
- a(v, {
834
- type: "submit",
835
- class: "flex-1",
836
- variant: "primary",
837
- label: "Save"
838
- })
839
- ])
840
- ]),
841
- _: 1
842
- }, 512);
843
- };
844
- }
845
- }), Ge = { class: "flex mt-6 space-x-6" }, Ee = /* @__PURE__ */ k({
846
- __name: "AdyenGateway",
847
- props: {
848
- gateway: {
849
- type: Object,
850
- required: !0
851
- },
852
- onUpdate: {
853
- type: Function,
854
- required: !0
855
- },
856
- onDelete: {
857
- type: Function,
858
- required: !0
859
- }
860
- },
861
- setup(n) {
862
- var d;
863
- const e = U(((d = n.gateway) == null ? void 0 : d.config) || {
864
- merchantAccount: "",
865
- username: "",
866
- apiKey: "",
867
- clientKey: "",
868
- endpoint: "",
869
- hmacKey: ""
870
- });
871
- return (o, t) => {
872
- const s = p("FmTextField"), v = p("FmButton"), i = p("FmForm");
873
- return g(), V(i, {
874
- ref: "form",
875
- class: "flex flex-col gap-16",
876
- onValidationSuccess: t[6] || (t[6] = () => n.onUpdate(e.value))
877
- }, {
878
- default: F(() => [
879
- a(s, {
880
- modelValue: e.value.endpoint,
881
- "onUpdate:modelValue": t[0] || (t[0] = (l) => e.value.endpoint = l),
882
- label: "Endpoint",
883
- rules: u(w)(u(A).string())
884
- }, null, 8, ["modelValue", "rules"]),
885
- a(s, {
886
- modelValue: e.value.merchantAccount,
887
- "onUpdate:modelValue": t[1] || (t[1] = (l) => e.value.merchantAccount = l),
888
- label: "Merchant Account",
889
- rules: u(w)(u(A).string())
890
- }, null, 8, ["modelValue", "rules"]),
891
- a(s, {
892
- modelValue: e.value.username,
893
- "onUpdate:modelValue": t[2] || (t[2] = (l) => e.value.username = l),
894
- label: "Username",
895
- rules: u(w)(u(A).string())
896
- }, null, 8, ["modelValue", "rules"]),
897
- a(s, {
898
- modelValue: e.value.apiKey,
899
- "onUpdate:modelValue": t[3] || (t[3] = (l) => e.value.apiKey = l),
900
- label: "API Key",
901
- rules: u(w)(u(A).string())
902
- }, null, 8, ["modelValue", "rules"]),
903
- a(s, {
904
- modelValue: e.value.clientKey,
905
- "onUpdate:modelValue": t[4] || (t[4] = (l) => e.value.clientKey = l),
906
- label: "Client Key",
907
- rules: u(w)(u(A).string())
908
- }, null, 8, ["modelValue", "rules"]),
909
- a(s, {
910
- modelValue: e.value.hmacKey,
911
- "onUpdate:modelValue": t[5] || (t[5] = (l) => e.value.hmacKey = l),
912
- label: "HMac Key"
913
- }, null, 8, ["modelValue"]),
914
- r("div", Ge, [
915
- n.gateway ? (g(), V(v, {
916
- key: 0,
917
- class: "flex-1",
918
- variant: "secondary",
919
- label: "Delete",
920
- onclick: () => n.onDelete()
921
- }, null, 8, ["onclick"])) : D("", !0),
922
- a(v, {
923
- type: "submit",
924
- class: "flex-1",
925
- variant: "primary",
926
- label: "Save"
927
- })
928
- ])
929
- ]),
930
- _: 1
931
- }, 512);
932
- };
933
- }
934
- }), Oe = { class: "flex mt-6 space-x-6" }, Be = /* @__PURE__ */ k({
935
- __name: "KsherGateway",
936
- props: {
937
- gateway: {
938
- type: Object,
939
- required: !0
940
- },
941
- onUpdate: {
942
- type: Function,
943
- required: !0
944
- },
945
- onDelete: {
946
- type: Function,
947
- required: !0
948
- }
949
- },
950
- setup(n) {
951
- var d;
952
- const e = U(((d = n.gateway) == null ? void 0 : d.config) || {
953
- appId: "",
954
- privateKey: ""
955
- });
956
- return (o, t) => {
957
- const s = p("FmTextField"), v = p("FmTextarea"), i = p("FmButton"), l = p("FmForm");
958
- return g(), V(l, {
959
- ref: "form",
960
- class: "flex flex-col gap-16",
961
- onValidationSuccess: t[2] || (t[2] = () => n.onUpdate(e.value))
962
- }, {
963
- default: F(() => [
964
- a(s, {
965
- modelValue: e.value.appId,
966
- "onUpdate:modelValue": t[0] || (t[0] = (y) => e.value.appId = y),
967
- label: "App ID",
968
- rules: u(w)(u(A).string())
969
- }, null, 8, ["modelValue", "rules"]),
970
- a(v, {
971
- modelValue: e.value.privateKey,
972
- "onUpdate:modelValue": t[1] || (t[1] = (y) => e.value.privateKey = y),
973
- label: "Private Key",
974
- placeholder: "Paste your private key including BEGIN and END markers",
975
- rules: u(w)(u(A).string())
976
- }, null, 8, ["modelValue", "rules"]),
977
- r("div", Oe, [
978
- n.gateway ? (g(), V(i, {
979
- key: 0,
980
- class: "flex-1",
981
- variant: "secondary",
982
- label: "Delete",
983
- onclick: () => n.onDelete()
984
- }, null, 8, ["onclick"])) : D("", !0),
985
- a(i, {
986
- type: "submit",
987
- class: "flex-1",
988
- variant: "primary",
989
- label: "Save"
990
- })
991
- ])
992
- ]),
993
- _: 1
994
- }, 512);
995
- };
996
- }
997
- }), Ke = /* @__PURE__ */ k({
998
- __name: "TyroGateway",
999
- props: {
1000
- gateway: {
1001
- type: Object,
1002
- required: !0
1003
- },
1004
- onUpdate: {
1005
- type: Function,
1006
- required: !0
1007
- },
1008
- onDelete: {
1009
- type: Function,
1010
- required: !0
1011
- }
1012
- },
1013
- setup(n) {
1014
- var d;
1015
- const e = U(
1016
- ((d = n.gateway) == null ? void 0 : d.config) || {
1017
- locationId: ""
1018
- }
1019
- );
1020
- return (o, t) => {
1021
- const s = p("FmTextField"), v = p("FmForm");
1022
- return g(), V(v, {
1023
- ref: "form",
1024
- class: "flex flex-col gap-16",
1025
- onValidationSuccess: t[1] || (t[1] = () => n.onUpdate(e.value))
1026
- }, {
1027
- default: F(() => [
1028
- a(s, {
1029
- modelValue: e.value.locationId,
1030
- "onUpdate:modelValue": t[0] || (t[0] = (i) => e.value.locationId = i),
1031
- label: "Location ID",
1032
- readonly: !0,
1033
- rules: u(w)(u(A).string())
1034
- }, null, 8, ["modelValue", "rules"])
1035
- ]),
1036
- _: 1
1037
- }, 512);
1038
- };
1039
- }
1040
- }), qe = {
1041
- key: 0,
1042
- className: "mt-1 my-6 text-gray-600"
1043
- }, je = {
1044
- key: 1,
1045
- class: "flex items-center justify-center min-h-[80vh]"
1046
- }, Ye = /* @__PURE__ */ k({
1047
- __name: "PaymentGateway",
1048
- props: {
1049
- payoutAccount: {
1050
- type: Object,
1051
- required: !0
1052
- }
1053
- },
1054
- setup(n) {
1055
- const f = ae().currentCountry, e = f.value, d = H(), { isLoading: o, startAsyncCall: t } = Y(), { gatewayTab: s } = z({
1056
- gatewayTab: ""
1057
- }), v = n, i = [
1058
- {
1059
- label: "Fiuu",
1060
- value: "RAZER_MERCHANT_SERVICE",
1061
- render: Re,
1062
- region: [S.F_COUNTRY.enum.MY, S.F_COUNTRY.enum.SG]
1063
- },
1064
- {
1065
- label: "Macau Pass",
1066
- value: "MACAU_PASS",
1067
- render: Me,
1068
- region: [S.F_COUNTRY.enum.MO]
1069
- },
1070
- {
1071
- label: "Digio",
1072
- value: "DIGIO",
1073
- render: $e,
1074
- region: [S.F_COUNTRY.enum.TH]
1075
- },
1076
- {
1077
- label: "Ksher",
1078
- value: "KSHER",
1079
- render: Be,
1080
- region: [S.F_COUNTRY.enum.TH]
1081
- },
1082
- {
1083
- label: "Adyen",
1084
- value: "ADYEN",
1085
- render: Ee,
1086
- region: [S.F_COUNTRY.enum.MY, S.F_COUNTRY.enum.SG]
1087
- },
1088
- {
1089
- label: "Tyro",
1090
- value: "TYRO",
1091
- render: Ke,
1092
- region: [S.F_COUNTRY.enum.AU]
1093
- }
1094
- ], l = U(
1095
- v.payoutAccount.gateways ?? []
1096
- ), y = O(() => i.find((C) => C.value === s.value)), m = O(() => i.filter(
1097
- (C) => C.region.includes(f.value ?? S.F_COUNTRY.enum.MY)
1098
- ));
1099
- async function c(C) {
1100
- await t(async () => {
1101
- try {
1102
- await $.updateGateway(v.payoutAccount._id, C), d.open({
1103
- type: "success",
1104
- title: "Payout account gateways update succesfully"
1105
- }), b.value = C.length === 0;
1106
- } catch (_) {
1107
- d.open({
1108
- type: "error",
1109
- title: "Error occurs when updating payout account gateways",
1110
- message: q(_)
1111
- });
1112
- }
1113
- });
1114
- }
1115
- const b = U((v.payoutAccount.gateways ?? []).length === 0), x = O(() => e !== "MY" || !b.value);
1116
- return (C, _) => {
1117
- var K;
1118
- const P = p("FmCircularProgress"), R = p("FmSwitch"), M = p("FmTabs");
1119
- return g(), N(E, null, [
1120
- u(e) ? (g(), N("p", qe, [..._[2] || (_[2] = [
1121
- r("b", null, "Note: ", -1),
1122
- T(" There's no setup required for Malaysia Payment Gateway, once Payout Account is ready you will able to configure the payment channels. ", -1)
1123
- ])])) : D("", !0),
1124
- u(o) ? (g(), N("div", je, [
1125
- a(P, { size: "xxl" })
1126
- ])) : (g(), N(E, { key: 2 }, [
1127
- u(e) === "MY" ? (g(), V(R, {
1128
- key: 0,
1129
- modelValue: b.value,
1130
- "onUpdate:modelValue": _[0] || (_[0] = (h) => b.value = h),
1131
- style: { "padding-bottom": "12px" },
1132
- label: "Use FeedMe's Fiuu Account?"
1133
- }, null, 8, ["modelValue"])) : D("", !0),
1134
- x.value ? (g(), V(M, {
1135
- key: 1,
1136
- "model-value": u(s),
1137
- "onUpdate:modelValue": _[1] || (_[1] = (h) => j(s) ? s.value = h : null),
1138
- class: "mb-6",
1139
- items: m.value
1140
- }, null, 8, ["model-value", "items"])) : D("", !0),
1141
- x.value && u(s) ? (g(), V(J((K = y.value) == null ? void 0 : K.render), Q(W({ key: 2 }, {
1142
- gateway: l.value.find(
1143
- (h) => {
1144
- var G;
1145
- return h.paymentGateway === ((G = y.value) == null ? void 0 : G.value);
1146
- }
1147
- ),
1148
- onDelete: async () => {
1149
- l.value = l.value.filter(
1150
- (h) => {
1151
- var G;
1152
- return h.paymentGateway !== ((G = y.value) == null ? void 0 : G.value);
1153
- }
1154
- ), c(l.value);
1155
- },
1156
- onUpdate: (h) => {
1157
- var X;
1158
- let G = l.value.find(
1159
- (le) => {
1160
- var ee;
1161
- return le.paymentGateway === ((ee = y.value) == null ? void 0 : ee.value);
1162
- }
1163
- );
1164
- G ? G.config = h : l.value.push({
1165
- paymentGateway: (X = y.value) == null ? void 0 : X.value,
1166
- config: h
1167
- }), c(l.value);
1168
- }
1169
- })), null, 16)) : D("", !0)
1170
- ], 64))
1171
- ], 64);
1172
- };
1173
- }
1174
- }), ze = { class: "flex mt-6 space-x-6" }, He = /* @__PURE__ */ k({
1175
- __name: "GooglePayToken",
1176
- props: {
1177
- gateway: {
1178
- type: Object,
1179
- required: !0
1180
- },
1181
- onUpdate: {
1182
- type: Function,
1183
- required: !0
1184
- },
1185
- onDelete: {
1186
- type: Function,
1187
- required: !0
1188
- }
1189
- },
1190
- setup(n) {
1191
- const e = U(
1192
- n.gateway || {
1193
- type: "googlePay",
1194
- gateway: "RAZER_MERCHANT_SERVICE",
1195
- config: {
1196
- gateway: "molpay",
1197
- gatewayMerchantId: "molpay"
1198
- }
1199
- }
1200
- );
1201
- return (d, o) => {
1202
- const t = p("FmTextField"), s = p("FmButton"), v = p("FmForm");
1203
- return g(), V(v, {
1204
- ref: "form",
1205
- class: "flex flex-col gap-16",
1206
- onValidationSuccess: o[3] || (o[3] = () => n.onUpdate(e.value))
1207
- }, {
1208
- default: F(() => [
1209
- a(t, {
1210
- modelValue: e.value.gateway,
1211
- "onUpdate:modelValue": o[0] || (o[0] = (i) => e.value.gateway = i),
1212
- label: "Gateway",
1213
- disabled: !0,
1214
- rules: u(w)(u(A).string())
1215
- }, null, 8, ["modelValue", "rules"]),
1216
- a(t, {
1217
- modelValue: e.value.config.gateway,
1218
- "onUpdate:modelValue": o[1] || (o[1] = (i) => e.value.config.gateway = i),
1219
- label: "Gateway ID",
1220
- disabled: !0,
1221
- rules: u(w)(u(A).string())
1222
- }, null, 8, ["modelValue", "rules"]),
1223
- a(t, {
1224
- modelValue: e.value.config.gatewayMerchantId,
1225
- "onUpdate:modelValue": o[2] || (o[2] = (i) => e.value.config.gatewayMerchantId = i),
1226
- label: "Gateway Merchant ID",
1227
- disabled: !0,
1228
- rules: u(w)(u(A).string())
1229
- }, null, 8, ["modelValue", "rules"]),
1230
- r("div", ze, [
1231
- n.gateway ? (g(), V(s, {
1232
- key: 0,
1233
- class: "flex-1",
1234
- variant: "secondary",
1235
- label: "Delete",
1236
- onclick: () => n.onDelete()
1237
- }, null, 8, ["onclick"])) : D("", !0),
1238
- a(s, {
1239
- type: "submit",
1240
- class: "flex-1",
1241
- variant: "primary",
1242
- label: "Save"
1243
- })
1244
- ])
1245
- ]),
1246
- _: 1
1247
- }, 512);
1248
- };
1249
- }
1250
- }), Le = { class: "flex mt-6 space-x-6" }, Ze = /* @__PURE__ */ k({
1251
- __name: "ApplePayToken",
1252
- props: {
1253
- gateway: {
1254
- type: Object,
1255
- required: !0
1256
- },
1257
- onUpdate: {
1258
- type: Function,
1259
- required: !0
1260
- },
1261
- onDelete: {
1262
- type: Function,
1263
- required: !0
1264
- }
1265
- },
1266
- setup(n) {
1267
- const e = U(
1268
- n.gateway || {
1269
- type: "applePay",
1270
- gateway: "RAZER_MERCHANT_SERVICE",
1271
- config: {
1272
- merchantId: "FMfeedme"
1273
- }
1274
- }
1275
- );
1276
- return (d, o) => {
1277
- const t = p("FmTextField"), s = p("FmButton"), v = p("FmForm");
1278
- return g(), V(v, {
1279
- ref: "form",
1280
- class: "flex flex-col gap-16",
1281
- onValidationSuccess: o[2] || (o[2] = () => n.onUpdate(e.value))
1282
- }, {
1283
- default: F(() => [
1284
- a(t, {
1285
- modelValue: e.value.gateway,
1286
- "onUpdate:modelValue": o[0] || (o[0] = (i) => e.value.gateway = i),
1287
- label: "Gateway",
1288
- disabled: !0,
1289
- rules: u(w)(u(A).string())
1290
- }, null, 8, ["modelValue", "rules"]),
1291
- a(t, {
1292
- modelValue: e.value.config.merchantId,
1293
- "onUpdate:modelValue": o[1] || (o[1] = (i) => e.value.config.merchantId = i),
1294
- label: "Merchant ID",
1295
- disabled: !0,
1296
- rules: u(w)(u(A).string())
1297
- }, null, 8, ["modelValue", "rules"]),
1298
- r("div", Le, [
1299
- n.gateway ? (g(), V(s, {
1300
- key: 0,
1301
- class: "flex-1",
1302
- variant: "secondary",
1303
- label: "Delete",
1304
- onclick: () => n.onDelete()
1305
- }, null, 8, ["onclick"])) : D("", !0),
1306
- a(s, {
1307
- type: "submit",
1308
- class: "flex-1",
1309
- variant: "primary",
1310
- label: "Save"
1311
- })
1312
- ])
1313
- ]),
1314
- _: 1
1315
- }, 512);
1316
- };
1317
- }
1318
- }), Je = {
1319
- key: 0,
1320
- class: "flex items-center justify-center min-h-[80vh]"
1321
- }, Qe = /* @__PURE__ */ k({
1322
- __name: "TokenGateway",
1323
- props: {
1324
- payoutAccount: {
1325
- type: Object,
1326
- required: !0
1327
- }
1328
- },
1329
- setup(n) {
1330
- const f = ae().currentCountry, e = H(), { isLoading: d, startAsyncCall: o } = Y(), { tokenTab: t } = z({
1331
- tokenTab: ""
1332
- }), s = n, v = [
1333
- {
1334
- label: "Google Pay",
1335
- value: "googlePay",
1336
- icon: "android",
1337
- render: He,
1338
- region: [S.F_COUNTRY.enum.MY, S.F_COUNTRY.enum.SG]
1339
- },
1340
- {
1341
- label: "Apple Pay",
1342
- value: "applePay",
1343
- icon: "iOS",
1344
- render: Ze,
1345
- region: [S.F_COUNTRY.enum.MY, S.F_COUNTRY.enum.SG]
1346
- }
1347
- ], i = U(s.payoutAccount.tokens ?? []), l = O(() => v.find((c) => c.value === t.value)), y = O(() => v.filter(
1348
- (c) => c.region.includes(f.value ?? S.F_COUNTRY.enum.MY)
1349
- ));
1350
- async function m(c) {
1351
- await o(async () => {
1352
- try {
1353
- await $.updateTokens(s.payoutAccount._id, c), e.open({
1354
- type: "success",
1355
- title: "Payout account tokens gateway update succesfully"
1356
- });
1357
- } catch (b) {
1358
- e.open({
1359
- type: "error",
1360
- title: "Error occurs when updating payout account tokens",
1361
- message: q(b)
1362
- });
1363
- }
1364
- });
1365
- }
1366
- return (c, b) => {
1367
- var _;
1368
- const x = p("FmCircularProgress"), C = p("FmTabs");
1369
- return g(), N(E, null, [
1370
- b[1] || (b[1] = r("p", { className: "mt-1 my-6 text-gray-600" }, [
1371
- r("b", null, "Note: "),
1372
- T(" Token gateways appear above other online payment channels to comply with provider branding requirements. Configuration is standardized, so you generally only need to select the provider. "),
1373
- r("br"),
1374
- r("br"),
1375
- r("b", null, ` Token payments are automatically enabled for "Pay-First" merchants. You do not need to adjust settings here unless you're modifying for a non-Pay-First merchant who wishes to manually enable this feature. `),
1376
- r("br")
1377
- ], -1)),
1378
- u(d) ? (g(), N("div", Je, [
1379
- a(x, { size: "xxl" })
1380
- ])) : (g(), V(C, {
1381
- key: 1,
1382
- "model-value": u(t),
1383
- "onUpdate:modelValue": b[0] || (b[0] = (P) => j(t) ? t.value = P : null),
1384
- class: "mb-6 mt-6",
1385
- items: y.value
1386
- }, null, 8, ["model-value", "items"])),
1387
- u(t) ? (g(), V(J((_ = l.value) == null ? void 0 : _.render), Q(W({ key: 2 }, {
1388
- gateway: i.value.find((P) => {
1389
- var R;
1390
- return P.type === ((R = l.value) == null ? void 0 : R.value);
1391
- }),
1392
- onDelete: async () => {
1393
- i.value = i.value.filter((P) => {
1394
- var R;
1395
- return P.type !== ((R = l.value) == null ? void 0 : R.value);
1396
- }), m(i.value);
1397
- },
1398
- onUpdate: (P) => {
1399
- let R = i.value.find((M) => {
1400
- var K;
1401
- return M.type === ((K = l.value) == null ? void 0 : K.value);
1402
- });
1403
- R ? R.config = P : i.value.push(P), m(i.value);
1404
- }
1405
- })), null, 16)) : D("", !0)
1406
- ], 64);
1407
- };
1408
- }
1409
- }), dt = /* @__PURE__ */ k({
1410
- __name: "PayoutAccountSetting",
1411
- props: {
1412
- accountId: {
1413
- type: String,
1414
- required: !0
1415
- }
1416
- },
1417
- setup(n) {
1418
- const f = n, { tab: e } = z({
1419
- tab: "information"
1420
- }), { isLoading: d, startAsyncCall: o } = Y(!0), t = ue(), s = U();
1421
- async function v(m) {
1422
- await $.updateById(
1423
- f.accountId,
1424
- m
1425
- ), s.value = await $.readById(f.accountId);
1426
- }
1427
- const i = [
1428
- {
1429
- label: "Information",
1430
- value: "information",
1431
- icon: "overview",
1432
- render: pe
1433
- },
1434
- {
1435
- label: "Settlement",
1436
- value: "settlement",
1437
- icon: "payments",
1438
- render: ge
1439
- },
1440
- {
1441
- label: "MDR Status",
1442
- value: "payment",
1443
- icon: "account_box",
1444
- render: Ue
1445
- },
1446
- {
1447
- label: "Online Gateways",
1448
- icon: "assured_workload",
1449
- value: "gateways",
1450
- render: Ye
1451
- },
1452
- {
1453
- label: "Token Gateways",
1454
- value: "tokens",
1455
- icon: "wallet",
1456
- render: Qe
1457
- },
1458
- {
1459
- label: "Online Channels",
1460
- icon: "shopping_cart",
1461
- value: "channels",
1462
- render: _e
1463
- }
1464
- ];
1465
- function l() {
1466
- o(async () => {
1467
- s.value = await $.readById(f.accountId);
1468
- });
1469
- }
1470
- ne(l);
1471
- const y = O(() => {
1472
- const m = i.reduce((c, b) => c || (b.children ? b.children.find((x) => x.value === e.value) || null : b.value === e.value ? b : null), null);
1473
- return m == null ? void 0 : m.render;
1474
- });
1475
- return (m, c) => {
1476
- var x;
1477
- const b = p("FmTabs");
1478
- return g(), V(oe, {
1479
- title: `Payout Account (${(x = s.value) == null ? void 0 : x._id})`,
1480
- loading: u(d),
1481
- onBack: u(t).back
1482
- }, {
1483
- default: F(() => [
1484
- a(b, {
1485
- "model-value": u(e),
1486
- "onUpdate:modelValue": c[0] || (c[0] = (C) => j(e) ? e.value = C : null),
1487
- class: "mb-6",
1488
- items: i
1489
- }, null, 8, ["model-value"]),
1490
- u(e) ? (g(), V(J(y.value), Q(W({ key: 0 }, {
1491
- payoutAccount: s.value,
1492
- onUpdate: v
1493
- })), null, 16)) : D("", !0)
1494
- ]),
1495
- _: 1
1496
- }, 8, ["title", "loading", "onBack"]);
1497
- };
1498
- }
1499
- });
1500
- export {
1501
- dt as default
1502
- };