@feedmepos/mf-payment 0.0.0-beta.9 → 1.0.0-beta.10
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/README.md +11 -1
- package/dist/AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js +39 -0
- package/dist/AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js +42 -0
- package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js +40 -0
- package/dist/DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js +31 -0
- package/dist/Modal-DB8M9o1T.js +13 -0
- package/dist/PDFViewer-xrBtzrlR.js +22426 -0
- package/dist/{PayoutAccount-DLhMMlw_.js → PayoutAccount-B1sLInPk.js} +96 -83
- package/dist/PayoutAccount-Dut_OQHJ.js +613 -0
- package/dist/PayoutAccountSetting-CmgVLhdp.js +780 -0
- package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js +33 -0
- package/dist/SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js +42 -0
- package/dist/Settlement-B1-WmCwC.js +193 -0
- package/dist/Settlement-BSOQRlp1.js +145 -0
- package/dist/{SettlementTransactions-Dl1H4jvh.js → SettlementTransactions-Cqd2raea.js} +117 -130
- package/dist/{SettlementTransactions-CoEzdtYT.js → SettlementTransactions-JTwD_Vuq.js} +99 -105
- package/dist/Terminal-De69bTKY.js +373 -0
- package/dist/TerminalSetting-DlRHaEZh.js +387 -0
- package/dist/TerminalTransaction-4rE-cikT.js +261 -0
- package/dist/TerminalTransaction-BGzVHOHQ.js +485 -0
- package/dist/Transaction-B3ZWKg6Q.js +403 -0
- package/dist/Transaction-B_0nUmpf.js +238 -0
- package/dist/api/index.d.ts +14 -0
- package/dist/api/pagination.d.ts +20 -0
- package/dist/api/payment-gateway/index.d.ts +9 -0
- package/dist/api/settlement/index.d.ts +12 -13
- package/dist/api/terminal/index.d.ts +13 -1
- package/dist/api/terminal-transaction/index.d.ts +12 -1
- package/dist/api/transaction/index.d.ts +7 -2
- package/dist/app-ssoGt5u4.js +6356 -0
- package/dist/app.js +3 -198
- package/dist/assets-BCAivOTo.js +45 -0
- package/dist/clipboard-4jh1WteU.js +10 -0
- package/dist/components/AdminLayout.vue.d.ts +8 -13
- package/dist/components/AsyncButton.vue.d.ts +21 -0
- package/dist/components/AutoCopyCell.vue.d.ts +5 -0
- package/dist/components/CursorTable/index.vue.d.ts +24 -5
- package/dist/components/DateRangePicker.vue.d.ts +13 -0
- package/dist/components/Layout.vue.d.ts +8 -13
- package/dist/components/PDFViewer.vue.d.ts +1 -1
- package/dist/components/RestaurantSelector.vue.d.ts +2 -0
- package/dist/components/RouteCell.vue.d.ts +7 -0
- package/dist/components/SelectAll.vue.d.ts +57 -0
- package/dist/helpers/assets.d.ts +2 -0
- package/dist/helpers/idToDate.d.ts +1 -1
- package/dist/index-4meiCsRz.js +56117 -0
- package/dist/{index-CF56zGyu.js → index-BFYq3eq8.js} +1 -1
- package/dist/{index-Bmka-1lQ.js → index-BwFHcZlm.js} +1 -1
- package/dist/index-CBa6eapm.js +47 -0
- package/dist/index-CETCXB6X.js +127 -0
- package/dist/index-CbsnpMWl.js +52 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-CKOlikHb.js +167 -0
- package/dist/model/transaction.d.ts +2 -1
- package/dist/package.json +5 -5
- package/dist/payout-account-02bK8c23.js +1805 -0
- package/dist/router/index.d.ts +1 -0
- package/dist/stores/iframe.d.ts +1 -1
- package/dist/stores/payoutAccount.d.ts +5 -5
- package/dist/transaction-COjHU7aN.js +97 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/validator-D5jtpt9A.js +2877 -0
- package/dist/views/admin/payout-account/cell/Bank.vue.d.ts +3 -5
- package/dist/views/admin/payout-account/cell/IsActive.vue.d.ts +3 -5
- package/dist/views/admin/payout-account/cell/PersonInCharge.vue.d.ts +3 -5
- package/dist/views/admin/payout-account/cell/RateInput.vue.d.ts +3 -5
- package/dist/views/admin/payout-account/cell/Status.vue.d.ts +3 -5
- package/dist/views/admin/payout-account/cell/TPlusInput.vue.d.ts +3 -5
- package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +4 -4
- package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +81 -0
- package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +4 -4
- package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +4 -4
- package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +56 -0
- package/dist/views/admin/payout-account/tabs/gateway/GhlGateway.vue.d.ts +50 -0
- package/dist/views/admin/payout-account/tabs/gateway/RevenueMonsterGateway.vue.d.ts +52 -0
- package/dist/views/admin/settlement/SettlementTable.vue.d.ts +12 -12
- package/dist/views/admin/settlement/cell/Actions.vue.d.ts +4 -6
- package/dist/views/admin/settlement/cell/Gateway.vue.d.ts +3 -5
- package/dist/views/admin/settlement/cell/Method.vue.d.ts +3 -5
- package/dist/views/admin/settlement/cell/Status.vue.d.ts +3 -5
- package/dist/views/admin/terminal/TerminalBindCodeDialog.vue.d.ts +1 -1
- package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +83 -0
- package/dist/views/admin/terminal/TerminalSetting.vue.d.ts +12 -0
- package/dist/views/admin/terminal/cell/Actions.vue.d.ts +13 -14
- package/dist/views/admin/terminal/cell/ID.vue.d.ts +3 -5
- package/dist/views/admin/terminal/tabs/FiuuGateway.vue.d.ts +94 -0
- package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +94 -0
- package/dist/views/admin/terminal/tabs/Information.vue.d.ts +85 -0
- package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +94 -0
- package/dist/views/admin/terminal-transaction/cell/Actions.vue.d.ts +6 -0
- package/dist/views/admin/terminal-transaction/cell/Gateway.vue.d.ts +3 -5
- package/dist/views/admin/terminal-transaction/cell/Status.vue.d.ts +3 -5
- package/dist/views/admin/terminal-transaction/cell/Timestamp.vue.d.ts +7 -0
- package/dist/views/admin/transaction/TransactionTable.vue.d.ts +6 -2
- package/dist/views/admin/transaction/cell/Actions.vue.d.ts +6 -0
- package/dist/views/admin/transaction/cell/Gateway.vue.d.ts +3 -5
- package/dist/views/admin/transaction/cell/Method.vue.d.ts +3 -5
- package/dist/views/admin/transaction/cell/Status.vue.d.ts +3 -5
- package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +8 -8
- package/dist/views/payout-account/cell/Bank.vue.d.ts +3 -5
- package/dist/views/payout-account/cell/IsActive.vue.d.ts +3 -5
- package/dist/views/payout-account/cell/PersonInCharge.vue.d.ts +3 -5
- package/dist/views/payout-account/cell/Status.vue.d.ts +3 -5
- package/dist/views/settlement/SettlementTable.vue.d.ts +12 -12
- package/dist/views/settlement/cell/Actions.vue.d.ts +4 -6
- package/dist/views/settlement/cell/Gateway.vue.d.ts +3 -5
- package/dist/views/settlement/cell/Method.vue.d.ts +3 -5
- package/dist/views/settlement/cell/Status.vue.d.ts +3 -5
- package/dist/views/terminal-transaction/TerminalTransaction.vue.d.ts +2 -0
- package/dist/views/terminal-transaction/cell/Gateway.vue.d.ts +7 -0
- package/dist/views/terminal-transaction/cell/Status.vue.d.ts +7 -0
- package/dist/views/transaction/cell/Gateway.vue.d.ts +3 -5
- package/dist/views/transaction/cell/Method.vue.d.ts +3 -5
- package/dist/views/transaction/cell/Status.vue.d.ts +3 -5
- package/package.json +5 -5
- package/dist/AdminLayout.vue_vue_type_script_setup_true_lang-oPYFBeEo.js +0 -42
- package/dist/PDFViewer-CjH_C1uT.js +0 -21792
- package/dist/PayoutAccount-xxSxqBTL.js +0 -3485
- package/dist/PayoutAccountSetting-CIeos0md.js +0 -425
- package/dist/Settlement-BVGACeme.js +0 -136
- package/dist/Settlement-Ce48KHrc.js +0 -132
- package/dist/Terminal-ByKV2Rof.js +0 -204
- package/dist/TerminalTransaction-RuSxBAxf.js +0 -240
- package/dist/Transaction-CYo-uLQi.js +0 -241
- package/dist/Transaction-Cjw9WwX8.js +0 -242
- package/dist/api/auth/index.d.ts +0 -7
- package/dist/assets-BuLGUMIx.js +0 -472
- package/dist/index-Coz5aeIO.js +0 -61
- package/dist/index-DCPNrUDq.js +0 -40075
- package/dist/index.vue_vue_type_script_setup_true_lang-CAR-bNaR.js +0 -150
- package/dist/mascot-side-3VXskf9y.js +0 -4
- package/dist/payout-account-iAM7HPtG.js +0 -3317
- package/dist/transaction-vRrBf3FN.js +0 -64
@@ -0,0 +1,403 @@
|
|
1
|
+
import { defineComponent as g, resolveComponent as _, openBlock as y, createBlock as E, normalizeClass as Y, withCtx as w, createElementVNode as b, toDisplayString as $, createElementBlock as x, unref as d, createVNode as f, Fragment as L, renderList as B, ref as S, h as T, onMounted as U, watch as D, isRef as M } from "vue";
|
2
|
+
import { t as v, a as k, b as G } from "./transaction-COjHU7aN.js";
|
3
|
+
import { e as I, u as J } from "./index-4meiCsRz.js";
|
4
|
+
import { useSnackbar as Q, useDialog as j } from "@feedmepos/ui-library";
|
5
|
+
import "./dinero-CIVmXLL-.js";
|
6
|
+
import { h as R } from "./moment-h96o7c8I.js";
|
7
|
+
import { g as z, a as H } from "./assets-BCAivOTo.js";
|
8
|
+
import { _ as W } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js";
|
9
|
+
import { u as X } from "./index-BwFHcZlm.js";
|
10
|
+
import { _ as Z } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
|
11
|
+
import { _ as ee } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
|
12
|
+
import { w as q } from "./Modal-DB8M9o1T.js";
|
13
|
+
import { u as N } from "./error-K1CakhA9.js";
|
14
|
+
import { _ as te } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
|
15
|
+
const ae = /* @__PURE__ */ g({
|
16
|
+
__name: "Status",
|
17
|
+
props: {
|
18
|
+
row: {},
|
19
|
+
data: {}
|
20
|
+
},
|
21
|
+
setup(m) {
|
22
|
+
const n = m;
|
23
|
+
function o() {
|
24
|
+
return n.data === I.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === I.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : n.data === I.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
|
25
|
+
}
|
26
|
+
return (u, p) => {
|
27
|
+
const s = _("FmBadge");
|
28
|
+
return y(), E(s, {
|
29
|
+
inline: "",
|
30
|
+
class: Y(o())
|
31
|
+
}, {
|
32
|
+
default: w(() => [
|
33
|
+
b("div", null, $(u.data), 1)
|
34
|
+
]),
|
35
|
+
_: 1
|
36
|
+
}, 8, ["class"]);
|
37
|
+
};
|
38
|
+
}
|
39
|
+
}), ne = ["src"], oe = /* @__PURE__ */ g({
|
40
|
+
__name: "Gateway",
|
41
|
+
props: {
|
42
|
+
row: {},
|
43
|
+
data: {}
|
44
|
+
},
|
45
|
+
setup(m) {
|
46
|
+
return (n, o) => (y(), x("img", {
|
47
|
+
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
48
|
+
src: d(z)(n.row.original.gateway)
|
49
|
+
}, null, 8, ne));
|
50
|
+
}
|
51
|
+
}), re = ["src"], se = /* @__PURE__ */ g({
|
52
|
+
__name: "Method",
|
53
|
+
props: {
|
54
|
+
row: {},
|
55
|
+
data: {}
|
56
|
+
},
|
57
|
+
setup(m) {
|
58
|
+
return (n, o) => (y(), x("img", {
|
59
|
+
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
60
|
+
src: d(H)(n.row.original.method.issuer)
|
61
|
+
}, null, 8, re));
|
62
|
+
}
|
63
|
+
}), ie = /* @__PURE__ */ g({
|
64
|
+
__name: "Actions",
|
65
|
+
props: {
|
66
|
+
onAction: { type: Function }
|
67
|
+
},
|
68
|
+
setup(m) {
|
69
|
+
const n = [
|
70
|
+
{
|
71
|
+
label: "Query",
|
72
|
+
sublabel: "Perform transaction status inquriy",
|
73
|
+
icon: "question_answer",
|
74
|
+
action: "query"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
label: "Refund",
|
78
|
+
sublabel: "Perform transaction refund request",
|
79
|
+
icon: "request_page",
|
80
|
+
action: "refund"
|
81
|
+
},
|
82
|
+
{
|
83
|
+
label: "Notify",
|
84
|
+
sublabel: "Perform webhook notification for transaction",
|
85
|
+
icon: "webhook",
|
86
|
+
action: "notify"
|
87
|
+
}
|
88
|
+
];
|
89
|
+
return (o, u) => {
|
90
|
+
const p = _("FmIcon"), s = _("FmMenuItem"), r = _("FmMenu");
|
91
|
+
return y(), x("div", {
|
92
|
+
onClick: u[0] || (u[0] = (e) => {
|
93
|
+
e.stopPropagation();
|
94
|
+
})
|
95
|
+
}, [
|
96
|
+
f(r, null, {
|
97
|
+
"menu-button": w(() => [
|
98
|
+
f(p, { name: "settings" })
|
99
|
+
]),
|
100
|
+
default: w(() => [
|
101
|
+
(y(), x(L, null, B(n, (e) => f(s, {
|
102
|
+
selectable: !0,
|
103
|
+
key: e.label,
|
104
|
+
sublabel: e.sublabel,
|
105
|
+
label: e.label,
|
106
|
+
icon: e.icon,
|
107
|
+
onclick: () => o.onAction(e.action)
|
108
|
+
}, null, 8, ["sublabel", "label", "icon", "onclick"])), 64))
|
109
|
+
]),
|
110
|
+
_: 1
|
111
|
+
})
|
112
|
+
]);
|
113
|
+
};
|
114
|
+
}
|
115
|
+
}), ce = /* @__PURE__ */ g({
|
116
|
+
__name: "TransactionTable",
|
117
|
+
props: {
|
118
|
+
data: {
|
119
|
+
type: Array,
|
120
|
+
required: !0
|
121
|
+
},
|
122
|
+
loading: {
|
123
|
+
type: Boolean,
|
124
|
+
required: !0
|
125
|
+
}
|
126
|
+
},
|
127
|
+
emits: ["query", "refund", "notify"],
|
128
|
+
setup(m, { emit: n }) {
|
129
|
+
const o = m, u = n, p = S(""), s = [
|
130
|
+
{
|
131
|
+
header: () => "Transaction ID",
|
132
|
+
accessorKey: "id",
|
133
|
+
cell: ({ cell: r }) => T(W, { data: r.getValue() })
|
134
|
+
},
|
135
|
+
{
|
136
|
+
header: () => "Pay ID",
|
137
|
+
accessorKey: "payId"
|
138
|
+
},
|
139
|
+
{
|
140
|
+
header: () => "Gateway",
|
141
|
+
accessorKey: "gateway",
|
142
|
+
meta: {
|
143
|
+
textAlign: "center"
|
144
|
+
},
|
145
|
+
cell: ({ cell: r, row: e }) => e.original.method ? T(oe, { row: e, data: r.getValue() }) : ""
|
146
|
+
},
|
147
|
+
{
|
148
|
+
header: () => "Method",
|
149
|
+
accessorKey: "method",
|
150
|
+
meta: {
|
151
|
+
textAlign: "center"
|
152
|
+
},
|
153
|
+
cell: ({ cell: r, row: e }) => e.original.method ? T(se, { row: e, data: r.getValue() }) : ""
|
154
|
+
},
|
155
|
+
{
|
156
|
+
header: () => "Type",
|
157
|
+
accessorKey: "type",
|
158
|
+
meta: {
|
159
|
+
textAlign: "center"
|
160
|
+
},
|
161
|
+
cell: ({ row: r }) => {
|
162
|
+
if (!r.original.method)
|
163
|
+
return "";
|
164
|
+
const e = r.original.method.variant;
|
165
|
+
return e.includes("_ONLINE") ? "ONLINE" : e.includes("_OFFLINE") ? "OFFLINE" : e;
|
166
|
+
}
|
167
|
+
},
|
168
|
+
{
|
169
|
+
header: () => "Status",
|
170
|
+
accessorKey: "status",
|
171
|
+
cell: ({ cell: r, row: e }) => T(ae, { row: e, data: r.getValue() })
|
172
|
+
},
|
173
|
+
{
|
174
|
+
header: () => "Transaction At",
|
175
|
+
accessorKey: "transactionAt",
|
176
|
+
meta: {
|
177
|
+
width: "180px"
|
178
|
+
}
|
179
|
+
},
|
180
|
+
{
|
181
|
+
header: () => "Sales Amount",
|
182
|
+
accessorKey: "amount"
|
183
|
+
},
|
184
|
+
{
|
185
|
+
header: () => "Fee",
|
186
|
+
accessorKey: "fee"
|
187
|
+
},
|
188
|
+
{
|
189
|
+
header: () => "Settlement Amount",
|
190
|
+
accessorKey: "payout"
|
191
|
+
},
|
192
|
+
{
|
193
|
+
header: () => "Actions",
|
194
|
+
accessorKey: "actions",
|
195
|
+
cell: ({ row: r }) => T(ie, {
|
196
|
+
onAction: (e) => u(e, r.index)
|
197
|
+
})
|
198
|
+
}
|
199
|
+
];
|
200
|
+
return (r, e) => {
|
201
|
+
const l = _("FmTable");
|
202
|
+
return y(), E(l, {
|
203
|
+
modelValue: p.value,
|
204
|
+
"onUpdate:modelValue": e[0] || (e[0] = (A) => p.value = A),
|
205
|
+
"column-defs": s,
|
206
|
+
"row-data": o.data,
|
207
|
+
loading: o.loading
|
208
|
+
}, null, 8, ["modelValue", "row-data", "loading"]);
|
209
|
+
};
|
210
|
+
}
|
211
|
+
}), le = { class: "flex justify-between mb-6 items-center" }, ue = { class: "flex space-x-4" }, de = { class: "flex space-x-4 self-center" }, me = { class: "mb-6" }, Ne = /* @__PURE__ */ g({
|
212
|
+
__name: "Transaction",
|
213
|
+
setup(m) {
|
214
|
+
const { dateRange: n, searchKey: o } = X({
|
215
|
+
searchKey: "",
|
216
|
+
dateRange: {
|
217
|
+
startDate: R().startOf("day").format("YYYY-MM-DD"),
|
218
|
+
endDate: R().endOf("day").format("YYYY-MM-DD")
|
219
|
+
}
|
220
|
+
}), { isLoading: u, startAsyncCall: p } = J(!0), s = Q(), r = j(), e = S([]), l = S([]);
|
221
|
+
async function A() {
|
222
|
+
await p(async () => {
|
223
|
+
const { startDate: i, endDate: t } = n.value, a = await v.readTransactions({
|
224
|
+
start: i,
|
225
|
+
end: t
|
226
|
+
});
|
227
|
+
if (e.value = G(a), l.value = e.value, o.value > "") {
|
228
|
+
var c = new RegExp(o.value, "i");
|
229
|
+
l.value = e.value.filter((h) => {
|
230
|
+
const C = JSON.stringify(h);
|
231
|
+
return c.test(C);
|
232
|
+
});
|
233
|
+
}
|
234
|
+
});
|
235
|
+
}
|
236
|
+
function K() {
|
237
|
+
A();
|
238
|
+
}
|
239
|
+
U(K);
|
240
|
+
let F;
|
241
|
+
D(o, async () => {
|
242
|
+
F && clearTimeout(F), F = setTimeout(() => {
|
243
|
+
var i = new RegExp(o.value, "i");
|
244
|
+
l.value = e.value.filter((t) => {
|
245
|
+
const a = JSON.stringify(t);
|
246
|
+
return i.test(a);
|
247
|
+
});
|
248
|
+
}, 700);
|
249
|
+
}), D(e, async () => {
|
250
|
+
let i = e.value;
|
251
|
+
if (o.value) {
|
252
|
+
var t = new RegExp(o.value, "i");
|
253
|
+
i = e.value.filter((a) => {
|
254
|
+
const c = JSON.stringify(a);
|
255
|
+
return t.test(c);
|
256
|
+
});
|
257
|
+
}
|
258
|
+
l.value = i;
|
259
|
+
}, { deep: !0 });
|
260
|
+
async function O(i) {
|
261
|
+
const t = l.value.at(i);
|
262
|
+
if (!t) {
|
263
|
+
s.open({
|
264
|
+
type: "error",
|
265
|
+
title: "Something went wrong",
|
266
|
+
message: "Fail to find transactions from the displayed transactions."
|
267
|
+
});
|
268
|
+
return;
|
269
|
+
}
|
270
|
+
try {
|
271
|
+
const a = await v.refetchTransaction({ transactionId: t.id }), c = e.value.findIndex((h) => h.id === a._id);
|
272
|
+
e.value[c] = k(a), s.open({
|
273
|
+
type: "success",
|
274
|
+
title: "Transaction queried and updated successfully."
|
275
|
+
});
|
276
|
+
} catch (a) {
|
277
|
+
s.open({
|
278
|
+
type: "error",
|
279
|
+
title: "Fail to query transaction.",
|
280
|
+
message: N(a)
|
281
|
+
});
|
282
|
+
}
|
283
|
+
}
|
284
|
+
async function V(i) {
|
285
|
+
const t = l.value.at(i);
|
286
|
+
if (!t) {
|
287
|
+
s.open({
|
288
|
+
type: "error",
|
289
|
+
title: "Something went wrong",
|
290
|
+
message: "Fail to find transactions from the displayed transactions."
|
291
|
+
});
|
292
|
+
return;
|
293
|
+
}
|
294
|
+
q(
|
295
|
+
r,
|
296
|
+
"Refund Transaction",
|
297
|
+
"Are you sure to refund transaction? This action cannot be revert!",
|
298
|
+
async () => {
|
299
|
+
try {
|
300
|
+
const a = await v.refundTransaction({
|
301
|
+
transactionId: t.id,
|
302
|
+
reason: "portal transaction refund",
|
303
|
+
amount: t.fdoAmount
|
304
|
+
}), c = e.value.findIndex((h) => h.id === a._id);
|
305
|
+
e.value[c] = k(a), s.open({
|
306
|
+
type: "success",
|
307
|
+
title: "Transaction refund request initiated."
|
308
|
+
});
|
309
|
+
} catch (a) {
|
310
|
+
s.open({
|
311
|
+
type: "error",
|
312
|
+
title: "Fail to request refund transaction.",
|
313
|
+
message: N(a)
|
314
|
+
});
|
315
|
+
}
|
316
|
+
}
|
317
|
+
);
|
318
|
+
}
|
319
|
+
async function P(i) {
|
320
|
+
const t = l.value.at(i);
|
321
|
+
if (!t) {
|
322
|
+
s.open({
|
323
|
+
type: "error",
|
324
|
+
title: "Something went wrong",
|
325
|
+
message: "Fail to find transactions from the displayed transactions."
|
326
|
+
});
|
327
|
+
return;
|
328
|
+
}
|
329
|
+
q(
|
330
|
+
r,
|
331
|
+
"Notify Transaction",
|
332
|
+
"Are you sure to perform notify transaction?",
|
333
|
+
async () => {
|
334
|
+
try {
|
335
|
+
await v.renotifyTransaction(t.id), s.open({
|
336
|
+
type: "success",
|
337
|
+
title: "Transaction notify successfully."
|
338
|
+
});
|
339
|
+
} catch (a) {
|
340
|
+
s.open({
|
341
|
+
type: "error",
|
342
|
+
title: "Fail to notify transaction.",
|
343
|
+
message: N(a)
|
344
|
+
});
|
345
|
+
}
|
346
|
+
}
|
347
|
+
);
|
348
|
+
}
|
349
|
+
return (i, t) => {
|
350
|
+
const a = _("FmSearch");
|
351
|
+
return y(), E(Z, {
|
352
|
+
title: "Online Transactions",
|
353
|
+
loading: d(u)
|
354
|
+
}, {
|
355
|
+
default: w(() => [
|
356
|
+
b("div", le, [
|
357
|
+
b("div", ue, [
|
358
|
+
f(a, {
|
359
|
+
"model-value": d(o),
|
360
|
+
"onUpdate:modelValue": t[0] || (t[0] = (c) => M(o) ? o.value = c : null),
|
361
|
+
class: "mr-8",
|
362
|
+
label: "Search",
|
363
|
+
placeholder: "Search Transactions ..."
|
364
|
+
}, null, 8, ["model-value"])
|
365
|
+
]),
|
366
|
+
b("div", de, [
|
367
|
+
f(ee, {
|
368
|
+
button: {
|
369
|
+
appendIcon: "file_download",
|
370
|
+
variant: "primary",
|
371
|
+
label: "Export"
|
372
|
+
},
|
373
|
+
handler: async () => {
|
374
|
+
await d(v).downloadTransactionReport({
|
375
|
+
start: d(n).startDate,
|
376
|
+
end: d(n).endDate
|
377
|
+
});
|
378
|
+
}
|
379
|
+
}, null, 8, ["handler"])
|
380
|
+
])
|
381
|
+
]),
|
382
|
+
b("div", me, [
|
383
|
+
f(te, {
|
384
|
+
modelValue: d(n),
|
385
|
+
"onUpdate:modelValue": t[1] || (t[1] = (c) => M(n) ? n.value = c : null)
|
386
|
+
}, null, 8, ["modelValue"])
|
387
|
+
]),
|
388
|
+
f(ce, {
|
389
|
+
loading: d(u),
|
390
|
+
data: l.value,
|
391
|
+
onQuery: O,
|
392
|
+
onRefund: V,
|
393
|
+
onNotify: P
|
394
|
+
}, null, 8, ["loading", "data"])
|
395
|
+
]),
|
396
|
+
_: 1
|
397
|
+
}, 8, ["loading"]);
|
398
|
+
};
|
399
|
+
}
|
400
|
+
});
|
401
|
+
export {
|
402
|
+
Ne as default
|
403
|
+
};
|
@@ -0,0 +1,238 @@
|
|
1
|
+
import { defineComponent as f, resolveComponent as N, openBlock as g, createBlock as S, normalizeClass as O, withCtx as D, createElementVNode as _, toDisplayString as V, createElementBlock as I, unref as o, ref as A, h as v, onMounted as C, watch as w, createVNode as p, isRef as E } from "vue";
|
2
|
+
import { t as b, b as M } from "./transaction-COjHU7aN.js";
|
3
|
+
import { e as x, u as Y } from "./index-4meiCsRz.js";
|
4
|
+
import "@feedmepos/ui-library";
|
5
|
+
import "./dinero-CIVmXLL-.js";
|
6
|
+
import { h as F } from "./moment-h96o7c8I.js";
|
7
|
+
import { g as $, a as k } from "./assets-BCAivOTo.js";
|
8
|
+
import { useCoreStore as L } from "@feedmepos/mf-common";
|
9
|
+
import { _ as P } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
10
|
+
import { u as B } from "./index-BwFHcZlm.js";
|
11
|
+
import { _ as U } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
|
12
|
+
import { _ as G } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
|
13
|
+
import { _ as q } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
|
14
|
+
const J = /* @__PURE__ */ f({
|
15
|
+
__name: "Status",
|
16
|
+
props: {
|
17
|
+
row: {},
|
18
|
+
data: {}
|
19
|
+
},
|
20
|
+
setup(s) {
|
21
|
+
const a = s;
|
22
|
+
function t() {
|
23
|
+
return a.data === x.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : a.data === x.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : a.data === x.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
|
24
|
+
}
|
25
|
+
return (l, c) => {
|
26
|
+
const d = N("FmBadge");
|
27
|
+
return g(), S(d, {
|
28
|
+
inline: "",
|
29
|
+
class: O(t())
|
30
|
+
}, {
|
31
|
+
default: D(() => [
|
32
|
+
_("div", null, V(l.data), 1)
|
33
|
+
]),
|
34
|
+
_: 1
|
35
|
+
}, 8, ["class"]);
|
36
|
+
};
|
37
|
+
}
|
38
|
+
}), j = ["src"], z = /* @__PURE__ */ f({
|
39
|
+
__name: "Gateway",
|
40
|
+
props: {
|
41
|
+
row: {},
|
42
|
+
data: {}
|
43
|
+
},
|
44
|
+
setup(s) {
|
45
|
+
return (a, t) => (g(), I("img", {
|
46
|
+
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
47
|
+
src: o($)(a.row.original.gateway)
|
48
|
+
}, null, 8, j));
|
49
|
+
}
|
50
|
+
}), Q = ["src"], H = /* @__PURE__ */ f({
|
51
|
+
__name: "Method",
|
52
|
+
props: {
|
53
|
+
row: {},
|
54
|
+
data: {}
|
55
|
+
},
|
56
|
+
setup(s) {
|
57
|
+
return (a, t) => (g(), I("img", {
|
58
|
+
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
59
|
+
src: o(k)(a.row.original.method.issuer)
|
60
|
+
}, null, 8, Q));
|
61
|
+
}
|
62
|
+
}), W = /* @__PURE__ */ f({
|
63
|
+
__name: "TransactionTable",
|
64
|
+
props: {
|
65
|
+
data: {
|
66
|
+
type: Array,
|
67
|
+
required: !0
|
68
|
+
},
|
69
|
+
loading: {
|
70
|
+
type: Boolean,
|
71
|
+
required: !0
|
72
|
+
}
|
73
|
+
},
|
74
|
+
emits: ["row-click"],
|
75
|
+
setup(s, { emit: a }) {
|
76
|
+
const t = s, l = a, c = A(""), d = [
|
77
|
+
{
|
78
|
+
header: () => "Transaction ID",
|
79
|
+
accessorKey: "id"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
header: () => "Pay ID",
|
83
|
+
accessorKey: "payId"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
header: () => "Gateway",
|
87
|
+
accessorKey: "gateway",
|
88
|
+
meta: {
|
89
|
+
textAlign: "center"
|
90
|
+
},
|
91
|
+
cell: ({ cell: n, row: e }) => e.original.method ? v(z, { row: e, data: n.getValue() }) : ""
|
92
|
+
},
|
93
|
+
{
|
94
|
+
header: () => "Method",
|
95
|
+
accessorKey: "method",
|
96
|
+
meta: {
|
97
|
+
textAlign: "center"
|
98
|
+
},
|
99
|
+
cell: ({ cell: n, row: e }) => e.original.method ? v(H, { row: e, data: n.getValue() }) : ""
|
100
|
+
},
|
101
|
+
{
|
102
|
+
header: () => "Type",
|
103
|
+
accessorKey: "type",
|
104
|
+
meta: {
|
105
|
+
textAlign: "center"
|
106
|
+
},
|
107
|
+
cell: ({ row: n }) => {
|
108
|
+
if (!n.original.method)
|
109
|
+
return "";
|
110
|
+
const e = n.original.method.variant;
|
111
|
+
return e.includes("_ONLINE") ? "ONLINE" : e.includes("_OFFLINE") ? "OFFLINE" : e;
|
112
|
+
}
|
113
|
+
},
|
114
|
+
{
|
115
|
+
header: () => "Status",
|
116
|
+
accessorKey: "status",
|
117
|
+
cell: ({ cell: n, row: e }) => v(J, { row: e, data: n.getValue() })
|
118
|
+
},
|
119
|
+
{
|
120
|
+
header: () => "Transaction At",
|
121
|
+
accessorKey: "transactionAt",
|
122
|
+
meta: {
|
123
|
+
width: "180px"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
{
|
127
|
+
header: () => "Sales Amount",
|
128
|
+
accessorKey: "amount"
|
129
|
+
},
|
130
|
+
{
|
131
|
+
header: () => "Fee",
|
132
|
+
accessorKey: "fee"
|
133
|
+
},
|
134
|
+
{
|
135
|
+
header: () => "Settlement Amount",
|
136
|
+
accessorKey: "payout"
|
137
|
+
}
|
138
|
+
];
|
139
|
+
return (n, e) => {
|
140
|
+
const h = N("FmTable");
|
141
|
+
return g(), S(h, {
|
142
|
+
modelValue: c.value,
|
143
|
+
"onUpdate:modelValue": e[0] || (e[0] = (i) => c.value = i),
|
144
|
+
"column-defs": d,
|
145
|
+
"row-data": t.data,
|
146
|
+
loading: t.loading,
|
147
|
+
onRowClick: e[1] || (e[1] = (i) => l("row-click", t.data.at(i.index)))
|
148
|
+
}, null, 8, ["modelValue", "row-data", "loading"]);
|
149
|
+
};
|
150
|
+
}
|
151
|
+
}), X = { class: "flex justify-between mb-6 items-center" }, Z = { class: "flex space-x-8" }, ee = { class: "flex space-x-4 self-center" }, ae = { class: "mb-6" }, fe = /* @__PURE__ */ f({
|
152
|
+
__name: "Transaction",
|
153
|
+
setup(s) {
|
154
|
+
const { dateRange: a, searchKey: t } = B({
|
155
|
+
searchKey: "",
|
156
|
+
dateRange: {
|
157
|
+
startDate: F().startOf("day").format("YYYY-MM-DD"),
|
158
|
+
endDate: F().endOf("day").format("YYYY-MM-DD")
|
159
|
+
}
|
160
|
+
}), { isLoading: l, startAsyncCall: c } = Y(!0), { currentRestaurant: d } = L(), n = A([]), e = A([]);
|
161
|
+
async function h() {
|
162
|
+
await c(async () => {
|
163
|
+
const { startDate: y, endDate: r } = a.value, u = await b.readRestaurantTransactions({
|
164
|
+
start: y,
|
165
|
+
end: r
|
166
|
+
});
|
167
|
+
if (n.value = M(u), e.value = n.value, t.value > "") {
|
168
|
+
var m = new RegExp(t.value, "i");
|
169
|
+
e.value = n.value.filter((R) => {
|
170
|
+
const K = JSON.stringify(R);
|
171
|
+
return m.test(K);
|
172
|
+
});
|
173
|
+
}
|
174
|
+
});
|
175
|
+
}
|
176
|
+
function i() {
|
177
|
+
h();
|
178
|
+
}
|
179
|
+
C(i), w(d, i), w(a, h);
|
180
|
+
let T;
|
181
|
+
return w(t, async () => {
|
182
|
+
T && clearTimeout(T), T = setTimeout(() => {
|
183
|
+
var y = new RegExp(t.value, "i");
|
184
|
+
e.value = n.value.filter((r) => {
|
185
|
+
const u = JSON.stringify(r);
|
186
|
+
return y.test(u);
|
187
|
+
});
|
188
|
+
}, 700);
|
189
|
+
}), (y, r) => {
|
190
|
+
const u = N("FmSearch");
|
191
|
+
return g(), S(P, {
|
192
|
+
title: "Online Transactions",
|
193
|
+
description: "Transactions are purchases or payments made over the internet using electronic methods like cards or digital wallets.",
|
194
|
+
loading: o(l)
|
195
|
+
}, {
|
196
|
+
default: D(() => [
|
197
|
+
_("div", X, [
|
198
|
+
_("div", Z, [
|
199
|
+
p(G),
|
200
|
+
p(u, {
|
201
|
+
"model-value": o(t),
|
202
|
+
"onUpdate:modelValue": r[0] || (r[0] = (m) => E(t) ? t.value = m : null),
|
203
|
+
label: "Search",
|
204
|
+
placeholder: "Search Transactions ..."
|
205
|
+
}, null, 8, ["model-value"])
|
206
|
+
]),
|
207
|
+
_("div", ee, [
|
208
|
+
p(U, {
|
209
|
+
button: {
|
210
|
+
appendIcon: "file_download",
|
211
|
+
variant: "primary",
|
212
|
+
label: "Export"
|
213
|
+
},
|
214
|
+
handler: async () => {
|
215
|
+
await o(b).downloadRestaurantTransactionReport(n.value);
|
216
|
+
}
|
217
|
+
}, null, 8, ["handler"])
|
218
|
+
])
|
219
|
+
]),
|
220
|
+
_("div", ae, [
|
221
|
+
p(q, {
|
222
|
+
modelValue: o(a),
|
223
|
+
"onUpdate:modelValue": r[1] || (r[1] = (m) => E(a) ? a.value = m : null)
|
224
|
+
}, null, 8, ["modelValue"])
|
225
|
+
]),
|
226
|
+
p(W, {
|
227
|
+
loading: o(l),
|
228
|
+
data: e.value
|
229
|
+
}, null, 8, ["loading", "data"])
|
230
|
+
]),
|
231
|
+
_: 1
|
232
|
+
}, 8, ["loading"]);
|
233
|
+
};
|
234
|
+
}
|
235
|
+
});
|
236
|
+
export {
|
237
|
+
fe as default
|
238
|
+
};
|
package/dist/api/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { type PaginatedResult } from "@feedmepos/payment-entity";
|
2
2
|
import { type AxiosInstance, type AxiosResponse } from "axios";
|
3
|
+
import type { WorkBook } from "xlsx";
|
3
4
|
type ApiVariant = "portal" | "auth";
|
4
5
|
interface ApiUrl {
|
5
6
|
portalBackendUrl: string;
|
@@ -29,6 +30,19 @@ export declare const authInstance: (config?: {
|
|
29
30
|
}) => AxiosInstance;
|
30
31
|
export declare const businessClientInstance: () => AxiosInstance;
|
31
32
|
export declare const restaurantClientInstance: (prefix?: string) => AxiosInstance;
|
33
|
+
type TransformFunction<T> = (value: T) => any;
|
34
|
+
type TransformFunctions<T> = {
|
35
|
+
[K in keyof T]?: TransformFunction<T[K]>;
|
36
|
+
};
|
37
|
+
export declare function flattenObject(obj: Record<string, any>, parentKey?: string): Record<string, any>;
|
38
|
+
export declare function localWorkbookAndDownload<T extends Object>(data: T[], options?: {
|
39
|
+
transformers?: TransformFunctions<T>;
|
40
|
+
exclude?: (keyof T)[];
|
41
|
+
rename?: Partial<Record<keyof T, string>>;
|
42
|
+
filename?: string;
|
43
|
+
}): void;
|
44
|
+
export declare function getWorkbookAndDownload(response: AxiosResponse<WorkBook>, filename: string): void;
|
45
|
+
export declare function downloadAs(blob: Blob, filename: string): void;
|
32
46
|
export declare function getData<T>(response: AxiosResponse<T>): T;
|
33
47
|
export declare function getPaginatedResult<T>(response: AxiosResponse<PaginatedResult<T>>): PaginatedResult<T>;
|
34
48
|
export {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export interface PaginationRequest {
|
2
|
+
skip: number;
|
3
|
+
limit: number;
|
4
|
+
sortBy: string;
|
5
|
+
descending?: boolean;
|
6
|
+
search?: string;
|
7
|
+
}
|
8
|
+
export interface PaginatedResponse<T> {
|
9
|
+
resources: T[];
|
10
|
+
meta: PaginatedMeta;
|
11
|
+
}
|
12
|
+
export interface PaginatedMeta {
|
13
|
+
skip: number;
|
14
|
+
limit: number;
|
15
|
+
sortBy: string;
|
16
|
+
descending?: boolean;
|
17
|
+
search?: string;
|
18
|
+
totalPages: number | null;
|
19
|
+
totalResources: number | null;
|
20
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { FdoPaymentGateway } from "@feedmepos/payment-entity";
|
2
|
+
/**
|
3
|
+
* Relying on the payout account so need pass in the restaurant id from the payout account
|
4
|
+
*/
|
5
|
+
export declare const paymentGatewayApi: {
|
6
|
+
get(restaurantId: string): Promise<FdoPaymentGateway[]>;
|
7
|
+
upsert(restaurantId: string, body: FdoPaymentGateway): Promise<FdoPaymentGateway[]>;
|
8
|
+
delete(restaurantId: string, gatewayId: string): Promise<FdoPaymentGateway[]>;
|
9
|
+
};
|