@feedmepos/mf-payment 0.0.0-beta.28 → 0.0.0-beta.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,6 +21,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
21
21
  gateway: "Terminal";
22
22
  })[] | null | undefined;
23
23
  status: "Active" | "Inactive";
24
+ /**__VLS_emit,__VLS_9,validation-success*/
24
25
  _id: string;
25
26
  referenceId: string;
26
27
  securityCode: string;
@@ -55,6 +56,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
55
56
  gateway: "Terminal";
56
57
  })[] | null | undefined;
57
58
  status: "Active" | "Inactive";
59
+ /**__VLS_emit,__VLS_9,validation-success*/
58
60
  _id: string;
59
61
  referenceId: string;
60
62
  securityCode: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "0.0.0-beta.28",
3
+ "version": "0.0.0-beta.29",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,259 +0,0 @@
1
- import { defineComponent as x, openBlock as w, createElementBlock as C, Fragment as L, createElementVNode as v, createTextVNode as q, toDisplayString as B, ref as y, onMounted as T, computed as _, resolveComponent as c, unref as I, createVNode as g, createBlock as k, withCtx as U, isRef as N, resolveDynamicComponent as P, normalizeProps as E, mergeProps as M, createCommentVNode as O } from "vue";
2
- import { u as D } from "./index-CTWoVKkI.js";
3
- import { useRouter as $ } from "vue-router";
4
- import { t as b } from "./index-DvBq8FZH.js";
5
- import { _ as j } from "./Layout.vue_vue_type_script_setup_true_lang-C38PTqO5.js";
6
- import { u as A } from "./index-BYz1HdLk.js";
7
- import { useSnackbar as G } from "@feedmepos/ui-library";
8
- import { u as R } from "./error-K1CakhA9.js";
9
- const z = /* @__PURE__ */ x({
10
- __name: "Information",
11
- props: {
12
- terminal: {
13
- type: Object,
14
- required: !0
15
- }
16
- },
17
- setup(t) {
18
- return (i, e) => (w(), C(L, null, [
19
- e[0] || (e[0] = v("b", null, "Name", -1)),
20
- q(": " + B(t.terminal.name), 1),
21
- e[1] || (e[1] = v("br", null, null, -1)),
22
- e[2] || (e[2] = v("b", null, "Status", -1)),
23
- q(": " + B(t.terminal.status), 1),
24
- e[3] || (e[3] = v("br", null, null, -1)),
25
- e[4] || (e[4] = v("b", null, "Device ID", -1)),
26
- q(": " + B(t.terminal.deviceId ?? "-"), 1),
27
- e[5] || (e[5] = v("br", null, null, -1))
28
- ], 64));
29
- }
30
- }), Q = {
31
- key: 0,
32
- class: "flex items-center justify-center min-h-[80vh]"
33
- }, H = /* @__PURE__ */ x({
34
- __name: "TerminalGateway",
35
- props: {
36
- terminal: {
37
- type: Object,
38
- required: !0
39
- },
40
- onUpdate: {
41
- type: Function,
42
- required: !0
43
- }
44
- },
45
- setup(t) {
46
- const { isLoading: i, startAsyncCall: e } = D(), m = t, d = y();
47
- async function o() {
48
- e(async () => {
49
- d.value = await b.getTerminals(m.terminal.referenceId);
50
- });
51
- }
52
- T(o);
53
- const s = y(), a = y(-1), l = y({
54
- terminalId: ""
55
- });
56
- T(() => {
57
- if (!m.terminal.gateways)
58
- return;
59
- const r = m.terminal.gateways.findIndex((n) => n && n.gateway && n.gateway === "Terminal");
60
- if (r === -1)
61
- return;
62
- a.value = r;
63
- const u = m.terminal.gateways.at(r);
64
- u.gateway === "Terminal" && u.config && (l.value = {
65
- terminalId: u.config.terminalId
66
- });
67
- });
68
- const p = _(() => (d.value ?? []).map((r) => ({
69
- label: r.name ?? r._id,
70
- value: r._id
71
- })));
72
- return (r, u) => {
73
- const n = c("FmCircularProgress"), f = c("FmSelect"), V = c("FmButton"), F = c("FmForm");
74
- return I(i) ? (w(), C("div", Q, [
75
- g(n, { size: "xxl" })
76
- ])) : (w(), k(F, {
77
- key: 1,
78
- ref: s.value,
79
- class: "flex flex-col gap-16 w-[500px]",
80
- onValidationSuccess: u[1] || (u[1] = () => {
81
- a.value > -1 ? t.terminal.gateways[a.value] = { gateway: "Terminal", config: l.value } : (t.terminal.gateways || (t.terminal.gateways = []), t.terminal.gateways.push({ gateway: "Terminal", config: l.value })), m.onUpdate(t.terminal);
82
- })
83
- }, {
84
- default: U(() => [
85
- g(f, {
86
- modelValue: l.value.terminalId,
87
- "onUpdate:modelValue": u[0] || (u[0] = (S) => l.value.terminalId = S),
88
- label: "Terminal ID",
89
- items: p.value
90
- }, null, 8, ["modelValue", "items"]),
91
- g(V, {
92
- type: "submit",
93
- label: "Save"
94
- })
95
- ]),
96
- _: 1
97
- }, 512));
98
- };
99
- }
100
- }), J = /* @__PURE__ */ x({
101
- __name: "FiuuGateway",
102
- props: {
103
- terminal: {
104
- type: Object,
105
- required: !0
106
- },
107
- onUpdate: {
108
- type: Function,
109
- required: !0
110
- }
111
- },
112
- setup(t) {
113
- const i = t, e = [
114
- {
115
- label: "Fiuu Malaysia",
116
- value: "cc.feedme.payment.rms"
117
- },
118
- {
119
- label: "Fiuu Malaysia V2",
120
- value: "cc.feedme.payment.fiuu_my"
121
- },
122
- {
123
- label: "Fiuu Singapore",
124
- value: "cc.feedme.payment.fiuu_sg"
125
- }
126
- ], m = y(), d = y(-1), o = y({
127
- packageId: "",
128
- uniqueId: ""
129
- });
130
- return T(() => {
131
- if (!i.terminal.gateways)
132
- return;
133
- const s = i.terminal.gateways.findIndex((l) => l && l.gateway && l.gateway === "Fiuu");
134
- if (s === -1)
135
- return;
136
- d.value = s;
137
- const a = i.terminal.gateways.at(s);
138
- a.gateway === "Fiuu" && a.config && (o.value = {
139
- packageId: a.config.packageId,
140
- uniqueId: a.config.uniqueId
141
- });
142
- }), (s, a) => {
143
- const l = c("FmSelect"), p = c("FmTextField"), r = c("FmButton"), u = c("FmForm");
144
- return w(), k(u, {
145
- ref: m.value,
146
- class: "flex flex-col gap-16 w-[500px]",
147
- onValidationSuccess: a[2] || (a[2] = () => {
148
- d.value > -1 ? t.terminal.gateways[d.value] = { gateway: "Fiuu", config: o.value } : (t.terminal.gateways || (t.terminal.gateways = []), t.terminal.gateways.push({ gateway: "Fiuu", config: o.value })), i.onUpdate(t.terminal);
149
- })
150
- }, {
151
- default: U(() => [
152
- g(l, {
153
- modelValue: o.value.packageId,
154
- "onUpdate:modelValue": a[0] || (a[0] = (n) => o.value.packageId = n),
155
- label: "Package ID",
156
- items: e
157
- }, null, 8, ["modelValue"]),
158
- g(p, {
159
- modelValue: o.value.uniqueId,
160
- "onUpdate:modelValue": a[1] || (a[1] = (n) => o.value.uniqueId = n),
161
- label: "Unique ID"
162
- }, null, 8, ["modelValue"]),
163
- g(r, {
164
- type: "submit",
165
- label: "Save"
166
- })
167
- ]),
168
- _: 1
169
- }, 512);
170
- };
171
- }
172
- }), te = /* @__PURE__ */ x({
173
- __name: "TerminalSetting",
174
- props: {
175
- terminalId: {
176
- type: String,
177
- required: !0
178
- }
179
- },
180
- setup(t) {
181
- const i = t, { tab: e } = A({
182
- tab: "information"
183
- }), { isLoading: m, startAsyncCall: d } = D(!0), o = $(), s = G(), a = y();
184
- async function l(n) {
185
- try {
186
- await b.updateById(
187
- i.terminalId,
188
- {
189
- name: n.name,
190
- status: n.status,
191
- gateways: n.gateways ?? []
192
- }
193
- ), a.value = await b.readById(i.terminalId), s.open({
194
- type: "success",
195
- message: "Terminal updated successfully"
196
- });
197
- } catch (f) {
198
- s.open({
199
- type: "error",
200
- title: "Error occurs when update terminal",
201
- message: R(f)
202
- });
203
- }
204
- }
205
- const p = [
206
- {
207
- label: "Information",
208
- value: "information",
209
- icon: "overview",
210
- render: z
211
- },
212
- {
213
- label: "Fiuu",
214
- value: "fiuu",
215
- icon: "payment",
216
- render: J
217
- }
218
- ], r = _(() => {
219
- var n;
220
- return (n = p.find((f) => f.value === e.value)) == null ? void 0 : n.render;
221
- });
222
- async function u() {
223
- d(async () => {
224
- a.value = await b.readById(i.terminalId), a.value.deviceType !== "TERMINAL" && p.push({
225
- label: "Terminal",
226
- value: "terminal",
227
- icon: "shopping_cart_checkout",
228
- render: H
229
- });
230
- });
231
- }
232
- return T(u), (n, f) => {
233
- var F;
234
- const V = c("FmTabs");
235
- return w(), k(j, {
236
- title: `Terminal (${(F = a.value) == null ? void 0 : F._id})`,
237
- loading: I(m),
238
- onBack: I(o).back
239
- }, {
240
- default: U(() => [
241
- g(V, {
242
- "model-value": I(e),
243
- "onUpdate:modelValue": f[0] || (f[0] = (S) => N(e) ? e.value = S : null),
244
- class: "mb-6",
245
- items: p
246
- }, null, 8, ["model-value"]),
247
- I(e) ? (w(), k(P(r.value), E(M({ key: 0 }, {
248
- terminal: a.value,
249
- onUpdate: l
250
- })), null, 16)) : O("", !0)
251
- ]),
252
- _: 1
253
- }, 8, ["title", "loading", "onBack"]);
254
- };
255
- }
256
- });
257
- export {
258
- te as default
259
- };