@feedmepos/mf-payment 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions.vue_vue_type_script_setup_true_lang-CqIt6ELp.js +144 -0
- package/dist/{OnboardForm-BUITPCLG.js → OnboardForm-BNyK_Vet.js} +2 -2
- package/dist/{OnboardForm-B3Ej-hV_.js → OnboardForm-Cjrcx5AR.js} +2 -2
- package/dist/{OnboardSubmission-BoMaHHzE.js → OnboardSubmission-BEy7c_d7.js} +1 -1
- package/dist/{OnboardSubmission-C0yZsQjU.js → OnboardSubmission-oe4t2AgG.js} +1 -1
- package/dist/{PayoutAccount-D55CjZse.js → PayoutAccount-Bfw-iMZd.js} +1 -1
- package/dist/{PayoutAccount-Bz_X_FDJ.js → PayoutAccount-D0IOAymI.js} +3 -3
- package/dist/{Settlement-L8ukHWPs.js → Settlement-DW_ElmEK.js} +1 -2
- package/dist/{SettlementTransactions-C8o5Atmc.js → SettlementTransactions-BG1btImp.js} +1 -1
- package/dist/{SettlementTransactions-DG9nJuLQ.js → SettlementTransactions-CXAt4toA.js} +1 -1
- package/dist/{Transaction-CfC0yN9P.js → Transaction-Cl6LzyIv.js} +1 -1
- package/dist/Transaction-LDOp9d9W.js +413 -0
- package/dist/TransactionOld-DqRQHymo.js +309 -0
- package/dist/api/transaction/index.d.ts +4 -2
- package/dist/{app-CwgKwO4j.js → app-BBSHlMY3.js} +13 -13
- package/dist/app.js +1 -1
- package/dist/{assets-D4ayW3GC.js → assets-B67WKlO6.js} +62 -60
- package/dist/{index-BM7OisOh.js → index-BvWJrSY2.js} +1 -1
- package/dist/package.json +1 -1
- package/dist/{payout-account-BNS0PTHj.js → payout-account-CgJxxXw9.js} +2 -2
- package/dist/{plugins-DEpfQnZI.js → plugins-BADrx0Dw.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/Transaction-fhDUanwr.js +0 -250
- package/dist/TransactionOld-CObh3uJa.js +0 -99
- package/dist/TransactionTable.vue_vue_type_script_setup_true_lang-DPRIp0wx.js +0 -351
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
import { defineComponent as y, resolveComponent as d, openBlock as m, createBlock as f, normalizeClass as R, withCtx as p, createElementVNode as A, toDisplayString as V, unref as K, createElementBlock as N, createVNode as k, Fragment as U, renderList as B, ref as S, watch as $, h as b } from "vue";
|
|
2
|
-
import { useSnackbar as L, useDialog as G } from "@feedmepos/ui-library";
|
|
3
|
-
import { g as O, a as Y, t as h, c as x } from "./assets-D4ayW3GC.js";
|
|
4
|
-
import { e as T } from "./index-C4FfKmPS.js";
|
|
5
|
-
import { g as z } from "./grafana-BrdrOUM4.js";
|
|
6
|
-
import { w as E } from "./Modal-DB8M9o1T.js";
|
|
7
|
-
import { u as w } from "./error-K1CakhA9.js";
|
|
8
|
-
import { useCoreStore as Q, useI18n as j } from "@feedmepos/mf-common";
|
|
9
|
-
const H = /* @__PURE__ */ y({
|
|
10
|
-
__name: "Status",
|
|
11
|
-
props: {
|
|
12
|
-
row: {},
|
|
13
|
-
data: {}
|
|
14
|
-
},
|
|
15
|
-
setup(c) {
|
|
16
|
-
const o = c;
|
|
17
|
-
function l() {
|
|
18
|
-
return o.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : o.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : o.data === T.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
|
|
19
|
-
}
|
|
20
|
-
return (n, g) => {
|
|
21
|
-
const i = d("FmBadge");
|
|
22
|
-
return m(), f(i, {
|
|
23
|
-
inline: "",
|
|
24
|
-
class: R(l())
|
|
25
|
-
}, {
|
|
26
|
-
default: p(() => [
|
|
27
|
-
A("div", null, V(n.data), 1)
|
|
28
|
-
]),
|
|
29
|
-
_: 1
|
|
30
|
-
}, 8, ["class"]);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}), J = ["src"], W = /* @__PURE__ */ y({
|
|
34
|
-
__name: "Gateway",
|
|
35
|
-
props: {
|
|
36
|
-
row: {},
|
|
37
|
-
data: {}
|
|
38
|
-
},
|
|
39
|
-
setup(c) {
|
|
40
|
-
return (o, l) => {
|
|
41
|
-
const n = d("FmTooltip");
|
|
42
|
-
return m(), f(n, {
|
|
43
|
-
variant: "plain",
|
|
44
|
-
placement: "top",
|
|
45
|
-
content: o.row.original.gateway,
|
|
46
|
-
"hide-arrow": !0
|
|
47
|
-
}, {
|
|
48
|
-
default: p(() => [
|
|
49
|
-
A("img", {
|
|
50
|
-
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
|
51
|
-
src: K(O)(o.row.original.gateway)
|
|
52
|
-
}, null, 8, J)
|
|
53
|
-
]),
|
|
54
|
-
_: 1
|
|
55
|
-
}, 8, ["content"]);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}), X = ["src"], Z = /* @__PURE__ */ y({
|
|
59
|
-
__name: "Method",
|
|
60
|
-
props: {
|
|
61
|
-
row: {},
|
|
62
|
-
data: {}
|
|
63
|
-
},
|
|
64
|
-
setup(c) {
|
|
65
|
-
return (o, l) => {
|
|
66
|
-
const n = d("FmTooltip");
|
|
67
|
-
return m(), f(n, {
|
|
68
|
-
variant: "plain",
|
|
69
|
-
placement: "top",
|
|
70
|
-
content: o.row.original.method.issuer,
|
|
71
|
-
"hide-arrow": !0
|
|
72
|
-
}, {
|
|
73
|
-
default: p(() => [
|
|
74
|
-
A("img", {
|
|
75
|
-
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
|
76
|
-
src: K(Y)(o.row.original.method.issuer, o.row.original.method.variant)
|
|
77
|
-
}, null, 8, X)
|
|
78
|
-
]),
|
|
79
|
-
_: 1
|
|
80
|
-
}, 8, ["content"]);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}), ee = /* @__PURE__ */ y({
|
|
84
|
-
__name: "Actions",
|
|
85
|
-
props: {
|
|
86
|
-
onAction: { type: Function },
|
|
87
|
-
transaction: {}
|
|
88
|
-
},
|
|
89
|
-
setup(c) {
|
|
90
|
-
const o = [
|
|
91
|
-
c.transaction.flags.query && {
|
|
92
|
-
label: "Query",
|
|
93
|
-
sublabel: "Perform transaction status inquriy",
|
|
94
|
-
icon: "question_answer",
|
|
95
|
-
action: "query"
|
|
96
|
-
},
|
|
97
|
-
c.transaction.flags.refund && {
|
|
98
|
-
label: "Refund",
|
|
99
|
-
sublabel: "Perform transaction refund request",
|
|
100
|
-
icon: "request_page",
|
|
101
|
-
action: "refund"
|
|
102
|
-
},
|
|
103
|
-
c.transaction.flags.notify && {
|
|
104
|
-
label: "Notify",
|
|
105
|
-
sublabel: "Perform webhook notification for transaction",
|
|
106
|
-
icon: "webhook",
|
|
107
|
-
action: "notify"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
label: "Log",
|
|
111
|
-
sublabel: "Inspect transaction historical actions, requests and responses.",
|
|
112
|
-
icon: "history",
|
|
113
|
-
action: "history"
|
|
114
|
-
}
|
|
115
|
-
];
|
|
116
|
-
return (l, n) => {
|
|
117
|
-
const g = d("FmIcon"), i = d("FmMenuItem"), _ = d("FmMenu");
|
|
118
|
-
return m(), N("div", {
|
|
119
|
-
onClick: n[0] || (n[0] = (a) => {
|
|
120
|
-
a.stopPropagation();
|
|
121
|
-
})
|
|
122
|
-
}, [
|
|
123
|
-
k(_, null, {
|
|
124
|
-
"menu-button": p(() => [
|
|
125
|
-
k(g, { name: "settings" })
|
|
126
|
-
]),
|
|
127
|
-
default: p(() => [
|
|
128
|
-
(m(!0), N(U, null, B(o.filter((a) => !!a), (a) => (m(), f(i, {
|
|
129
|
-
selectable: !0,
|
|
130
|
-
key: a.label,
|
|
131
|
-
sublabel: a.sublabel,
|
|
132
|
-
label: a.label,
|
|
133
|
-
icon: a.icon,
|
|
134
|
-
onclick: () => l.onAction(a.action)
|
|
135
|
-
}, null, 8, ["sublabel", "label", "icon", "onclick"]))), 128))
|
|
136
|
-
]),
|
|
137
|
-
_: 1
|
|
138
|
-
})
|
|
139
|
-
]);
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}), le = /* @__PURE__ */ y({
|
|
143
|
-
__name: "TransactionTable",
|
|
144
|
-
props: {
|
|
145
|
-
data: {
|
|
146
|
-
type: Array,
|
|
147
|
-
required: !0
|
|
148
|
-
},
|
|
149
|
-
loading: {
|
|
150
|
-
type: Boolean,
|
|
151
|
-
required: !0
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
emits: ["row-click"],
|
|
155
|
-
setup(c, { emit: o }) {
|
|
156
|
-
var I, q;
|
|
157
|
-
const l = c, n = S([...l.data]);
|
|
158
|
-
$(
|
|
159
|
-
() => l.data,
|
|
160
|
-
(t) => {
|
|
161
|
-
n.value = [...t];
|
|
162
|
-
},
|
|
163
|
-
{ deep: !0, immediate: !0 }
|
|
164
|
-
);
|
|
165
|
-
const g = o, i = L(), _ = G(), { sessionUser: a } = Q(), { t: s } = j();
|
|
166
|
-
async function C(t) {
|
|
167
|
-
try {
|
|
168
|
-
const e = await h.refetchTransaction({ transactionId: t.id });
|
|
169
|
-
n.value = n.value.map((r) => r.id === e._id ? x(e) : r), i.open({
|
|
170
|
-
type: "success",
|
|
171
|
-
title: "Transaction queried and updated successfully."
|
|
172
|
-
});
|
|
173
|
-
} catch (e) {
|
|
174
|
-
i.open({
|
|
175
|
-
type: "error",
|
|
176
|
-
title: "Fail to query transaction.",
|
|
177
|
-
message: w(e)
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
async function D(t) {
|
|
182
|
-
E(
|
|
183
|
-
_,
|
|
184
|
-
"Refund Transaction",
|
|
185
|
-
"Are you sure to refund transaction? This action cannot be revert!",
|
|
186
|
-
async () => {
|
|
187
|
-
try {
|
|
188
|
-
const e = await h.refundTransaction({
|
|
189
|
-
transactionId: t.id,
|
|
190
|
-
reason: "portal transaction refund",
|
|
191
|
-
amount: t.fdoAmount
|
|
192
|
-
});
|
|
193
|
-
n.value = n.value.map((r) => r.id === e._id ? x(e) : r), i.open({
|
|
194
|
-
type: "success",
|
|
195
|
-
title: "Transaction refund request initiated."
|
|
196
|
-
});
|
|
197
|
-
} catch (e) {
|
|
198
|
-
i.open({
|
|
199
|
-
type: "error",
|
|
200
|
-
title: "Fail to request refund transaction.",
|
|
201
|
-
message: w(e)
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
async function M(t) {
|
|
208
|
-
E(
|
|
209
|
-
_,
|
|
210
|
-
"Notify Transaction",
|
|
211
|
-
"Are you sure to perform notify transaction?",
|
|
212
|
-
async () => {
|
|
213
|
-
try {
|
|
214
|
-
await h.renotifyTransaction(t.id), i.open({
|
|
215
|
-
type: "success",
|
|
216
|
-
title: "Transaction notify successfully."
|
|
217
|
-
});
|
|
218
|
-
} catch (e) {
|
|
219
|
-
i.open({
|
|
220
|
-
type: "error",
|
|
221
|
-
title: "Fail to notify transaction.",
|
|
222
|
-
message: w(e)
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
async function P(t) {
|
|
229
|
-
const e = z([
|
|
230
|
-
{
|
|
231
|
-
type: "span",
|
|
232
|
-
queryKey: "transaction.id",
|
|
233
|
-
queryValue: t.id
|
|
234
|
-
}
|
|
235
|
-
], t.transactionAt);
|
|
236
|
-
window.open(e, "_blank");
|
|
237
|
-
}
|
|
238
|
-
const F = S(""), v = [
|
|
239
|
-
{
|
|
240
|
-
header: () => s("payment.transactions.table.id"),
|
|
241
|
-
accessorKey: "id",
|
|
242
|
-
cell: ({ cell: t, row: e }) => {
|
|
243
|
-
var r, u;
|
|
244
|
-
return ((r = a.value) != null && r.role.isStaff || (u = a.value) != null && u.role.isAdmin) && e.original.transactionId ? e.original.id + `
|
|
245
|
-
ID: ` + e.original.transactionId : e.original.id;
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
header: () => s("payment.transactions.table.pay_id"),
|
|
250
|
-
accessorKey: "payId"
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
header: () => s("payment.transactions.table.gateway_id"),
|
|
254
|
-
accessorKey: "gatewayTransactionId"
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
header: () => s("payment.transactions.table.bill_seq"),
|
|
258
|
-
accessorKey: "seqNumber"
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
header: () => s("payment.transactions.table.gateway"),
|
|
262
|
-
accessorKey: "gateway",
|
|
263
|
-
meta: {
|
|
264
|
-
textAlign: "center"
|
|
265
|
-
},
|
|
266
|
-
cell: ({ cell: t, row: e }) => e.original.gateway ? b(W, { row: e, data: t.getValue() }) : ""
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
header: () => s("payment.transactions.table.method"),
|
|
270
|
-
accessorKey: "method",
|
|
271
|
-
meta: {
|
|
272
|
-
textAlign: "center"
|
|
273
|
-
},
|
|
274
|
-
cell: ({ cell: t, row: e }) => e.original.method ? b(Z, { row: e, data: t.getValue() }) : ""
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
header: () => s("payment.transactions.table.type"),
|
|
278
|
-
accessorKey: "payFor",
|
|
279
|
-
meta: {
|
|
280
|
-
textAlign: "center"
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
header: () => s("payment.transactions.table.status"),
|
|
285
|
-
accessorKey: "status",
|
|
286
|
-
cell: ({ cell: t, row: e }) => b(H, { row: e, data: t.getValue() })
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
header: () => s("payment.transactions.table.restaurant"),
|
|
290
|
-
accessorKey: "restaurantId"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
header: () => s("payment.transactions.table.source"),
|
|
294
|
-
accessorKey: "source",
|
|
295
|
-
cell: ({ cell: t, row: e }) => `(${e.original.sourceType}) ${e.original.source}`
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
header: () => s("payment.transactions.table.transaction_at"),
|
|
299
|
-
accessorKey: "transactionAt",
|
|
300
|
-
meta: {
|
|
301
|
-
width: "180px"
|
|
302
|
-
},
|
|
303
|
-
cell: ({ cell: t, row: e }) => e.original.status === "REFUNDED" ? e.original.refundedAt : e.original.transactionAt
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
header: () => s("payment.transactions.table.sales_amount"),
|
|
307
|
-
accessorKey: "amount",
|
|
308
|
-
cell: ({ cell: t, row: e }) => {
|
|
309
|
-
var r, u;
|
|
310
|
-
return ((r = a.value) != null && r.role.isStaff || (u = a.value) != null && u.role.isAdmin) && e.original.flags.isDelivery ? e.original.amount + "( " + e.original.gatewayAmount + ")" : e.original.amount;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
];
|
|
314
|
-
return ((I = a.value) != null && I.role.isStaff || (q = a.value) != null && q.role.isAdmin) && v.push({
|
|
315
|
-
header: () => s("payment.transactions.table.actions"),
|
|
316
|
-
accessorKey: "actions",
|
|
317
|
-
cell: ({ row: t }) => b(ee, {
|
|
318
|
-
transaction: t.original,
|
|
319
|
-
onAction: (e) => {
|
|
320
|
-
var r;
|
|
321
|
-
switch (e) {
|
|
322
|
-
case "notify":
|
|
323
|
-
return M(t.original);
|
|
324
|
-
case "query":
|
|
325
|
-
return C(t.original);
|
|
326
|
-
case "refund":
|
|
327
|
-
return (r = a.value) != null && r.role.isStaff ? i.open({
|
|
328
|
-
type: "error",
|
|
329
|
-
title: "You are not allowed to refund transaction."
|
|
330
|
-
}) : D(t.original);
|
|
331
|
-
case "history":
|
|
332
|
-
return P(t.original);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
})
|
|
336
|
-
}), (t, e) => {
|
|
337
|
-
const r = d("FmTable");
|
|
338
|
-
return m(), f(r, {
|
|
339
|
-
modelValue: F.value,
|
|
340
|
-
"onUpdate:modelValue": e[0] || (e[0] = (u) => F.value = u),
|
|
341
|
-
"column-defs": v,
|
|
342
|
-
"row-data": n.value,
|
|
343
|
-
loading: l.loading,
|
|
344
|
-
onRowClick: e[1] || (e[1] = (u) => g("row-click", n.value.at(u.index)))
|
|
345
|
-
}, null, 8, ["modelValue", "row-data", "loading"]);
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
export {
|
|
350
|
-
le as _
|
|
351
|
-
};
|