@feedmepos/mf-payment 1.0.2-beta.4 → 1.0.3-beta.1

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 (35) hide show
  1. package/dist/{PayoutAccount-DHEdIngR.js → PayoutAccount-BpTmAq7L.js} +5 -5
  2. package/dist/{PayoutAccount-DXcUdz0p.js → PayoutAccount-DPDYDztu.js} +3 -3
  3. package/dist/{PayoutAccountSetting-C_v2LzIF.js → PayoutAccountSetting-Dqj5Ay8_.js} +4 -4
  4. package/dist/{Restaurant-D-3PoRsg.js → Restaurant-BouKFsha.js} +3 -3
  5. package/dist/{RestaurantSetting-d_ccb58Z.js → RestaurantSetting-BeXpe5M9.js} +4 -4
  6. package/dist/{Settlement-9X7D3aKj.js → Settlement-BZevkUVD.js} +3 -3
  7. package/dist/{Settlement-C1nSxMvx.js → Settlement-C5S8SCT8.js} +3 -3
  8. package/dist/{SettlementTransactions-fmTcVx0U.js → SettlementTransactions-CNFm-E92.js} +4 -4
  9. package/dist/{SettlementTransactions-Cddu9sWg.js → SettlementTransactions-D2Z-i4tv.js} +4 -4
  10. package/dist/{Terminal-CwCiK8YZ.js → Terminal-D7EMm_un.js} +4 -4
  11. package/dist/{TerminalSetting-tZ24yC3L.js → TerminalSetting-BgxObmZ4.js} +3 -3
  12. package/dist/{TerminalTransaction-C9dtZ_E_.js → TerminalTransaction-Buf0yMu-.js} +5 -5
  13. package/dist/{TerminalTransaction-VFTcSYeV.js → TerminalTransaction-DUAhQ3VJ.js} +5 -5
  14. package/dist/{Transaction-tqeuoig4.js → Transaction-DJ62jUdZ.js} +4 -4
  15. package/dist/Transaction-y9wPMvLS.js +408 -0
  16. package/dist/api/transaction/index.d.ts +3 -0
  17. package/dist/{app-C1INGISa.js → app-D9URbI68.js} +53 -53
  18. package/dist/app.js +1 -1
  19. package/dist/{assets-BXpdxpRw.js → assets-C_LulpgD.js} +1 -1
  20. package/dist/{index-DNIQKw1Q.js → index-B6KIJrFV.js} +1 -1
  21. package/dist/{index-DGcicJfn.js → index-B74aXBpn.js} +1 -1
  22. package/dist/{index-6RZiyj0k.js → index-C1AMSmO9.js} +1 -1
  23. package/dist/{index-DONDDb7N.js → index-CKD2hEEa.js} +1 -1
  24. package/dist/{index-Cy-jcd0-.js → index-CuQ0G8FE.js} +1 -1
  25. package/dist/{index-06qlNCIm.js → index-CvqYcrBo.js} +1 -1
  26. package/dist/{index-CMmDke3y.js → index-DBnMiisv.js} +1 -1
  27. package/dist/{index-CQn2FlVk.js → index-DzBM1rDP.js} +1 -1
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-CEbLFVp1.js → index.vue_vue_type_script_setup_true_lang-BmM0EooD.js} +1 -1
  29. package/dist/package.json +1 -1
  30. package/dist/{payout-account-DyZkEARm.js → payout-account-CvnI-60K.js} +2 -2
  31. package/dist/{transaction-BFDDvzwa.js → transaction-DNuE-yMH.js} +12 -9
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/package.json +1 -1
  34. package/dist/Transaction-CdtMD82u.js +0 -430
  35. package/dist/views/admin/transaction/TransactionTable.vue.d.ts +0 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "1.0.2-beta.4",
