@feedmepos/mf-payment 1.2.1 → 1.2.2

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 (61) hide show
  1. package/dist/{PDFViewer-BQfgFexr.js → PDFViewer-xrBtzrlR.js} +1 -2
  2. package/dist/{PayoutAccount-D8R2kieb.js → PayoutAccount-C1eI-Tha.js} +6 -6
  3. package/dist/{PayoutAccount-CajKtGCP.js → PayoutAccount-QY9LkR0r.js} +7 -7
  4. package/dist/PayoutAccountSetting-Bt-BBfpF.js +970 -0
  5. package/dist/{Restaurant-Dbp_UTNd.js → Restaurant-DMEt0GSf.js} +4 -4
  6. package/dist/RestaurantSetting-Bjgjx7_c.js +487 -0
  7. package/dist/{Settlement-D47q_Wmh.js → Settlement-DHczxjKA.js} +3 -3
  8. package/dist/{Settlement-CIl7p5BM.js → Settlement-PYl2xRrw.js} +3 -3
  9. package/dist/{SettlementTransactions-BSN_bqJ2.js → SettlementTransactions-B6eUs4ay.js} +3 -3
  10. package/dist/{SettlementTransactions-VhSpt9Ya.js → SettlementTransactions-Bn2-iO30.js} +3 -3
  11. package/dist/{Terminal-DhDp8CZP.js → Terminal-q9AtQVTw.js} +36 -36
  12. package/dist/{TerminalSetting-Z4Yf71s4.js → TerminalSetting-DKvLKsrH.js} +218 -212
  13. package/dist/{Transaction-DfqdJTc4.js → Transaction-BSDhGkTu.js} +5 -5
  14. package/dist/{Transaction-DodA1Rsr.js → Transaction-DlkiWPJt.js} +7 -7
  15. package/dist/{TransactionOld-BVC2EZES.js → TransactionOld-B93Kp78J.js} +4 -4
  16. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-BSQyjy9r.js → TransactionTable.vue_vue_type_script_setup_true_lang-DEgiifDL.js} +3 -3
  17. package/dist/{app-DO-yUYMX.js → app-B1yXzXMJ.js} +361 -361
  18. package/dist/app.js +1 -1
  19. package/dist/{assets-Afjskent.js → assets-DbCf2oTj.js} +2 -2
  20. package/dist/{grafana-Bx1CNAeG.js → grafana-CxvNheOh.js} +1 -1
  21. package/dist/{index-eVDNyUp0.js → index-BoafQG_3.js} +1 -1
  22. package/dist/{index-DcA8mNkW.js → index-BwmZGhzh.js} +7830 -7804
  23. package/dist/{index-CWjhBRl-.js → index-C9YbV874.js} +1 -1
  24. package/dist/{index-DjMmMfFw.js → index-DJx90D2_.js} +1 -1
  25. package/dist/{index-9ImIPLpT.js → index-DQ6y1YEM.js} +1 -1
  26. package/dist/{index-BG-pqgpq.js → index-DoWYy-5F.js} +2 -2
  27. package/dist/{index-DJFB47Iu.js → index-DrVrxzsm.js} +1 -1
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-Pj1GGD11.js → index.vue_vue_type_script_setup_true_lang-BJAdIBCX.js} +1 -1
  29. package/dist/package.json +4 -4
  30. package/dist/{payout-account-1UTg_py3.js → payout-account-Cy0D7ycP.js} +3 -3
  31. package/dist/stores/payoutAccount.d.ts +62 -12
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +62 -12
  34. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +38 -20
  35. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +38 -20
  36. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +62 -12
  37. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +62 -12
  38. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +38 -20
  39. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +2 -2
  40. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +46 -1
  41. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  42. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +6 -6
  43. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +2 -2
  44. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +50 -0
  45. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +2 -2
  46. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +12 -12
  47. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +12 -12
  48. package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +14 -12
  49. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +12 -12
  50. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +12 -12
  51. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +12 -12
  52. package/dist/views/admin/terminal/tabs/SoftspaceGateway.vue.d.ts +12 -12
  53. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +12 -12
  54. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +12 -12
  55. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +124 -24
  56. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +36 -36
  57. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +18 -18
  58. package/dist/views/settlement/SettlementTable.vue.d.ts +12 -12
  59. package/package.json +4 -4
  60. package/dist/PayoutAccountSetting-DQqH71Pj.js +0 -890
  61. package/dist/RestaurantSetting-dem9GccJ.js +0 -412
