@feedmepos/mf-payment 1.7.6-dev → 1.7.6

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 (102) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-3JBwNlGx.js → Actions.vue_vue_type_script_setup_true_lang-DQR1_RpF.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-BsmZ17dQ.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-CHkrHNPF.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-Dv42bb8d.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-BIvrqTNw.js} +2 -2
  4. package/dist/{Chargeback-iw42NmhQ.js → Chargeback-CAj9Jgcy.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-CEgmqMPG.js → DocumentViewer.vue_vue_type_script_setup_true_lang-jTkg_too.js} +1 -1
  6. package/dist/{OnboardForm-BKrj6MlH.js → OnboardForm-DRoUPx01.js} +5 -5
  7. package/dist/{OnboardForm-DKKZj1r1.js → OnboardForm-v-95d-S1.js} +5 -5
  8. package/dist/{OnboardSubmission-BUmm693d.js → OnboardSubmission-C09-Ac_u.js} +5 -5
  9. package/dist/{OnboardSubmission-CTi_k_LL.js → OnboardSubmission-ciBwl8NO.js} +2 -2
  10. package/dist/PayoutAccount-5ckNIseh.js +384 -0
  11. package/dist/{PayoutAccount-BEMqd1z_.js → PayoutAccount-BIXgrxF8.js} +5 -5
  12. package/dist/PayoutAccountSetting-Bhg_rRvI.js +1943 -0
  13. package/dist/{Restaurant-BXSPjKBF.js → Restaurant-CAkspzgz.js} +4 -4
  14. package/dist/{RestaurantSetting-DN3J5ffo.js → RestaurantSetting-D-joRYbL.js} +3 -3
  15. package/dist/{Settlement-Bsz_dIzQ.js → Settlement-DCBsf6-S.js} +3 -3
  16. package/dist/{Settlement-vo8MPovs.js → Settlement-tz1oE3Qt.js} +4 -4
  17. package/dist/{SettlementTransactions-BZl7_Xa2.js → SettlementTransactions-B2IUyVs5.js} +4 -4
  18. package/dist/{SettlementTransactions-DDrEx1YK.js → SettlementTransactions-YSNYN3HM.js} +4 -4
  19. package/dist/{Status.vue_vue_type_script_setup_true_lang-CUXS7I4X.js → Status.vue_vue_type_script_setup_true_lang-CpoEkJUQ.js} +1 -1
  20. package/dist/{Terminal-BlbmYTBq.js → Terminal-V45vMcvG.js} +5 -5
  21. package/dist/{TerminalSetting-CX9iXWRz.js → TerminalSetting-DtSt5q66.js} +521 -655
  22. package/dist/{Transaction-OzWglcKv.js → Transaction-8K6WJBsa.js} +10 -10
  23. package/dist/{Transaction-Drs-TpOg.js → Transaction-BJ6-2G9v.js} +10 -10
  24. package/dist/{TransactionOld-Cm8iNWsy.js → TransactionOld-DNVGQ2ck.js} +7 -7
  25. package/dist/api/settlement/index.d.ts +1 -1
  26. package/dist/{app-C0XKu0jl.js → app-DiZz8sPe.js} +469 -463
  27. package/dist/app.js +1 -1
  28. package/dist/{assets-DWLVlgG7.js → assets-DiH3EaF3.js} +1 -1
  29. package/dist/{grafana-CWSgbuy6.js → grafana-Bou0e3nV.js} +1 -1
  30. package/dist/{index-DyYRhqsz.js → index-CTKrpHLR.js} +2 -2
  31. package/dist/{index-Zct56Atf.js → index-CZ_b9Pch.js} +1 -1
  32. package/dist/{index-DkKk3kia.js → index-CfsmsUeJ.js} +1 -1
  33. package/dist/{index-BF2Ll-1V.js → index-DO4-_8Af.js} +2 -2
  34. package/dist/{index-6ApGYfIO.js → index-Da6Yh4Gu.js} +5474 -5544
  35. package/dist/{index-DM4_Wt8u.js → index-DeT3z3Jr.js} +1 -1
  36. package/dist/{index-B5nzDCce.js → index-DjOUxa1H.js} +1 -1
  37. package/dist/{index-ggQ7Kq-J.js → index-LkcyucJ_.js} +16 -16
  38. package/dist/{index-DeAOhjan.js → index-yLXt4lrZ.js} +1 -1
  39. package/dist/{index.vue_vue_type_script_setup_true_lang-DGPlPaAk.js → index.vue_vue_type_script_setup_true_lang-BQSr_US-.js} +1 -1
  40. package/dist/model/payout-account.d.ts +2 -2
  41. package/dist/package.json +2 -2
  42. package/dist/{payout-account-DJI6NhRC.js → payout-account-DDudWzkA.js} +3 -3
  43. package/dist/stores/payoutAccount.d.ts +22 -22
  44. package/dist/tsconfig.app.tsbuildinfo +1 -1
  45. package/dist/views/admin/onboard-submission/forms/NTTSubmission.vue.d.ts +16 -20
  46. package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +16 -20
  47. package/dist/views/admin/onboard-submission/forms/TyroSubmission.vue.d.ts +16 -20
  48. package/dist/views/admin/payout-account/CreateDummyPayoutDialog.vue.d.ts +11 -1
  49. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +31 -22
  50. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +44 -44
  51. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +44 -44
  52. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +22 -22
  53. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +22 -22
  54. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +44 -44
  55. package/dist/views/admin/payout-account/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
  56. package/dist/views/admin/payout-account/tabs/gateway/DigioGateway.vue.d.ts +4 -4
  57. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  58. package/dist/views/admin/payout-account/tabs/gateway/KsherGateway.vue.d.ts +2 -2
  59. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  60. package/dist/views/admin/payout-account/tabs/gateway/TyroGateway.vue.d.ts +2 -2
  61. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  62. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  63. package/dist/views/admin/restaurant/tabs/gateway/AdyenGateway.vue.d.ts +6 -6
  64. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +6 -6
  65. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +10 -10
  66. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +10 -10
  67. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +6 -6
  68. package/dist/views/admin/restaurant/tabs/gateway/KsherGateway.vue.d.ts +6 -6
  69. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +8 -8
  70. package/dist/views/admin/restaurant/tabs/gateway/MaybankGateway.vue.d.ts +8 -8
  71. package/dist/views/admin/restaurant/tabs/gateway/MonetapayGateway.vue.d.ts +6 -6
  72. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +10 -10
  73. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +6 -6
  74. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +16 -16
  75. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +14 -14
  76. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +14 -14
  77. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +14 -14
  78. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +14 -14
  79. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +14 -14
  80. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +14 -14
  81. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +14 -14
  82. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +14 -14
  83. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +14 -14
  84. package/dist/views/admin/terminal/tabs/ecr/GlobalPaymentsGateway.vue.d.ts +14 -14
  85. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +14 -14
  86. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +14 -14
  87. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +14 -14
  88. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +14 -14
  89. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +14 -14
  90. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +14 -14
  91. package/dist/views/admin/terminal/tabs/ecr/OmaGateway.vue.d.ts +14 -14
  92. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +14 -14
  93. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +14 -14
  94. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +14 -14
  95. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +44 -44
  96. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +80 -80
  97. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +40 -40
  98. package/dist/views/settlement/SettlementTable.vue.d.ts +16 -16
  99. package/package.json +2 -2
  100. package/dist/PayoutAccount-SjIfbvLB.js +0 -399
  101. package/dist/PayoutAccountSetting-5yDs3zgb.js +0 -1847
  102. package/dist/views/admin/terminal/tabs/ecr/RevenueGateway.vue.d.ts +0 -140
