@feedmepos/mf-payment 0.0.0-beta.40 → 0.0.0-beta.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/dist/{PayoutAccount-Bx7WBGhx.js → PayoutAccount-BmZwmSt4.js} +5 -5
  2. package/dist/{PayoutAccount-CW3L2i8M.js → PayoutAccount-UHEZ4sXv.js} +3 -3
  3. package/dist/{PayoutAccountSetting-CPaxWLYZ.js → PayoutAccountSetting-CywVFXxL.js} +3 -3
  4. package/dist/{Settlement-DL8ff0Vv.js → Settlement-CwdBiElJ.js} +3 -3
  5. package/dist/{Settlement-CRGaycXE.js → Settlement-ID4SKZQU.js} +3 -3
  6. package/dist/{SettlementTransactions-W0DQHQMd.js → SettlementTransactions-CZc3gg2W.js} +4 -4
  7. package/dist/{SettlementTransactions-CdL1ExM6.js → SettlementTransactions-Cva0BhNe.js} +4 -4
  8. package/dist/{Terminal-D0TElER9.js → Terminal-CD2HjTZ6.js} +4 -4
  9. package/dist/TerminalSetting-1bqfLfaT.js +379 -0
  10. package/dist/{TerminalTransaction-GEIPUUzT.js → TerminalTransaction-DYrFWTIb.js} +5 -5
  11. package/dist/{TerminalTransaction-BszPZSBF.js → TerminalTransaction-jVoZHvia.js} +5 -5
  12. package/dist/{Transaction-16R7hUeI.js → Transaction-CjUdHN9-.js} +4 -4
  13. package/dist/{Transaction-C8P0mIss.js → Transaction-D1RHJmuR.js} +4 -4
  14. package/dist/app.js +13 -13
  15. package/dist/{assets-CFcerXvc.js → assets-BhBS0p9e.js} +1 -1
  16. package/dist/{index-DtBydBjg.js → index-9ujJCGqe.js} +2 -2
  17. package/dist/{index-B43_27r6.js → index-BlGpdOEP.js} +1 -1
  18. package/dist/{index-DU5MydmH.js → index-C074LfUa.js} +1 -1
  19. package/dist/{index-Cck_cJ4W.js → index-C5AZUa6M.js} +1 -1
  20. package/dist/{index-BDfIDSZM.js → index-CM83utfE.js} +1 -1
  21. package/dist/{index-DEkrv1NK.js → index-DuCv6dOI.js} +1 -1
  22. package/dist/{index.vue_vue_type_script_setup_true_lang-BSRXe76m.js → index.vue_vue_type_script_setup_true_lang-DcbfY6SQ.js} +1 -1
  23. package/dist/package.json +1 -1
  24. package/dist/{payout-account-9gryxf2v.js → payout-account-D_HmqPHp.js} +215 -215
  25. package/dist/{transaction-kfOOv_cv.js → transaction-D5lnozQA.js} +1 -1
  26. package/dist/tsconfig.app.tsbuildinfo +1 -1
  27. package/package.json +1 -1
  28. package/dist/TerminalSetting-lqi5bdAq.js +0 -378
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "0.0.0-beta.40",
3
+ "version": "0.0.0-beta.42",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,378 +0,0 @@
1
- import { defineComponent as b, openBlock as F, createElementBlock as D, Fragment as _, createElementVNode as p, createTextVNode as V, toDisplayString as T, ref as y, onMounted as S, computed as M, resolveComponent as f, unref as w, createVNode as g, createBlock as I, withCtx as G, createCommentVNode as q, isRef as $, resolveDynamicComponent as P, normalizeProps as K, mergeProps as L } from "vue";
2
- import { u as C } from "./index-DtBydBjg.js";
3
- import { useRouter as N } from "vue-router";
4
- import { t as U } from "./index-DEkrv1NK.js";
5
- import { _ as O } from "./Layout.vue_vue_type_script_setup_true_lang-C38PTqO5.js";
6
- import { u as j } from "./index-Cck_cJ4W.js";
7
- import { useSnackbar as E } from "@feedmepos/ui-library";
8
- import { u as A } from "./error-K1CakhA9.js";
9
- const R = /* @__PURE__ */ b({
10
- __name: "Information",
11
- props: {
12
- terminal: {
13
- type: Object,
14
- required: !0
15
- }
16
- },
17
- setup(t) {
18
- return (l, a) => (F(), D(_, null, [
19
- a[0] || (a[0] = p("b", null, "Name", -1)),
20
- V(": " + T(t.terminal.name), 1),
21
- a[1] || (a[1] = p("br", null, null, -1)),
22
- a[2] || (a[2] = p("b", null, "Status", -1)),
23
- V(": " + T(t.terminal.status), 1),
24
- a[3] || (a[3] = p("br", null, null, -1)),
25
- a[4] || (a[4] = p("b", null, "Device ID", -1)),
26
- V(": " + T(t.terminal.deviceId ?? "-"), 1),
27
- a[5] || (a[5] = p("br", null, null, -1)),
28
- a[6] || (a[6] = p("b", null, "Device Type", -1)),
29
- V(": " + T(t.terminal.deviceType ?? "-"), 1),
30
- a[7] || (a[7] = p("br", null, null, -1))
31
- ], 64));
32
- }
33
- }), z = {
34
- key: 0,
35
- class: "flex items-center justify-center min-h-[80vh]"
36
- }, H = { class: "flex mt-6 space-x-6" }, Q = /* @__PURE__ */ b({
37
- __name: "TerminalGateway",
38
- props: {
39
- terminal: {
40
- type: Object,
41
- required: !0
42
- },
43
- onUpdate: {
44
- type: Function,
45
- required: !0
46
- }
47
- },
48
- setup(t) {
49
- const { isLoading: l, startAsyncCall: a } = C(), o = t, i = y(), c = y(), m = y(-1), e = y({
50
- terminalId: ""
51
- });
52
- S(() => {
53
- if (a(async () => {
54
- i.value = await U.getTerminals(o.terminal.referenceId);
55
- }), !o.terminal.ecrs)
56
- return;
57
- const s = o.terminal.ecrs.findIndex((r) => r && r.gateway && r.gateway === "FeedMe");
58
- if (s === -1)
59
- return;
60
- m.value = s;
61
- const u = o.terminal.ecrs.at(s);
62
- u.gateway === "FeedMe" && u.config && (e.value = {
63
- terminalId: u.config.terminalId
64
- });
65
- });
66
- const n = M(() => (i.value ?? []).map((s) => ({
67
- label: s.name ?? s._id,
68
- value: s._id
69
- })));
70
- async function d(s) {
71
- var u;
72
- (u = o.terminal.ecrs) == null || u.splice(s, 1), o.onUpdate(o.terminal);
73
- }
74
- return (s, u) => {
75
- const r = f("FmCircularProgress"), v = f("FmSelect"), x = f("FmButton"), k = f("FmForm");
76
- return w(l) ? (F(), D("div", z, [
77
- g(r, { size: "xxl" })
78
- ])) : (F(), I(k, {
79
- key: 1,
80
- ref: c.value,
81
- class: "flex flex-col gap-16 w-[500px]",
82
- onValidationSuccess: u[1] || (u[1] = () => {
83
- m.value > -1 ? t.terminal.ecrs[m.value] = { gateway: "FeedMe", config: e.value } : (t.terminal.ecrs || (t.terminal.ecrs = []), t.terminal.ecrs.push({ gateway: "FeedMe", config: e.value })), o.onUpdate(t.terminal);
84
- })
85
- }, {
86
- default: G(() => [
87
- g(v, {
88
- modelValue: e.value.terminalId,
89
- "onUpdate:modelValue": u[0] || (u[0] = (B) => e.value.terminalId = B),
90
- label: "Terminal ID",
91
- items: n.value
92
- }, null, 8, ["modelValue", "items"]),
93
- p("div", H, [
94
- m.value > -1 ? (F(), I(x, {
95
- key: 0,
96
- class: "flex-1",
97
- variant: "secondary",
98
- label: "Delete",
99
- onclick: () => d(m.value)
100
- }, null, 8, ["onclick"])) : q("", !0),
101
- g(x, {
102
- type: "submit",
103
- class: "flex-1",
104
- variant: "primary",
105
- label: "Save"
106
- })
107
- ])
108
- ]),
109
- _: 1
110
- }, 512));
111
- };
112
- }
113
- }), h = { class: "flex mt-6 space-x-6" }, J = /* @__PURE__ */ b({
114
- __name: "FiuuGateway",
115
- props: {
116
- terminal: {
117
- type: Object,
118
- required: !0
119
- },
120
- onUpdate: {
121
- type: Function,
122
- required: !0
123
- }
124
- },
125
- setup(t) {
126
- const l = t, a = [
127
- {
128
- label: "Fiuu Malaysia",
129
- value: "cc.feedme.payment.rms"
130
- },
131
- {
132
- label: "Fiuu Malaysia V2",
133
- value: "cc.feedme.payment.fiuu_my"
134
- },
135
- {
136
- label: "Fiuu Singapore",
137
- value: "cc.feedme.payment.fiuu_sg"
138
- }
139
- ], o = y(), i = y(-1), c = y({
140
- packageId: "",
141
- uniqueId: ""
142
- });
143
- S(() => {
144
- if (!l.terminal.gateways)
145
- return;
146
- const e = l.terminal.gateways.findIndex((d) => d && d.gateway && d.gateway === "Fiuu");
147
- if (e === -1)
148
- return;
149
- i.value = e;
150
- const n = l.terminal.gateways.at(e);
151
- n.gateway === "Fiuu" && n.config && (c.value = {
152
- packageId: n.config.packageId,
153
- uniqueId: n.config.uniqueId
154
- });
155
- });
156
- async function m(e) {
157
- var n;
158
- (n = l.terminal.gateways) == null || n.splice(e, 1), l.onUpdate(l.terminal);
159
- }
160
- return (e, n) => {
161
- const d = f("FmSelect"), s = f("FmTextField"), u = f("FmButton"), r = f("FmForm");
162
- return F(), I(r, {
163
- ref: o.value,
164
- class: "flex flex-col gap-16 w-[500px]",
165
- onValidationSuccess: n[2] || (n[2] = () => {
166
- i.value > -1 ? t.terminal.gateways[i.value] = { gateway: "Fiuu", config: c.value } : (t.terminal.gateways || (t.terminal.gateways = []), t.terminal.gateways.push({ gateway: "Fiuu", config: c.value })), l.onUpdate(t.terminal);
167
- })
168
- }, {
169
- default: G(() => [
170
- g(d, {
171
- modelValue: c.value.packageId,
172
- "onUpdate:modelValue": n[0] || (n[0] = (v) => c.value.packageId = v),
173
- label: "Package ID",
174
- items: a
175
- }, null, 8, ["modelValue"]),
176
- g(s, {
177
- modelValue: c.value.uniqueId,
178
- "onUpdate:modelValue": n[1] || (n[1] = (v) => c.value.uniqueId = v),
179
- label: "Unique ID"
180
- }, null, 8, ["modelValue"]),
181
- p("div", h, [
182
- i.value > -1 ? (F(), I(u, {
183
- key: 0,
184
- class: "flex-1",
185
- variant: "secondary",
186
- label: "Delete",
187
- onclick: () => m(i.value)
188
- }, null, 8, ["onclick"])) : q("", !0),
189
- g(u, {
190
- type: "submit",
191
- class: "flex-1",
192
- variant: "primary",
193
- label: "Save"
194
- })
195
- ])
196
- ]),
197
- _: 1
198
- }, 512);
199
- };
200
- }
201
- }), W = { class: "flex mt-6 space-x-6" }, X = /* @__PURE__ */ b({
202
- __name: "GhlGateway",
203
- props: {
204
- terminal: {
205
- type: Object,
206
- required: !0
207
- },
208
- onUpdate: {
209
- type: Function,
210
- required: !0
211
- }
212
- },
213
- setup(t) {
214
- const l = t, a = y(), o = y(-1), i = y({
215
- merchantId: "",
216
- terminalId: "",
217
- privateKey: ""
218
- });
219
- S(() => {
220
- if (!l.terminal.ecrs)
221
- return;
222
- const m = l.terminal.ecrs.findIndex((n) => n && n.gateway && n.gateway === "Ghl");
223
- if (m === -1)
224
- return;
225
- o.value = m;
226
- const e = l.terminal.ecrs.at(m);
227
- e.gateway === "Ghl" && e.config && (i.value = {
228
- merchantId: e.config.merchantId,
229
- terminalId: e.config.terminalId,
230
- privateKey: e.config.privateKey
231
- });
232
- });
233
- async function c(m) {
234
- var e;
235
- (e = l.terminal.ecrs) == null || e.splice(m, 1), l.onUpdate(l.terminal);
236
- }
237
- return (m, e) => {
238
- const n = f("FmTextField"), d = f("FmTextarea"), s = f("FmButton"), u = f("FmForm");
239
- return F(), I(u, {
240
- ref: a.value,
241
- class: "flex flex-col gap-16 w-[500px]",
242
- onValidationSuccess: e[3] || (e[3] = () => {
243
- o.value > -1 ? t.terminal.ecrs[o.value] = { gateway: "Ghl", config: i.value } : (t.terminal.ecrs || (t.terminal.ecrs = []), t.terminal.ecrs.push({ gateway: "Ghl", config: i.value })), l.onUpdate(t.terminal);
244
- })
245
- }, {
246
- default: G(() => [
247
- g(n, {
248
- modelValue: i.value.merchantId,
249
- "onUpdate:modelValue": e[0] || (e[0] = (r) => i.value.merchantId = r),
250
- label: "Merchant ID"
251
- }, null, 8, ["modelValue"]),
252
- g(n, {
253
- modelValue: i.value.terminalId,
254
- "onUpdate:modelValue": e[1] || (e[1] = (r) => i.value.terminalId = r),
255
- label: "Terminal ID"
256
- }, null, 8, ["modelValue"]),
257
- g(d, {
258
- modelValue: i.value.privateKey,
259
- "onUpdate:modelValue": e[2] || (e[2] = (r) => i.value.privateKey = r),
260
- label: "Private Key"
261
- }, null, 8, ["modelValue"]),
262
- p("div", W, [
263
- o.value > -1 ? (F(), I(s, {
264
- key: 0,
265
- class: "flex-1",
266
- variant: "secondary",
267
- label: "Delete",
268
- onclick: () => c(o.value)
269
- }, null, 8, ["onclick"])) : q("", !0),
270
- g(s, {
271
- type: "submit",
272
- class: "flex-1",
273
- variant: "primary",
274
- label: "Save"
275
- })
276
- ])
277
- ]),
278
- _: 1
279
- }, 512);
280
- };
281
- }
282
- }), ie = /* @__PURE__ */ b({
283
- __name: "TerminalSetting",
284
- props: {
285
- terminalId: {
286
- type: String,
287
- required: !0
288
- }
289
- },
290
- setup(t) {
291
- const l = t, { tab: a } = j({
292
- tab: "information"
293
- }), { isLoading: o, startAsyncCall: i } = C(!0), c = N(), m = E(), e = y();
294
- async function n(r) {
295
- try {
296
- await U.updateById(
297
- l.terminalId,
298
- {
299
- name: r.name,
300
- status: r.status,
301
- ecrs: r.ecrs ?? [],
302
- gateways: r.gateways ?? []
303
- }
304
- ), e.value = await U.readById(l.terminalId), m.open({
305
- type: "success",
306
- message: "Terminal updated successfully"
307
- });
308
- } catch (v) {
309
- m.open({
310
- type: "error",
311
- title: "Error occurs when update terminal",
312
- message: A(v)
313
- });
314
- }
315
- }
316
- const d = [
317
- {
318
- label: "Information",
319
- value: "information",
320
- icon: "overview",
321
- render: R
322
- },
323
- {
324
- label: "Fiuu",
325
- value: "fiuu",
326
- icon: "payment",
327
- render: J
328
- }
329
- ], s = M(() => {
330
- var r;
331
- return (r = d.find((v) => v.value === a.value)) == null ? void 0 : r.render;
332
- });
333
- async function u() {
334
- i(async () => {
335
- e.value = await U.readById(l.terminalId), e.value.deviceType !== "TERMINAL" && d.push(
336
- {
337
- label: "FeedMe Terminal",
338
- value: "terminal",
339
- icon: "shopping_cart_checkout",
340
- render: Q
341
- },
342
- {
343
- label: "GHL Terminal (V2)",
344
- value: "ghl",
345
- icon: "shopping_cart_checkout",
346
- render: X
347
- }
348
- );
349
- });
350
- }
351
- return S(u), (r, v) => {
352
- var k;
353
- const x = f("FmTabs");
354
- return F(), I(O, {
355
- title: `Terminal (${(k = e.value) == null ? void 0 : k._id})`,
356
- loading: w(o),
357
- onBack: w(c).back
358
- }, {
359
- default: G(() => [
360
- g(x, {
361
- "model-value": w(a),
362
- "onUpdate:modelValue": v[0] || (v[0] = (B) => $(a) ? a.value = B : null),
363
- class: "mb-6",
364
- items: d
365
- }, null, 8, ["model-value"]),
366
- w(a) ? (F(), I(P(s.value), K(L({ key: 0 }, {
367
- terminal: e.value,
368
- onUpdate: n
369
- })), null, 16)) : q("", !0)
370
- ]),
371
- _: 1
372
- }, 8, ["title", "loading", "onBack"]);
373
- };
374
- }
375
- });
376
- export {
377
- ie as default
378
- };