3
+ "version": "1.0.3-beta.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,430 +0,0 @@
1
- import { defineComponent as g, resolveComponent as _, openBlock as y, createBlock as D, normalizeClass as Y, withCtx as x, createElementVNode as T, toDisplayString as $, createElementBlock as A, unref as d, createVNode as f, Fragment as U, renderList as B, ref as E, h as b, onMounted as G, watch as I, isRef as q } from "vue";
2
- import { t as w, a as J, b as M } from "./transaction-BFDDvzwa.js";
3
- import { e as N, u as Q } from "./index-6RZiyj0k.js";
4
- import { useSnackbar as j, useDialog as z } from "@feedmepos/ui-library";
5
- import "./dinero-CIVmXLL-.js";
6
- import { h as k } from "./moment-h96o7c8I.js";
7
- import { g as H, a as W } from "./assets-BXpdxpRw.js";
8
- import { _ as X } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
9
- import { u as Z } from "./index-CQn2FlVk.js";
10
- import { _ as ee } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
11
- import { _ as te } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
12
- import { w as R } from "./Modal-DB8M9o1T.js";
13
- import { u as S } from "./error-K1CakhA9.js";
14
- import { _ as ae } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
15
- import { g as ne } from "./grafana-CqkYm_ru.js";
16
- const oe = /* @__PURE__ */ g({
17
- __name: "Status",
18
- props: {
19
- row: {},
20
- data: {}
21
- },
22
- setup(m) {
23
- const n = m;
24
- function o() {
25
- return n.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : n.data === N.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
26
- }
27
- return (u, p) => {
28
- const s = _("FmBadge");
29
- return y(), D(s, {
30
- inline: "",
31
- class: Y(o())
32
- }, {
33
- default: x(() => [
34
- T("div", null, $(u.data), 1)
35
- ]),
36
- _: 1
37
- }, 8, ["class"]);
38
- };
39
- }
40
- }), re = ["src"], se = /* @__PURE__ */ g({
41
- __name: "Gateway",
42
- props: {
43
- row: {},
44
- data: {}
45
- },
46
- setup(m) {
47
- return (n, o) => (y(), A("img", {
48
- class: "rounded-md m-auto border-transparent object-contain w-[32px] h-[32px]",
49
- src: d(H)(n.row.original.gateway)
50
- }, null, 8, re));
51
- }
52
- }), ie = ["src"], ce = /* @__PURE__ */ g({
53
- __name: "Method",
54
- props: {
55
- row: {},
56
- data: {}
57
- },
58
- setup(m) {
59
- return (n, o) => (y(), A("img", {
60
- class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
61
- src: d(W)(n.row.original.method.issuer)
62
- }, null, 8, ie));
63
- }
64
- }), le = /* @__PURE__ */ g({
65
- __name: "Actions",
66
- props: {
67
- onAction: { type: Function }
68
- },
69
- setup(m) {
70
- const n = [
71
- {
72
- label: "Query",
73
- sublabel: "Perform transaction status inquriy",
74
- icon: "question_answer",
75
- action: "query"
76
- },
77
- {
78
- label: "Refund",
79
- sublabel: "Perform transaction refund request",
80
- icon: "request_page",
81
- action: "refund"
82
- },
83
- {
84
- label: "Notify",
85
- sublabel: "Perform webhook notification for transaction",
86
- icon: "webhook",
87
- action: "notify"
88
- },
89
- {
90
- label: "Log",
91
- sublabel: "Inspect transaction historical actions, requests and responses.",
92
- icon: "history",
93
- action: "history"
94
- }
95
- ];
96
- return (o, u) => {
97
- const p = _("FmIcon"), s = _("FmMenuItem"), r = _("FmMenu");
98
- return y(), A("div", {
99
- onClick: u[0] || (u[0] = (e) => {
100
- e.stopPropagation();
101
- })
102
- }, [
103
- f(r, null, {
104
- "menu-button": x(() => [
105
- f(p, { name: "settings" })
106
- ]),
107
- default: x(() => [
108
- (y(), A(U, null, B(n, (e) => f(s, {
109
- selectable: !0,
110
- key: e.label,
111
- sublabel: e.sublabel,
112
- label: e.label,
113
- icon: e.icon,
114
- onclick: () => o.onAction(e.action)
115
- }, null, 8, ["sublabel", "label", "icon", "onclick"])), 64))
116
- ]),
117
- _: 1
118
- })
119
- ]);
120
- };
121
- }
122
- }), ue = /* @__PURE__ */ g({
123
- __name: "TransactionTable",
124
- props: {
125
- data: {
126
- type: Array,
127
- required: !0
128
- },
129
- loading: {
130
- type: Boolean,
131
- required: !0
132
- }
133
- },
134
- emits: ["query", "refund", "notify", "history"],
135
- setup(m, { emit: n }) {
136
- const o = m, u = n, p = E(""), s = [
137
- {
138
- header: () => "Transaction ID",
139
- accessorKey: "id",
140
- cell: ({ cell: r }) => b(X, { data: r.getValue() })
141
- },
142
- {
143
- header: () => "Pay ID",
144
- accessorKey: "payId"
145
- },
146
- {
147
- header: () => "Gateway",
148
- accessorKey: "gateway",
149
- meta: {
150
- textAlign: "center"
151
- },
152
- cell: ({ cell: r, row: e }) => e.original.method ? b(se, { row: e, data: r.getValue() }) : ""
153
- },
154
- {
155
- header: () => "Method",
156
- accessorKey: "method",
157
- meta: {
158
- textAlign: "center"
159
- },
160
- cell: ({ cell: r, row: e }) => e.original.method ? b(ce, { row: e, data: r.getValue() }) : ""
161
- },
162
- {
163
- header: () => "Type",
164
- accessorKey: "type",
165
- meta: {
166
- textAlign: "center"
167
- },
168
- cell: ({ row: r }) => {
169
- if (!r.original.method)
170
- return "";
171
- const e = r.original.method.variant;
172
- return e.includes("_ONLINE") ? "ONLINE" : e.includes("_OFFLINE") ? "OFFLINE" : e;
173
- }
174
- },
175
- {
176
- header: () => "Status",
177
- accessorKey: "status",
178
- cell: ({ cell: r, row: e }) => b(oe, { row: e, data: r.getValue() })
179
- },
180
- {
181
- header: () => "Transaction At",
182
- accessorKey: "transactionAt",
183
- meta: {
184
- width: "180px"
185
- }
186
- },
187
- {
188
- header: () => "Sales Amount",
189
- accessorKey: "amount"
190
- },
191
- {
192
- header: () => "Fee",
193
- accessorKey: "fee"
194
- },
195
- {
196
- header: () => "Settlement Amount",
197
- accessorKey: "payout"
198
- },
199
- {
200
- header: () => "Actions",
201
- accessorKey: "actions",
202
- cell: ({ row: r }) => b(le, {
203
- onAction: (e) => u(e, r.index)
204
- })
205
- }
206
- ];
207
- return (r, e) => {
208
- const c = _("FmTable");
209
- return y(), D(c, {
210
- modelValue: p.value,
211
- "onUpdate:modelValue": e[0] || (e[0] = (v) => p.value = v),
212
- "column-defs": s,
213
- "row-data": o.data,
214
- loading: o.loading
215
- }, null, 8, ["modelValue", "row-data", "loading"]);
216
- };
217
- }
218
- }), de = { class: "flex justify-between mb-6 items-center" }, me = { class: "flex space-x-4" }, pe = { class: "flex space-x-4 self-center" }, fe = { class: "mb-6" }, De = /* @__PURE__ */ g({
219
- __name: "Transaction",
220
- setup(m) {
221
- const { dateRange: n, searchKey: o } = Z({
222
- searchKey: "",
223
- dateRange: {
224
- startDate: k().startOf("day").format("YYYY-MM-DD"),
225
- endDate: k().endOf("day").format("YYYY-MM-DD")
226
- }
227
- }), { isLoading: u, startAsyncCall: p } = Q(!0), s = j(), r = z(), e = E([]), c = E([]);
228
- async function v() {
229
- await p(async () => {
230
- const { startDate: i, endDate: t } = n.value, a = await w.readTransactions({
231
- start: i,
232
- end: t
233
- });
234
- if (e.value = J(a), c.value = e.value, o.value > "") {
235
- var l = new RegExp(o.value, "i");
236
- c.value = e.value.filter((h) => {
237
- const C = JSON.stringify(h);
238
- return l.test(C);
239
- });
240
- }
241
- });
242
- }
243
- function K() {
244
- v();
245
- }
246
- G(K), I(n, v);
247
- let F;
248
- I(o, async () => {
249
- F && clearTimeout(F), F = setTimeout(() => {
250
- var i = new RegExp(o.value, "i");
251
- c.value = e.value.filter((t) => {
252
- const a = JSON.stringify(t);
253
- return i.test(a);
254
- });
255
- }, 700);
256
- }), I(e, async () => {
257
- let i = e.value;
258
- if (o.value) {
259
- var t = new RegExp(o.value, "i");
260
- i = e.value.filter((a) => {
261
- const l = JSON.stringify(a);
262
- return t.test(l);
263
- });
264
- }
265
- c.value = i;
266
- }, { deep: !0 });
267
- async function O(i) {
268
- const t = c.value.at(i);
269
- if (!t) {
270
- s.open({
271
- type: "error",
272
- title: "Something went wrong",
273
- message: "Fail to find transactions from the displayed transactions."
274
- });
275
- return;
276
- }
277
- try {
278
- const a = await w.refetchTransaction({ transactionId: t.id }), l = e.value.findIndex((h) => h.id === a._id);
279
- e.value[l] = M(a), s.open({
280
- type: "success",
281
- title: "Transaction queried and updated successfully."
282
- });
283
- } catch (a) {
284
- s.open({
285
- type: "error",
286
- title: "Fail to query transaction.",
287
- message: S(a)
288
- });
289
- }
290
- }
291
- async function V(i) {
292
- const t = c.value.at(i);
293
- if (!t) {
294
- s.open({
295
- type: "error",
296
- title: "Something went wrong",
297
- message: "Fail to find transactions from the displayed transactions."
298
- });
299
- return;
300
- }
301
- R(
302
- r,
303
- "Refund Transaction",
304
- "Are you sure to refund transaction? This action cannot be revert!",
305
- async () => {
306
- try {
307
- const a = await w.refundTransaction({
308
- transactionId: t.id,
309
- reason: "portal transaction refund",
310
- amount: t.fdoAmount
311
- }), l = e.value.findIndex((h) => h.id === a._id);
312
- e.value[l] = M(a), s.open({
313
- type: "success",
314
- title: "Transaction refund request initiated."
315
- });
316
- } catch (a) {
317
- s.open({
318
- type: "error",
319
- title: "Fail to request refund transaction.",
320
- message: S(a)
321
- });
322
- }
323
- }
324
- );
325
- }
326
- async function L(i) {
327
- const t = c.value.at(i);
328
- if (!t) {
329
- s.open({
330
- type: "error",
331
- title: "Something went wrong",
332
- message: "Fail to find transactions from the displayed transactions."
333
- });
334
- return;
335
- }
336
- R(
337
- r,
338
- "Notify Transaction",
339
- "Are you sure to perform notify transaction?",
340
- async () => {
341
- try {
342
- await w.renotifyTransaction(t.id), s.open({
343
- type: "success",
344
- title: "Transaction notify successfully."
345
- });
346
- } catch (a) {
347
- s.open({
348
- type: "error",
349
- title: "Fail to notify transaction.",
350
- message: S(a)
351
- });
352
- }
353
- }
354
- );
355
- }
356
- async function P(i) {
357
- const t = c.value.at(i);
358
- if (!t) {
359
- s.open({
360
- type: "error",
361
- title: "Something went wrong",
362
- message: "Fail to find transactions from the displayed transactions."
363
- });
364
- return;
365
- }
366
- const a = ne([
367
- {
368
- type: "span",
369
- queryKey: "transaction.id",
370
- queryValue: t.id
371
- }
372
- ], t.createdAt);
373
- window.open(a, "_blank");
374
- }
375
- return (i, t) => {
376
- const a = _("FmSearch");
377
- return y(), D(ee, {
378
- title: "Online Transactions",
379
- loading: d(u)
380
- }, {
381
- default: x(() => [
382
- T("div", de, [
383
- T("div", me, [
384
- f(a, {
385
- "model-value": d(o),
386
- "onUpdate:modelValue": t[0] || (t[0] = (l) => q(o) ? o.value = l : null),
387
- class: "mr-8",
388
- label: "Search",
389
- placeholder: "Search Transactions ..."
390
- }, null, 8, ["model-value"])
391
- ]),
392
- T("div", pe, [
393
- f(te, {
394
- button: {
395
- appendIcon: "file_download",
396
- variant: "primary",
397
- label: "Export"
398
- },
399
- handler: async () => {
400
- await d(w).downloadTransactionReport({
401
- start: d(n).startDate,
402
- end: d(n).endDate
403
- });
404
- }
405
- }, null, 8, ["handler"])
406
- ])
407
- ]),
408
- T("div", fe, [
409
- f(ae, {
410
- modelValue: d(n),
411
- "onUpdate:modelValue": t[1] || (t[1] = (l) => q(n) ? n.value = l : null)
412
- }, null, 8, ["modelValue"])
413
- ]),
414
- f(ue, {
415
- loading: d(u),
416
- data: c.value,
417
- onQuery: O,
418
- onRefund: V,
419
- onNotify: L,
420
- onHistory: P
421
- }, null, 8, ["loading", "data"])
422
- ]),
423
- _: 1
424
- }, 8, ["loading"]);
425
- };
426
- }
427
- });
428
- export {
429
- De as default
430
- };
@@ -1,32 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import { type PortalPaymentTransaction } from '@/model/transaction';
3
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
- data: {
5
- type: PropType<PortalPaymentTransaction[]>;
6
- required: true;
7
- };
8
- loading: {
9
- type: BooleanConstructor;
10
- required: true;
11
- };
12
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
- query: (index: number) => any;
14
- refund: (index: number) => any;
15
- history: (index: number) => any;
16
- notify: (index: number) => any;
17
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
- data: {
19
- type: PropType<PortalPaymentTransaction[]>;
20
- required: true;
21
- };
22
- loading: {
23
- type: BooleanConstructor;
24
- required: true;
25
- };
26
- }>> & Readonly<{
27
- onQuery?: ((index: number) => any) | undefined;
28
- onRefund?: ((index: number) => any) | undefined;
29
- onHistory?: ((index: number) => any) | undefined;
30
- onNotify?: ((index: number) => any) | undefined;
31
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
- export default _default;