@@ -1,1847 +0,0 @@
1
- import { defineComponent as D, resolveComponent as y, openBlock as g, createElementBlock as E, Fragment as j, createElementVNode as s, createVNode as n, withCtx as k, createTextVNode as h, toDisplayString as B, unref as r, reactive as de, ref as C, createBlock as w, watch as te, computed as Y, isRef as W, createCommentVNode as $, h as H, onMounted as re, resolveDynamicComponent as ae, normalizeProps as ne, mergeProps as oe } from "vue";
2
- import { p as G } from "./index-BF2Ll-1V.js";
3
- import { u as X, e as _ } from "./index-6ApGYfIO.js";
4
- import { _ as pe } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
5
- import { useRouter as ye } from "vue-router";
6
- import { u as ee } from "./index-DkKk3kia.js";
7
- import { _ as Z, P as Q } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-CEgmqMPG.js";
8
- import { h as be } from "./moment-h96o7c8I.js";
9
- import { useDialogChild as fe, useDialog as ie, useSnackbar as J, components as ve } from "@feedmepos/ui-library";
10
- import { u as z } from "./error-K1CakhA9.js";
11
- import { P as ge } from "./payout-account-DJI6NhRC.js";
12
- import { d as se } from "./index-DeAOhjan.js";
13
- import { s as L, o as Fe, z as A, a as N } from "./validator-CTlVogBQ.js";
14
- import { _ as xe } from "./TextInputDialog.vue_vue_type_script_setup_true_lang-C3AeZqwO.js";
15
- import { useCoreStore as me } from "@feedmepos/mf-common";
16
- const ke = { class: "flex gap-16 mb-6" }, Ve = { class: "flex gap-16 mb-6" }, we = /* @__PURE__ */ D({
17
- __name: "Information",
18
- props: {
19
- payoutAccount: {
20
- type: Object,
21
- required: !0
22
- }
23
- },
24
- setup(a) {
25
- return (u, e) => {
26
- var m, v;
27
- const b = y("FmCardHeader"), l = y("FmCardSection"), t = y("FmCard");
28
- return g(), E(j, null, [
29
- s("div", ke, [
30
- n(t, {
31
- horizontal: "",
32
- class: "flex-1 p-6",
33
- variant: "elevated"
34
- }, {
35
- default: k(() => [
36
- n(l, { class: "flex flex-col gap-16 justify-between" }, {
37
- default: k(() => [
38
- n(b, {
39
- class: "p-0",
40
- title: "Account Info",
41
- subtitle: ""
42
- }),
43
- n(l, { class: "p-0" }, {
44
- default: k(() => {
45
- var p, i, d, o, c;
46
- return [
47
- e[0] || (e[0] = s("b", null, "For", -1)),
48
- h(": " + B((i = (p = a.payoutAccount) == null ? void 0 : p.store) == null ? void 0 : i.event) + " ", 1),
49
- e[1] || (e[1] = s("br", null, null, -1)),
50
- e[2] || (e[2] = s("b", null, "Reference", -1)),
51
- h(": " + B((o = (d = a.payoutAccount) == null ? void 0 : d.store) == null ? void 0 : o.id), 1),
52
- e[3] || (e[3] = s("br", null, null, -1)),
53
- e[4] || (e[4] = s("b", null, "Business", -1)),
54
- h(": " + B((c = a.payoutAccount) == null ? void 0 : c.businessId), 1),
55
- e[5] || (e[5] = s("br", null, null, -1))
56
- ];
57
- }),
58
- _: 1
59
- })
60
- ]),
61
- _: 1
62
- })
63
- ]),
64
- _: 1
65
- }),
66
- n(t, {
67
- horizontal: "",
68
- class: "flex-1 p-6",
69
- variant: "elevated"
70
- }, {
71
- default: k(() => [
72
- n(l, { class: "flex flex-col gap-16 justify-between" }, {
73
- default: k(() => [
74
- n(b, {
75
- class: "p-0",
76
- title: "Key Person",
77
- subtitle: ""
78
- }),
79
- n(l, { class: "p-0" }, {
80
- default: k(() => {
81
- var p, i, d, o, c, f, F, S;
82
- return [
83
- e[6] || (e[6] = s("b", null, "Email", -1)),
84
- h(": " + B((d = (i = (p = a.payoutAccount) == null ? void 0 : p.store) == null ? void 0 : i.keyPerson) == null ? void 0 : d.email) + " ", 1),
85
- e[7] || (e[7] = s("br", null, null, -1)),
86
- e[8] || (e[8] = s("b", null, "Name", -1)),
87
- h(": " + B((f = (c = (o = a.payoutAccount) == null ? void 0 : o.store) == null ? void 0 : c.keyPerson) == null ? void 0 : f.name), 1),
88
- e[9] || (e[9] = s("br", null, null, -1)),
89
- e[10] || (e[10] = s("b", null, "Phone", -1)),
90
- h(": " + B((S = (F = a.payoutAccount) == null ? void 0 : F.store.keyPerson) == null ? void 0 : S.phone), 1),
91
- e[11] || (e[11] = s("br", null, null, -1))
92
- ];
93
- }),
94
- _: 1
95
- })
96
- ]),
97
- _: 1
98
- })
99
- ]),
100
- _: 1
101
- })
102
- ]),
103
- s("div", Ve, [
104
- n(t, {
105
- horizontal: "",
106
- class: "flex-1 p-6",
107
- variant: "elevated"
108
- }, {
109
- default: k(() => [
110
- n(l, { class: "flex flex-col gap-16 justify-between" }, {
111
- default: k(() => [
112
- n(b, {
113
- class: "p-0",
114
- title: "Status Info",
115
- subtitle: ""
116
- }),
117
- n(l, { class: "p-0" }, {
118
- default: k(() => {
119
- var p, i, d;
120
- return [
121
- e[12] || (e[12] = s("b", null, "Submission Date", -1)),
122
- h(": " + B((p = a.payoutAccount) != null && p.submissionDate ? r(be)(a.payoutAccount.submissionDate).format(
123
- "YYYY-MM-DD HH:mm:ss"
124
- ) : "—"), 1),
125
- e[13] || (e[13] = s("br", null, null, -1)),
126
- e[14] || (e[14] = s("b", null, "Status By", -1)),
127
- h(": " + B(((i = a.payoutAccount) == null ? void 0 : i.statusBy) ?? "—"), 1),
128
- e[15] || (e[15] = s("br", null, null, -1)),
129
- e[16] || (e[16] = s("b", null, "Status Reason", -1)),
130
- h(": " + B(((d = a.payoutAccount) == null ? void 0 : d.statusReason) ?? "—"), 1),
131
- e[17] || (e[17] = s("br", null, null, -1))
132
- ];
133
- }),
134
- _: 1
135
- })
136
- ]),
137
- _: 1
138
- })
139
- ]),
140
- _: 1
141
- })
142
- ]),
143
- e[18] || (e[18] = s("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Exterior Photo", -1)),
144
- n(Z, {
145
- document: a.payoutAccount.store.exteriorPhoto,
146
- "business-id": a.payoutAccount.businessId,
147
- "restaurant-id": ((v = (m = a.payoutAccount) == null ? void 0 : m.store) == null ? void 0 : v.event) === "ORDERING" ? a.payoutAccount.store.id : void 0
148
- }, null, 8, ["document", "business-id", "restaurant-id"])
149
- ], 64);
150
- };
151
- }
152
- }), Ae = { class: "flex flex-col gap-8" }, Se = { class: "flex flex-col gap-8" }, Ne = { class: "flex justify-end mb-2" }, Ce = /* @__PURE__ */ D({
153
- __name: "SettlementEditDialog",
154
- props: {
155
- initialValue: {
156
- type: Object,
157
- required: !0
158
- },
159
- bankNameOptions: {
160
- type: Array,
161
- required: !0
162
- },
163
- businessId: {
164
- type: String,
165
- required: !0
166
- },
167
- restaurantId: {
168
- type: String,
169
- default: void 0
170
- }
171
- },
172
- setup(a) {
173
- const u = a, { emitAction: e, emitData: b } = fe(), l = de({
174
- companyName: u.initialValue.companyName,
175
- regNo: u.initialValue.regNo,
176
- bankName: u.initialValue.bankName,
177
- bankHolderName: u.initialValue.bankHolderName,
178
- bankAccountNumber: u.initialValue.bankAccountNumber,
179
- ssm: u.initialValue.ssm,
180
- bankStatement: u.initialValue.bankStatement
181
- }), t = C(), m = C(), v = C(l.ssm ?? ""), p = C(l.bankStatement ?? ""), i = L().trim().min(1, "Company name is required"), d = L().trim().min(1, "Registration number is required"), o = L().trim().min(1, "Bank name is required"), c = L().trim().min(1, "Bank holder name is required"), f = L().trim().min(1, "Bank account number is required"), F = Fe({
182
- companyName: i,
183
- regNo: d,
184
- bankName: o,
185
- bankHolderName: c,
186
- bankAccountNumber: f
187
- }), S = () => {
188
- const V = F.safeParse(l);
189
- V.success && (b({
190
- ...V.data,
191
- ssm: l.ssm,
192
- bankStatement: l.bankStatement,
193
- newSSM: t.value,
194
- newBankStatement: m.value
195
- }), e("primary"));
196
- };
197
- async function U(V) {
198
- const x = new FileReader();
199
- return new Promise((q) => {
200
- x.onload = (K) => {
201
- var O;
202
- q((O = K.target) == null ? void 0 : O.result);
203
- }, x.readAsDataURL(V);
204
- });
205
- }
206
- const I = async (V) => {
207
- t.value = V, v.value = V ? await U(V) : "";
208
- }, T = async (V) => {
209
- m.value = V, p.value = V ? await U(V) : "";
210
- }, R = () => {
211
- t.value = void 0, v.value = "";
212
- }, M = () => {
213
- m.value = void 0, p.value = "";
214
- };
215
- return (V, x) => {
216
- const q = y("FmTextField"), K = y("FmSelect"), O = y("FmButton"), le = y("FmFormGroup"), ue = y("FmDropField"), ce = y("FmForm");
217
- return g(), w(ce, {
218
- class: "flex flex-col gap-16",
219
- onValidationSuccess: S
220
- }, {
221
- default: k(() => [
222
- x[9] || (x[9] = s("div", { class: "flex items-center my-2" }, [
223
- s("hr", { class: "w-[80px] border-t border-gray-300" }),
224
- s("span", { class: "text-left mx-6 text-gray-500" }, "Account"),
225
- s("hr", { class: "flex-grow border-t border-gray-300" })
226
- ], -1)),
227
- n(q, {
228
- modelValue: l.regNo,
229
- "onUpdate:modelValue": x[0] || (x[0] = (P) => l.regNo = P),
230
- label: "Registration Number",
231
- "label-mark": "required",
232
- "helper-text": "Registration Number must match uploaded SSM registration number.",
233
- rules: r(A)(r(d)),
234
- autofocus: ""
235
- }, null, 8, ["modelValue", "rules"]),
236
- n(q, {
237
- modelValue: l.companyName,
238
- "onUpdate:modelValue": x[1] || (x[1] = (P) => l.companyName = P),
239
- label: "Company Name",
240
- "label-mark": "required",
241
- "helper-text": "Company Name must match uploaded SSM registration name.",
242
- rules: r(A)(r(i))
243
- }, null, 8, ["modelValue", "rules"]),
244
- x[10] || (x[10] = s("div", { class: "flex items-center my-2" }, [
245
- s("hr", { class: "w-[80px] border-t border-gray-300" }),
246
- s("span", { class: "text-left mx-6 text-gray-500" }, "Bank"),
247
- s("hr", { class: "flex-grow border-t border-gray-300" })
248
- ], -1)),
249
- n(K, {
250
- modelValue: l.bankName,
251
- "onUpdate:modelValue": x[2] || (x[2] = (P) => l.bankName = P),
252
- label: "Bank",
253
- "label-mark": "required",
254
- items: u.bankNameOptions,
255
- rules: r(A)(r(o))
256
- }, null, 8, ["modelValue", "items", "rules"]),
257
- n(q, {
258
- modelValue: l.bankHolderName,
259
- "onUpdate:modelValue": x[3] || (x[3] = (P) => l.bankHolderName = P),
260
- label: "Bank Holder",
261
- "label-mark": "required",
262
- rules: r(A)(r(c))
263
- }, null, 8, ["modelValue", "rules"]),
264
- n(q, {
265
- modelValue: l.bankAccountNumber,
266
- "onUpdate:modelValue": x[4] || (x[4] = (P) => l.bankAccountNumber = P),
267
- label: "Bank Account Number",
268
- "label-mark": "required",
269
- type: "number",
270
- rules: r(A)(r(f))
271
- }, null, 8, ["modelValue", "rules"]),
272
- x[11] || (x[11] = s("div", { class: "flex items-center my-2" }, [
273
- s("hr", { class: "w-[80px] border-t border-gray-300" }),
274
- s("span", { class: "text-left mx-6 text-gray-500" }, "Document"),
275
- s("hr", { class: "flex-grow border-t border-gray-300" })
276
- ], -1)),
277
- s("div", Ae, [
278
- x[7] || (x[7] = s("p", { class: "fm-typo-en-body-md-500" }, "SSM (PDF)", -1)),
279
- v.value ? (g(), w(le, {
280
- key: 0,
281
- modelValue: v.value,
282
- "onUpdate:modelValue": x[5] || (x[5] = (P) => v.value = P),
283
- label: "SSM"
284
- }, {
285
- default: k(() => [
286
- n(Z, {
287
- document: v.value,
288
- "business-id": a.businessId,
289
- "restaurant-id": a.restaurantId
290
- }, {
291
- default: k(({ src: P }) => [
292
- n(Q, {
293
- height: 300,
294
- pdf: P,
295
- "disable-text-layer": !0,
296
- "disable-annotation-layer": !0
297
- }, null, 8, ["pdf"])
298
- ]),
299
- _: 1
300
- }, 8, ["document", "business-id", "restaurant-id"]),
301
- n(O, {
302
- type: "button",
303
- variant: "tertiary",
304
- label: "Remove",
305
- size: "md",
306
- "prepend-icon": "delete",
307
- onClick: R
308
- })
309
- ]),
310
- _: 1
311
- }, 8, ["modelValue"])) : (g(), w(ue, {
312
- key: 1,
313
- accept: ".pdf",
314
- onFileUpload: I
315
- }))
316
- ]),
317
- s("div", Se, [
318
- x[8] || (x[8] = s("p", { class: "fm-typo-en-body-md-500" }, "Bank Statement (PDF)", -1)),
319
- p.value ? (g(), w(le, {
320
- key: 0,
321
- modelValue: p.value,
322
- "onUpdate:modelValue": x[6] || (x[6] = (P) => p.value = P),
323
- label: "Bank Statement"
324
- }, {
325
- default: k(() => [
326
- n(Z, {
327
- document: p.value,
328
- "business-id": a.businessId,
329
- "restaurant-id": a.restaurantId
330
- }, {
331
- default: k(({ src: P }) => [
332
- n(Q, {
333
- height: 300,
334
- pdf: P,
335
- "disable-text-layer": !0,
336
- "disable-annotation-layer": !0
337
- }, null, 8, ["pdf"])
338
- ]),
339
- _: 1
340
- }, 8, ["document", "business-id", "restaurant-id"]),
341
- n(O, {
342
- type: "button",
343
- variant: "tertiary",
344
- label: "Remove",
345
- size: "md",
346
- "prepend-icon": "delete",
347
- onClick: M
348
- })
349
- ]),
350
- _: 1
351
- }, 8, ["modelValue"])) : (g(), w(ue, {
352
- key: 1,
353
- accept: ".pdf",
354
- onFileUpload: T
355
- }))
356
- ]),
357
- s("div", Ne, [
358
- n(O, {
359
- type: "submit",
360
- variant: "primary",
361
- label: "Save"
362
- })
363
- ])
364
- ]),
365
- _: 1
366
- });
367
- };
368
- }
369
- }), Ue = { class: "flex justify-end mb-6" }, Ie = { class: "flex gap-16 mb-6" }, Te = { class: "flex gap-16" }, De = { class: "flex-1" }, Re = { class: "flex-1" }, he = /* @__PURE__ */ D({
370
- __name: "Settlement",
371
- props: {
372
- onUpdate: {
373
- type: Function,
374
- required: !0
375
- },
376
- payoutAccount: {
377
- type: Object,
378
- required: !0
379
- }
380
- },
381
- setup(a) {
382
- const u = a, e = C(!1), b = ie(), l = J(), t = ge.bankNameOptions(), m = () => {
383
- var d, o, c, f, F, S, U, I, T, R;
384
- return {
385
- companyName: ((d = u.payoutAccount.store) == null ? void 0 : d.companyName) ?? "",
386
- regNo: ((o = u.payoutAccount.store) == null ? void 0 : o.regNo) ?? "",
387
- bankName: ((f = (c = u.payoutAccount.store) == null ? void 0 : c.bank) == null ? void 0 : f.name) ?? "",
388
- bankHolderName: ((S = (F = u.payoutAccount.store) == null ? void 0 : F.bank) == null ? void 0 : S.holderName) ?? "",
389
- bankAccountNumber: ((I = (U = u.payoutAccount.store) == null ? void 0 : U.bank) == null ? void 0 : I.accountNumber) ?? "",
390
- ssm: ((T = u.payoutAccount.store) == null ? void 0 : T.ssm) ?? "",
391
- bankStatement: ((R = u.payoutAccount.store) == null ? void 0 : R.bankStatement) ?? ""
392
- };
393
- }, v = async (d, o) => {
394
- var F;
395
- const c = (/* @__PURE__ */ new Date()).toISOString();
396
- if (((F = u.payoutAccount.store) == null ? void 0 : F.event) === "ORDERING")
397
- return await se.adminUpload(
398
- `restaurant/${u.payoutAccount.store.id}/documents/${d}/${c}.pdf`,
399
- o,
400
- u.payoutAccount.businessId,
401
- u.payoutAccount.store.id
402
- );
403
- const f = u.payoutAccount.businessId || u.payoutAccount.store.id;
404
- return await se.adminUpload(
405
- `business/${f}/documents/${d}/${c}.pdf`,
406
- o,
407
- f,
408
- void 0
409
- );
410
- }, p = async (d) => {
411
- if (!u.payoutAccount.store) return;
412
- let o = u.payoutAccount.store.ssm;
413
- d.newSSM && (o = await v("ssm", d.newSSM));
414
- let c = u.payoutAccount.store.bankStatement;
415
- d.newBankStatement && (c = await v(
416
- "bankStatement",
417
- d.newBankStatement
418
- ));
419
- const f = {
420
- ...u.payoutAccount,
421
- store: {
422
- ...u.payoutAccount.store,
423
- companyName: d.companyName,
424
- regNo: d.regNo,
425
- bank: {
426
- ...u.payoutAccount.store.bank ?? {},
427
- name: d.bankName,
428
- holderName: d.bankHolderName,
429
- accountNumber: d.bankAccountNumber
430
- },
431
- ssm: o,
432
- bankStatement: c
433
- }
434
- };
435
- try {
436
- e.value = !0, await u.onUpdate(f), l.open({
437
- type: "success",
438
- title: "Settlement info updated successfully"
439
- }), b.close();
440
- } catch (F) {
441
- l.open({
442
- type: "error",
443
- title: "Failed to update settlement info",
444
- message: z(F)
445
- });
446
- } finally {
447
- e.value = !1;
448
- }
449
- }, i = () => {
450
- var d;
451
- b.close(), b.open({
452
- title: "Edit Settlement Info",
453
- closeButton: !0,
454
- overlay: !0,
455
- contentComponent: Ce,
456
- contentComponentProps: {
457
- initialValue: m(),
458
- bankNameOptions: t,
459
- businessId: u.payoutAccount.businessId,
460
- restaurantId: ((d = u.payoutAccount.store) == null ? void 0 : d.event) === "ORDERING" ? u.payoutAccount.store.id : void 0
461
- }
462
- }).onPrimary((o) => {
463
- p(o);
464
- });
465
- };
466
- return (d, o) => {
467
- var U, I, T, R;
468
- const c = y("FmButton"), f = y("FmCardHeader"), F = y("FmCardSection"), S = y("FmCard");
469
- return g(), E(j, null, [
470
- s("div", Ue, [
471
- n(c, {
472
- variant: "primary",
473
- label: "Edit Settlement Info",
474
- loading: e.value,
475
- onclick: i
476
- }, null, 8, ["loading"])
477
- ]),
478
- s("div", Ie, [
479
- n(S, {
480
- horizontal: "",
481
- class: "flex-1 p-6",
482
- variant: "elevated"
483
- }, {
484
- default: k(() => [
485
- n(F, { class: "flex flex-col gap-16 justify-between" }, {
486
- default: k(() => [
487
- n(f, {
488
- class: "p-0",
489
- title: "Company Info",
490
- subtitle: ""
491
- }),
492
- n(F, { class: "p-0" }, {
493
- default: k(() => {
494
- var M, V;
495
- return [
496
- o[0] || (o[0] = s("b", null, "Name", -1)),
497
- h(": " + B((M = a.payoutAccount) == null ? void 0 : M.store.companyName), 1),
498
- o[1] || (o[1] = s("br", null, null, -1)),
499
- o[2] || (o[2] = s("b", null, "Registration Number", -1)),
500
- h(": " + B((V = a.payoutAccount) == null ? void 0 : V.store.regNo), 1),
501
- o[3] || (o[3] = s("br", null, null, -1))
502
- ];
503
- }),
504
- _: 1
505
- })
506
- ]),
507
- _: 1
508
- })
509
- ]),
510
- _: 1
511
- }),
512
- n(S, {
513
- horizontal: "",
514
- class: "flex-1 p-6",
515
- variant: "elevated"
516
- }, {
517
- default: k(() => [
518
- n(F, { class: "flex flex-col gap-16 justify-between" }, {
519
- default: k(() => [
520
- n(f, {
521
- class: "p-0",
522
- title: "Bank Info",
523
- subtitle: ""
524
- }),
525
- n(F, { class: "p-0" }, {
526
- default: k(() => {
527
- var M, V, x, q, K, O;
528
- return [
529
- o[4] || (o[4] = s("b", null, "Bank", -1)),
530
- h(": " + B((V = (M = a.payoutAccount) == null ? void 0 : M.store.bank) == null ? void 0 : V.name), 1),
531
- o[5] || (o[5] = s("br", null, null, -1)),
532
- o[6] || (o[6] = s("b", null, "Name", -1)),
533
- h(": " + B((q = (x = a.payoutAccount) == null ? void 0 : x.store.bank) == null ? void 0 : q.holderName), 1),
534
- o[7] || (o[7] = s("br", null, null, -1)),
535
- o[8] || (o[8] = s("b", null, "Number", -1)),
536
- h(": " + B((O = (K = a.payoutAccount) == null ? void 0 : K.store.bank) == null ? void 0 : O.accountNumber), 1)
537
- ];
538
- }),
539
- _: 1
540
- })
541
- ]),
542
- _: 1
543
- })
544
- ]),
545
- _: 1
546
- })
547
- ]),
548
- s("div", Te, [
549
- s("div", De, [
550
- o[9] || (o[9] = s("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
551
- n(Z, {
552
- "business-id": a.payoutAccount.businessId,
553
- "restaurant-id": ((I = (U = a.payoutAccount) == null ? void 0 : U.store) == null ? void 0 : I.event) === "ORDERING" ? a.payoutAccount.store.id : void 0,
554
- document: a.payoutAccount.store.ssm
555
- }, {
556
- default: k(({ src: M }) => [
557
- n(Q, {
558
- pdf: M,
559
- "disable-text-layer": !0,
560
- "disable-annotation-layer": !0
561
- }, null, 8, ["pdf"])
562
- ]),
563
- _: 1
564
- }, 8, ["business-id", "restaurant-id", "document"])
565
- ]),
566
- s("div", Re, [
567
- o[10] || (o[10] = s("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
568
- n(Z, {
569
- "business-id": a.payoutAccount.businessId,
570
- "restaurant-id": ((R = (T = a.payoutAccount) == null ? void 0 : T.store) == null ? void 0 : R.event) === "ORDERING" ? a.payoutAccount.store.id : void 0,
571
- document: a.payoutAccount.store.bankStatement
572
- }, {
573
- default: k(({ src: M }) => [
574
- n(Q, {
575
- pdf: M,
576
- "disable-text-layer": !0,
577
- "disable-annotation-layer": !0
578
- }, null, 8, ["pdf"])
579
- ]),
580
- _: 1
581
- }, 8, ["business-id", "restaurant-id", "document"])
582
- ])
583
- ])
584
- ], 64);
585
- };
586
- }
587
- }), Me = /* @__PURE__ */ D({
588
- __name: "RateInput",
589
- props: {
590
- data: {},
591
- onChange: { type: Function }
592
- },
593
- setup(a) {
594
- const u = a, e = C(u.data.toString());
595
- return te(e, (b) => {
596
- u.onChange(parseFloat(b));
597
- }), (b, l) => {
598
- const t = y("FmTextField");
599
- return g(), w(t, {
600
- inputmode: "decimal",
601
- modelValue: e.value,
602
- "onUpdate:modelValue": l[0] || (l[0] = (m) => e.value = m)
603
- }, {
604
- append: k(() => [...l[1] || (l[1] = [
605
- h("%", -1)
606
- ])]),
607
- _: 1
608
- }, 8, ["modelValue"]);
609
- };
610
- }
611
- }), Pe = /* @__PURE__ */ D({
612
- __name: "TPlusInput",
613
- props: {
614
- data: {},
615
- onChange: { type: Function }
616
- },
617
- setup(a) {
618
- const u = a, e = C(u.data.toString());
619
- return te(e, (b) => {
620
- u.onChange(parseInt(b));
621
- }), (b, l) => {
622
- const t = y("FmTextField");
623
- return g(), w(t, {
624
- inputmode: "numeric",
625
- modelValue: e.value,
626
- "onUpdate:modelValue": l[0] || (l[0] = (m) => e.value = m)
627
- }, null, 8, ["modelValue"]);
628
- };
629
- }
630
- }), Be = /* @__PURE__ */ D({
631
- __name: "MinimumFeeInput",
632
- props: {
633
- data: {},
634
- onChange: { type: Function }
635
- },
636
- setup(a) {
637
- const u = a, e = C(u.data.toString());
638
- return te(e, (b) => {
639
- u.onChange(parseFloat(b));
640
- }), (b, l) => {
641
- const t = y("FmTextField");
642
- return g(), w(t, {
643
- inputmode: "numeric",
644
- modelValue: e.value,
645
- "onUpdate:modelValue": l[0] || (l[0] = (m) => e.value = m)
646
- }, {
647
- prepend: k(() => [...l[1] || (l[1] = [
648
- h("$", -1)
649
- ])]),
650
- _: 1
651
- }, 8, ["modelValue"]);
652
- };
653
- }
654
- }), _e = { class: "flex gap-16 mt-6" }, $e = { class: "flex-1" }, qe = { class: "flex-1" }, Oe = { class: "my-6 w-full flex justify-end" }, Ee = { class: "w-[320px]" }, Ge = /* @__PURE__ */ D({
655
- __name: "PaymentStatus",
656
- props: {
657
- onUpdate: {
658
- type: Function,
659
- required: !0
660
- },
661
- payoutAccount: {
662
- type: Object,
663
- required: !0
664
- }
665
- },
666
- setup(a) {
667
- const u = a, e = C(!1), b = J(), l = ie(), t = async (o) => {
668
- try {
669
- e.value = !0, await u.onUpdate(o), b.open({
670
- type: "success",
671
- title: "Payout account update succesfully"
672
- });
673
- } catch (c) {
674
- b.open({
675
- type: "error",
676
- title: "Error occurs when updating payout account",
677
- message: z(c)
678
- });
679
- } finally {
680
- e.value = !1;
681
- }
682
- }, m = async () => {
683
- l.close(), l.open({
684
- title: "Rejection Reason",
685
- closeButton: !0,
686
- overlay: !0,
687
- contentComponent: xe,
688
- contentComponentProps: {
689
- label: "Reason",
690
- selectableReasons: [
691
- {
692
- label: "Incorrect Exterior Photo.",
693
- value: "Incorrect Exterior Photo."
694
- },
695
- {
696
- label: "The bank statement provided is unclear.",
697
- value: "The bank statement provided is unclear."
698
- },
699
- {
700
- label: "The exterior photo provided is unclear.",
701
- value: "The exterior photo provided is unclear."
702
- },
703
- {
704
- label: "Bank Account Name Mismatch with SSM Registration Name.",
705
- value: "Bank Account Name Mismatch with SSM Registration Name."
706
- },
707
- {
708
- label: 'Mismatch SSM with Signboard "Dimiliki Oleh"',
709
- value: 'Mismatch SSM with Signboard "Dimiliki Oleh"'
710
- },
711
- {
712
- label: "Mismatch Company Info with SSM Document",
713
- value: "Mismatch Company Info with SSM Document"
714
- },
715
- {
716
- label: "Other (fill in manually)",
717
- value: "OTHER"
718
- }
719
- ],
720
- otherLabel: "Other Reason",
721
- otherPlaceholder: "Enter reason for rejection..."
722
- }
723
- }).onPrimary((o) => {
724
- u.payoutAccount.enable = !1, u.payoutAccount.status = "REJECTED", u.payoutAccount.statusReason = o, t(u.payoutAccount), l.close();
725
- });
726
- }, { search: v } = ee({
727
- search: ""
728
- }), p = Y(() => {
729
- const { ssm: o, bank: c, bankStatement: f } = u.payoutAccount.store;
730
- return o && c && c.name && c.accountNumber && c.holderName && f;
731
- }), i = C(""), d = [
732
- {
733
- header: () => "Payment Method",
734
- accessorKey: "issuer",
735
- cell: (o) => `${o.row.original.issuer} (${o.row.original.variant})`
736
- },
737
- {
738
- header: () => "Rate",
739
- accessorKey: "rate",
740
- cell: ({ row: o }) => {
741
- let c = 0;
742
- return o.original.rate && (c = o.original.rate.amount / Math.pow(10, o.original.rate.precision)), H(Me, {
743
- data: c,
744
- onChange: (f) => {
745
- const F = u.payoutAccount.methods.at(o.index);
746
- F.rate || (F.rate = {
747
- amount: 0,
748
- precision: 4
749
- }), F.rate.amount = f * Math.pow(10, F.rate.precision);
750
- }
751
- });
752
- }
753
- },
754
- {
755
- header: () => "Minimum Fee",
756
- accessorKey: "minimumFee",
757
- cell: ({ row: o }) => {
758
- let c = 0;
759
- return o.original.minimumFee && (c = o.original.minimumFee.amount / Math.pow(10, o.original.minimumFee.precision)), H(Be, {
760
- data: c,
761
- onChange: (f) => {
762
- const F = u.payoutAccount.methods.at(o.index);
763
- F.minimumFee || (F.minimumFee = {
764
- amount: 0,
765
- precision: 2
766
- }), F.minimumFee.amount = f * Math.pow(10, F.minimumFee.precision);
767
- }
768
- });
769
- }
770
- },
771
- {
772
- header: () => "T plus",
773
- accessorKey: "tPlus",
774
- cell: ({ row: o }) => H(Pe, {
775
- data: o.original.tPlus ?? 0,
776
- onChange: (c) => {
777
- const f = u.payoutAccount.methods.at(o.index);
778
- f.tPlus = c;
779
- }
780
- })
781
- }
782
- ];
783
- return (o, c) => {
784
- const f = y("FmRadio"), F = y("FmRadioGroup"), S = y("FmSwitch"), U = y("FmSearch"), I = y("FmTable"), T = y("FmButton");
785
- return g(), E(j, null, [
786
- s("div", _e, [
787
- s("div", $e, [
788
- n(F, {
789
- modelValue: a.payoutAccount.status,
790
- "onUpdate:modelValue": c[0] || (c[0] = (R) => a.payoutAccount.status = R),
791
- label: "Account Status"
792
- }, {
793
- default: k(() => [
794
- n(f, {
795
- value: "PENDING",
796
- label: "Pending"
797
- }),
798
- n(f, {
799
- value: "APPROVED",
800
- label: "Approved"
801
- }),
802
- n(f, {
803
- value: "REJECTED",
804
- label: "Rejected",
805
- onClick: m
806
- })
807
- ]),
808
- _: 1
809
- }, 8, ["modelValue"])
810
- ]),
811
- s("div", qe, [
812
- n(S, {
813
- modelValue: a.payoutAccount.enable,
814
- "onUpdate:modelValue": c[1] || (c[1] = (R) => a.payoutAccount.enable = R),
815
- disabled: !p.value,
816
- label: "Enabled",
817
- sublabel: "Merchant can use online features such as e-payment, settlement"
818
- }, null, 8, ["modelValue", "disabled"])
819
- ])
820
- ]),
821
- a.payoutAccount.enable ? (g(), E(j, { key: 0 }, [
822
- s("div", Oe, [
823
- s("div", Ee, [
824
- n(U, {
825
- modelValue: r(v),
826
- "onUpdate:modelValue": c[2] || (c[2] = (R) => W(v) ? v.value = R : null),
827
- placeholder: "Search Method ..."
828
- }, null, 8, ["modelValue"])
829
- ])
830
- ]),
831
- n(I, {
832
- class: "mt-6",
833
- modelValue: i.value,
834
- "onUpdate:modelValue": c[3] || (c[3] = (R) => i.value = R),
835
- "shrink-at": !1,
836
- "search-value": r(v),
837
- "row-data": a.payoutAccount.methods,
838
- "column-defs": d
839
- }, null, 8, ["modelValue", "search-value", "row-data"])
840
- ], 64)) : $("", !0),
841
- n(T, {
842
- class: "w-full mt-6",
843
- variant: "primary",
844
- label: "Save",
845
- loading: e.value,
846
- onclick: () => t(a.payoutAccount)
847
- }, null, 8, ["loading", "onclick"])
848
- ], 64);
849
- };
850
- }
851
- }), Ke = { class: "flex" }, je = /* @__PURE__ */ D({
852
- __name: "Actions",
853
- emits: ["edit", "delete"],
854
- setup(a, { emit: u }) {
855
- const e = u;
856
- return (b, l) => {
857
- const t = y("FmButton");
858
- return g(), E("div", Ke, [
859
- n(t, {
860
- variant: "plain",
861
- "prepend-icon": "delete",
862
- onClick: l[0] || (l[0] = (m) => {
863
- m.stopPropagation(), e("delete");
864
- })
865
- })
866
- ]);
867
- };
868
- }
869
- }), Ye = { class: "flex justify-end px-6 pb-6" }, He = /* @__PURE__ */ D({
870
- __name: "PaymentChannel",
871
- props: {
872
- payoutAccount: {
873
- type: Object,
874
- required: !0
875
- }
876
- },
877
- setup(a) {
878
- const u = J(), e = a, { isLoading: b, startAsyncCall: l } = X(), t = C([]);
879
- function m() {
880
- l(async () => {
881
- t.value = await G.getChannels(e.payoutAccount._id);
882
- });
883
- }
884
- re(m);
885
- function v() {
886
- l(async () => {
887
- try {
888
- await G.updateChannels(e.payoutAccount._id, t.value), u.open({
889
- type: "success",
890
- title: "Payout account channels update succesfully"
891
- });
892
- } catch (d) {
893
- u.open({
894
- type: "error",
895
- title: "Error occurs when updating payout account channels",
896
- message: z(d)
897
- });
898
- }
899
- });
900
- }
901
- function p() {
902
- l(async () => {
903
- try {
904
- await G.resetChannels(e.payoutAccount._id), t.value = await G.getChannels(e.payoutAccount._id), u.open({
905
- type: "success",
906
- title: "Payout account channels reset succesfully"
907
- });
908
- } catch (d) {
909
- u.open({
910
- type: "error",
911
- title: "Error occurs when reset payout account channels",
912
- message: z(d)
913
- });
914
- }
915
- });
916
- }
917
- const i = [
918
- {
919
- header: () => "Gateway",
920
- accessorKey: "gateway"
921
- },
922
- {
923
- header: () => "Payment Type",
924
- accessorKey: "type"
925
- },
926
- {
927
- header: () => "Display",
928
- accessorKey: "icon",
929
- cell: ({ row: d }) => H("img", { src: d.original.icon, width: 32, height: 32 })
930
- },
931
- {
932
- header: () => "Label",
933
- accessorKey: "label",
934
- cell: ({ row: d }) => H(ve.FmTextField, {
935
- modelValue: d.original.label,
936
- "onUpdate:modelValue": (o) => d.original.label = o
937
- })
938
- },
939
- {
940
- id: "actions",
941
- header: () => "Actions",
942
- cell: ({ row: d }) => H(je, {
943
- onDelete: () => t.value.splice(d.index, 1)
944
- })
945
- }
946
- ];
947
- return (d, o) => {
948
- const c = y("FmButton"), f = y("FmTable");
949
- return g(), E(j, null, [
950
- s("div", Ye, [
951
- n(c, {
952
- class: "mx-4",
953
- variant: "destructive",
954
- size: "md",
955
- icon: "history",
956
- label: "Reset",
957
- onClick: p
958
- }),
959
- n(c, {
960
- variant: "primary",
961
- size: "md",
962
- icon: "save",
963
- label: "Save",
964
- onClick: v
965
- })
966
- ]),
967
- n(f, {
968
- loading: r(b),
969
- "row-data": t.value,
970
- "column-defs": i,
971
- "shrink-at": !1
972
- }, null, 8, ["loading", "row-data"])
973
- ], 64);
974
- };
975
- }
976
- }), ze = { class: "flex mt-6 space-x-6" }, Le = /* @__PURE__ */ D({
977
- __name: "FiuuGateway",
978
- props: {
979
- gateway: {
980
- type: Object,
981
- required: !0
982
- },
983
- onUpdate: {
984
- type: Function,
985
- required: !0
986
- },
987
- onDelete: {
988
- type: Function,
989
- required: !0
990
- }
991
- },
992
- setup(a) {
993
- var b;
994
- const e = C(((b = a.gateway) == null ? void 0 : b.config) || {
995
- merchantId: "",
996
- verifyKey: "",
997
- secretKey: ""
998
- });
999
- return (l, t) => {
1000
- const m = y("FmTextField"), v = y("FmButton"), p = y("FmForm");
1001
- return g(), w(p, {
1002
- ref: "form",
1003
- class: "flex flex-col gap-16",
1004
- onValidationSuccess: t[3] || (t[3] = () => a.onUpdate(e.value))
1005
- }, {
1006
- default: k(() => [
1007
- n(m, {
1008
- modelValue: e.value.merchantId,
1009
- "onUpdate:modelValue": t[0] || (t[0] = (i) => e.value.merchantId = i),
1010
- label: "Merchant ID",
1011
- rules: r(A)(r(N).string())
1012
- }, null, 8, ["modelValue", "rules"]),
1013
- n(m, {
1014
- modelValue: e.value.verifyKey,
1015
- "onUpdate:modelValue": t[1] || (t[1] = (i) => e.value.verifyKey = i),
1016
- label: "Verify Key",
1017
- rules: r(A)(r(N).string())
1018
- }, null, 8, ["modelValue", "rules"]),
1019
- n(m, {
1020
- modelValue: e.value.secretKey,
1021
- "onUpdate:modelValue": t[2] || (t[2] = (i) => e.value.secretKey = i),
1022
- label: "Secret Key",
1023
- rules: r(A)(r(N).string())
1024
- }, null, 8, ["modelValue", "rules"]),
1025
- s("div", ze, [
1026
- a.gateway ? (g(), w(v, {
1027
- key: 0,
1028
- class: "flex-1",
1029
- variant: "secondary",
1030
- label: "Delete",
1031
- onclick: () => a.onDelete()
1032
- }, null, 8, ["onclick"])) : $("", !0),
1033
- n(v, {
1034
- type: "submit",
1035
- class: "flex-1",
1036
- variant: "primary",
1037
- label: "Save"
1038
- })
1039
- ])
1040
- ]),
1041
- _: 1
1042
- }, 512);
1043
- };
1044
- }
1045
- }), Ze = { class: "flex mt-6 space-x-6" }, Je = /* @__PURE__ */ D({
1046
- __name: "MacauPassGateway",
1047
- props: {
1048
- gateway: {
1049
- type: Object,
1050
- required: !0
1051
- },
1052
- onUpdate: {
1053
- type: Function,
1054
- required: !0
1055
- },
1056
- onDelete: {
1057
- type: Function,
1058
- required: !0
1059
- }
1060
- },
1061
- setup(a) {
1062
- var b;
1063
- const e = C(((b = a.gateway) == null ? void 0 : b.config) || {
1064
- merchantId: "",
1065
- merchantName: "",
1066
- merchantCategoryCode: "",
1067
- storeID: "",
1068
- storeName: ""
1069
- });
1070
- return (l, t) => {
1071
- const m = y("FmTextField"), v = y("FmButton"), p = y("FmForm");
1072
- return g(), w(p, {
1073
- ref: "form",
1074
- class: "flex flex-col gap-16",
1075
- onValidationSuccess: t[5] || (t[5] = () => a.onUpdate(e.value))
1076
- }, {
1077
- default: k(() => [
1078
- n(m, {
1079
- modelValue: e.value.merchantId,
1080
- "onUpdate:modelValue": t[0] || (t[0] = (i) => e.value.merchantId = i),
1081
- label: "Merchant ID",
1082
- rules: r(A)(r(N).string())
1083
- }, null, 8, ["modelValue", "rules"]),
1084
- n(m, {
1085
- modelValue: e.value.merchantName,
1086
- "onUpdate:modelValue": t[1] || (t[1] = (i) => e.value.merchantName = i),
1087
- label: "Merchant Name",
1088
- rules: r(A)(r(N).string())
1089
- }, null, 8, ["modelValue", "rules"]),
1090
- n(m, {
1091
- modelValue: e.value.merchantCategoryCode,
1092
- "onUpdate:modelValue": t[2] || (t[2] = (i) => e.value.merchantCategoryCode = i),
1093
- label: "Merchant MCC",
1094
- rules: r(A)(r(N).string())
1095
- }, null, 8, ["modelValue", "rules"]),
1096
- n(m, {
1097
- modelValue: e.value.storeID,
1098
- "onUpdate:modelValue": t[3] || (t[3] = (i) => e.value.storeID = i),
1099
- label: "Store ID",
1100
- rules: r(A)(r(N).string())
1101
- }, null, 8, ["modelValue", "rules"]),
1102
- n(m, {
1103
- modelValue: e.value.storeName,
1104
- "onUpdate:modelValue": t[4] || (t[4] = (i) => e.value.storeName = i),
1105
- label: "Store Name",
1106
- rules: r(A)(r(N).string())
1107
- }, null, 8, ["modelValue", "rules"]),
1108
- s("div", Ze, [
1109
- a.gateway ? (g(), w(v, {
1110
- key: 0,
1111
- class: "flex-1",
1112
- variant: "secondary",
1113
- label: "Delete",
1114
- onclick: () => a.onDelete()
1115
- }, null, 8, ["onclick"])) : $("", !0),
1116
- n(v, {
1117
- type: "submit",
1118
- class: "flex-1",
1119
- variant: "primary",
1120
- label: "Save"
1121
- })
1122
- ])
1123
- ]),
1124
- _: 1
1125
- }, 512);
1126
- };
1127
- }
1128
- }), Qe = { class: "flex mt-6 space-x-6" }, We = /* @__PURE__ */ D({
1129
- __name: "DigioGateway",
1130
- props: {
1131
- gateway: {
1132
- type: Object,
1133
- required: !0
1134
- },
1135
- onUpdate: {
1136
- type: Function,
1137
- required: !0
1138
- },
1139
- onDelete: {
1140
- type: Function,
1141
- required: !0
1142
- }
1143
- },
1144
- setup(a) {
1145
- var b;
1146
- const e = C(((b = a.gateway) == null ? void 0 : b.config) || {
1147
- merchantId: "",
1148
- cardMerchantId: ""
1149
- });
1150
- return (l, t) => {
1151
- const m = y("FmTextField"), v = y("FmButton"), p = y("FmForm");
1152
- return g(), w(p, {
1153
- ref: "form",
1154
- class: "flex flex-col gap-16",
1155
- onValidationSuccess: t[2] || (t[2] = () => a.onUpdate(e.value))
1156
- }, {
1157
- default: k(() => [
1158
- n(m, {
1159
- modelValue: e.value.merchantId,
1160
- "onUpdate:modelValue": t[0] || (t[0] = (i) => e.value.merchantId = i),
1161
- label: "Merchant ID",
1162
- rules: r(A)(r(N).string())
1163
- }, null, 8, ["modelValue", "rules"]),
1164
- n(m, {
1165
- modelValue: e.value.cardMerchantId,
1166
- "onUpdate:modelValue": t[1] || (t[1] = (i) => e.value.cardMerchantId = i),
1167
- label: "Card Merchant ID",
1168
- rules: r(A)(r(N).string())
1169
- }, null, 8, ["modelValue", "rules"]),
1170
- s("div", Qe, [
1171
- a.gateway ? (g(), w(v, {
1172
- key: 0,
1173
- class: "flex-1",
1174
- variant: "secondary",
1175
- label: "Delete",
1176
- onclick: () => a.onDelete()
1177
- }, null, 8, ["onclick"])) : $("", !0),
1178
- n(v, {
1179
- type: "submit",
1180
- class: "flex-1",
1181
- variant: "primary",
1182
- label: "Save"
1183
- })
1184
- ])
1185
- ]),
1186
- _: 1
1187
- }, 512);
1188
- };
1189
- }
1190
- }), Xe = { class: "flex mt-6 space-x-6" }, et = /* @__PURE__ */ D({
1191
- __name: "AdyenGateway",
1192
- props: {
1193
- gateway: {
1194
- type: Object,
1195
- required: !0
1196
- },
1197
- onUpdate: {
1198
- type: Function,
1199
- required: !0
1200
- },
1201
- onDelete: {
1202
- type: Function,
1203
- required: !0
1204
- }
1205
- },
1206
- setup(a) {
1207
- var b;
1208
- const e = C(((b = a.gateway) == null ? void 0 : b.config) || {
1209
- merchantAccount: "",
1210
- username: "",
1211
- apiKey: "",
1212
- clientKey: "",
1213
- endpoint: "",
1214
- hmacKey: ""
1215
- });
1216
- return (l, t) => {
1217
- const m = y("FmTextField"), v = y("FmButton"), p = y("FmForm");
1218
- return g(), w(p, {
1219
- ref: "form",
1220
- class: "flex flex-col gap-16",
1221
- onValidationSuccess: t[6] || (t[6] = () => a.onUpdate(e.value))
1222
- }, {
1223
- default: k(() => [
1224
- n(m, {
1225
- modelValue: e.value.endpoint,
1226
- "onUpdate:modelValue": t[0] || (t[0] = (i) => e.value.endpoint = i),
1227
- label: "Endpoint",
1228
- rules: r(A)(r(N).string())
1229
- }, null, 8, ["modelValue", "rules"]),
1230
- n(m, {
1231
- modelValue: e.value.merchantAccount,
1232
- "onUpdate:modelValue": t[1] || (t[1] = (i) => e.value.merchantAccount = i),
1233
- label: "Merchant Account",
1234
- rules: r(A)(r(N).string())
1235
- }, null, 8, ["modelValue", "rules"]),
1236
- n(m, {
1237
- modelValue: e.value.username,
1238
- "onUpdate:modelValue": t[2] || (t[2] = (i) => e.value.username = i),
1239
- label: "Username",
1240
- rules: r(A)(r(N).string())
1241
- }, null, 8, ["modelValue", "rules"]),
1242
- n(m, {
1243
- modelValue: e.value.apiKey,
1244
- "onUpdate:modelValue": t[3] || (t[3] = (i) => e.value.apiKey = i),
1245
- label: "API Key",
1246
- rules: r(A)(r(N).string())
1247
- }, null, 8, ["modelValue", "rules"]),
1248
- n(m, {
1249
- modelValue: e.value.clientKey,
1250
- "onUpdate:modelValue": t[4] || (t[4] = (i) => e.value.clientKey = i),
1251
- label: "Client Key",
1252
- rules: r(A)(r(N).string())
1253
- }, null, 8, ["modelValue", "rules"]),
1254
- n(m, {
1255
- modelValue: e.value.hmacKey,
1256
- "onUpdate:modelValue": t[5] || (t[5] = (i) => e.value.hmacKey = i),
1257
- label: "HMac Key"
1258
- }, null, 8, ["modelValue"]),
1259
- s("div", Xe, [
1260
- a.gateway ? (g(), w(v, {
1261
- key: 0,
1262
- class: "flex-1",
1263
- variant: "secondary",
1264
- label: "Delete",
1265
- onclick: () => a.onDelete()
1266
- }, null, 8, ["onclick"])) : $("", !0),
1267
- n(v, {
1268
- type: "submit",
1269
- class: "flex-1",
1270
- variant: "primary",
1271
- label: "Save"
1272
- })
1273
- ])
1274
- ]),
1275
- _: 1
1276
- }, 512);
1277
- };
1278
- }
1279
- }), tt = { class: "flex mt-6 space-x-6" }, at = /* @__PURE__ */ D({
1280
- __name: "KsherGateway",
1281
- props: {
1282
- gateway: {
1283
- type: Object,
1284
- required: !0
1285
- },
1286
- onUpdate: {
1287
- type: Function,
1288
- required: !0
1289
- },
1290
- onDelete: {
1291
- type: Function,
1292
- required: !0
1293
- }
1294
- },
1295
- setup(a) {
1296
- var b;
1297
- const e = C(((b = a.gateway) == null ? void 0 : b.config) || {
1298
- appId: "",
1299
- privateKey: ""
1300
- });
1301
- return (l, t) => {
1302
- const m = y("FmTextField"), v = y("FmTextarea"), p = y("FmButton"), i = y("FmForm");
1303
- return g(), w(i, {
1304
- ref: "form",
1305
- class: "flex flex-col gap-16",
1306
- onValidationSuccess: t[2] || (t[2] = () => a.onUpdate(e.value))
1307
- }, {
1308
- default: k(() => [
1309
- n(m, {
1310
- modelValue: e.value.appId,
1311
- "onUpdate:modelValue": t[0] || (t[0] = (d) => e.value.appId = d),
1312
- label: "App ID",
1313
- rules: r(A)(r(N).string())
1314
- }, null, 8, ["modelValue", "rules"]),
1315
- n(v, {
1316
- modelValue: e.value.privateKey,
1317
- "onUpdate:modelValue": t[1] || (t[1] = (d) => e.value.privateKey = d),
1318
- label: "Private Key",
1319
- placeholder: "Paste your private key including BEGIN and END markers",
1320
- rules: r(A)(r(N).string())
1321
- }, null, 8, ["modelValue", "rules"]),
1322
- s("div", tt, [
1323
- a.gateway ? (g(), w(p, {
1324
- key: 0,
1325
- class: "flex-1",
1326
- variant: "secondary",
1327
- label: "Delete",
1328
- onclick: () => a.onDelete()
1329
- }, null, 8, ["onclick"])) : $("", !0),
1330
- n(p, {
1331
- type: "submit",
1332
- class: "flex-1",
1333
- variant: "primary",
1334
- label: "Save"
1335
- })
1336
- ])
1337
- ]),
1338
- _: 1
1339
- }, 512);
1340
- };
1341
- }
1342
- }), nt = /* @__PURE__ */ D({
1343
- __name: "TyroGateway",
1344
- props: {
1345
- gateway: {
1346
- type: Object,
1347
- required: !0
1348
- },
1349
- onUpdate: {
1350
- type: Function,
1351
- required: !0
1352
- },
1353
- onDelete: {
1354
- type: Function,
1355
- required: !0
1356
- }
1357
- },
1358
- setup(a) {
1359
- var b;
1360
- const e = C(
1361
- ((b = a.gateway) == null ? void 0 : b.config) || {
1362
- locationId: ""
1363
- }
1364
- );
1365
- return (l, t) => {
1366
- const m = y("FmTextField"), v = y("FmForm");
1367
- return g(), w(v, {
1368
- ref: "form",
1369
- class: "flex flex-col gap-16",
1370
- onValidationSuccess: t[1] || (t[1] = () => a.onUpdate(e.value))
1371
- }, {
1372
- default: k(() => [
1373
- n(m, {
1374
- modelValue: e.value.locationId,
1375
- "onUpdate:modelValue": t[0] || (t[0] = (p) => e.value.locationId = p),
1376
- label: "Location ID",
1377
- readonly: !0,
1378
- rules: r(A)(r(N).string())
1379
- }, null, 8, ["modelValue", "rules"])
1380
- ]),
1381
- _: 1
1382
- }, 512);
1383
- };
1384
- }
1385
- }), ot = {
1386
- key: 0,
1387
- className: "mt-1 my-6 text-gray-600"
1388
- }, lt = {
1389
- key: 1,
1390
- class: "flex items-center justify-center min-h-[80vh]"
1391
- }, ut = /* @__PURE__ */ D({
1392
- __name: "PaymentGateway",
1393
- props: {
1394
- payoutAccount: {
1395
- type: Object,
1396
- required: !0
1397
- }
1398
- },
1399
- setup(a) {
1400
- const u = me().currentCountry, e = u.value, b = J(), { isLoading: l, startAsyncCall: t } = X(), { gatewayTab: m } = ee({
1401
- gatewayTab: ""
1402
- }), v = a, p = [
1403
- {
1404
- label: "Fiuu",
1405
- value: "RAZER_MERCHANT_SERVICE",
1406
- render: Le,
1407
- region: [_.F_COUNTRY.enum.MY, _.F_COUNTRY.enum.SG]
1408
- },
1409
- {
1410
- label: "Macau Pass",
1411
- value: "MACAU_PASS",
1412
- render: Je,
1413
- region: [_.F_COUNTRY.enum.MO]
1414
- },
1415
- {
1416
- label: "Digio",
1417
- value: "DIGIO",
1418
- render: We,
1419
- region: [_.F_COUNTRY.enum.TH]
1420
- },
1421
- {
1422
- label: "Ksher",
1423
- value: "KSHER",
1424
- render: at,
1425
- region: [_.F_COUNTRY.enum.TH]
1426
- },
1427
- {
1428
- label: "Adyen",
1429
- value: "ADYEN",
1430
- render: et,
1431
- region: [_.F_COUNTRY.enum.MY, _.F_COUNTRY.enum.SG]
1432
- },
1433
- {
1434
- label: "Tyro",
1435
- value: "TYRO",
1436
- render: nt,
1437
- region: [_.F_COUNTRY.enum.AU]
1438
- }
1439
- ], i = C(
1440
- v.payoutAccount.gateways ?? []
1441
- ), d = Y(() => p.find((S) => S.value === m.value)), o = Y(() => p.filter(
1442
- (S) => S.region.includes(u.value ?? _.F_COUNTRY.enum.MY)
1443
- ));
1444
- async function c(S) {
1445
- await t(async () => {
1446
- try {
1447
- await G.updateGateway(v.payoutAccount._id, S), b.open({
1448
- type: "success",
1449
- title: "Payout account gateways update succesfully"
1450
- }), f.value = S.length === 0;
1451
- } catch (U) {
1452
- b.open({
1453
- type: "error",
1454
- title: "Error occurs when updating payout account gateways",
1455
- message: z(U)
1456
- });
1457
- }
1458
- });
1459
- }
1460
- const f = C((v.payoutAccount.gateways ?? []).length === 0), F = Y(() => e !== "MY" || !f.value);
1461
- return (S, U) => {
1462
- var M;
1463
- const I = y("FmCircularProgress"), T = y("FmSwitch"), R = y("FmTabs");
1464
- return g(), E(j, null, [
1465
- r(e) ? (g(), E("p", ot, [...U[2] || (U[2] = [
1466
- s("b", null, "Note: ", -1),
1467
- h(" There's no setup required for Malaysia Payment Gateway, once Payout Account is ready you will able to configure the payment channels. ", -1)
1468
- ])])) : $("", !0),
1469
- r(l) ? (g(), E("div", lt, [
1470
- n(I, { size: "xxl" })
1471
- ])) : (g(), E(j, { key: 2 }, [
1472
- r(e) === "MY" ? (g(), w(T, {
1473
- key: 0,
1474
- modelValue: f.value,
1475
- "onUpdate:modelValue": U[0] || (U[0] = (V) => f.value = V),
1476
- style: { "padding-bottom": "12px" },
1477
- label: "Use FeedMe's Default Account?"
1478
- }, null, 8, ["modelValue"])) : $("", !0),
1479
- F.value ? (g(), w(R, {
1480
- key: 1,
1481
- "model-value": r(m),
1482
- "onUpdate:modelValue": U[1] || (U[1] = (V) => W(m) ? m.value = V : null),
1483
- class: "mb-6",
1484
- items: o.value
1485
- }, null, 8, ["model-value", "items"])) : $("", !0),
1486
- F.value && r(m) ? (g(), w(ae((M = d.value) == null ? void 0 : M.render), ne(oe({ key: 2 }, {
1487
- gateway: i.value.find(
1488
- (V) => {
1489
- var x;
1490
- return V.paymentGateway === ((x = d.value) == null ? void 0 : x.value);
1491
- }
1492
- ),
1493
- onDelete: async () => {
1494
- i.value = i.value.filter(
1495
- (V) => {
1496
- var x;
1497
- return V.paymentGateway !== ((x = d.value) == null ? void 0 : x.value);
1498
- }
1499
- ), c(i.value);
1500
- },
1501
- onUpdate: (V) => {
1502
- var q;
1503
- let x = i.value.find(
1504
- (K) => {
1505
- var O;
1506
- return K.paymentGateway === ((O = d.value) == null ? void 0 : O.value);
1507
- }
1508
- );
1509
- x ? x.config = V : i.value.push({
1510
- paymentGateway: (q = d.value) == null ? void 0 : q.value,
1511
- config: V
1512
- }), c(i.value);
1513
- }
1514
- })), null, 16)) : $("", !0)
1515
- ], 64))
1516
- ], 64);
1517
- };
1518
- }
1519
- }), st = { class: "flex mt-6 space-x-6" }, rt = /* @__PURE__ */ D({
1520
- __name: "GooglePayToken",
1521
- props: {
1522
- gateway: {
1523
- type: Object,
1524
- required: !0
1525
- },
1526
- onUpdate: {
1527
- type: Function,
1528
- required: !0
1529
- },
1530
- onDelete: {
1531
- type: Function,
1532
- required: !0
1533
- }
1534
- },
1535
- setup(a) {
1536
- const e = C(
1537
- a.gateway || {
1538
- type: "googlePay",
1539
- gateway: "RAZER_MERCHANT_SERVICE",
1540
- config: {
1541
- gateway: "molpay",
1542
- gatewayMerchantId: "molpay"
1543
- }
1544
- }
1545
- );
1546
- return (b, l) => {
1547
- const t = y("FmTextField"), m = y("FmButton"), v = y("FmForm");
1548
- return g(), w(v, {
1549
- ref: "form",
1550
- class: "flex flex-col gap-16",
1551
- onValidationSuccess: l[3] || (l[3] = () => a.onUpdate(e.value))
1552
- }, {
1553
- default: k(() => [
1554
- n(t, {
1555
- modelValue: e.value.gateway,
1556
- "onUpdate:modelValue": l[0] || (l[0] = (p) => e.value.gateway = p),
1557
- label: "Gateway",
1558
- disabled: !0,
1559
- rules: r(A)(r(N).string())
1560
- }, null, 8, ["modelValue", "rules"]),
1561
- n(t, {
1562
- modelValue: e.value.config.gateway,
1563
- "onUpdate:modelValue": l[1] || (l[1] = (p) => e.value.config.gateway = p),
1564
- label: "Gateway ID",
1565
- disabled: !0,
1566
- rules: r(A)(r(N).string())
1567
- }, null, 8, ["modelValue", "rules"]),
1568
- n(t, {
1569
- modelValue: e.value.config.gatewayMerchantId,
1570
- "onUpdate:modelValue": l[2] || (l[2] = (p) => e.value.config.gatewayMerchantId = p),
1571
- label: "Gateway Merchant ID",
1572
- disabled: !0,
1573
- rules: r(A)(r(N).string())
1574
- }, null, 8, ["modelValue", "rules"]),
1575
- s("div", st, [
1576
- a.gateway ? (g(), w(m, {
1577
- key: 0,
1578
- class: "flex-1",
1579
- variant: "secondary",
1580
- label: "Delete",
1581
- onclick: () => a.onDelete()
1582
- }, null, 8, ["onclick"])) : $("", !0),
1583
- n(m, {
1584
- type: "submit",
1585
- class: "flex-1",
1586
- variant: "primary",
1587
- label: "Save"
1588
- })
1589
- ])
1590
- ]),
1591
- _: 1
1592
- }, 512);
1593
- };
1594
- }
1595
- }), it = { class: "flex mt-6 space-x-6" }, mt = /* @__PURE__ */ D({
1596
- __name: "ApplePayToken",
1597
- props: {
1598
- gateway: {
1599
- type: Object,
1600
- required: !0
1601
- },
1602
- onUpdate: {
1603
- type: Function,
1604
- required: !0
1605
- },
1606
- onDelete: {
1607
- type: Function,
1608
- required: !0
1609
- }
1610
- },
1611
- setup(a) {
1612
- const e = C(
1613
- a.gateway || {
1614
- type: "applePay",
1615
- gateway: "RAZER_MERCHANT_SERVICE",
1616
- config: {
1617
- merchantId: "FMfeedme"
1618
- }
1619
- }
1620
- );
1621
- return (b, l) => {
1622
- const t = y("FmTextField"), m = y("FmButton"), v = y("FmForm");
1623
- return g(), w(v, {
1624
- ref: "form",
1625
- class: "flex flex-col gap-16",
1626
- onValidationSuccess: l[2] || (l[2] = () => a.onUpdate(e.value))
1627
- }, {
1628
- default: k(() => [
1629
- n(t, {
1630
- modelValue: e.value.gateway,
1631
- "onUpdate:modelValue": l[0] || (l[0] = (p) => e.value.gateway = p),
1632
- label: "Gateway",
1633
- disabled: !0,
1634
- rules: r(A)(r(N).string())
1635
- }, null, 8, ["modelValue", "rules"]),
1636
- n(t, {
1637
- modelValue: e.value.config.merchantId,
1638
- "onUpdate:modelValue": l[1] || (l[1] = (p) => e.value.config.merchantId = p),
1639
- label: "Merchant ID",
1640
- disabled: !0,
1641
- rules: r(A)(r(N).string())
1642
- }, null, 8, ["modelValue", "rules"]),
1643
- s("div", it, [
1644
- a.gateway ? (g(), w(m, {
1645
- key: 0,
1646
- class: "flex-1",
1647
- variant: "secondary",
1648
- label: "Delete",
1649
- onclick: () => a.onDelete()
1650
- }, null, 8, ["onclick"])) : $("", !0),
1651
- n(m, {
1652
- type: "submit",
1653
- class: "flex-1",
1654
- variant: "primary",
1655
- label: "Save"
1656
- })
1657
- ])
1658
- ]),
1659
- _: 1
1660
- }, 512);
1661
- };
1662
- }
1663
- }), ct = {
1664
- key: 0,
1665
- class: "flex items-center justify-center min-h-[80vh]"
1666
- }, dt = /* @__PURE__ */ D({
1667
- __name: "TokenGateway",
1668
- props: {
1669
- payoutAccount: {
1670
- type: Object,
1671
- required: !0
1672
- }
1673
- },
1674
- setup(a) {
1675
- const u = me().currentCountry, e = J(), { isLoading: b, startAsyncCall: l } = X(), { tokenTab: t } = ee({
1676
- tokenTab: ""
1677
- }), m = a, v = [
1678
- {
1679
- label: "Google Pay",
1680
- value: "googlePay",
1681
- icon: "android",
1682
- render: rt,
1683
- region: [_.F_COUNTRY.enum.MY, _.F_COUNTRY.enum.SG]
1684
- },
1685
- {
1686
- label: "Apple Pay",
1687
- value: "applePay",
1688
- icon: "iOS",
1689
- render: mt,
1690
- region: [_.F_COUNTRY.enum.MY, _.F_COUNTRY.enum.SG]
1691
- }
1692
- ], p = C(m.payoutAccount.tokens ?? []), i = Y(() => v.find((c) => c.value === t.value)), d = Y(() => v.filter(
1693
- (c) => c.region.includes(u.value ?? _.F_COUNTRY.enum.MY)
1694
- ));
1695
- async function o(c) {
1696
- await l(async () => {
1697
- try {
1698
- await G.updateTokens(m.payoutAccount._id, c), e.open({
1699
- type: "success",
1700
- title: "Payout account tokens gateway update succesfully"
1701
- });
1702
- } catch (f) {
1703
- e.open({
1704
- type: "error",
1705
- title: "Error occurs when updating payout account tokens",
1706
- message: z(f)
1707
- });
1708
- }
1709
- });
1710
- }
1711
- return (c, f) => {
1712
- var U;
1713
- const F = y("FmCircularProgress"), S = y("FmTabs");
1714
- return g(), E(j, null, [
1715
- f[1] || (f[1] = s("p", { className: "mt-1 my-6 text-gray-600" }, [
1716
- s("b", null, "Note: "),
1717
- h(" 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. "),
1718
- s("br"),
1719
- s("br"),
1720
- s("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. `),
1721
- s("br")
1722
- ], -1)),
1723
- r(b) ? (g(), E("div", ct, [
1724
- n(F, { size: "xxl" })
1725
- ])) : (g(), w(S, {
1726
- key: 1,
1727
- "model-value": r(t),
1728
- "onUpdate:modelValue": f[0] || (f[0] = (I) => W(t) ? t.value = I : null),
1729
- class: "mb-6 mt-6",
1730
- items: d.value
1731
- }, null, 8, ["model-value", "items"])),
1732
- r(t) ? (g(), w(ae((U = i.value) == null ? void 0 : U.render), ne(oe({ key: 2 }, {
1733
- gateway: p.value.find((I) => {
1734
- var T;
1735
- return I.type === ((T = i.value) == null ? void 0 : T.value);
1736
- }),
1737
- onDelete: async () => {
1738
- p.value = p.value.filter((I) => {
1739
- var T;
1740
- return I.type !== ((T = i.value) == null ? void 0 : T.value);
1741
- }), o(p.value);
1742
- },
1743
- onUpdate: (I) => {
1744
- let T = p.value.find((R) => {
1745
- var M;
1746
- return R.type === ((M = i.value) == null ? void 0 : M.value);
1747
- });
1748
- T ? T.config = I : p.value.push(I), o(p.value);
1749
- }
1750
- })), null, 16)) : $("", !0)
1751
- ], 64);
1752
- };
1753
- }
1754
- }), Ut = /* @__PURE__ */ D({
1755
- __name: "PayoutAccountSetting",
1756
- props: {
1757
- accountId: {
1758
- type: String,
1759
- required: !0
1760
- }
1761
- },
1762
- setup(a) {
1763
- const u = a, { tab: e } = ee({
1764
- tab: "information"
1765
- }), { isLoading: b, startAsyncCall: l } = X(!0), t = ye(), m = C();
1766
- async function v(o) {
1767
- await G.updateById(
1768
- u.accountId,
1769
- o
1770
- ), m.value = await G.readById(u.accountId);
1771
- }
1772
- const p = [
1773
- {
1774
- label: "Information",
1775
- value: "information",
1776
- icon: "overview",
1777
- render: we
1778
- },
1779
- {
1780
- label: "Settlement",
1781
- value: "settlement",
1782
- icon: "payments",
1783
- render: he
1784
- },
1785
- {
1786
- label: "MDR Status",
1787
- value: "payment",
1788
- icon: "account_box",
1789
- render: Ge
1790
- },
1791
- {
1792
- label: "Online Gateways",
1793
- icon: "assured_workload",
1794
- value: "gateways",
1795
- render: ut
1796
- },
1797
- {
1798
- label: "Token Gateways",
1799
- value: "tokens",
1800
- icon: "wallet",
1801
- render: dt
1802
- },
1803
- {
1804
- label: "Online Channels",
1805
- icon: "shopping_cart",
1806
- value: "channels",
1807
- render: He
1808
- }
1809
- ];
1810
- function i() {
1811
- l(async () => {
1812
- m.value = await G.readById(u.accountId);
1813
- });
1814
- }
1815
- re(i);
1816
- const d = Y(() => {
1817
- const o = p.reduce((c, f) => c || (f.children ? f.children.find((F) => F.value === e.value) || null : f.value === e.value ? f : null), null);
1818
- return o == null ? void 0 : o.render;
1819
- });
1820
- return (o, c) => {
1821
- var F;
1822
- const f = y("FmTabs");
1823
- return g(), w(pe, {
1824
- title: `Payout Account (${(F = m.value) == null ? void 0 : F._id})`,
1825
- loading: r(b),
1826
- onBack: r(t).back
1827
- }, {
1828
- default: k(() => [
1829
- n(f, {
1830
- "model-value": r(e),
1831
- "onUpdate:modelValue": c[0] || (c[0] = (S) => W(e) ? e.value = S : null),
1832
- class: "mb-6",
1833
- items: p
1834
- }, null, 8, ["model-value"]),
1835
- r(e) ? (g(), w(ae(d.value), ne(oe({ key: 0 }, {
1836
- payoutAccount: m.value,
1837
- onUpdate: v
1838
- })), null, 16)) : $("", !0)
1839
- ]),
1840
- _: 1
1841
- }, 8, ["title", "loading", "onBack"]);
1842
- };
1843
- }
1844
- });
1845
- export {
1846
- Ut as default
1847
- };