@reeboot/strapi-payment-plugin 0.0.5 → 0.0.7
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 +21 -0
- package/dist/_chunks/{Analytics-CQmAVKsq.mjs → Analytics-CncK5kn-.mjs} +6 -7
- package/dist/_chunks/{Analytics-CLjtRWYA.js → Analytics-c8KBuG3k.js} +6 -7
- package/dist/_chunks/{App-DXN62SV6.mjs → App-B5AB8Omu.mjs} +7 -7
- package/dist/_chunks/{App-Dk7XtjNA.js → App-Cih9sWu1.js} +7 -7
- package/dist/_chunks/{Customers-BQzVBQDT.mjs → Customers-BVk2gx7w.mjs} +51 -118
- package/dist/_chunks/{Customers-BNDi4QBH.js → Customers-CZWOnN26.js} +50 -117
- package/dist/_chunks/{Dashboard-UUwohHZa.js → Dashboard-CEif4jQn.js} +60 -84
- package/dist/_chunks/{Dashboard-CuHC-dit.mjs → Dashboard-DAjD8Q_6.mjs} +60 -84
- package/dist/_chunks/{Orders-CitNCdWE.js → Orders-DZXb54VO.js} +73 -146
- package/dist/_chunks/{Orders-65mNfu2i.mjs → Orders-DdJqI1HB.mjs} +74 -147
- package/dist/_chunks/{PaymentList-B0CAzInT.mjs → PaymentList-3HWK7PMz.mjs} +14 -39
- package/dist/_chunks/{PaymentList-Dy1BAFoD.js → PaymentList-APfyYD1h.js} +14 -39
- package/dist/_chunks/{Payments-FnhoV_2B.mjs → Payments-DFL-Cwgy.mjs} +97 -103
- package/dist/_chunks/{Payments-TOnygGIW.js → Payments-VzDGbK4W.js} +96 -102
- package/dist/_chunks/{Settings-BJtDagUs.js → Settings-B1tR3WOm.js} +157 -161
- package/dist/_chunks/{Settings-EoLSuZLe.mjs → Settings-SALxClBu.mjs} +157 -161
- package/dist/_chunks/{index-2Zd_T7bD.mjs → index-CB6TMitx.mjs} +1 -1
- package/dist/_chunks/{index-CHEgJ7e5.js → index-D-fFikb8.js} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +17 -5
- package/dist/server/index.mjs +17 -5
- package/package.json +1 -1
- /package/dist/server/src/{types → services/types}/api.d.ts +0 -0
- /package/dist/server/src/{types → services/types}/customer.d.ts +0 -0
- /package/dist/server/src/{types → services/types}/index.d.ts +0 -0
- /package/dist/server/src/{types → services/types}/order.d.ts +0 -0
- /package/dist/server/src/{types → services/types}/payment.d.ts +0 -0
|
@@ -5,8 +5,9 @@ const React = require("react");
|
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
|
6
6
|
const reactIntl = require("react-intl");
|
|
7
7
|
const admin = require("@strapi/strapi/admin");
|
|
8
|
-
const index = require("./index-
|
|
9
|
-
const
|
|
8
|
+
const index = require("./index-D-fFikb8.js");
|
|
9
|
+
const icons = require("@strapi/icons");
|
|
10
|
+
const PaymentList = require("./PaymentList-APfyYD1h.js");
|
|
10
11
|
const RefundModal = ({ payment, onClose, onSuccess }) => {
|
|
11
12
|
const { formatMessage } = reactIntl.useIntl();
|
|
12
13
|
const { post } = admin.useFetchClient();
|
|
@@ -36,9 +37,7 @@ const RefundModal = ({ payment, onClose, onSuccess }) => {
|
|
|
36
37
|
const { data } = await post(`/${index.PLUGIN_ID}/admin/payments/${payment.id}/refund`, {
|
|
37
38
|
amount: refundAmount,
|
|
38
39
|
reason,
|
|
39
|
-
metadata: {
|
|
40
|
-
admin_notes: notes
|
|
41
|
-
}
|
|
40
|
+
metadata: { admin_notes: notes }
|
|
42
41
|
});
|
|
43
42
|
if (data.success) {
|
|
44
43
|
onSuccess();
|
|
@@ -88,7 +87,7 @@ const RefundModal = ({ payment, onClose, onSuccess }) => {
|
|
|
88
87
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: () => handlePartialRefund(25), children: formatMessage({ id: "payment-plugin.refund.quarter", defaultMessage: "25% Refund" }) })
|
|
89
88
|
] })
|
|
90
89
|
] }),
|
|
91
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
92
91
|
designSystem.TextInput,
|
|
93
92
|
{
|
|
94
93
|
label: formatMessage({ id: "payment-plugin.refund.amount", defaultMessage: "Refund Amount" }),
|
|
@@ -104,8 +103,8 @@ const RefundModal = ({ payment, onClose, onSuccess }) => {
|
|
|
104
103
|
{ amount: formatCurrency(payment.amount, payment.currency) }
|
|
105
104
|
)
|
|
106
105
|
}
|
|
107
|
-
)
|
|
108
|
-
/* @__PURE__ */ jsxRuntime.
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
109
108
|
designSystem.SingleSelect,
|
|
110
109
|
{
|
|
111
110
|
label: formatMessage({ id: "payment-plugin.refund.reason", defaultMessage: "Reason" }),
|
|
@@ -117,8 +116,8 @@ const RefundModal = ({ payment, onClose, onSuccess }) => {
|
|
|
117
116
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "fraudulent", children: formatMessage({ id: "payment-plugin.refund.reason.fraudulent", defaultMessage: "Fraudulent" }) })
|
|
118
117
|
]
|
|
119
118
|
}
|
|
120
|
-
)
|
|
121
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
122
121
|
designSystem.Textarea,
|
|
123
122
|
{
|
|
124
123
|
label: formatMessage({ id: "payment-plugin.refund.notes", defaultMessage: "Internal Notes (Optional)" }),
|
|
@@ -127,12 +126,29 @@ const RefundModal = ({ payment, onClose, onSuccess }) => {
|
|
|
127
126
|
onChange: (e) => setNotes(e.target.value),
|
|
128
127
|
rows: 3
|
|
129
128
|
}
|
|
130
|
-
)
|
|
131
|
-
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
),
|
|
130
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
131
|
+
designSystem.Alert,
|
|
132
|
+
{
|
|
133
|
+
variant: "danger",
|
|
134
|
+
title: formatMessage({ id: "payment-plugin.refund.error", defaultMessage: "Error" }),
|
|
135
|
+
closeLabel: formatMessage({ id: "payment-plugin.alert.close", defaultMessage: "Close alert" }),
|
|
136
|
+
onClose: () => setError(null),
|
|
137
|
+
children: error
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
141
|
+
designSystem.Alert,
|
|
142
|
+
{
|
|
143
|
+
variant: "warning",
|
|
144
|
+
title: formatMessage({ id: "payment-plugin.refund.warning", defaultMessage: "Warning" }),
|
|
145
|
+
closeLabel: formatMessage({ id: "payment-plugin.alert.dismiss", defaultMessage: "Dismiss" }),
|
|
146
|
+
children: formatMessage({
|
|
147
|
+
id: "payment-plugin.refund.warningMessage",
|
|
148
|
+
defaultMessage: "This action cannot be undone. The refund will be processed immediately."
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
)
|
|
136
152
|
] }) }),
|
|
137
153
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
|
|
138
154
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: onClose, disabled: loading, children: formatMessage({ id: "payment-plugin.refund.cancel", defaultMessage: "Cancel" }) }),
|
|
@@ -151,7 +167,7 @@ const RefundModal = ({ payment, onClose, onSuccess }) => {
|
|
|
151
167
|
};
|
|
152
168
|
const PaymentCard = ({ payment, onClose }) => {
|
|
153
169
|
const { formatMessage } = reactIntl.useIntl();
|
|
154
|
-
|
|
170
|
+
const [copied, setCopied] = React.useState(false);
|
|
155
171
|
const formatCurrency = (amount, currency = "usd") => {
|
|
156
172
|
return new Intl.NumberFormat("en-US", {
|
|
157
173
|
style: "currency",
|
|
@@ -170,14 +186,19 @@ const PaymentCard = ({ payment, onClose }) => {
|
|
|
170
186
|
};
|
|
171
187
|
const getStatusBadge = (status) => {
|
|
172
188
|
const statusConfig = {
|
|
173
|
-
succeeded: {
|
|
174
|
-
pending: {
|
|
175
|
-
failed: {
|
|
176
|
-
refunded: {
|
|
177
|
-
canceled: {
|
|
189
|
+
succeeded: { variant: "success", label: "Success" },
|
|
190
|
+
pending: { variant: "warning", label: "Pending" },
|
|
191
|
+
failed: { variant: "danger", label: "Failed" },
|
|
192
|
+
refunded: { variant: "secondary", label: "Refunded" },
|
|
193
|
+
canceled: { variant: "neutral", label: "Canceled" }
|
|
178
194
|
};
|
|
179
195
|
const config = statusConfig[status] || statusConfig.pending;
|
|
180
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, {
|
|
196
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { variant: config.variant, children: config.label });
|
|
197
|
+
};
|
|
198
|
+
const handleCopyStripeId = () => {
|
|
199
|
+
navigator.clipboard.writeText(payment.stripe_payment_intent_id || "");
|
|
200
|
+
setCopied(true);
|
|
201
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
181
202
|
};
|
|
182
203
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open: true, onOpenChange: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
|
|
183
204
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", textColor: "neutral800", as: "h2", id: "title", children: formatMessage({ id: "payment-plugin.paymentDetails.title", defaultMessage: "Payment Details" }) }) }),
|
|
@@ -227,15 +248,14 @@ const PaymentCard = ({ payment, onClose }) => {
|
|
|
227
248
|
] })
|
|
228
249
|
] }) }),
|
|
229
250
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
|
|
230
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onClose, variant: "tertiary", children: "Close" }),
|
|
251
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onClose, variant: "tertiary", children: formatMessage({ id: "payment-plugin.paymentDetails.close", defaultMessage: "Close" }) }),
|
|
231
252
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
232
253
|
designSystem.Button,
|
|
233
254
|
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
},
|
|
238
|
-
children: "Copy Stripe ID"
|
|
255
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Duplicate, {}),
|
|
256
|
+
onClick: handleCopyStripeId,
|
|
257
|
+
variant: copied ? "success" : "default",
|
|
258
|
+
children: copied ? formatMessage({ id: "payment-plugin.paymentDetails.copied", defaultMessage: "Copied!" }) : formatMessage({ id: "payment-plugin.paymentDetails.copyStripeId", defaultMessage: "Copy Stripe ID" })
|
|
239
259
|
}
|
|
240
260
|
)
|
|
241
261
|
] })
|
|
@@ -245,36 +265,32 @@ const Payments = () => {
|
|
|
245
265
|
const { formatMessage } = reactIntl.useIntl();
|
|
246
266
|
const { get } = admin.useFetchClient();
|
|
247
267
|
const [payments, setPayments] = React.useState([]);
|
|
248
|
-
const [filteredPayments, setFilteredPayments] = React.useState([]);
|
|
249
268
|
const [loading, setLoading] = React.useState(true);
|
|
250
269
|
const [error, setError] = React.useState(null);
|
|
251
270
|
const [selectedPayment, setSelectedPayment] = React.useState(null);
|
|
252
271
|
const [showRefundModal, setShowRefundModal] = React.useState(false);
|
|
253
272
|
const [showPaymentCard, setShowPaymentCard] = React.useState(false);
|
|
254
|
-
console.log("payments:", payments);
|
|
255
273
|
const [currentPage, setCurrentPage] = React.useState(1);
|
|
256
|
-
const
|
|
274
|
+
const pageSize = 25;
|
|
257
275
|
const [totalCount, setTotalCount] = React.useState(0);
|
|
258
276
|
const [filters, setFilters] = React.useState({
|
|
259
277
|
payment_status: "",
|
|
260
278
|
paymentMethod: "",
|
|
261
|
-
dateRange: { from: null, to: null },
|
|
262
279
|
search: "",
|
|
263
280
|
currency: ""
|
|
264
281
|
});
|
|
265
282
|
React.useEffect(() => {
|
|
266
283
|
fetchPayments();
|
|
267
|
-
}, [currentPage,
|
|
268
|
-
React.useEffect(() => {
|
|
269
|
-
applyFilters();
|
|
270
|
-
}, [payments, filters]);
|
|
284
|
+
}, [currentPage, filters]);
|
|
271
285
|
const fetchPayments = async () => {
|
|
272
286
|
try {
|
|
273
287
|
setLoading(true);
|
|
274
288
|
const queryParams = new URLSearchParams({
|
|
275
289
|
page: currentPage.toString(),
|
|
276
290
|
pageSize: pageSize.toString(),
|
|
277
|
-
...filters.payment_status && { payment_status: filters.payment_status }
|
|
291
|
+
...filters.payment_status && { payment_status: filters.payment_status },
|
|
292
|
+
...filters.search && { search: filters.search },
|
|
293
|
+
...filters.currency && { currency: filters.currency }
|
|
278
294
|
});
|
|
279
295
|
const { data } = await get(`/${index.PLUGIN_ID}/admin/payments?${queryParams}`);
|
|
280
296
|
if (data.success && data.data) {
|
|
@@ -286,7 +302,7 @@ const Payments = () => {
|
|
|
286
302
|
orderId: p.order?.documentId
|
|
287
303
|
}));
|
|
288
304
|
setPayments(formattedPayments);
|
|
289
|
-
setTotalCount(data.meta
|
|
305
|
+
setTotalCount(data.meta?.pagination?.total || 0);
|
|
290
306
|
}
|
|
291
307
|
setLoading(false);
|
|
292
308
|
} catch (err) {
|
|
@@ -294,35 +310,7 @@ const Payments = () => {
|
|
|
294
310
|
setLoading(false);
|
|
295
311
|
}
|
|
296
312
|
};
|
|
297
|
-
const
|
|
298
|
-
let filtered = [...payments];
|
|
299
|
-
if (filters.search) {
|
|
300
|
-
const searchLower = filters.search.toLowerCase();
|
|
301
|
-
filtered = filtered.filter(
|
|
302
|
-
(payment) => payment.customerEmail.toLowerCase().includes(searchLower) || payment.customerName?.toLowerCase().includes(searchLower) || payment.stripe_payment_intent_id && payment.stripe_payment_intent_id.toLowerCase().includes(searchLower) || payment.description?.toLowerCase().includes(searchLower)
|
|
303
|
-
);
|
|
304
|
-
}
|
|
305
|
-
if (filters.payment_status) {
|
|
306
|
-
filtered = filtered.filter((payment) => payment.payment_status === filters.payment_status);
|
|
307
|
-
}
|
|
308
|
-
if (filters.paymentMethod) {
|
|
309
|
-
filtered = filtered.filter((payment) => payment.payment_method === filters.paymentMethod);
|
|
310
|
-
}
|
|
311
|
-
if (filters.currency) {
|
|
312
|
-
filtered = filtered.filter((payment) => payment.currency === filters.currency);
|
|
313
|
-
}
|
|
314
|
-
if (filters.dateRange.from) {
|
|
315
|
-
filtered = filtered.filter(
|
|
316
|
-
(payment) => new Date(payment.createdAt) >= filters.dateRange.from
|
|
317
|
-
);
|
|
318
|
-
}
|
|
319
|
-
if (filters.dateRange.to) {
|
|
320
|
-
filtered = filtered.filter(
|
|
321
|
-
(payment) => new Date(payment.createdAt) <= filters.dateRange.to
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
setFilteredPayments(filtered);
|
|
325
|
-
};
|
|
313
|
+
const totalPages = Math.max(1, Math.ceil(totalCount / pageSize));
|
|
326
314
|
const formatDate = (dateString) => {
|
|
327
315
|
return new Date(dateString).toLocaleDateString("en-US", {
|
|
328
316
|
year: "numeric",
|
|
@@ -345,19 +333,13 @@ const Payments = () => {
|
|
|
345
333
|
setCurrentPage(1);
|
|
346
334
|
};
|
|
347
335
|
const clearFilters = () => {
|
|
348
|
-
setFilters({
|
|
349
|
-
payment_status: "",
|
|
350
|
-
paymentMethod: "",
|
|
351
|
-
dateRange: { from: null, to: null },
|
|
352
|
-
search: "",
|
|
353
|
-
currency: ""
|
|
354
|
-
});
|
|
336
|
+
setFilters({ payment_status: "", paymentMethod: "", search: "", currency: "" });
|
|
355
337
|
setCurrentPage(1);
|
|
356
338
|
};
|
|
357
339
|
const exportPayments = () => {
|
|
358
340
|
const csvContent = [
|
|
359
341
|
["ID", "Stripe Payment ID", "Customer Email", "Amount", "Currency", "Status", "Payment Method", "Date"],
|
|
360
|
-
...
|
|
342
|
+
...payments.map((payment) => [
|
|
361
343
|
payment.id,
|
|
362
344
|
payment.stripe_payment_intent_id || "",
|
|
363
345
|
payment.customerEmail || "",
|
|
@@ -376,19 +358,14 @@ const Payments = () => {
|
|
|
376
358
|
a.click();
|
|
377
359
|
window.URL.revokeObjectURL(url);
|
|
378
360
|
};
|
|
379
|
-
const startIndex = (currentPage - 1) * pageSize;
|
|
380
|
-
const endIndex = startIndex + pageSize;
|
|
381
|
-
const paginatedPayments = filteredPayments.slice(startIndex, endIndex);
|
|
382
|
-
const totalPages = Math.ceil(filteredPayments.length / pageSize);
|
|
383
361
|
if (loading && payments.length === 0) {
|
|
384
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, {
|
|
362
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, {}) }) });
|
|
385
363
|
}
|
|
386
364
|
if (error) {
|
|
387
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, {
|
|
365
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
388
366
|
designSystem.EmptyStateLayout,
|
|
389
367
|
{
|
|
390
|
-
|
|
391
|
-
subtitle: error,
|
|
368
|
+
content: error,
|
|
392
369
|
action: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: fetchPayments, children: formatMessage({ id: "payment-plugin.payments.retry", defaultMessage: "Retry" }) })
|
|
393
370
|
}
|
|
394
371
|
) });
|
|
@@ -404,13 +381,14 @@ const Payments = () => {
|
|
|
404
381
|
] }),
|
|
405
382
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
406
383
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: exportPayments, children: formatMessage({ id: "payment-plugin.payments.export", defaultMessage: "Export" }) }),
|
|
407
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick:
|
|
384
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: fetchPayments, children: formatMessage({ id: "payment-plugin.payments.refresh", defaultMessage: "Refresh" }) })
|
|
408
385
|
] })
|
|
409
386
|
] }) }),
|
|
410
387
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
|
|
411
388
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
412
389
|
designSystem.TextInput,
|
|
413
390
|
{
|
|
391
|
+
label: formatMessage({ id: "payment-plugin.payments.search.label", defaultMessage: "Search" }),
|
|
414
392
|
placeholder: formatMessage({
|
|
415
393
|
id: "payment-plugin.payments.search.placeholder",
|
|
416
394
|
defaultMessage: "Search payments..."
|
|
@@ -422,6 +400,7 @@ const Payments = () => {
|
|
|
422
400
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
423
401
|
designSystem.SingleSelect,
|
|
424
402
|
{
|
|
403
|
+
label: formatMessage({ id: "payment-plugin.payments.status.label", defaultMessage: "Status" }),
|
|
425
404
|
placeholder: formatMessage({
|
|
426
405
|
id: "payment-plugin.payments.status.placeholder",
|
|
427
406
|
defaultMessage: "All Statuses"
|
|
@@ -440,9 +419,10 @@ const Payments = () => {
|
|
|
440
419
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
441
420
|
designSystem.SingleSelect,
|
|
442
421
|
{
|
|
422
|
+
label: formatMessage({ id: "payment-plugin.payments.method.label", defaultMessage: "Method" }),
|
|
443
423
|
placeholder: formatMessage({
|
|
444
424
|
id: "payment-plugin.payments.paymentMethod.placeholder",
|
|
445
|
-
defaultMessage: "All
|
|
425
|
+
defaultMessage: "All Methods"
|
|
446
426
|
}),
|
|
447
427
|
value: filters.paymentMethod,
|
|
448
428
|
onChange: (value) => handleFilterChange("paymentMethod", value),
|
|
@@ -457,6 +437,7 @@ const Payments = () => {
|
|
|
457
437
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
458
438
|
designSystem.SingleSelect,
|
|
459
439
|
{
|
|
440
|
+
label: formatMessage({ id: "payment-plugin.payments.currency.label", defaultMessage: "Currency" }),
|
|
460
441
|
placeholder: formatMessage({
|
|
461
442
|
id: "payment-plugin.payments.currency.placeholder",
|
|
462
443
|
defaultMessage: "All Currencies"
|
|
@@ -471,33 +452,46 @@ const Payments = () => {
|
|
|
471
452
|
]
|
|
472
453
|
}
|
|
473
454
|
) }),
|
|
474
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: clearFilters, children: formatMessage({ id: "payment-plugin.payments.clearFilters", defaultMessage: "Clear" }) }) }) })
|
|
455
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, alignItems: "flex-end", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: clearFilters, children: formatMessage({ id: "payment-plugin.payments.clearFilters", defaultMessage: "Clear" }) }) }) })
|
|
475
456
|
] }) }) }),
|
|
476
457
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 4, marginBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
|
|
477
|
-
{ id: "payment-plugin.payments.results", defaultMessage: "
|
|
478
|
-
{
|
|
479
|
-
start: startIndex + 1,
|
|
480
|
-
end: Math.min(endIndex, filteredPayments.length),
|
|
481
|
-
total: filteredPayments.length
|
|
482
|
-
}
|
|
458
|
+
{ id: "payment-plugin.payments.results", defaultMessage: "{total} payments" },
|
|
459
|
+
{ total: totalCount }
|
|
483
460
|
) }) }),
|
|
484
461
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
485
462
|
PaymentList.PaymentList,
|
|
486
463
|
{
|
|
487
|
-
payments
|
|
464
|
+
payments,
|
|
488
465
|
onPaymentClick: (payment) => handleViewDetails(payment),
|
|
489
466
|
onRefund: (payment) => handleRefund(payment),
|
|
490
467
|
onViewDetails: (payment) => handleViewDetails(payment)
|
|
491
468
|
}
|
|
492
469
|
) }),
|
|
493
|
-
totalPages > 1 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
470
|
+
totalPages > 1 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Pagination, { activePage: currentPage, pageCount: totalPages, label: "Payments pagination", children: [
|
|
471
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
472
|
+
designSystem.PreviousLink,
|
|
473
|
+
{
|
|
474
|
+
as: "button",
|
|
475
|
+
onClick: () => setCurrentPage((p) => Math.max(1, p - 1))
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
479
|
+
designSystem.PageLink,
|
|
480
|
+
{
|
|
481
|
+
number: page,
|
|
482
|
+
as: "button",
|
|
483
|
+
onClick: () => setCurrentPage(page)
|
|
484
|
+
},
|
|
485
|
+
page
|
|
486
|
+
)),
|
|
487
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
488
|
+
designSystem.NextLink,
|
|
489
|
+
{
|
|
490
|
+
as: "button",
|
|
491
|
+
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1))
|
|
492
|
+
}
|
|
493
|
+
)
|
|
494
|
+
] }) }) }),
|
|
501
495
|
showRefundModal && selectedPayment && /* @__PURE__ */ jsxRuntime.jsx(
|
|
502
496
|
RefundModal,
|
|
503
497
|
{
|