@feedmepos/mf-payment 1.3.2 → 1.3.4

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 (70) hide show
  1. package/dist/{OnboardForm-BR1OjadM.js → OnboardForm-0gm_drkY.js} +4 -4
  2. package/dist/{OnboardForm-4zEyVLUv.js → OnboardForm-DiFkSYCY.js} +4 -4
  3. package/dist/{OnboardSubmission-CQlnohqQ.js → OnboardSubmission-D2RCkW7k.js} +5 -5
  4. package/dist/{OnboardSubmission-CsSrEezv.js → OnboardSubmission-DuoQ5dv7.js} +2 -2
  5. package/dist/{PayoutAccount-BLyqZUnt.js → PayoutAccount-D8Pfhz4C.js} +5 -5
  6. package/dist/{PayoutAccount-CbA1YDwd.js → PayoutAccount-Lym1Za-n.js} +5 -5
  7. package/dist/{PayoutAccountSetting-DfGw639O.js → PayoutAccountSetting-DcuumyW4.js} +3 -3
  8. package/dist/{Restaurant-BdDDrAsq.js → Restaurant-C8lLkTRk.js} +4 -4
  9. package/dist/RestaurantSetting-IW965gti.js +764 -0
  10. package/dist/{Settlement-Cfhafc8m.js → Settlement-BQPbR8m-.js} +3 -3
  11. package/dist/{Settlement-8RYgvfzf.js → Settlement-D18xsXRd.js} +3 -3
  12. package/dist/{SettlementTransactions-Bb54OlAj.js → SettlementTransactions-BQmJ_nZS.js} +3 -3
  13. package/dist/{SettlementTransactions-DrA8PAyd.js → SettlementTransactions-DhKWeuuo.js} +3 -3
  14. package/dist/{Status.vue_vue_type_script_setup_true_lang-BumKpo4s.js → Status.vue_vue_type_script_setup_true_lang-Cp3akQew.js} +1 -1
  15. package/dist/{Terminal-DoTJw-hl.js → Terminal-tg7f8Wue.js} +5 -5
  16. package/dist/TerminalSetting-B5VdUivg.js +1080 -0
  17. package/dist/{Transaction-C5DXkIjl.js → Transaction-CQF5lDAd.js} +5 -5
  18. package/dist/{Transaction-qKhaX4qv.js → Transaction-DFxizbZ7.js} +6 -6
  19. package/dist/{TransactionOld-DAoWcstb.js → TransactionOld-uFMnygUK.js} +4 -4
  20. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-C5cEFUs2.js → TransactionTable.vue_vue_type_script_setup_true_lang-CFr-DduC.js} +3 -3
  21. package/dist/api/payment-gateway/index.d.ts +1 -3
  22. package/dist/{app-D0KpHznD.js → app-DlajGnF4.js} +151 -151
  23. package/dist/app.js +1 -1
  24. package/dist/{assets-C_H0OeWB.js → assets-R7Pf2tcC.js} +1 -1
  25. package/dist/{grafana-BK_sYlee.js → grafana-DLVFFmRO.js} +1 -1
  26. package/dist/{index-jsEyizHG.js → index-BRcPRBkm.js} +1 -1
  27. package/dist/{index-D4_YGL4B.js → index-BUXnw6w4.js} +1 -1
  28. package/dist/{index-BjqwgRyA.js → index-C4T0m6DM.js} +1 -1
  29. package/dist/{index-CvXTRd5n.js → index-CTPvAooK.js} +2 -2
  30. package/dist/index-C_4l0JZj.js +58590 -0
  31. package/dist/{index-GsQWAnBk.js → index-Cpsfcvcu.js} +1 -1
  32. package/dist/{index-Dogc22BO.js → index-D7GUIvIW.js} +1 -1
  33. package/dist/{index.vue_vue_type_script_setup_true_lang-CIxp2j06.js → index.vue_vue_type_script_setup_true_lang-BIGL3hMd.js} +1 -1
  34. package/dist/package.json +2 -2
  35. package/dist/{payout-account-DU-Eid_y.js → payout-account-BN3SUWK6.js} +3 -3
  36. package/dist/{plugins-Dk-0C0b6.js → plugins-BJJ6gEom.js} +1 -1
  37. package/dist/stores/payoutAccount.d.ts +16 -16
  38. package/dist/tsconfig.app.tsbuildinfo +1 -1
  39. package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +24 -24
  40. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +16 -16
  41. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +20 -20
  42. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +20 -20
  43. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +16 -16
  44. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +16 -16
  45. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +20 -20
  46. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  47. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +92 -8
  48. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +174 -0
  49. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +92 -8
  50. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +174 -0
  51. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +92 -8
  52. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +92 -8
  53. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +174 -0
  54. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +174 -0
  55. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +174 -0
  56. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +174 -0
  57. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +174 -0
  58. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +174 -0
  59. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +174 -0
  60. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +92 -8
  61. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +32 -32
  62. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +4 -4
  63. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +2 -2
  64. package/package.json +2 -2
  65. package/dist/RestaurantSetting-C-16ifI3.js +0 -834
  66. package/dist/TerminalSetting-DpePQHKW.js +0 -572
  67. package/dist/index-eNSd1RuW.js +0 -57995
  68. package/dist/views/admin/restaurant/tabs/LocalIntegration.vue.d.ts +0 -803
  69. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +0 -90
  70. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +0 -92