@@ -1,890 +0,0 @@
1
- import { defineComponent as k, resolveComponent as p, openBlock as g, createElementBlock as A, Fragment as R, createElementVNode as c, createVNode as i, withCtx as x, createTextVNode as C, toDisplayString as T, createCommentVNode as U, createBlock as _, ref as V, watch as Q, computed as D, unref as y, isRef as O, h as N, onMounted as W, resolveDynamicComponent as z, normalizeProps as Y, mergeProps as L } from "vue";
2
- import { p as S } from "./index-BG-pqgpq.js";
3
- import { u as j, e as $ } from "./index-DcA8mNkW.js";
4
- import { _ as X } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
5
- import { useRouter as ee } from "vue-router";
6
- import { u as K } from "./index-9ImIPLpT.js";
7
- import { P as Z, _ as te } from "./PDFViewer-BQfgFexr.js";
8
- import { useSnackbar as q, components as ae } from "@feedmepos/ui-library";
9
- import { u as M } from "./error-K1CakhA9.js";
10
- import { z as I, a as G } from "./validator-D5jtpt9A.js";
11
- import { useCoreStore as J } from "@feedmepos/mf-common";
12
- const ne = { class: "flex gap-16 mb-6" }, oe = ["src"], le = /* @__PURE__ */ k({
13
- __name: "Information",
14
- props: {
15
- payoutAccount: {
16
- type: Object,
17
- required: !0
18
- }
19
- },
20
- setup(t) {
21
- return (d, e) => {
22
- const f = p("FmCardHeader"), l = p("FmCardSection"), n = p("FmCard");
23
- return g(), A(R, null, [
24
- c("div", ne, [
25
- i(n, {
26
- horizontal: "",
27
- class: "flex-1 p-6",
28
- variant: "elevated"
29
- }, {
30
- default: x(() => [
31
- i(l, { class: "flex flex-col gap-16 justify-between" }, {
32
- default: x(() => [
33
- i(f, {
34
- class: "p-0",
35
- title: "Account Info",
36
- subtitle: ""
37
- }),
38
- i(l, { class: "p-0" }, {
39
- default: x(() => {
40
- var s, v, u, o, a;
41
- return [
42
- e[0] || (e[0] = c("b", null, "For", -1)),
43
- C(": " + T((v = (s = t.payoutAccount) == null ? void 0 : s.store) == null ? void 0 : v.event) + " ", 1),
44
- e[1] || (e[1] = c("br", null, null, -1)),
45
- e[2] || (e[2] = c("b", null, "Reference", -1)),
46
- C(": " + T((o = (u = t.payoutAccount) == null ? void 0 : u.store) == null ? void 0 : o.id), 1),
47
- e[3] || (e[3] = c("br", null, null, -1)),
48
- e[4] || (e[4] = c("b", null, "Business", -1)),
49
- C(": " + T((a = t.payoutAccount) == null ? void 0 : a.businessId), 1),
50
- e[5] || (e[5] = c("br", null, null, -1))
51
- ];
52
- }),
53
- _: 1
54
- })
55
- ]),
56
- _: 1
57
- })
58
- ]),
59
- _: 1
60
- }),
61
- i(n, {
62
- horizontal: "",
63
- class: "flex-1 p-6",
64
- variant: "elevated"
65
- }, {
66
- default: x(() => [
67
- i(l, { class: "flex flex-col gap-16 justify-between" }, {
68
- default: x(() => [
69
- i(f, {
70
- class: "p-0",
71
- title: "Key Person",
72
- subtitle: ""
73
- }),
74
- i(l, { class: "p-0" }, {
75
- default: x(() => {
76
- var s, v, u, o, a, r, m, w;
77
- return [
78
- e[6] || (e[6] = c("b", null, "Email", -1)),
79
- C(": " + T((u = (v = (s = t.payoutAccount) == null ? void 0 : s.store) == null ? void 0 : v.keyPerson) == null ? void 0 : u.email) + " ", 1),
80
- e[7] || (e[7] = c("br", null, null, -1)),
81
- e[8] || (e[8] = c("b", null, "Name", -1)),
82
- C(": " + T((r = (a = (o = t.payoutAccount) == null ? void 0 : o.store) == null ? void 0 : a.keyPerson) == null ? void 0 : r.name), 1),
83
- e[9] || (e[9] = c("br", null, null, -1)),
84
- e[10] || (e[10] = c("b", null, "Phone", -1)),
85
- C(": " + T((w = (m = t.payoutAccount) == null ? void 0 : m.store.keyPerson) == null ? void 0 : w.phone), 1),
86
- e[11] || (e[11] = c("br", null, null, -1))
87
- ];
88
- }),
89
- _: 1
90
- })
91
- ]),
92
- _: 1
93
- })
94
- ]),
95
- _: 1
96
- })
97
- ]),
98
- e[12] || (e[12] = c("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
99
- t.payoutAccount.store.exteriorPhoto ? (g(), A("img", {
100
- key: 0,
101
- src: t.payoutAccount.store.exteriorPhoto
102
- }, null, 8, oe)) : U("", !0)
103
- ], 64);
104
- };
105
- }
106
- }), ue = { class: "flex gap-16" }, se = { class: "flex-1" }, re = { class: "flex-1" }, ce = /* @__PURE__ */ k({
107
- __name: "Settlement",
108
- props: {
109
- payoutAccount: {
110
- type: Object,
111
- required: !0
112
- }
113
- },
114
- setup(t) {
115
- return (d, e) => {
116
- const f = p("FmCardHeader"), l = p("FmCardSection"), n = p("FmCard");
117
- return g(), A(R, null, [
118
- i(n, {
119
- horizontal: "",
120
- class: "flex-1 p-6 mx-6 mb-6",
121
- variant: "elevated"
122
- }, {
123
- default: x(() => [
124
- i(l, { class: "flex flex-col gap-16 justify-between" }, {
125
- default: x(() => [
126
- i(f, {
127
- class: "p-0",
128
- title: "Bank Info",
129
- subtitle: ""
130
- }),
131
- i(l, { class: "p-0" }, {
132
- default: x(() => {
133
- var s, v, u, o, a, r;
134
- return [
135
- e[0] || (e[0] = c("b", null, "Bank", -1)),
136
- C(": " + T((v = (s = t.payoutAccount) == null ? void 0 : s.store.bank) == null ? void 0 : v.name), 1),
137
- e[1] || (e[1] = c("br", null, null, -1)),
138
- e[2] || (e[2] = c("b", null, "Name", -1)),
139
- C(": " + T((o = (u = t.payoutAccount) == null ? void 0 : u.store.bank) == null ? void 0 : o.holderName), 1),
140
- e[3] || (e[3] = c("br", null, null, -1)),
141
- e[4] || (e[4] = c("b", null, "Number", -1)),
142
- C(": " + T((r = (a = t.payoutAccount) == null ? void 0 : a.store.bank) == null ? void 0 : r.accountNumber), 1)
143
- ];
144
- }),
145
- _: 1
146
- })
147
- ]),
148
- _: 1
149
- })
150
- ]),
151
- _: 1
152
- }),
153
- c("div", ue, [
154
- c("div", se, [
155
- e[5] || (e[5] = c("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
156
- t.payoutAccount.store.ssm ? (g(), _(Z, {
157
- key: 0,
158
- pdf: t.payoutAccount.store.ssm,
159
- "disable-text-layer": !0,
160
- "disable-annotation-layer": !0
161
- }, null, 8, ["pdf"])) : U("", !0)
162
- ]),
163
- c("div", re, [
164
- e[6] || (e[6] = c("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
165
- t.payoutAccount.store.bankStatement ? (g(), _(Z, {
166
- key: 0,
167
- pdf: t.payoutAccount.store.bankStatement,
168
- "disable-text-layer": !0,
169
- "disable-annotation-layer": !0
170
- }, null, 8, ["pdf"])) : U("", !0)
171
- ])
172
- ])
173
- ], 64);
174
- };
175
- }
176
- }), ie = /* @__PURE__ */ k({
177
- __name: "RateInput",
178
- props: {
179
- data: {},
180
- onChange: { type: Function }
181
- },
182
- setup(t) {
183
- const d = t, e = V(d.data.toString());
184
- return Q(e, (f) => {
185
- d.onChange(parseFloat(f));
186
- }), (f, l) => {
187
- const n = p("FmTextField");
188
- return g(), _(n, {
189
- inputmode: "decimal",
190
- modelValue: e.value,
191
- "onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s)
192
- }, {
193
- append: x(() => l[1] || (l[1] = [
194
- C("%")
195
- ])),
196
- _: 1
197
- }, 8, ["modelValue"]);
198
- };
199
- }
200
- }), de = /* @__PURE__ */ k({
201
- __name: "TPlusInput",
202
- props: {
203
- data: {},
204
- onChange: { type: Function }
205
- },
206
- setup(t) {
207
- const d = t, e = V(d.data.toString());
208
- return Q(e, (f) => {
209
- d.onChange(parseInt(f));
210
- }), (f, l) => {
211
- const n = p("FmTextField");
212
- return g(), _(n, {
213
- inputmode: "numeric",
214
- modelValue: e.value,
215
- "onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s)
216
- }, null, 8, ["modelValue"]);
217
- };
218
- }
219
- }), me = { class: "flex gap-16 mt-6" }, ye = { class: "flex-1" }, pe = { class: "flex-1" }, fe = { class: "my-6 w-full flex justify-end" }, ve = { class: "w-[320px]" }, ge = /* @__PURE__ */ k({
220
- __name: "PaymentStatus",
221
- props: {
222
- onUpdate: {
223
- type: Function,
224
- required: !0
225
- },
226
- payoutAccount: {
227
- type: Object,
228
- required: !0
229
- }
230
- },
231
- setup(t) {
232
- const d = t, e = V(!1), f = q(), l = async (o) => {
233
- try {
234
- e.value = !0, await d.onUpdate(o), f.open({
235
- type: "success",
236
- title: "Payout account update succesfully"
237
- });
238
- } catch (a) {
239
- f.open({
240
- type: "error",
241
- title: "Error occurs when updating payout account",
242
- message: M(a)
243
- });
244
- } finally {
245
- e.value = !1;
246
- }
247
- }, { search: n } = K({
248
- search: ""
249
- }), s = D(() => {
250
- const { ssm: o, bank: a, bankStatement: r } = d.payoutAccount.store;
251
- return o && a && a.name && a.accountNumber && a.holderName && r;
252
- }), v = V(""), u = [
253
- {
254
- header: () => "Payment Method",
255
- accessorKey: "issuer",
256
- cell: (o) => `${o.row.original.issuer} (${o.row.original.variant})`
257
- },
258
- {
259
- header: () => "Rate",
260
- accessorKey: "rate",
261
- cell: ({ row: o }) => {
262
- let a = 0;
263
- return o.original.rate && (a = o.original.rate.amount / Math.pow(10, o.original.rate.precision)), N(ie, {
264
- data: a,
265
- onChange: (r) => {
266
- const m = d.payoutAccount.methods.at(o.index);
267
- m.rate || (m.rate = {
268
- amount: 0,
269
- precision: 4
270
- }), m.rate.amount = r * Math.pow(10, m.rate.precision);
271
- }
272
- });
273
- }
274
- },
275
- {
276
- header: () => "T plus",
277
- accessorKey: "tPlus",
278
- cell: ({ row: o }) => N(de, {
279
- data: o.original.tPlus ?? 0,
280
- onChange: (a) => {
281
- const r = d.payoutAccount.methods.at(o.index);
282
- r.tPlus = a;
283
- }
284
- })
285
- }
286
- ];
287
- return (o, a) => {
288
- const r = p("FmRadio"), m = p("FmRadioGroup"), w = p("FmSwitch"), P = p("FmSearch"), h = p("FmTable"), F = p("FmButton");
289
- return g(), A(R, null, [
290
- c("div", me, [
291
- c("div", ye, [
292
- i(m, {
293
- modelValue: t.payoutAccount.status,
294
- "onUpdate:modelValue": a[0] || (a[0] = (b) => t.payoutAccount.status = b),
295
- label: "Account Status"
296
- }, {
297
- default: x(() => [
298
- i(r, {
299
- value: "NEW",
300
- label: "New"
301
- }),
302
- i(r, {
303
- value: "PENDING",
304
- label: "Pending"
305
- }),
306
- i(r, {
307
- value: "APPROVED",
308
- label: "Approved"
309
- })
310
- ]),
311
- _: 1
312
- }, 8, ["modelValue"])
313
- ]),
314
- c("div", pe, [
315
- i(w, {
316
- modelValue: t.payoutAccount.enable,
317
- "onUpdate:modelValue": a[1] || (a[1] = (b) => t.payoutAccount.enable = b),
318
- disabled: !s.value,
319
- label: "Enabled",
320
- sublabel: "Merchant can use online features such as e-payment, settlement"
321
- }, null, 8, ["modelValue", "disabled"])
322
- ])
323
- ]),
324
- t.payoutAccount.enable ? (g(), A(R, { key: 0 }, [
325
- c("div", fe, [
326
- c("div", ve, [
327
- i(P, {
328
- modelValue: y(n),
329
- "onUpdate:modelValue": a[2] || (a[2] = (b) => O(n) ? n.value = b : null),
330
- placeholder: "Search Method ..."
331
- }, null, 8, ["modelValue"])
332
- ])
333
- ]),
334
- i(h, {
335
- class: "mt-6",
336
- modelValue: v.value,
337
- "onUpdate:modelValue": a[3] || (a[3] = (b) => v.value = b),
338
- "shrink-at": !1,
339
- "search-value": y(n),
340
- "row-data": t.payoutAccount.methods,
341
- "column-defs": u
342
- }, null, 8, ["modelValue", "search-value", "row-data"])
343
- ], 64)) : U("", !0),
344
- i(F, {
345
- class: "w-full mt-6",
346
- variant: "primary",
347
- label: "Save",
348
- loading: e.value,
349
- onclick: () => l(t.payoutAccount)
350
- }, null, 8, ["loading", "onclick"])
351
- ], 64);
352
- };
353
- }
354
- }), be = { class: "flex" }, Fe = /* @__PURE__ */ k({
355
- __name: "Actions",
356
- emits: ["edit", "delete"],
357
- setup(t, { emit: d }) {
358
- const e = d;
359
- return (f, l) => {
360
- const n = p("FmButton");
361
- return g(), A("div", be, [
362
- i(n, {
363
- variant: "plain",
364
- "prepend-icon": "delete",
365
- onClick: l[0] || (l[0] = (s) => {
366
- s.stopPropagation(), e("delete");
367
- })
368
- })
369
- ]);
370
- };
371
- }
372
- }), we = { class: "flex justify-end px-6 pb-6" }, xe = /* @__PURE__ */ k({
373
- __name: "PaymentChannel",
374
- props: {
375
- payoutAccount: {
376
- type: Object,
377
- required: !0
378
- }
379
- },
380
- setup(t) {
381
- const d = q(), e = t, { isLoading: f, startAsyncCall: l } = j(), n = V([]);
382
- function s() {
383
- l(async () => {
384
- n.value = await S.getChannels(e.payoutAccount._id);
385
- });
386
- }
387
- W(s);
388
- function v() {
389
- l(async () => {
390
- try {
391
- await S.updateChannels(e.payoutAccount._id, n.value), d.open({
392
- type: "success",
393
- title: "Payout account channels update succesfully"
394
- });
395
- } catch (a) {
396
- d.open({
397
- type: "error",
398
- title: "Error occurs when updating payout account channels",
399
- message: M(a)
400
- });
401
- }
402
- });
403
- }
404
- function u() {
405
- l(async () => {
406
- try {
407
- await S.resetChannels(e.payoutAccount._id), n.value = await S.getChannels(e.payoutAccount._id), d.open({
408
- type: "success",
409
- title: "Payout account channels reset succesfully"
410
- });
411
- } catch (a) {
412
- d.open({
413
- type: "error",
414
- title: "Error occurs when reset payout account channels",
415
- message: M(a)
416
- });
417
- }
418
- });
419
- }
420
- const o = [
421
- {
422
- header: () => "Gateway",
423
- accessorKey: "gateway"
424
- },
425
- {
426
- header: () => "Payment Type",
427
- accessorKey: "type"
428
- },
429
- {
430
- header: () => "Display",
431
- accessorKey: "icon",
432
- cell: ({ row: a }) => N("img", { src: a.original.icon, width: 32, height: 32 })
433
- },
434
- {
435
- header: () => "Label",
436
- accessorKey: "label",
437
- cell: ({ row: a }) => N(ae.FmTextField, {
438
- modelValue: a.original.label,
439
- "onUpdate:modelValue": (r) => a.original.label = r
440
- })
441
- },
442
- {
443
- id: "actions",
444
- header: () => "Actions",
445
- cell: ({ row: a }) => N(Fe, {
446
- onDelete: () => n.value.splice(a.index, 1)
447
- })
448
- }
449
- ];
450
- return (a, r) => {
451
- const m = p("FmButton"), w = p("FmTable");
452
- return g(), A(R, null, [
453
- c("div", we, [
454
- i(m, {
455
- class: "mx-4",
456
- variant: "destructive",
457
- size: "md",
458
- icon: "history",
459
- label: "Reset",
460
- onClick: u
461
- }),
462
- i(m, {
463
- variant: "primary",
464
- size: "md",
465
- icon: "save",
466
- label: "Save",
467
- onClick: v
468
- })
469
- ]),
470
- i(w, {
471
- loading: y(f),
472
- "row-data": n.value,
473
- "column-defs": o,
474
- "shrink-at": !1
475
- }, null, 8, ["loading", "row-data"])
476
- ], 64);
477
- };
478
- }
479
- }), _e = { class: "flex mt-6 space-x-6" }, Ae = /* @__PURE__ */ k({
480
- __name: "FiuuGateway",
481
- props: {
482
- gateway: {
483
- type: Object,
484
- required: !0
485
- },
486
- onUpdate: {
487
- type: Function,
488
- required: !0
489
- },
490
- onDelete: {
491
- type: Function,
492
- required: !0
493
- }
494
- },
495
- setup(t) {
496
- var f;
497
- const e = V(((f = t.gateway) == null ? void 0 : f.config) || {
498
- merchantId: "",
499
- verifyKey: "",
500
- secretKey: ""
501
- });
502
- return (l, n) => {
503
- const s = p("FmTextField"), v = p("FmButton"), u = p("FmForm");
504
- return g(), _(u, {
505
- ref: "form",
506
- class: "flex flex-col gap-16",
507
- onValidationSuccess: n[3] || (n[3] = () => t.onUpdate(e.value))
508
- }, {
509
- default: x(() => [
510
- i(s, {
511
- modelValue: e.value.merchantId,
512
- "onUpdate:modelValue": n[0] || (n[0] = (o) => e.value.merchantId = o),
513
- label: "Merchant ID",
514
- rules: y(I)(y(G).string())
515
- }, null, 8, ["modelValue", "rules"]),
516
- i(s, {
517
- modelValue: e.value.verifyKey,
518
- "onUpdate:modelValue": n[1] || (n[1] = (o) => e.value.verifyKey = o),
519
- label: "Verify Key",
520
- rules: y(I)(y(G).string())
521
- }, null, 8, ["modelValue", "rules"]),
522
- i(s, {
523
- modelValue: e.value.secretKey,
524
- "onUpdate:modelValue": n[2] || (n[2] = (o) => e.value.secretKey = o),
525
- label: "Secret Key",
526
- rules: y(I)(y(G).string())
527
- }, null, 8, ["modelValue", "rules"]),
528
- c("div", _e, [
529
- t.gateway ? (g(), _(v, {
530
- key: 0,
531
- class: "flex-1",
532
- variant: "secondary",
533
- label: "Delete",
534
- onclick: () => t.onDelete()
535
- }, null, 8, ["onclick"])) : U("", !0),
536
- i(v, {
537
- type: "submit",
538
- class: "flex-1",
539
- variant: "primary",
540
- label: "Save"
541
- })
542
- ])
543
- ]),
544
- _: 1
545
- }, 512);
546
- };
547
- }
548
- }), ke = {}, Ce = { class: "flex items-center justify-center h-screen" };
549
- function Pe(t, d) {
550
- return g(), A("div", Ce, d[0] || (d[0] = [
551
- c("h1", { class: "text-4xl font-bold text-gray-800" }, "Coming Soon", -1)
552
- ]));
553
- }
554
- const Ve = /* @__PURE__ */ te(ke, [["render", Pe]]), he = {
555
- key: 0,
556
- class: "flex items-center justify-center min-h-[80vh]"
557
- }, Te = /* @__PURE__ */ k({
558
- __name: "PaymentGateway",
559
- props: {
560
- payoutAccount: {
561
- type: Object,
562
- required: !0
563
- }
564
- },
565
- setup(t) {
566
- const d = J().currentCountry, e = q(), { isLoading: f, startAsyncCall: l } = j(), { gatewayTab: n } = K({
567
- gatewayTab: ""
568
- }), s = t, v = [
569
- {
570
- label: "Fiuu",
571
- value: "RAZER_MERCHANT_SERVICE",
572
- render: Ae,
573
- region: [$.F_COUNTRY.enum.SG]
574
- },
575
- {
576
- label: "Macau Pass",
577
- value: "MACAU_PASS",
578
- render: Ve,
579
- region: [$.F_COUNTRY.enum.MO]
580
- }
581
- ], u = V(s.payoutAccount.gateways ?? []), o = D(() => v.find((r) => r.value === n.value));
582
- async function a(r) {
583
- await l(async () => {
584
- try {
585
- await S.updateGateway(s.payoutAccount._id, r), e.open({
586
- type: "success",
587
- title: "Payout account gateways update succesfully"
588
- });
589
- } catch (m) {
590
- e.open({
591
- type: "error",
592
- title: "Error occurs when updating payout account gateways",
593
- message: M(m)
594
- });
595
- }
596
- });
597
- }
598
- return (r, m) => {
599
- var h;
600
- const w = p("FmCircularProgress"), P = p("FmTabs");
601
- return g(), A(R, null, [
602
- m[1] || (m[1] = c("p", { className: "mt-1 my-6 text-gray-600" }, [
603
- c("b", null, "Note: "),
604
- C(" There's no setup required for Malaysia Payment Gateway, once Payout Account is ready you will able to configure the payment channels. ")
605
- ], -1)),
606
- y(f) ? (g(), A("div", he, [
607
- i(w, { size: "xxl" })
608
- ])) : (g(), _(P, {
609
- key: 1,
610
- "model-value": y(n),
611
- "onUpdate:modelValue": m[0] || (m[0] = (F) => O(n) ? n.value = F : null),
612
- class: "mb-6",
613
- items: v.filter((F) => F.region.includes(y(d) ?? y($.F_COUNTRY).enum.MY))
614
- }, null, 8, ["model-value", "items"])),
615
- y(n) ? (g(), _(z((h = o.value) == null ? void 0 : h.render), Y(L({ key: 2 }, {
616
- gateway: u.value.find((F) => {
617
- var b;
618
- return F.paymentGateway === ((b = o.value) == null ? void 0 : b.value);
619
- }),
620
- onDelete: async () => {
621
- u.value = u.value.filter((F) => {
622
- var b;
623
- return F.paymentGateway !== ((b = o.value) == null ? void 0 : b.value);
624
- }), a(u.value);
625
- },
626
- onUpdate: (F) => {
627
- var B;
628
- let b = u.value.find((E) => {
629
- var H;
630
- return E.paymentGateway === ((H = o.value) == null ? void 0 : H.value);
631
- });
632
- b ? b.config = F : u.value.push({
633
- paymentGateway: (B = o.value) == null ? void 0 : B.value,
634
- config: F
635
- }), a(u.value);
636
- }
637
- })), null, 16)) : U("", !0)
638
- ], 64);
639
- };
640
- }
641
- }), Se = { class: "flex mt-6 space-x-6" }, Ue = /* @__PURE__ */ k({
642
- __name: "GooglePayToken",
643
- props: {
644
- gateway: {
645
- type: Object,
646
- required: !0
647
- },
648
- onUpdate: {
649
- type: Function,
650
- required: !0
651
- },
652
- onDelete: {
653
- type: Function,
654
- required: !0
655
- }
656
- },
657
- setup(t) {
658
- const e = V(t.gateway || {
659
- // hardcoded first since only 1 PSP supported
660
- type: "googlePay",
661
- gateway: "RAZER_MERCHANT_SERVICE",
662
- config: {
663
- paymentType: "googlePay",
664
- gateway: {
665
- gateway: "molpay",
666
- gatewayMerchantId: "molpay"
667
- }
668
- }
669
- });
670
- return (f, l) => {
671
- const n = p("FmTextField"), s = p("FmButton"), v = p("FmForm");
672
- return g(), _(v, {
673
- ref: "form",
674
- class: "flex flex-col gap-16",
675
- onValidationSuccess: l[3] || (l[3] = () => t.onUpdate(e.value))
676
- }, {
677
- default: x(() => [
678
- i(n, {
679
- modelValue: e.value.gateway,
680
- "onUpdate:modelValue": l[0] || (l[0] = (u) => e.value.gateway = u),
681
- label: "Gateway",
682
- disabled: !0,
683
- rules: y(I)(y(G).string())
684
- }, null, 8, ["modelValue", "rules"]),
685
- i(n, {
686
- modelValue: e.value.config.gateway.gateway,
687
- "onUpdate:modelValue": l[1] || (l[1] = (u) => e.value.config.gateway.gateway = u),
688
- label: "Gateway ID",
689
- disabled: !0,
690
- rules: y(I)(y(G).string())
691
- }, null, 8, ["modelValue", "rules"]),
692
- i(n, {
693
- modelValue: e.value.config.gateway.gatewayMerchantId,
694
- "onUpdate:modelValue": l[2] || (l[2] = (u) => e.value.config.gateway.gatewayMerchantId = u),
695
- label: "Gateway Merchant ID",
696
- disabled: !0,
697
- rules: y(I)(y(G).string())
698
- }, null, 8, ["modelValue", "rules"]),
699
- c("div", Se, [
700
- t.gateway ? (g(), _(s, {
701
- key: 0,
702
- class: "flex-1",
703
- variant: "secondary",
704
- label: "Delete",
705
- onclick: () => t.onDelete()
706
- }, null, 8, ["onclick"])) : U("", !0),
707
- i(s, {
708
- type: "submit",
709
- class: "flex-1",
710
- variant: "primary",
711
- label: "Save"
712
- })
713
- ])
714
- ]),
715
- _: 1
716
- }, 512);
717
- };
718
- }
719
- }), Re = {
720
- key: 0,
721
- class: "flex items-center justify-center min-h-[80vh]"
722
- }, $e = /* @__PURE__ */ k({
723
- __name: "TokenGateway",
724
- props: {
725
- payoutAccount: {
726
- type: Object,
727
- required: !0
728
- }
729
- },
730
- setup(t) {
731
- const d = J().currentCountry, e = q(), { isLoading: f, startAsyncCall: l } = j(), { tokenTab: n } = K({
732
- tokenTab: "googlePay"
733
- }), s = t, v = [
734
- {
735
- label: "Google Pay",
736
- value: "googlePay",
737
- icon: "android",
738
- render: Ue,
739
- region: [$.F_COUNTRY.enum.MY, $.F_COUNTRY.enum.SG]
740
- }
741
- ], u = V(s.payoutAccount.tokens ?? []), o = D(() => v.find((r) => r.value === n.value));
742
- async function a(r) {
743
- await l(async () => {
744
- try {
745
- await S.updateTokens(s.payoutAccount._id, r), e.open({
746
- type: "success",
747
- title: "Payout account tokens gateway update succesfully"
748
- });
749
- } catch (m) {
750
- e.open({
751
- type: "error",
752
- title: "Error occurs when updating payout account tokens",
753
- message: M(m)
754
- });
755
- }
756
- });
757
- }
758
- return (r, m) => {
759
- var h;
760
- const w = p("FmCircularProgress"), P = p("FmTabs");
761
- return g(), A(R, null, [
762
- y(f) ? (g(), A("div", Re, [
763
- i(w, { size: "xxl" })
764
- ])) : (g(), _(P, {
765
- key: 1,
766
- "model-value": y(n),
767
- "onUpdate:modelValue": m[0] || (m[0] = (F) => O(n) ? n.value = F : null),
768
- class: "mb-6",
769
- items: v.filter((F) => F.region.includes(y(d) ?? y($.F_COUNTRY).enum.MY))
770
- }, null, 8, ["model-value", "items"])),
771
- y(n) ? (g(), _(z((h = o.value) == null ? void 0 : h.render), Y(L({ key: 2 }, {
772
- gateway: u.value.find((F) => {
773
- var b;
774
- return F.type === ((b = o.value) == null ? void 0 : b.value);
775
- }),
776
- onDelete: async () => {
777
- u.value = u.value.filter((F) => {
778
- var b;
779
- return F.type !== ((b = o.value) == null ? void 0 : b.value);
780
- }), a(u.value);
781
- },
782
- onUpdate: (F) => {
783
- let b = u.value.find((B) => {
784
- var E;
785
- return B.type === ((E = o.value) == null ? void 0 : E.value);
786
- });
787
- b ? b.config = F : u.value.push(F), a(u.value);
788
- }
789
- })), null, 16)) : U("", !0)
790
- ], 64);
791
- };
792
- }
793
- }), ze = /* @__PURE__ */ k({
794
- __name: "PayoutAccountSetting",
795
- props: {
796
- accountId: {
797
- type: String,
798
- required: !0
799
- }
800
- },
801
- setup(t) {
802
- const d = t, { tab: e } = K({
803
- tab: "information"
804
- }), { isLoading: f, startAsyncCall: l } = j(!0), n = ee(), s = V();
805
- async function v(r) {
806
- await S.updateById(
807
- d.accountId,
808
- r
809
- ), s.value = await S.readById(d.accountId);
810
- }
811
- const u = [
812
- {
813
- label: "Information",
814
- value: "information",
815
- icon: "overview",
816
- render: le
817
- },
818
- {
819
- label: "Settlement",
820
- value: "settlement",
821
- icon: "payments",
822
- render: ce
823
- },
824
- {
825
- label: "MDR Status",
826
- value: "payment",
827
- icon: "account_box",
828
- render: ge
829
- },
830
- {
831
- label: "Online Payment",
832
- icon: "assured_workload",
833
- children: [
834
- {
835
- label: "Gateways",
836
- value: "gateways",
837
- render: Te
838
- },
839
- {
840
- label: "Channels",
841
- value: "channels",
842
- render: xe
843
- }
844
- ]
845
- },
846
- {
847
- label: "Token Gateways",
848
- value: "tokens",
849
- icon: "wallet",
850
- render: $e
851
- }
852
- ];
853
- function o() {
854
- l(async () => {
855
- s.value = await S.readById(d.accountId);
856
- });
857
- }
858
- W(o);
859
- const a = D(() => {
860
- const r = u.reduce((m, w) => m || (w.children ? w.children.find((P) => P.value === e.value) || null : w.value === e.value ? w : null), null);
861
- return r == null ? void 0 : r.render;
862
- });
863
- return (r, m) => {
864
- var P;
865
- const w = p("FmTabs");
866
- return g(), _(X, {
867
- title: `Payout Account (${(P = s.value) == null ? void 0 : P._id})`,
868
- loading: y(f),
869
- onBack: y(n).back
870
- }, {
871
- default: x(() => [
872
- i(w, {
873
- "model-value": y(e),
874
- "onUpdate:modelValue": m[0] || (m[0] = (h) => O(e) ? e.value = h : null),
875
- class: "mb-6",
876
- items: u
877
- }, null, 8, ["model-value"]),
878
- y(e) ? (g(), _(z(a.value), Y(L({ key: 0 }, {
879
- payoutAccount: s.value,
880
- onUpdate: v
881
- })), null, 16)) : U("", !0)
882
- ]),
883
- _: 1
884
- }, 8, ["title", "loading", "onBack"]);
885
- };
886
- }
887
- });
888
- export {
889
- ze as default
890
- };