strapi-plugin-payone-provider 4.6.9 → 4.6.11
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 +64 -0
- package/admin/src/pages/App/components/AppHeader.jsx +3 -2
- package/admin/src/pages/App/components/AppTabs.jsx +34 -88
- package/admin/src/pages/App/components/DocsPanel.jsx +1726 -1726
- package/admin/src/pages/App/components/GooglePaybutton.jsx +300 -300
- package/admin/src/pages/App/components/common/InfoTooltip.jsx +16 -0
- package/admin/src/pages/App/components/{ApplePayConfig.jsx → configuration/ApplePayConfig.jsx} +191 -62
- package/admin/src/pages/App/components/{ApplePayConfigPanel.jsx → configuration/ApplePayConfigPanel.jsx} +71 -70
- package/admin/src/pages/App/components/configuration/ConfigurationFields.jsx +408 -0
- package/admin/src/pages/App/components/configuration/ConfigurationPanel.jsx +67 -0
- package/admin/src/pages/App/components/{GooglePayConfig.jsx → configuration/GooglePayConfig.jsx} +254 -254
- package/admin/src/pages/App/components/{GooglePayConfigPanel.jsx → configuration/GooglePayConfigPanel.jsx} +82 -82
- package/admin/src/pages/App/components/configuration/TestConnection.jsx +129 -0
- package/admin/src/pages/App/components/paymentActions/ApplePayPanel.jsx +137 -95
- package/admin/src/pages/App/components/paymentActions/CaptureForm.jsx +119 -14
- package/admin/src/pages/App/components/paymentActions/CardDetailsInput.jsx +85 -24
- package/admin/src/pages/App/components/paymentActions/PaymentActionsPanel.jsx +361 -0
- package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +22 -4
- package/admin/src/pages/App/components/paymentActions/RefundForm.jsx +91 -20
- package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationForm.jsx +157 -0
- package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationFormFields.jsx +308 -0
- package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationFormHeader.jsx +27 -0
- package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationPaymentButtons.jsx +93 -0
- package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationForm.jsx +134 -0
- package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationFormFields.jsx +295 -0
- package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationFormHeader.jsx +27 -0
- package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationPaymentButtons.jsx +53 -0
- package/admin/src/pages/App/components/transaction-history/FiltersPanel.jsx +182 -0
- package/admin/src/pages/App/components/transaction-history/HistoryPanel.jsx +49 -0
- package/admin/src/pages/App/components/transaction-history/TransactionTable.jsx +169 -0
- package/admin/src/pages/App/components/transaction-history/TransactionTablePagination.jsx +28 -0
- package/admin/src/pages/App/components/transaction-history/details/TransactionDetails.jsx +155 -0
- package/admin/src/pages/App/index.jsx +5 -29
- package/admin/src/pages/hooks/usePaymentActions.js +87 -11
- package/admin/src/pages/hooks/useSettings.js +64 -22
- package/admin/src/pages/hooks/useTransactionHistory.js +100 -88
- package/admin/src/pages/utils/api.js +31 -3
- package/admin/src/pages/utils/countryLanguageUtils.js +236 -0
- package/admin/src/pages/utils/transactionTableUtils.js +60 -0
- package/package.json +1 -1
- package/server/bootstrap.js +6 -6
- package/server/controllers/payone.js +27 -3
- package/server/policies/index.js +2 -1
- package/server/policies/is-payone-notification.js +31 -0
- package/server/routes/index.js +10 -0
- package/server/services/payone.js +11 -4
- package/server/services/settingsService.js +8 -2
- package/server/services/testConnectionService.js +11 -72
- package/server/services/transactionService.js +58 -78
- package/server/services/transactionStatusService.js +87 -0
- package/admin/src/pages/App/components/ConfigurationPanel.jsx +0 -517
- package/admin/src/pages/App/components/CustomerInfoPopover.jsx +0 -147
- package/admin/src/pages/App/components/HistoryPanel.jsx +0 -94
- package/admin/src/pages/App/components/PaymentActionsPanel.jsx +0 -280
- package/admin/src/pages/App/components/RawDataPopover.jsx +0 -113
- package/admin/src/pages/App/components/TransactionHistoryItem.jsx +0 -522
- package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTableFilters.jsx +0 -113
- package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTablePagination.jsx +0 -180
- package/admin/src/pages/App/components/TransactionHistoryTable/index.jsx +0 -225
- package/admin/src/pages/App/components/paymentActions/AuthorizationForm.jsx +0 -197
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +0 -142
|
@@ -1,522 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Box,
|
|
4
|
-
Card,
|
|
5
|
-
CardBody,
|
|
6
|
-
Flex,
|
|
7
|
-
Stack,
|
|
8
|
-
Typography,
|
|
9
|
-
Badge,
|
|
10
|
-
Button,
|
|
11
|
-
} from "@strapi/design-system";
|
|
12
|
-
import { ChevronDownIcon, ChevronUpIcon } from "./icons";
|
|
13
|
-
const TransactionHistoryItem = ({ transaction }) => {
|
|
14
|
-
const [isExpanded, setIsExpanded] = useState(false);
|
|
15
|
-
|
|
16
|
-
const getStatusColor = (status) => {
|
|
17
|
-
switch (status) {
|
|
18
|
-
case "APPROVED":
|
|
19
|
-
return "success";
|
|
20
|
-
case "ERROR":
|
|
21
|
-
return "danger";
|
|
22
|
-
case "PENDING":
|
|
23
|
-
return "warning";
|
|
24
|
-
default:
|
|
25
|
-
return "neutral";
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const getPaymentMethodName = (clearingtype, wallettype) => {
|
|
30
|
-
switch (clearingtype) {
|
|
31
|
-
case "cc":
|
|
32
|
-
return "Credit Card";
|
|
33
|
-
case "sb":
|
|
34
|
-
return "Online Banking";
|
|
35
|
-
case "wlt":
|
|
36
|
-
return wallettype === "PPE" ? "PayPal" : "Wallet";
|
|
37
|
-
case "elv":
|
|
38
|
-
return "Direct Debit (SEPA)";
|
|
39
|
-
default:
|
|
40
|
-
return "Unknown";
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const formatAmount = (amount, currency) => {
|
|
45
|
-
return `${(amount / 100).toFixed(2)} ${currency}`;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const formatDate = (dateString) => {
|
|
49
|
-
return new Date(dateString).toLocaleString("de-DE", {
|
|
50
|
-
year: "numeric",
|
|
51
|
-
month: "2-digit",
|
|
52
|
-
day: "2-digit",
|
|
53
|
-
hour: "2-digit",
|
|
54
|
-
minute: "2-digit",
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const getCardTypeName = (cardtype) => {
|
|
59
|
-
switch (cardtype) {
|
|
60
|
-
case "V":
|
|
61
|
-
return "Visa";
|
|
62
|
-
case "M":
|
|
63
|
-
return "Mastercard";
|
|
64
|
-
case "A":
|
|
65
|
-
return "American Express";
|
|
66
|
-
default:
|
|
67
|
-
return cardtype || "Unknown";
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<Card
|
|
73
|
-
className="payment-transaction-item"
|
|
74
|
-
background="neutral0"
|
|
75
|
-
hasRadius
|
|
76
|
-
shadow="filterShadow"
|
|
77
|
-
style={{
|
|
78
|
-
marginBottom: "16px",
|
|
79
|
-
}}
|
|
80
|
-
>
|
|
81
|
-
<CardBody
|
|
82
|
-
padding={6}
|
|
83
|
-
style={{ display: "flex", flexDirection: "column", gap: "6px" }}
|
|
84
|
-
>
|
|
85
|
-
{/* Main Values in Column Format */}
|
|
86
|
-
<Stack spacing={3} marginBottom={4}>
|
|
87
|
-
{/* Reference */}
|
|
88
|
-
<Flex alignItems="center" gap={2}>
|
|
89
|
-
<Typography variant="pi" textColor="neutral600" fontWeight="medium">
|
|
90
|
-
Reference:
|
|
91
|
-
</Typography>
|
|
92
|
-
<Typography variant="pi" textColor="neutral800">
|
|
93
|
-
{transaction.reference}
|
|
94
|
-
</Typography>
|
|
95
|
-
</Flex>
|
|
96
|
-
{/* Date */}
|
|
97
|
-
<Flex alignItems="center" gap={2}>
|
|
98
|
-
<Typography variant="pi" textColor="neutral600" fontWeight="medium">
|
|
99
|
-
Date:
|
|
100
|
-
</Typography>
|
|
101
|
-
<Typography variant="pi" textColor="neutral800">
|
|
102
|
-
{formatDate(transaction.timestamp)}
|
|
103
|
-
</Typography>
|
|
104
|
-
</Flex>
|
|
105
|
-
|
|
106
|
-
{/* Payment Method */}
|
|
107
|
-
<Flex alignItems="center" gap={2}>
|
|
108
|
-
<Typography variant="pi" textColor="neutral600" fontWeight="medium">
|
|
109
|
-
Method:
|
|
110
|
-
</Typography>
|
|
111
|
-
<Typography variant="pi" textColor="neutral800">
|
|
112
|
-
{getPaymentMethodName(
|
|
113
|
-
transaction.raw_request?.clearingtype,
|
|
114
|
-
transaction.raw_request?.wallettype
|
|
115
|
-
)}
|
|
116
|
-
</Typography>
|
|
117
|
-
{transaction.txid && (
|
|
118
|
-
<>
|
|
119
|
-
<Typography variant="pi" textColor="neutral500">
|
|
120
|
-
•
|
|
121
|
-
</Typography>
|
|
122
|
-
<Typography variant="pi" textColor="neutral600">
|
|
123
|
-
TX: {transaction.txid}
|
|
124
|
-
</Typography>
|
|
125
|
-
</>
|
|
126
|
-
)}
|
|
127
|
-
</Flex>
|
|
128
|
-
|
|
129
|
-
{/* Amount */}
|
|
130
|
-
<Flex alignItems="center" gap={2}>
|
|
131
|
-
<Typography variant="pi" textColor="neutral600" fontWeight="medium">
|
|
132
|
-
Amount:
|
|
133
|
-
</Typography>
|
|
134
|
-
<Typography
|
|
135
|
-
variant="pi"
|
|
136
|
-
fontWeight="bold"
|
|
137
|
-
textColor="primary600"
|
|
138
|
-
fontSize={2}
|
|
139
|
-
>
|
|
140
|
-
{formatAmount(transaction.amount, transaction.currency)}
|
|
141
|
-
</Typography>
|
|
142
|
-
<Badge
|
|
143
|
-
backgroundColor={getStatusColor(transaction.status)}
|
|
144
|
-
textColor="neutral0"
|
|
145
|
-
>
|
|
146
|
-
{transaction.status}
|
|
147
|
-
</Badge>
|
|
148
|
-
</Flex>
|
|
149
|
-
</Stack>
|
|
150
|
-
|
|
151
|
-
{/* Expand/Collapse Button */}
|
|
152
|
-
<Flex justifyContent="center">
|
|
153
|
-
<Button
|
|
154
|
-
size="S"
|
|
155
|
-
onClick={() => setIsExpanded(!isExpanded)}
|
|
156
|
-
startIcon={
|
|
157
|
-
isExpanded ? (
|
|
158
|
-
<ChevronUpIcon size={16} />
|
|
159
|
-
) : (
|
|
160
|
-
<ChevronDownIcon size={16} />
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
className="payment-button payment-button-primary"
|
|
164
|
-
>
|
|
165
|
-
{isExpanded ? "Hide Details" : "Show Details"}
|
|
166
|
-
</Button>
|
|
167
|
-
</Flex>
|
|
168
|
-
|
|
169
|
-
{/* Expanded Details */}
|
|
170
|
-
{isExpanded && (
|
|
171
|
-
<Flex
|
|
172
|
-
marginTop={4}
|
|
173
|
-
style={{
|
|
174
|
-
animation: "fadeIn 0.3s ease-out",
|
|
175
|
-
gap: "32px",
|
|
176
|
-
}}
|
|
177
|
-
>
|
|
178
|
-
<Stack spacing={4}>
|
|
179
|
-
{/* Error Message */}
|
|
180
|
-
{transaction.status === "ERROR" && (
|
|
181
|
-
<Box
|
|
182
|
-
marginBottom={4}
|
|
183
|
-
padding={3}
|
|
184
|
-
background="danger100"
|
|
185
|
-
hasRadius
|
|
186
|
-
className="payment-alert"
|
|
187
|
-
style={{
|
|
188
|
-
border: "1px solid",
|
|
189
|
-
borderColor: "var(--strapi-colors-danger200)",
|
|
190
|
-
}}
|
|
191
|
-
>
|
|
192
|
-
<Typography
|
|
193
|
-
variant="pi"
|
|
194
|
-
fontWeight="bold"
|
|
195
|
-
textColor="danger600"
|
|
196
|
-
marginBottom={1}
|
|
197
|
-
>
|
|
198
|
-
Error: {transaction.error_message}
|
|
199
|
-
</Typography>
|
|
200
|
-
{transaction.customer_message && (
|
|
201
|
-
<Typography variant="pi" textColor="danger600">
|
|
202
|
-
Customer Message: {transaction.customer_message}
|
|
203
|
-
</Typography>
|
|
204
|
-
)}
|
|
205
|
-
</Box>
|
|
206
|
-
)}
|
|
207
|
-
{/* Customer Information */}
|
|
208
|
-
<Box>
|
|
209
|
-
<Flex alignItems="center" gap={2} marginBottom={3}>
|
|
210
|
-
<Typography
|
|
211
|
-
variant="pi"
|
|
212
|
-
fontWeight="bold"
|
|
213
|
-
textColor="neutral800"
|
|
214
|
-
>
|
|
215
|
-
Customer Information
|
|
216
|
-
</Typography>
|
|
217
|
-
</Flex>
|
|
218
|
-
<Box paddingLeft={4}>
|
|
219
|
-
<Stack spacing={2}>
|
|
220
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
221
|
-
<Typography
|
|
222
|
-
variant="pi"
|
|
223
|
-
textColor="neutral600"
|
|
224
|
-
fontWeight="medium"
|
|
225
|
-
>
|
|
226
|
-
Name:
|
|
227
|
-
</Typography>
|
|
228
|
-
<Typography variant="pi" textColor="neutral800">
|
|
229
|
-
{transaction.raw_request?.firstname}{" "}
|
|
230
|
-
{transaction.raw_request?.lastname}
|
|
231
|
-
</Typography>
|
|
232
|
-
</Flex>
|
|
233
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
234
|
-
<Typography
|
|
235
|
-
variant="pi"
|
|
236
|
-
textColor="neutral600"
|
|
237
|
-
fontWeight="medium"
|
|
238
|
-
>
|
|
239
|
-
Email:
|
|
240
|
-
</Typography>
|
|
241
|
-
<Typography variant="pi" textColor="neutral800">
|
|
242
|
-
{transaction.raw_request?.email}
|
|
243
|
-
</Typography>
|
|
244
|
-
</Flex>
|
|
245
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
246
|
-
<Typography
|
|
247
|
-
variant="pi"
|
|
248
|
-
textColor="neutral600"
|
|
249
|
-
fontWeight="medium"
|
|
250
|
-
>
|
|
251
|
-
Phone:
|
|
252
|
-
</Typography>
|
|
253
|
-
<Typography variant="pi" textColor="neutral800">
|
|
254
|
-
{transaction.raw_request?.telephonenumber}
|
|
255
|
-
</Typography>
|
|
256
|
-
</Flex>
|
|
257
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
258
|
-
<Typography
|
|
259
|
-
variant="pi"
|
|
260
|
-
textColor="neutral600"
|
|
261
|
-
fontWeight="medium"
|
|
262
|
-
>
|
|
263
|
-
Address:
|
|
264
|
-
</Typography>
|
|
265
|
-
<Typography variant="pi" textColor="neutral800">
|
|
266
|
-
{transaction.raw_request?.street},{" "}
|
|
267
|
-
{transaction.raw_request?.zip}{" "}
|
|
268
|
-
{transaction.raw_request?.city}
|
|
269
|
-
</Typography>
|
|
270
|
-
</Flex>
|
|
271
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
272
|
-
<Typography
|
|
273
|
-
variant="pi"
|
|
274
|
-
textColor="neutral600"
|
|
275
|
-
fontWeight="medium"
|
|
276
|
-
>
|
|
277
|
-
Country:
|
|
278
|
-
</Typography>
|
|
279
|
-
<Typography variant="pi" textColor="neutral800">
|
|
280
|
-
{transaction.raw_request?.country}
|
|
281
|
-
</Typography>
|
|
282
|
-
</Flex>
|
|
283
|
-
</Stack>
|
|
284
|
-
</Box>
|
|
285
|
-
</Box>
|
|
286
|
-
|
|
287
|
-
{/* Payment Method Details */}
|
|
288
|
-
<Box>
|
|
289
|
-
<Flex alignItems="center" gap={2} marginBottom={3}>
|
|
290
|
-
<Typography
|
|
291
|
-
variant="pi"
|
|
292
|
-
fontWeight="bold"
|
|
293
|
-
textColor="neutral800"
|
|
294
|
-
>
|
|
295
|
-
Payment Method Details
|
|
296
|
-
</Typography>
|
|
297
|
-
</Flex>
|
|
298
|
-
<Box paddingLeft={4}>
|
|
299
|
-
<Stack spacing={2}>
|
|
300
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
301
|
-
<Typography
|
|
302
|
-
variant="pi"
|
|
303
|
-
textColor="neutral600"
|
|
304
|
-
fontWeight="medium"
|
|
305
|
-
>
|
|
306
|
-
Type:
|
|
307
|
-
</Typography>
|
|
308
|
-
<Typography variant="pi" textColor="neutral800">
|
|
309
|
-
{getPaymentMethodName(
|
|
310
|
-
transaction.raw_request?.clearingtype,
|
|
311
|
-
transaction.raw_request?.wallettype
|
|
312
|
-
)}
|
|
313
|
-
</Typography>
|
|
314
|
-
</Flex>
|
|
315
|
-
|
|
316
|
-
{transaction.raw_request?.clearingtype === "cc" && (
|
|
317
|
-
<>
|
|
318
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
319
|
-
<Typography
|
|
320
|
-
variant="pi"
|
|
321
|
-
textColor="neutral600"
|
|
322
|
-
fontWeight="medium"
|
|
323
|
-
>
|
|
324
|
-
Card Type:
|
|
325
|
-
</Typography>
|
|
326
|
-
<Typography variant="pi" textColor="neutral800">
|
|
327
|
-
{getCardTypeName(transaction.raw_request?.cardtype)}
|
|
328
|
-
</Typography>
|
|
329
|
-
</Flex>
|
|
330
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
331
|
-
<Typography
|
|
332
|
-
variant="pi"
|
|
333
|
-
textColor="neutral600"
|
|
334
|
-
fontWeight="medium"
|
|
335
|
-
>
|
|
336
|
-
Card Number:
|
|
337
|
-
</Typography>
|
|
338
|
-
<Typography variant="pi" textColor="neutral800">
|
|
339
|
-
**** **** ****{" "}
|
|
340
|
-
{transaction.raw_request?.cardpan?.slice(-4)}
|
|
341
|
-
</Typography>
|
|
342
|
-
</Flex>
|
|
343
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
344
|
-
<Typography
|
|
345
|
-
variant="pi"
|
|
346
|
-
textColor="neutral600"
|
|
347
|
-
fontWeight="medium"
|
|
348
|
-
>
|
|
349
|
-
Expiry:
|
|
350
|
-
</Typography>
|
|
351
|
-
<Typography variant="pi" textColor="neutral800">
|
|
352
|
-
{transaction.raw_request?.cardexpiredate}
|
|
353
|
-
</Typography>
|
|
354
|
-
</Flex>
|
|
355
|
-
</>
|
|
356
|
-
)}
|
|
357
|
-
|
|
358
|
-
{transaction.raw_request?.clearingtype === "wlt" &&
|
|
359
|
-
transaction.raw_request?.wallettype && (
|
|
360
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
361
|
-
<Typography
|
|
362
|
-
variant="pi"
|
|
363
|
-
textColor="neutral600"
|
|
364
|
-
fontWeight="medium"
|
|
365
|
-
>
|
|
366
|
-
Wallet Type:
|
|
367
|
-
</Typography>
|
|
368
|
-
<Typography variant="pi" textColor="neutral800">
|
|
369
|
-
{transaction.raw_request.wallettype}
|
|
370
|
-
</Typography>
|
|
371
|
-
</Flex>
|
|
372
|
-
)}
|
|
373
|
-
|
|
374
|
-
{transaction.raw_request?.clearingtype === "sb" && (
|
|
375
|
-
<>
|
|
376
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
377
|
-
<Typography
|
|
378
|
-
variant="pi"
|
|
379
|
-
textColor="neutral600"
|
|
380
|
-
fontWeight="medium"
|
|
381
|
-
>
|
|
382
|
-
Bank Transfer Type:
|
|
383
|
-
</Typography>
|
|
384
|
-
<Typography variant="pi" textColor="neutral800">
|
|
385
|
-
{transaction.raw_request?.onlinebanktransfertype}
|
|
386
|
-
</Typography>
|
|
387
|
-
</Flex>
|
|
388
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
389
|
-
<Typography
|
|
390
|
-
variant="pi"
|
|
391
|
-
textColor="neutral600"
|
|
392
|
-
fontWeight="medium"
|
|
393
|
-
>
|
|
394
|
-
Bank Country:
|
|
395
|
-
</Typography>
|
|
396
|
-
<Typography variant="pi" textColor="neutral800">
|
|
397
|
-
{transaction.raw_request?.bankcountry}
|
|
398
|
-
</Typography>
|
|
399
|
-
</Flex>
|
|
400
|
-
</>
|
|
401
|
-
)}
|
|
402
|
-
</Stack>
|
|
403
|
-
</Box>
|
|
404
|
-
</Box>
|
|
405
|
-
|
|
406
|
-
{/* Technical Details */}
|
|
407
|
-
<Box>
|
|
408
|
-
<Typography
|
|
409
|
-
variant="pi"
|
|
410
|
-
fontWeight="bold"
|
|
411
|
-
textColor="neutral800"
|
|
412
|
-
marginBottom={3}
|
|
413
|
-
>
|
|
414
|
-
Technical Details
|
|
415
|
-
</Typography>
|
|
416
|
-
<Box paddingLeft={4}>
|
|
417
|
-
<Stack spacing={2}>
|
|
418
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
419
|
-
<Typography
|
|
420
|
-
variant="pi"
|
|
421
|
-
textColor="neutral600"
|
|
422
|
-
fontWeight="medium"
|
|
423
|
-
>
|
|
424
|
-
Request Type:
|
|
425
|
-
</Typography>
|
|
426
|
-
<Typography variant="pi" textColor="neutral800">
|
|
427
|
-
{transaction.request_type}
|
|
428
|
-
</Typography>
|
|
429
|
-
</Flex>
|
|
430
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
431
|
-
<Typography
|
|
432
|
-
variant="pi"
|
|
433
|
-
textColor="neutral600"
|
|
434
|
-
fontWeight="medium"
|
|
435
|
-
>
|
|
436
|
-
Mode:
|
|
437
|
-
</Typography>
|
|
438
|
-
<Typography variant="pi" textColor="neutral800">
|
|
439
|
-
{transaction.raw_request?.mode}
|
|
440
|
-
</Typography>
|
|
441
|
-
</Flex>
|
|
442
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
443
|
-
<Typography
|
|
444
|
-
variant="pi"
|
|
445
|
-
textColor="neutral600"
|
|
446
|
-
fontWeight="medium"
|
|
447
|
-
>
|
|
448
|
-
IP Address:
|
|
449
|
-
</Typography>
|
|
450
|
-
<Typography variant="pi" textColor="neutral800">
|
|
451
|
-
{transaction.raw_request?.ip}
|
|
452
|
-
</Typography>
|
|
453
|
-
</Flex>
|
|
454
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
455
|
-
<Typography
|
|
456
|
-
variant="pi"
|
|
457
|
-
textColor="neutral600"
|
|
458
|
-
fontWeight="medium"
|
|
459
|
-
>
|
|
460
|
-
Language:
|
|
461
|
-
</Typography>
|
|
462
|
-
<Typography variant="pi" textColor="neutral800">
|
|
463
|
-
{transaction.raw_request?.language}
|
|
464
|
-
</Typography>
|
|
465
|
-
</Flex>
|
|
466
|
-
<Flex justifyContent="space-between" gap={3}>
|
|
467
|
-
<Typography
|
|
468
|
-
variant="pi"
|
|
469
|
-
textColor="neutral600"
|
|
470
|
-
fontWeight="medium"
|
|
471
|
-
>
|
|
472
|
-
Customer Present:
|
|
473
|
-
</Typography>
|
|
474
|
-
<Typography variant="pi" textColor="neutral800">
|
|
475
|
-
{transaction.raw_request?.customer_is_present}
|
|
476
|
-
</Typography>
|
|
477
|
-
</Flex>
|
|
478
|
-
</Stack>
|
|
479
|
-
</Box>
|
|
480
|
-
</Box>
|
|
481
|
-
</Stack>
|
|
482
|
-
|
|
483
|
-
<Stack spacing={4}>
|
|
484
|
-
<Typography variant="pi" fontWeight="bold" textColor="neutral800">
|
|
485
|
-
Raw Body
|
|
486
|
-
</Typography>
|
|
487
|
-
<Box
|
|
488
|
-
padding={4}
|
|
489
|
-
background="neutral100"
|
|
490
|
-
hasRadius
|
|
491
|
-
style={{
|
|
492
|
-
border: "1px solid",
|
|
493
|
-
borderColor: "var(--strapi-colors-neutral200)",
|
|
494
|
-
overflow: "auto",
|
|
495
|
-
maxHeight: "500px",
|
|
496
|
-
maxWidth: "800px",
|
|
497
|
-
}}
|
|
498
|
-
>
|
|
499
|
-
<pre
|
|
500
|
-
style={{
|
|
501
|
-
margin: 0,
|
|
502
|
-
padding: 0,
|
|
503
|
-
fontFamily: "monospace",
|
|
504
|
-
fontSize: "13px",
|
|
505
|
-
lineHeight: "1.5",
|
|
506
|
-
color: "Highlight",
|
|
507
|
-
whiteSpace: "pre-wrap",
|
|
508
|
-
wordBreak: "break-word",
|
|
509
|
-
}}
|
|
510
|
-
>
|
|
511
|
-
{JSON.stringify(transaction?.body || {}, null, 2)}
|
|
512
|
-
</pre>
|
|
513
|
-
</Box>
|
|
514
|
-
</Stack>
|
|
515
|
-
</Flex>
|
|
516
|
-
)}
|
|
517
|
-
</CardBody>
|
|
518
|
-
</Card>
|
|
519
|
-
);
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
export default TransactionHistoryItem;
|
package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTableFilters.jsx
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
Box,
|
|
4
|
-
Flex,
|
|
5
|
-
Select,
|
|
6
|
-
Option,
|
|
7
|
-
Button,
|
|
8
|
-
TextInput,
|
|
9
|
-
Typography,
|
|
10
|
-
} from "@strapi/design-system";
|
|
11
|
-
import { Search } from "@strapi/icons";
|
|
12
|
-
|
|
13
|
-
const TransactionHistoryTableFilters = ({
|
|
14
|
-
filters,
|
|
15
|
-
onFilterChange,
|
|
16
|
-
onFilterApply,
|
|
17
|
-
isLoading,
|
|
18
|
-
}) => {
|
|
19
|
-
const handleDateFromClick = (e) => {
|
|
20
|
-
const input = e.target.closest('div')?.querySelector('input[type="date"]');
|
|
21
|
-
if (input) {
|
|
22
|
-
input.showPicker?.();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const handleDateToClick = (e) => {
|
|
27
|
-
const input = e.target.closest('div')?.querySelector('input[type="date"]');
|
|
28
|
-
if (input) {
|
|
29
|
-
input.showPicker?.();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
return (
|
|
33
|
-
<Box marginBottom={2}>
|
|
34
|
-
<Flex gap={3} marginBottom={3} alignItems="center">
|
|
35
|
-
<TextInput
|
|
36
|
-
label="Search"
|
|
37
|
-
name="search"
|
|
38
|
-
value={filters?.search || ""}
|
|
39
|
-
onChange={(e) => onFilterChange("search", e.target.value)}
|
|
40
|
-
placeholder="Search by Status, Transaction ID, or Reference"
|
|
41
|
-
style={{ flex: 1, minWidth: "250px" }}
|
|
42
|
-
/>
|
|
43
|
-
<Select
|
|
44
|
-
label="Status"
|
|
45
|
-
name="status"
|
|
46
|
-
value={filters?.status || ""}
|
|
47
|
-
onChange={(value) => onFilterChange("status", value)}
|
|
48
|
-
placeholder="All Statuses"
|
|
49
|
-
style={{ width: "180px", minWidth: "180px" }}
|
|
50
|
-
>
|
|
51
|
-
<Option value="">All Statuses</Option>
|
|
52
|
-
<Option value="APPROVED">APPROVED</Option>
|
|
53
|
-
<Option value="PENDING">PENDING</Option>
|
|
54
|
-
<Option value="ERROR">ERROR</Option>
|
|
55
|
-
<Option value="CANCELLED">CANCELLED</Option>
|
|
56
|
-
<Option value="REDIRECTED">REDIRECTED</Option>
|
|
57
|
-
<Option value="CREATED">CREATED</Option>
|
|
58
|
-
</Select>
|
|
59
|
-
<Select
|
|
60
|
-
label="Request Type"
|
|
61
|
-
name="request_type"
|
|
62
|
-
value={filters?.request_type || ""}
|
|
63
|
-
onChange={(value) => onFilterChange("request_type", value)}
|
|
64
|
-
placeholder="Select request type"
|
|
65
|
-
style={{ width: "220px", minWidth: "220px" }}
|
|
66
|
-
>
|
|
67
|
-
<Option value="">All Types</Option>
|
|
68
|
-
<Option value="preauthorization">Preauthorization</Option>
|
|
69
|
-
<Option value="authorization">Authorization</Option>
|
|
70
|
-
<Option value="capture">Capture</Option>
|
|
71
|
-
<Option value="refund">Refund</Option>
|
|
72
|
-
</Select>
|
|
73
|
-
</Flex>
|
|
74
|
-
<Flex gap={3} marginBottom={3} alignItems="center">
|
|
75
|
-
<Box onClick={handleDateFromClick} style={{ cursor: "pointer" }}>
|
|
76
|
-
<TextInput
|
|
77
|
-
label="Date From"
|
|
78
|
-
name="date_from"
|
|
79
|
-
value={filters?.date_from || ""}
|
|
80
|
-
onChange={(e) => onFilterChange("date_from", e.target.value)}
|
|
81
|
-
placeholder="YYYY-MM-DD"
|
|
82
|
-
type="date"
|
|
83
|
-
style={{ minWidth: "150px" }}
|
|
84
|
-
/>
|
|
85
|
-
</Box>
|
|
86
|
-
<Box onClick={handleDateToClick} style={{ cursor: "pointer" }}>
|
|
87
|
-
<TextInput
|
|
88
|
-
label="Date To"
|
|
89
|
-
name="date_to"
|
|
90
|
-
value={filters?.date_to || ""}
|
|
91
|
-
onChange={(e) => onFilterChange("date_to", e.target.value)}
|
|
92
|
-
placeholder="YYYY-MM-DD"
|
|
93
|
-
type="date"
|
|
94
|
-
style={{ minWidth: "150px" }}
|
|
95
|
-
/>
|
|
96
|
-
</Box>
|
|
97
|
-
<Typography variant="pi" textColor="neutral600" style={{ fontSize: "12px", marginTop: "20px" }}>
|
|
98
|
-
By default, the last 30 days are shown
|
|
99
|
-
</Typography>
|
|
100
|
-
</Flex>
|
|
101
|
-
<Button
|
|
102
|
-
variant="default"
|
|
103
|
-
onClick={onFilterApply}
|
|
104
|
-
loading={isLoading}
|
|
105
|
-
startIcon={<Search />}
|
|
106
|
-
>
|
|
107
|
-
Apply Filters
|
|
108
|
-
</Button>
|
|
109
|
-
</Box>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export default TransactionHistoryTableFilters;
|