@@ -1,834 +0,0 @@
1
- import { defineComponent as _, ref as b, resolveComponent as r, openBlock as g, createBlock as w, withCtx as C, createVNode as o, unref as n, createElementVNode as I, createCommentVNode as S, computed as R, onMounted as N, createElementBlock as $, Fragment as B, isRef as P, resolveDynamicComponent as K, normalizeProps as E, mergeProps as Y, renderList as z } from "vue";
2
- import { g as q, b as A, u as O, e as U, p as H } from "./index-eNSd1RuW.js";
3
- import { _ as h } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
4
- import { useRouter as Q } from "vue-router";
5
- import { u as L } from "./index-BjqwgRyA.js";
6
- import { z as f, a as F } from "./validator-D5jtpt9A.js";
7
- import { useCoreStore as j } from "@feedmepos/mf-common";
8
- import { u as Z } from "./error-K1CakhA9.js";
9
- import { useSnackbar as J } from "@feedmepos/ui-library";
10
- import { r as W } from "./index-D4_YGL4B.js";
11
- const D = {
12
- async get(a) {
13
- return q(
14
- await A().get(
15
- `restaurants/${a}/payment-gateway`
16
- )
17
- );
18
- },
19
- async upsert(a, s) {
20
- return q(
21
- await A().post(
22
- `restaurants/${a}/payment-gateway`,
23
- { data: s }
24
- )
25
- );
26
- },
27
- async delete(a, s) {
28
- return q(
29
- await A().delete(
30
- `restaurants/${a}/payment-gateway/${s}`
31
- )
32
- );
33
- },
34
- async grabSync(a) {
35
- return q(
36
- await A().post(
37
- `restaurants/${a}/payment-gateway/grab/sync`
38
- )
39
- );
40
- },
41
- async getIntegration(a) {
42
- return q(
43
- await A().get(
44
- `restaurants/${a}/payment-gateway/integration`
45
- )
46
- );
47
- },
48
- async upsertIntegration(a, s) {
49
- return q(
50
- await A().put(
51
- `restaurants/${a}/payment-gateway/integration`,
52
- s
53
- )
54
- );
55
- }
56
- }, X = { class: "flex mt-6 space-x-6" }, ee = /* @__PURE__ */ _({
57
- __name: "FiuuGateway",
58
- props: {
59
- onUpdate: {
60
- type: Function,
61
- required: !0
62
- },
63
- onDelete: {
64
- type: Function,
65
- required: !0
66
- },
67
- gateway: {
68
- type: Object,
69
- required: !0
70
- }
71
- },
72
- setup(a) {
73
- var p, y;
74
- const s = a, u = b(((p = s.gateway) == null ? void 0 : p.active) ?? !1), t = b(((y = s.gateway) == null ? void 0 : y.config) || {
75
- merchantId: "",
76
- uniqueId: "",
77
- verifyKey: "",
78
- secretKey: "",
79
- applicationCode: "",
80
- offlineSecret: ""
81
- });
82
- return (i, e) => {
83
- const m = r("FmTextField"), V = r("FmSwitch"), d = r("FmButton"), v = r("FmForm");
84
- return g(), w(v, {
85
- ref: "form",
86
- class: "flex flex-col gap-16",
87
- onValidationSuccess: e[7] || (e[7] = () => a.onUpdate(u.value, t.value))
88
- }, {
89
- default: C(() => [
90
- o(m, {
91
- modelValue: t.value.merchantId,
92
- "onUpdate:modelValue": e[0] || (e[0] = (l) => t.value.merchantId = l),
93
- label: "Merchant ID",
94
- rules: n(f)(n(F).string())
95
- }, null, 8, ["modelValue", "rules"]),
96
- o(m, {
97
- modelValue: t.value.uniqueId,
98
- "onUpdate:modelValue": e[1] || (e[1] = (l) => t.value.uniqueId = l),
99
- label: "Unique ID",
100
- rules: n(f)(n(F).string())
101
- }, null, 8, ["modelValue", "rules"]),
102
- o(m, {
103
- modelValue: t.value.verifyKey,
104
- "onUpdate:modelValue": e[2] || (e[2] = (l) => t.value.verifyKey = l),
105
- label: "Verify Key",
106
- rules: n(f)(n(F).string())
107
- }, null, 8, ["modelValue", "rules"]),
108
- o(m, {
109
- modelValue: t.value.secretKey,
110
- "onUpdate:modelValue": e[3] || (e[3] = (l) => t.value.secretKey = l),
111
- label: "Secret Key",
112
- rules: n(f)(n(F).string())
113
- }, null, 8, ["modelValue", "rules"]),
114
- o(m, {
115
- modelValue: t.value.applicationCode,
116
- "onUpdate:modelValue": e[4] || (e[4] = (l) => t.value.applicationCode = l),
117
- label: "Application Code ( Offline )",
118
- rules: n(f)(n(F).string())
119
- }, null, 8, ["modelValue", "rules"]),
120
- o(m, {
121
- modelValue: t.value.offlineSecret,
122
- "onUpdate:modelValue": e[5] || (e[5] = (l) => t.value.offlineSecret = l),
123
- label: "Offline Secret ( Offline )",
124
- rules: n(f)(n(F).string())
125
- }, null, 8, ["modelValue", "rules"]),
126
- o(V, {
127
- modelValue: u.value,
128
- "onUpdate:modelValue": e[6] || (e[6] = (l) => u.value = l),
129
- label: "Is Active"
130
- }, null, 8, ["modelValue"]),
131
- I("div", X, [
132
- a.gateway ? (g(), w(d, {
133
- key: 0,
134
- class: "flex-1",
135
- variant: "secondary",
136
- label: "Delete",
137
- onclick: () => a.onDelete(a.gateway)
138
- }, null, 8, ["onclick"])) : S("", !0),
139
- o(d, {
140
- type: "submit",
141
- class: "flex-1",
142
- variant: "primary",
143
- label: "Save"
144
- })
145
- ])
146
- ]),
147
- _: 1
148
- }, 512);
149
- };
150
- }
151
- }), te = { class: "flex mt-6 space-x-6" }, ae = /* @__PURE__ */ _({
152
- __name: "RevenueMonsterGateway",
153
- props: {
154
- onUpdate: {
155
- type: Function,
156
- required: !0
157
- },
158
- onDelete: {
159
- type: Function,
160
- required: !0
161
- },
162
- gateway: {
163
- type: Object,
164
- required: !0
165
- }
166
- },
167
- setup(a) {
168
- var p, y;
169
- const s = a, u = b(((p = s.gateway) == null ? void 0 : p.active) ?? !1), t = b(((y = s.gateway) == null ? void 0 : y.config) || {
170
- storeId: "",
171
- clientId: "",
172
- clientSecret: "",
173
- clientPrivateKey: ""
174
- });
175
- return (i, e) => {
176
- const m = r("FmTextField"), V = r("FmTextarea"), d = r("FmSwitch"), v = r("FmButton"), l = r("FmForm");
177
- return g(), w(l, {
178
- ref: "form",
179
- class: "flex flex-col gap-16",
180
- onValidationSuccess: e[5] || (e[5] = () => a.onUpdate(u.value, t.value))
181
- }, {
182
- default: C(() => [
183
- o(m, {
184
- modelValue: t.value.storeId,
185
- "onUpdate:modelValue": e[0] || (e[0] = (c) => t.value.storeId = c),
186
- label: "Store ID",
187
- rules: n(f)(n(F).string())
188
- }, null, 8, ["modelValue", "rules"]),
189
- o(m, {
190
- modelValue: t.value.clientId,
191
- "onUpdate:modelValue": e[1] || (e[1] = (c) => t.value.clientId = c),
192
- label: "Client ID",
193
- rules: n(f)(n(F).string())
194
- }, null, 8, ["modelValue", "rules"]),
195
- o(m, {
196
- modelValue: t.value.clientSecret,
197
- "onUpdate:modelValue": e[2] || (e[2] = (c) => t.value.clientSecret = c),
198
- label: "Client Secret",
199
- rules: n(f)(n(F).string())
200
- }, null, 8, ["modelValue", "rules"]),
201
- o(V, {
202
- modelValue: t.value.clientPrivateKey,
203
- "onUpdate:modelValue": e[3] || (e[3] = (c) => t.value.clientPrivateKey = c),
204
- label: "Client Private Key"
205
- }, null, 8, ["modelValue"]),
206
- o(d, {
207
- modelValue: u.value,
208
- "onUpdate:modelValue": e[4] || (e[4] = (c) => u.value = c),
209
- label: "Is Active"
210
- }, null, 8, ["modelValue"]),
211
- I("div", te, [
212
- a.gateway ? (g(), w(v, {
213
- key: 0,
214
- class: "flex-1",
215
- variant: "secondary",
216
- label: "Delete",
217
- onclick: () => a.onDelete(a.gateway)
218
- }, null, 8, ["onclick"])) : S("", !0),
219
- o(v, {
220
- type: "submit",
221
- class: "flex-1",
222
- variant: "primary",
223
- label: "Save"
224
- })
225
- ])
226
- ]),
227
- _: 1
228
- }, 512);
229
- };
230
- }
231
- }), le = { class: "flex mt-6 space-x-6" }, ne = /* @__PURE__ */ _({
232
- __name: "GhlGateway",
233
- props: {
234
- onUpdate: {
235
- type: Function,
236
- required: !0
237
- },
238
- onDelete: {
239
- type: Function,
240
- required: !0
241
- },
242
- gateway: {
243
- type: Object,
244
- required: !0
245
- }
246
- },
247
- setup(a) {
248
- var p, y;
249
- const s = a, u = b(((p = s.gateway) == null ? void 0 : p.active) ?? !1), t = b(((y = s.gateway) == null ? void 0 : y.config) || {
250
- merchantId: "",
251
- terminalId: "",
252
- privateKey: ""
253
- });
254
- return (i, e) => {
255
- const m = r("FmTextField"), V = r("FmTextarea"), d = r("FmSwitch"), v = r("FmButton"), l = r("FmForm");
256
- return g(), w(l, {
257
- ref: "form",
258
- class: "flex flex-col gap-16",
259
- onValidationSuccess: e[4] || (e[4] = () => a.onUpdate(u.value, t.value))
260
- }, {
261
- default: C(() => [
262
- o(m, {
263
- modelValue: t.value.merchantId,
264
- "onUpdate:modelValue": e[0] || (e[0] = (c) => t.value.merchantId = c),
265
- label: "Merchant ID",
266
- rules: n(f)(n(F).string())
267
- }, null, 8, ["modelValue", "rules"]),
268
- o(m, {
269
- modelValue: t.value.terminalId,
270
- "onUpdate:modelValue": e[1] || (e[1] = (c) => t.value.terminalId = c),
271
- label: "Terminal ID",
272
- rules: n(f)(n(F).string())
273
- }, null, 8, ["modelValue", "rules"]),
274
- o(V, {
275
- id: "ghl_pkey",
276
- modelValue: t.value.privateKey,
277
- "onUpdate:modelValue": e[2] || (e[2] = (c) => t.value.privateKey = c),
278
- label: "Private Key",
279
- rules: n(f)(n(F).string())
280
- }, null, 8, ["modelValue", "rules"]),
281
- o(d, {
282
- modelValue: u.value,
283
- "onUpdate:modelValue": e[3] || (e[3] = (c) => u.value = c),
284
- label: "Is Active"
285
- }, null, 8, ["modelValue"]),
286
- I("div", le, [
287
- a.gateway ? (g(), w(v, {
288
- key: 0,
289
- class: "flex-1",
290
- variant: "secondary",
291
- label: "Delete",
292
- onclick: () => a.onDelete(a.gateway)
293
- }, null, 8, ["onclick"])) : S("", !0),
294
- o(v, {
295
- type: "submit",
296
- class: "flex-1",
297
- variant: "primary",
298
- label: "Save"
299
- })
300
- ])
301
- ]),
302
- _: 1
303
- }, 512);
304
- };
305
- }
306
- }), oe = { class: "flex mt-6 space-x-6" }, ue = /* @__PURE__ */ _({
307
- __name: "MacauPassGateway",
308
- props: {
309
- onUpdate: {
310
- type: Function,
311
- required: !0
312
- },
313
- onDelete: {
314
- type: Function,
315
- required: !0
316
- },
317
- gateway: {
318
- type: Object,
319
- required: !0
320
- }
321
- },
322
- setup(a) {
323
- var p, y;
324
- const s = a, u = b(((p = s.gateway) == null ? void 0 : p.active) ?? !1), t = b(((y = s.gateway) == null ? void 0 : y.config) || {
325
- merchantId: "",
326
- merchantName: "",
327
- merchantCategoryCode: "",
328
- storeID: "",
329
- storeName: ""
330
- });
331
- return (i, e) => {
332
- const m = r("FmTextField"), V = r("FmSwitch"), d = r("FmButton"), v = r("FmForm");
333
- return g(), w(v, {
334
- ref: "form",
335
- class: "flex flex-col gap-16",
336
- onValidationSuccess: e[6] || (e[6] = () => a.onUpdate(u.value, t.value))
337
- }, {
338
- default: C(() => [
339
- o(m, {
340
- modelValue: t.value.merchantId,
341
- "onUpdate:modelValue": e[0] || (e[0] = (l) => t.value.merchantId = l),
342
- label: "Merchant ID",
343
- rules: n(f)(n(F).string())
344
- }, null, 8, ["modelValue", "rules"]),
345
- o(m, {
346
- modelValue: t.value.merchantName,
347
- "onUpdate:modelValue": e[1] || (e[1] = (l) => t.value.merchantName = l),
348
- label: "Merchant Name",
349
- rules: n(f)(n(F).string())
350
- }, null, 8, ["modelValue", "rules"]),
351
- o(m, {
352
- modelValue: t.value.merchantCategoryCode,
353
- "onUpdate:modelValue": e[2] || (e[2] = (l) => t.value.merchantCategoryCode = l),
354
- label: "Merchant MCC",
355
- rules: n(f)(n(F).string())
356
- }, null, 8, ["modelValue", "rules"]),
357
- o(m, {
358
- modelValue: t.value.storeID,
359
- "onUpdate:modelValue": e[3] || (e[3] = (l) => t.value.storeID = l),
360
- label: "Store ID",
361
- rules: n(f)(n(F).string())
362
- }, null, 8, ["modelValue", "rules"]),
363
- o(m, {
364
- modelValue: t.value.storeName,
365
- "onUpdate:modelValue": e[4] || (e[4] = (l) => t.value.storeName = l),
366
- label: "Store Name",
367
- rules: n(f)(n(F).string())
368
- }, null, 8, ["modelValue", "rules"]),
369
- o(V, {
370
- modelValue: u.value,
371
- "onUpdate:modelValue": e[5] || (e[5] = (l) => u.value = l),
372
- label: "Is Active"
373
- }, null, 8, ["modelValue"]),
374
- I("div", oe, [
375
- a.gateway ? (g(), w(d, {
376
- key: 0,
377
- class: "flex-1",
378
- variant: "secondary",
379
- label: "Delete",
380
- onclick: () => a.onDelete(a.gateway)
381
- }, null, 8, ["onclick"])) : S("", !0),
382
- o(d, {
383
- type: "submit",
384
- class: "flex-1",
385
- variant: "primary",
386
- label: "Save"
387
- })
388
- ])
389
- ]),
390
- _: 1
391
- }, 512);
392
- };
393
- }
394
- }), re = { class: "flex items-end" }, se = { class: "flex mt-6 space-x-6" }, ie = /* @__PURE__ */ _({
395
- __name: "GrabGateway",
396
- props: {
397
- onUpdate: {
398
- type: Function,
399
- required: !0
400
- },
401
- onDelete: {
402
- type: Function,
403
- required: !0
404
- },
405
- gateway: {
406
- type: Object,
407
- required: !0
408
- }
409
- },
410
- setup(a) {
411
- var V, d;
412
- const s = J(), { isLoading: u, startAsyncCall: t } = O(), p = j(), y = a, i = b(((V = y.gateway) == null ? void 0 : V.active) ?? !1), e = b(((d = y.gateway) == null ? void 0 : d.config) || {
413
- merchantId: ""
414
- });
415
- async function m() {
416
- t(async () => {
417
- var v;
418
- try {
419
- const { merchantID: l } = await D.grabSync(((v = p.currentRestaurant.value) == null ? void 0 : v._id) ?? "");
420
- e.value.merchantId = l, i.value = !0, s.open({
421
- type: "success",
422
- title: "Grab Setting sync succesfully, you will still need to save the changes."
423
- });
424
- } catch (l) {
425
- s.open({
426
- type: "error",
427
- title: "Error occurs when sync ordering settings",
428
- message: Z(l)
429
- });
430
- }
431
- });
432
- }
433
- return (v, l) => {
434
- const c = r("FmTextField"), x = r("FmButton"), k = r("FmTooltip"), T = r("FmSwitch"), G = r("FmForm");
435
- return g(), w(G, {
436
- ref: "form",
437
- class: "flex flex-col gap-16",
438
- onValidationSuccess: l[2] || (l[2] = () => a.onUpdate(i.value, e.value))
439
- }, {
440
- default: C(() => [
441
- I("div", re, [
442
- o(c, {
443
- modelValue: e.value.merchantId,
444
- "onUpdate:modelValue": l[0] || (l[0] = (M) => e.value.merchantId = M),
445
- label: "Merchant ID",
446
- rules: n(f)(n(F).string())
447
- }, null, 8, ["modelValue", "rules"]),
448
- o(k, {
449
- variant: "plain",
450
- placement: "right",
451
- content: "Sync from Ordering Settings"
452
- }, {
453
- default: C(() => [
454
- o(x, {
455
- class: "ml-2",
456
- type: "button",
457
- variant: "primary",
458
- icon: "sync",
459
- loading: n(u),
460
- onclick: () => m()
461
- }, null, 8, ["loading", "onclick"])
462
- ]),
463
- _: 1
464
- })
465
- ]),
466
- o(T, {
467
- modelValue: i.value,
468
- "onUpdate:modelValue": l[1] || (l[1] = (M) => i.value = M),
469
- label: "Is Active"
470
- }, null, 8, ["modelValue"]),
471
- I("div", se, [
472
- a.gateway ? (g(), w(x, {
473
- key: 0,
474
- class: "flex-1",
475
- variant: "secondary",
476
- label: "Delete",
477
- onclick: () => a.onDelete(a.gateway)
478
- }, null, 8, ["onclick"])) : S("", !0),
479
- o(x, {
480
- type: "submit",
481
- class: "flex-1",
482
- variant: "primary",
483
- label: "Save"
484
- })
485
- ])
486
- ]),
487
- _: 1
488
- }, 512);
489
- };
490
- }
491
- }), me = { class: "flex mt-6 space-x-6" }, ce = /* @__PURE__ */ _({
492
- __name: "SoftSpaceGateway",
493
- props: {
494
- onUpdate: {
495
- type: Function,
496
- required: !0
497
- },
498
- onDelete: {
499
- type: Function,
500
- required: !0
501
- },
502
- gateway: {
503
- type: Object,
504
- required: !0
505
- }
506
- },
507
- setup(a) {
508
- var p, y;
509
- const s = a, u = b(((p = s.gateway) == null ? void 0 : p.active) ?? !1), t = b(((y = s.gateway) == null ? void 0 : y.config) || {
510
- mid: "",
511
- tid: ""
512
- });
513
- return (i, e) => {
514
- const m = r("FmTextField"), V = r("FmSwitch"), d = r("FmButton"), v = r("FmForm");
515
- return g(), w(v, {
516
- ref: "form",
517
- class: "flex flex-col gap-16",
518
- onValidationSuccess: e[3] || (e[3] = () => a.onUpdate(u.value, t.value))
519
- }, {
520
- default: C(() => [
521
- o(m, {
522
- modelValue: t.value.mid,
523
- "onUpdate:modelValue": e[0] || (e[0] = (l) => t.value.mid = l),
524
- label: "MID",
525
- rules: n(f)(n(F).string())
526
- }, null, 8, ["modelValue", "rules"]),
527
- o(m, {
528
- modelValue: t.value.tid,
529
- "onUpdate:modelValue": e[1] || (e[1] = (l) => t.value.tid = l),
530
- label: "TID",
531
- rules: n(f)(n(F).string())
532
- }, null, 8, ["modelValue", "rules"]),
533
- o(V, {
534
- modelValue: u.value,
535
- "onUpdate:modelValue": e[2] || (e[2] = (l) => u.value = l),
536
- label: "Is Active"
537
- }, null, 8, ["modelValue"]),
538
- I("div", me, [
539
- a.gateway ? (g(), w(d, {
540
- key: 0,
541
- class: "flex-1",
542
- variant: "secondary",
543
- label: "Delete",
544
- onclick: () => a.onDelete(a.gateway)
545
- }, null, 8, ["onclick"])) : S("", !0),
546
- o(d, {
547
- type: "submit",
548
- class: "flex-1",
549
- variant: "primary",
550
- label: "Save"
551
- })
552
- ])
553
- ]),
554
- _: 1
555
- }, 512);
556
- };
557
- }
558
- }), de = { class: "flex mt-6 space-x-6" }, ye = /* @__PURE__ */ _({
559
- __name: "DigioGateway",
560
- props: {
561
- gateway: {
562
- type: Object,
563
- required: !0
564
- },
565
- onUpdate: {
566
- type: Function,
567
- required: !0
568
- },
569
- onDelete: {
570
- type: Function,
571
- required: !0
572
- }
573
- },
574
- setup(a) {
575
- var p, y;
576
- const s = a, u = b(((p = s.gateway) == null ? void 0 : p.active) ?? !1), t = b(((y = s.gateway) == null ? void 0 : y.config) || {
577
- merchantId: ""
578
- });
579
- return (i, e) => {
580
- const m = r("FmTextField"), V = r("FmSwitch"), d = r("FmButton"), v = r("FmForm");
581
- return g(), w(v, {
582
- ref: "form",
583
- class: "flex flex-col gap-16",
584
- onValidationSuccess: e[2] || (e[2] = () => a.onUpdate(u.value, t.value))
585
- }, {
586
- default: C(() => [
587
- o(m, {
588
- modelValue: t.value.merchantId,
589
- "onUpdate:modelValue": e[0] || (e[0] = (l) => t.value.merchantId = l),
590
- label: "Merchant ID",
591
- rules: n(f)(n(F).string())
592
- }, null, 8, ["modelValue", "rules"]),
593
- o(V, {
594
- modelValue: u.value,
595
- "onUpdate:modelValue": e[1] || (e[1] = (l) => u.value = l),
596
- label: "Is Active"
597
- }, null, 8, ["modelValue"]),
598
- I("div", de, [
599
- a.gateway ? (g(), w(d, {
600
- key: 0,
601
- class: "flex-1",
602
- variant: "secondary",
603
- label: "Delete",
604
- onclick: () => a.onDelete(a.gateway)
605
- }, null, 8, ["onclick"])) : S("", !0),
606
- o(d, {
607
- type: "submit",
608
- class: "flex-1",
609
- variant: "primary",
610
- label: "Save"
611
- })
612
- ])
613
- ]),
614
- _: 1
615
- }, 512);
616
- };
617
- }
618
- }), pe = {
619
- key: 0,
620
- class: "flex items-center justify-center min-h-[80vh]"
621
- }, ve = /* @__PURE__ */ _({
622
- __name: "PaymentGateway",
623
- props: {
624
- restaurant: {
625
- type: Object,
626
- required: !0
627
- }
628
- },
629
- setup(a) {
630
- const s = [
631
- {
632
- label: "Fiuu",
633
- value: "RAZER_MERCHANT_SERVICE",
634
- form: ee,
635
- region: [U.F_COUNTRY.enum.MY, U.F_COUNTRY.enum.SG]
636
- },
637
- {
638
- label: "Revenue Monster",
639
- value: "REVENUE_MONSTER",
640
- form: ae,
641
- region: [U.F_COUNTRY.enum.MY]
642
- },
643
- {
644
- label: "GHL",
645
- value: "E_GHL",
646
- form: ne,
647
- region: [U.F_COUNTRY.enum.MY]
648
- },
649
- {
650
- label: "Grab",
651
- value: "GRAB",
652
- form: ie,
653
- region: [U.F_COUNTRY.enum.MY]
654
- },
655
- {
656
- label: "Macau Pass",
657
- value: "MACAU_PASS",
658
- form: ue,
659
- region: [U.F_COUNTRY.enum.MO]
660
- },
661
- {
662
- label: "SoftSpace",
663
- value: "SOFTSPACE",
664
- form: ce,
665
- region: [U.F_COUNTRY.enum.MY]
666
- },
667
- {
668
- label: "Digio",
669
- value: "DIGIO",
670
- form: ye,
671
- region: [U.F_COUNTRY.enum.TH]
672
- }
673
- ], u = a, t = j(), { isLoading: p, startAsyncCall: y } = O(), { activeGateway: i } = L({
674
- activeGateway: ""
675
- }), e = b([]);
676
- async function m(c, x) {
677
- await y(async () => {
678
- const k = {
679
- _id: "",
680
- _rev: "",
681
- paymentGateway: i.value,
682
- config: x,
683
- active: c
684
- }, T = e.value.find((G) => G.paymentGateway === i.value);
685
- T && (k._id = T._id, k._rev = T._rev), await D.upsert(u.restaurant._id, k), e.value = await D.get(u.restaurant._id);
686
- });
687
- }
688
- async function V(c) {
689
- y(async () => {
690
- await D.delete(u.restaurant._id, c._id), e.value = await D.get(u.restaurant._id);
691
- });
692
- }
693
- const d = R(() => s.filter((c) => c.region.includes(t.currentCountry.value ?? U.F_COUNTRY.enum.MY)));
694
- function v() {
695
- y(async () => {
696
- e.value = await D.get(u.restaurant._id), d.value.length > 0 && (i.value = d.value[0].value);
697
- });
698
- }
699
- N(v);
700
- const l = R(() => {
701
- var c;
702
- return (c = s.find((x) => x.value === i.value)) == null ? void 0 : c.form;
703
- });
704
- return (c, x) => {
705
- const k = r("FmCircularProgress"), T = r("FmTabs");
706
- return g(), $(B, null, [
707
- n(p) ? (g(), $("div", pe, [
708
- o(k, { size: "xxl" })
709
- ])) : S("", !0),
710
- o(T, {
711
- class: "mb-6",
712
- "model-value": n(i),
713
- "onUpdate:modelValue": x[0] || (x[0] = (G) => P(i) ? i.value = G : null),
714
- items: d.value
715
- }, null, 8, ["model-value", "items"]),
716
- n(i) ? (g(), w(K(l.value), E(Y({ key: 1 }, {
717
- gateway: e.value.find((G) => G.paymentGateway === n(i)),
718
- onDelete: V,
719
- onUpdate: m
720
- })), null, 16)) : S("", !0)
721
- ], 64);
722
- };
723
- }
724
- }), ge = { class: "flex flex-col gap-8" }, fe = { class: "mt-6 space-x-6" }, Fe = /* @__PURE__ */ _({
725
- __name: "LocalIntegration",
726
- props: {
727
- restaurant: {
728
- type: Object,
729
- required: !0
730
- }
731
- },
732
- setup(a) {
733
- const { isLoading: s, startAsyncCall: u } = O(!1), t = b([]), p = a;
734
- N(() => {
735
- u(async () => {
736
- const i = await D.getIntegration(p.restaurant._id);
737
- i && (t.value = i.integrations.map((e) => e.gateway) || []);
738
- });
739
- });
740
- function y() {
741
- u(async () => {
742
- const i = await D.upsertIntegration(p.restaurant._id, {
743
- integrations: t.value.map((e) => ({
744
- gateway: e
745
- }))
746
- });
747
- i && (t.value = i.integrations.map((e) => e.gateway) || []);
748
- });
749
- }
750
- return (i, e) => {
751
- const m = r("FmCheckbox"), V = r("FmButton");
752
- return g(), $(B, null, [
753
- I("div", ge, [
754
- (g(!0), $(B, null, z(n(H.FdoLocationIntegrationGateway).Values, (d) => (g(), w(m, {
755
- modelValue: t.value,
756
- "onUpdate:modelValue": e[0] || (e[0] = (v) => t.value = v),
757
- label: d,
758
- value: d
759
- }, null, 8, ["modelValue", "label", "value"]))), 256))
760
- ]),
761
- I("div", fe, [
762
- o(V, {
763
- variant: "primary",
764
- label: "Save",
765
- icon: "save",
766
- loading: n(s),
767
- onclick: y
768
- }, null, 8, ["loading"])
769
- ])
770
- ], 64);
771
- };
772
- }
773
- }), ke = /* @__PURE__ */ _({
774
- __name: "RestaurantSetting",
775
- props: {
776
- restaurantId: {
777
- type: String,
778
- required: !0
779
- }
780
- },
781
- setup(a) {
782
- const s = a, { tab: u } = L({
783
- tab: "payment-gateway"
784
- }), { isLoading: t, startAsyncCall: p } = O(!0), y = Q(), i = b(), e = [
785
- {
786
- label: "Payment Gateway",
787
- value: "payment-gateway",
788
- icon: "assured_workload",
789
- render: ve
790
- },
791
- {
792
- label: "Local Integration",
793
- value: "local-integration",
794
- icon: "api",
795
- render: Fe
796
- }
797
- ];
798
- function m() {
799
- p(async () => {
800
- i.value = await W.readRestaurantById(s.restaurantId);
801
- });
802
- }
803
- N(m);
804
- const V = R(() => {
805
- var d;
806
- return (d = e.find((v) => v.value === u.value)) == null ? void 0 : d.render;
807
- });
808
- return (d, v) => {
809
- var c;
810
- const l = r("FmTabs");
811
- return g(), w(h, {
812
- title: `Restaurant (${(c = i.value) == null ? void 0 : c._id})`,
813
- loading: n(t),
814
- onBack: n(y).back
815
- }, {
816
- default: C(() => [
817
- o(l, {
818
- "model-value": n(u),
819
- "onUpdate:modelValue": v[0] || (v[0] = (x) => P(u) ? u.value = x : null),
820
- class: "mb-6",
821
- items: e
822
- }, null, 8, ["model-value"]),
823
- n(u) && i.value ? (g(), w(K(V.value), E(Y({ key: 0 }, {
824
- restaurant: i.value
825
- })), null, 16)) : S("", !0)
826
- ]),
827
- _: 1
828
- }, 8, ["title", "loading", "onBack"]);
829
- };
830
- }
831
- });
832
- export {
833
- ke as default
834
- };