strapi-plugin-payone-provider 1.1.3 → 1.3.0
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 +1156 -380
- package/admin/src/index.js +4 -1
- package/admin/src/pages/App/components/AppHeader.js +37 -0
- package/admin/src/pages/App/components/AppTabs.js +134 -0
- package/admin/src/pages/App/components/ConfigurationPanel.js +34 -35
- package/admin/src/pages/App/components/GooglePaybutton.js +300 -0
- package/admin/src/pages/App/components/HistoryPanel.js +25 -38
- package/admin/src/pages/App/components/PaymentActionsPanel.js +119 -280
- package/admin/src/pages/App/components/StatusBadge.js +3 -1
- package/admin/src/pages/App/components/TransactionHistoryItem.js +4 -1
- package/admin/src/pages/App/components/paymentActions/AuthorizationForm.js +122 -0
- package/admin/src/pages/App/components/paymentActions/CaptureForm.js +64 -0
- package/admin/src/pages/App/components/paymentActions/CardDetailsInput.js +189 -0
- package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.js +52 -0
- package/admin/src/pages/App/components/paymentActions/PaymentResult.js +148 -0
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.js +122 -0
- package/admin/src/pages/App/components/paymentActions/RefundForm.js +89 -0
- package/admin/src/pages/App/index.js +41 -465
- package/admin/src/pages/App/styles.css +294 -0
- package/admin/src/pages/constants/paymentConstants.js +37 -0
- package/admin/src/pages/hooks/usePaymentActions.js +456 -0
- package/admin/src/pages/hooks/useSettings.js +111 -0
- package/admin/src/pages/hooks/useTransactionHistory.js +87 -0
- package/admin/src/pages/utils/api.js +10 -0
- package/admin/src/pages/utils/injectGooglePayScript.js +31 -0
- package/admin/src/pages/utils/paymentUtils.js +119 -15
- package/package.json +1 -1
- package/server/controllers/payone.js +71 -64
- package/server/routes/index.js +17 -0
- package/server/services/paymentService.js +271 -0
- package/server/services/payone.js +25 -648
- package/server/services/settingsService.js +59 -0
- package/server/services/testConnectionService.js +190 -0
- package/server/services/transactionService.js +114 -0
- package/server/utils/normalize.js +51 -0
- package/server/utils/paymentMethodParams.js +126 -0
- package/server/utils/requestBuilder.js +121 -0
- package/server/utils/responseParser.js +134 -0
|
@@ -29,22 +29,21 @@ const HistoryPanel = ({
|
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<Box
|
|
32
|
-
|
|
33
|
-
shadow="filterShadow"
|
|
32
|
+
className="payment-container"
|
|
34
33
|
paddingTop={8}
|
|
35
34
|
paddingBottom={8}
|
|
36
35
|
paddingLeft={8}
|
|
37
36
|
paddingRight={8}
|
|
38
|
-
style={{
|
|
39
|
-
borderRadius: "12px",
|
|
40
|
-
boxShadow: "0 4px 20px rgba(0, 0, 0, 0.08)",
|
|
41
|
-
border: "1px solid #f6f6f9"
|
|
42
|
-
}}
|
|
43
37
|
>
|
|
44
38
|
<Flex direction="column" alignItems="stretch" gap={8}>
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
<Box>
|
|
40
|
+
<Typography variant="beta" as="h2" className="payment-title" style={{ fontSize: '20px', marginBottom: '4px' }}>
|
|
41
|
+
Transaction Management
|
|
42
|
+
</Typography>
|
|
43
|
+
<Typography variant="pi" textColor="neutral600" className="payment-subtitle" style={{ fontSize: '14px', marginTop: '4px' }}>
|
|
44
|
+
View and filter all payment transactions processed through Payone
|
|
45
|
+
</Typography>
|
|
46
|
+
</Box>
|
|
48
47
|
{/* Filters */}
|
|
49
48
|
<Box>
|
|
50
49
|
<Box marginBottom={4}>
|
|
@@ -55,7 +54,7 @@ const HistoryPanel = ({
|
|
|
55
54
|
Filter transactions by status, type, date range, and more
|
|
56
55
|
</Typography>
|
|
57
56
|
</Box>
|
|
58
|
-
<Card
|
|
57
|
+
<Card className="payment-card">
|
|
59
58
|
<CardBody padding={6}>
|
|
60
59
|
<Stack spacing={4}>
|
|
61
60
|
<Flex gap={4} wrap="wrap" alignItems="center">
|
|
@@ -65,6 +64,7 @@ const HistoryPanel = ({
|
|
|
65
64
|
value={filters.status}
|
|
66
65
|
onChange={(e) => onFilterChange("status", e.target.value)}
|
|
67
66
|
placeholder="APPROVED, ERROR, etc."
|
|
67
|
+
className="payment-input"
|
|
68
68
|
style={{ flex: 1, minWidth: "200px" }}
|
|
69
69
|
/>
|
|
70
70
|
<TextInput
|
|
@@ -75,6 +75,7 @@ const HistoryPanel = ({
|
|
|
75
75
|
onFilterChange("request_type", e.target.value)
|
|
76
76
|
}
|
|
77
77
|
placeholder="preauthorization, authorization, etc."
|
|
78
|
+
className="payment-input"
|
|
78
79
|
style={{ flex: 1, minWidth: "200px" }}
|
|
79
80
|
/>
|
|
80
81
|
<TextInput
|
|
@@ -83,6 +84,7 @@ const HistoryPanel = ({
|
|
|
83
84
|
value={filters.txid}
|
|
84
85
|
onChange={(e) => onFilterChange("txid", e.target.value)}
|
|
85
86
|
placeholder="Enter TxId"
|
|
87
|
+
className="payment-input"
|
|
86
88
|
style={{ flex: 1, minWidth: "200px" }}
|
|
87
89
|
/>
|
|
88
90
|
<TextInput
|
|
@@ -93,6 +95,7 @@ const HistoryPanel = ({
|
|
|
93
95
|
onFilterChange("reference", e.target.value)
|
|
94
96
|
}
|
|
95
97
|
placeholder="Enter reference"
|
|
98
|
+
className="payment-input"
|
|
96
99
|
style={{ flex: 1, minWidth: "200px" }}
|
|
97
100
|
/>
|
|
98
101
|
<TextInput
|
|
@@ -104,6 +107,7 @@ const HistoryPanel = ({
|
|
|
104
107
|
}
|
|
105
108
|
placeholder="YYYY-MM-DD"
|
|
106
109
|
type="date"
|
|
110
|
+
className="payment-input"
|
|
107
111
|
style={{ flex: 1, minWidth: "200px" }}
|
|
108
112
|
/>
|
|
109
113
|
<TextInput
|
|
@@ -113,6 +117,7 @@ const HistoryPanel = ({
|
|
|
113
117
|
onChange={(e) => onFilterChange("date_to", e.target.value)}
|
|
114
118
|
placeholder="YYYY-MM-DD"
|
|
115
119
|
type="date"
|
|
120
|
+
className="payment-input"
|
|
116
121
|
style={{ flex: 1, minWidth: "200px" }}
|
|
117
122
|
/>
|
|
118
123
|
<Button
|
|
@@ -120,6 +125,7 @@ const HistoryPanel = ({
|
|
|
120
125
|
onClick={onFilterApply}
|
|
121
126
|
loading={isLoadingHistory}
|
|
122
127
|
startIcon={<Search />}
|
|
128
|
+
className="payment-button payment-button-primary"
|
|
123
129
|
>
|
|
124
130
|
Apply Filters
|
|
125
131
|
</Button>
|
|
@@ -155,13 +161,7 @@ const HistoryPanel = ({
|
|
|
155
161
|
loading={isLoadingHistory}
|
|
156
162
|
startIcon={<Search />}
|
|
157
163
|
size="S"
|
|
158
|
-
|
|
159
|
-
background: "#28a745",
|
|
160
|
-
border: "none",
|
|
161
|
-
color: "white",
|
|
162
|
-
fontWeight: "600",
|
|
163
|
-
borderRadius: "8px"
|
|
164
|
-
}}
|
|
164
|
+
className="payment-button payment-button-success"
|
|
165
165
|
>
|
|
166
166
|
Refresh
|
|
167
167
|
</Button>
|
|
@@ -189,9 +189,7 @@ const HistoryPanel = ({
|
|
|
189
189
|
|
|
190
190
|
{/* Pagination */}
|
|
191
191
|
<Box paddingTop={6} paddingBottom={4}>
|
|
192
|
-
<Card
|
|
193
|
-
style={{ borderRadius: "8px", border: "1px solid #e4e2e7" }}
|
|
194
|
-
>
|
|
192
|
+
<Card className="payment-card">
|
|
195
193
|
<CardBody padding={4}>
|
|
196
194
|
<Flex justifyContent="space-between" alignItems="center">
|
|
197
195
|
{transactionHistory.length > pageSize &&
|
|
@@ -204,13 +202,10 @@ const HistoryPanel = ({
|
|
|
204
202
|
onPageChange(Math.max(1, currentPage - 1))
|
|
205
203
|
}
|
|
206
204
|
disabled={currentPage === 1}
|
|
205
|
+
className={`payment-button ${currentPage === 1 ? '' : 'payment-button-success'}`}
|
|
207
206
|
style={{
|
|
208
|
-
background:
|
|
209
|
-
|
|
210
|
-
border: "none",
|
|
211
|
-
color: currentPage === 1 ? "#666687" : "white",
|
|
212
|
-
fontWeight: "600",
|
|
213
|
-
borderRadius: "6px"
|
|
207
|
+
background: currentPage === 1 ? "#f6f6f9" : undefined,
|
|
208
|
+
color: currentPage === 1 ? "#666687" : undefined
|
|
214
209
|
}}
|
|
215
210
|
>
|
|
216
211
|
← Previous
|
|
@@ -239,18 +234,10 @@ const HistoryPanel = ({
|
|
|
239
234
|
)
|
|
240
235
|
}
|
|
241
236
|
disabled={currentPage === totalPages}
|
|
237
|
+
className={`payment-button ${currentPage === totalPages ? '' : 'payment-button-success'}`}
|
|
242
238
|
style={{
|
|
243
|
-
background:
|
|
244
|
-
|
|
245
|
-
? "#f6f6f9"
|
|
246
|
-
: "#28a745",
|
|
247
|
-
border: "none",
|
|
248
|
-
color:
|
|
249
|
-
currentPage === totalPages
|
|
250
|
-
? "#666687"
|
|
251
|
-
: "white",
|
|
252
|
-
fontWeight: "600",
|
|
253
|
-
borderRadius: "6px"
|
|
239
|
+
background: currentPage === totalPages ? "#f6f6f9" : undefined,
|
|
240
|
+
color: currentPage === totalPages ? "#666687" : undefined
|
|
254
241
|
}}
|
|
255
242
|
>
|
|
256
243
|
Next →
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Stack,
|
|
10
|
-
Typography,
|
|
11
|
-
TextInput,
|
|
12
|
-
Alert
|
|
13
|
-
} from "@strapi/design-system";
|
|
14
|
-
import { Play } from "@strapi/icons";
|
|
15
|
-
import StatusBadge from "./StatusBadge";
|
|
16
|
-
import { formatTransactionData } from "../../utils/formatTransactionData";
|
|
2
|
+
import { Box, Flex, Typography } from "@strapi/design-system";
|
|
3
|
+
import PaymentMethodSelector from "./paymentActions/PaymentMethodSelector";
|
|
4
|
+
import PreauthorizationForm from "./paymentActions/PreauthorizationForm";
|
|
5
|
+
import AuthorizationForm from "./paymentActions/AuthorizationForm";
|
|
6
|
+
import CaptureForm from "./paymentActions/CaptureForm";
|
|
7
|
+
import RefundForm from "./paymentActions/RefundForm";
|
|
8
|
+
import PaymentResult from "./paymentActions/PaymentResult";
|
|
17
9
|
|
|
18
10
|
const PaymentActionsPanel = ({
|
|
19
11
|
paymentAmount,
|
|
@@ -30,293 +22,140 @@ const PaymentActionsPanel = ({
|
|
|
30
22
|
setRefundSequenceNumber,
|
|
31
23
|
refundReference,
|
|
32
24
|
setRefundReference,
|
|
25
|
+
paymentMethod,
|
|
26
|
+
setPaymentMethod,
|
|
27
|
+
captureMode,
|
|
28
|
+
setCaptureMode,
|
|
33
29
|
isProcessingPayment,
|
|
34
30
|
paymentError,
|
|
35
31
|
paymentResult,
|
|
36
32
|
onPreauthorization,
|
|
37
33
|
onAuthorization,
|
|
38
34
|
onCapture,
|
|
39
|
-
onRefund
|
|
35
|
+
onRefund,
|
|
36
|
+
settings,
|
|
37
|
+
googlePayToken,
|
|
38
|
+
setGooglePayToken,
|
|
39
|
+
cardtype,
|
|
40
|
+
setCardtype,
|
|
41
|
+
cardpan,
|
|
42
|
+
setCardpan,
|
|
43
|
+
cardexpiredate,
|
|
44
|
+
setCardexpiredate,
|
|
45
|
+
cardcvc2,
|
|
46
|
+
setCardcvc2
|
|
40
47
|
}) => {
|
|
41
48
|
return (
|
|
42
49
|
<Box
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
paddingLeft={7}
|
|
49
|
-
paddingRight={7}
|
|
50
|
+
className="payment-container"
|
|
51
|
+
paddingTop={8}
|
|
52
|
+
paddingBottom={8}
|
|
53
|
+
paddingLeft={8}
|
|
54
|
+
paddingRight={8}
|
|
50
55
|
>
|
|
51
56
|
<Flex direction="column" alignItems="stretch" gap={6}>
|
|
52
|
-
<Typography variant="beta" as="h2">
|
|
53
|
-
Payment Actions
|
|
54
|
-
</Typography>
|
|
55
|
-
|
|
56
|
-
{/* Preauthorization */}
|
|
57
57
|
<Box>
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
immediately.
|
|
65
|
-
</Typography>
|
|
66
|
-
|
|
67
|
-
<Flex gap={4}>
|
|
68
|
-
<TextInput
|
|
69
|
-
label="Amount (in cents) *"
|
|
70
|
-
name="paymentAmount"
|
|
71
|
-
value={paymentAmount}
|
|
72
|
-
onChange={(e) => setPaymentAmount(e.target.value)}
|
|
73
|
-
placeholder="Enter amount (e.g., 1000 for €10.00)"
|
|
74
|
-
hint="Amount in cents (e.g., 1000 = €10.00)"
|
|
75
|
-
required
|
|
76
|
-
style={{ flex: 1 }}
|
|
77
|
-
/>
|
|
78
|
-
|
|
79
|
-
<TextInput
|
|
80
|
-
label="Reference *"
|
|
81
|
-
name="preauthReference"
|
|
82
|
-
value={preauthReference}
|
|
83
|
-
onChange={(e) => setPreauthReference(e.target.value)}
|
|
84
|
-
placeholder="Enter reference"
|
|
85
|
-
hint="Reference for this transaction"
|
|
86
|
-
required
|
|
87
|
-
style={{ flex: 1 }}
|
|
88
|
-
/>
|
|
89
|
-
</Flex>
|
|
90
|
-
|
|
91
|
-
<Button
|
|
92
|
-
variant="default"
|
|
93
|
-
onClick={onPreauthorization}
|
|
94
|
-
loading={isProcessingPayment}
|
|
95
|
-
startIcon={<Play />}
|
|
96
|
-
fullWidth={false}
|
|
97
|
-
disabled={!paymentAmount.trim() || !preauthReference.trim()}
|
|
98
|
-
>
|
|
99
|
-
Process Preauthorization
|
|
100
|
-
</Button>
|
|
101
|
-
</Flex>
|
|
58
|
+
<Typography variant="beta" as="h2" className="payment-title" style={{ fontSize: '20px', marginBottom: '4px' }}>
|
|
59
|
+
Payment Actions
|
|
60
|
+
</Typography>
|
|
61
|
+
<Typography variant="pi" textColor="neutral600" className="payment-subtitle" style={{ fontSize: '14px' }}>
|
|
62
|
+
Process payments, captures, and refunds with multiple payment methods
|
|
63
|
+
</Typography>
|
|
102
64
|
</Box>
|
|
103
65
|
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
hint="Reference for this transaction"
|
|
135
|
-
required
|
|
136
|
-
style={{ flex: 1 }}
|
|
137
|
-
/>
|
|
138
|
-
</Flex>
|
|
139
|
-
|
|
140
|
-
<Button
|
|
141
|
-
variant="default"
|
|
142
|
-
onClick={onAuthorization}
|
|
143
|
-
loading={isProcessingPayment}
|
|
144
|
-
startIcon={<Play />}
|
|
145
|
-
fullWidth={false}
|
|
146
|
-
disabled={!paymentAmount.trim() || !authReference.trim()}
|
|
147
|
-
>
|
|
148
|
-
Process Authorization
|
|
149
|
-
</Button>
|
|
150
|
-
</Flex>
|
|
66
|
+
<PaymentMethodSelector
|
|
67
|
+
paymentMethod={paymentMethod}
|
|
68
|
+
setPaymentMethod={setPaymentMethod}
|
|
69
|
+
captureMode={captureMode}
|
|
70
|
+
setCaptureMode={setCaptureMode}
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<hr className="payment-divider" />
|
|
74
|
+
|
|
75
|
+
<Box className="payment-form-section">
|
|
76
|
+
<PreauthorizationForm
|
|
77
|
+
paymentAmount={paymentAmount}
|
|
78
|
+
setPaymentAmount={setPaymentAmount}
|
|
79
|
+
preauthReference={preauthReference}
|
|
80
|
+
setPreauthReference={setPreauthReference}
|
|
81
|
+
isProcessingPayment={isProcessingPayment}
|
|
82
|
+
onPreauthorization={onPreauthorization}
|
|
83
|
+
paymentMethod={paymentMethod}
|
|
84
|
+
settings={settings}
|
|
85
|
+
googlePayToken={googlePayToken}
|
|
86
|
+
setGooglePayToken={setGooglePayToken}
|
|
87
|
+
cardtype={cardtype}
|
|
88
|
+
setCardtype={setCardtype}
|
|
89
|
+
cardpan={cardpan}
|
|
90
|
+
setCardpan={setCardpan}
|
|
91
|
+
cardexpiredate={cardexpiredate}
|
|
92
|
+
setCardexpiredate={setCardexpiredate}
|
|
93
|
+
cardcvc2={cardcvc2}
|
|
94
|
+
setCardcvc2={setCardcvc2}
|
|
95
|
+
/>
|
|
151
96
|
</Box>
|
|
152
97
|
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
<TextInput
|
|
178
|
-
label="Amount (in cents)"
|
|
179
|
-
name="captureAmount"
|
|
180
|
-
value={paymentAmount}
|
|
181
|
-
onChange={(e) => setPaymentAmount(e.target.value)}
|
|
182
|
-
placeholder="1000"
|
|
183
|
-
hint="Amount in cents to capture"
|
|
184
|
-
style={{ flex: 1 }}
|
|
185
|
-
/>
|
|
186
|
-
</Flex>
|
|
187
|
-
|
|
188
|
-
<Button
|
|
189
|
-
variant="default"
|
|
190
|
-
onClick={onCapture}
|
|
191
|
-
loading={isProcessingPayment}
|
|
192
|
-
startIcon={<Play />}
|
|
193
|
-
fullWidth={false}
|
|
194
|
-
disabled={!captureTxid.trim() || !paymentAmount.trim()}
|
|
195
|
-
>
|
|
196
|
-
Process Capture
|
|
197
|
-
</Button>
|
|
198
|
-
</Flex>
|
|
98
|
+
<hr className="payment-divider" />
|
|
99
|
+
|
|
100
|
+
<Box className="payment-form-section">
|
|
101
|
+
<AuthorizationForm
|
|
102
|
+
paymentAmount={paymentAmount}
|
|
103
|
+
setPaymentAmount={setPaymentAmount}
|
|
104
|
+
authReference={authReference}
|
|
105
|
+
setAuthReference={setAuthReference}
|
|
106
|
+
isProcessingPayment={isProcessingPayment}
|
|
107
|
+
onAuthorization={onAuthorization}
|
|
108
|
+
paymentMethod={paymentMethod}
|
|
109
|
+
settings={settings}
|
|
110
|
+
googlePayToken={googlePayToken}
|
|
111
|
+
setGooglePayToken={setGooglePayToken}
|
|
112
|
+
cardtype={cardtype}
|
|
113
|
+
setCardtype={setCardtype}
|
|
114
|
+
cardpan={cardpan}
|
|
115
|
+
setCardpan={setCardpan}
|
|
116
|
+
cardexpiredate={cardexpiredate}
|
|
117
|
+
setCardexpiredate={setCardexpiredate}
|
|
118
|
+
cardcvc2={cardcvc2}
|
|
119
|
+
setCardcvc2={setCardcvc2}
|
|
120
|
+
/>
|
|
199
121
|
</Box>
|
|
200
122
|
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
<Flex gap={4}>
|
|
214
|
-
<TextInput
|
|
215
|
-
label="Transaction ID"
|
|
216
|
-
name="refundTxid"
|
|
217
|
-
value={refundTxid}
|
|
218
|
-
onChange={(e) => setRefundTxid(e.target.value)}
|
|
219
|
-
placeholder="Enter TxId from capture"
|
|
220
|
-
hint="Transaction ID from a previous capture"
|
|
221
|
-
style={{ flex: 1 }}
|
|
222
|
-
/>
|
|
223
|
-
|
|
224
|
-
<TextInput
|
|
225
|
-
label="Sequence Number"
|
|
226
|
-
name="refundSequenceNumber"
|
|
227
|
-
value={refundSequenceNumber}
|
|
228
|
-
onChange={(e) => setRefundSequenceNumber(e.target.value)}
|
|
229
|
-
placeholder="2"
|
|
230
|
-
hint="Sequence number for this refund (1-127) and by default for first 2"
|
|
231
|
-
style={{ flex: 1 }}
|
|
232
|
-
/>
|
|
233
|
-
|
|
234
|
-
<TextInput
|
|
235
|
-
label="Amount (in cents)"
|
|
236
|
-
name="refundAmount"
|
|
237
|
-
value={paymentAmount}
|
|
238
|
-
onChange={(e) => setPaymentAmount(e.target.value)}
|
|
239
|
-
placeholder="1000"
|
|
240
|
-
hint="Amount in cents to refund (will be negative)"
|
|
241
|
-
style={{ flex: 1 }}
|
|
242
|
-
/>
|
|
243
|
-
|
|
244
|
-
<TextInput
|
|
245
|
-
label="Reference"
|
|
246
|
-
name="refundReference"
|
|
247
|
-
value={refundReference}
|
|
248
|
-
onChange={(e) => setRefundReference(e.target.value)}
|
|
249
|
-
placeholder="Optional reference"
|
|
250
|
-
hint="Optional reference for this refund"
|
|
251
|
-
style={{ flex: 1 }}
|
|
252
|
-
/>
|
|
253
|
-
</Flex>
|
|
254
|
-
|
|
255
|
-
<Button
|
|
256
|
-
variant="default"
|
|
257
|
-
onClick={onRefund}
|
|
258
|
-
loading={isProcessingPayment}
|
|
259
|
-
startIcon={<Play />}
|
|
260
|
-
fullWidth={false}
|
|
261
|
-
disabled={!refundTxid.trim() || !paymentAmount.trim()}
|
|
262
|
-
>
|
|
263
|
-
Process Refund
|
|
264
|
-
</Button>
|
|
265
|
-
</Flex>
|
|
123
|
+
<hr className="payment-divider" />
|
|
124
|
+
|
|
125
|
+
<Box className="payment-form-section">
|
|
126
|
+
<CaptureForm
|
|
127
|
+
paymentAmount={paymentAmount}
|
|
128
|
+
setPaymentAmount={setPaymentAmount}
|
|
129
|
+
captureTxid={captureTxid}
|
|
130
|
+
setCaptureTxid={setCaptureTxid}
|
|
131
|
+
isProcessingPayment={isProcessingPayment}
|
|
132
|
+
onCapture={onCapture}
|
|
133
|
+
/>
|
|
266
134
|
</Box>
|
|
267
135
|
|
|
268
|
-
<
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
<
|
|
272
|
-
{
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
{paymentResult.Status && (
|
|
285
|
-
<StatusBadge status={paymentResult.Status} />
|
|
286
|
-
)}
|
|
287
|
-
</Flex>
|
|
136
|
+
<hr className="payment-divider" />
|
|
137
|
+
|
|
138
|
+
<Box className="payment-form-section">
|
|
139
|
+
<RefundForm
|
|
140
|
+
paymentAmount={paymentAmount}
|
|
141
|
+
setPaymentAmount={setPaymentAmount}
|
|
142
|
+
refundTxid={refundTxid}
|
|
143
|
+
setRefundTxid={setRefundTxid}
|
|
144
|
+
refundSequenceNumber={refundSequenceNumber}
|
|
145
|
+
setRefundSequenceNumber={setRefundSequenceNumber}
|
|
146
|
+
refundReference={refundReference}
|
|
147
|
+
setRefundReference={setRefundReference}
|
|
148
|
+
isProcessingPayment={isProcessingPayment}
|
|
149
|
+
onRefund={onRefund}
|
|
150
|
+
/>
|
|
151
|
+
</Box>
|
|
288
152
|
|
|
289
|
-
|
|
153
|
+
<hr className="payment-divider" />
|
|
290
154
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
key={index}
|
|
296
|
-
justifyContent="space-between"
|
|
297
|
-
alignItems="start"
|
|
298
|
-
>
|
|
299
|
-
<Typography
|
|
300
|
-
variant="pi"
|
|
301
|
-
textColor="neutral600"
|
|
302
|
-
style={{ minWidth: "200px" }}
|
|
303
|
-
>
|
|
304
|
-
{item.key}:
|
|
305
|
-
</Typography>
|
|
306
|
-
<Typography
|
|
307
|
-
variant="pi"
|
|
308
|
-
style={{ flex: 1, textAlign: "right" }}
|
|
309
|
-
>
|
|
310
|
-
{item.value}
|
|
311
|
-
</Typography>
|
|
312
|
-
</Flex>
|
|
313
|
-
))}
|
|
314
|
-
</Stack>
|
|
315
|
-
</Box>
|
|
316
|
-
</Stack>
|
|
317
|
-
</CardBody>
|
|
318
|
-
</Card>
|
|
319
|
-
)}
|
|
155
|
+
<PaymentResult
|
|
156
|
+
paymentError={paymentError}
|
|
157
|
+
paymentResult={paymentResult}
|
|
158
|
+
/>
|
|
320
159
|
|
|
321
160
|
<Box paddingTop={4}>
|
|
322
161
|
<Typography variant="sigma" textColor="neutral600">
|
|
@@ -75,6 +75,7 @@ const TransactionHistoryItem = ({ transaction }) => {
|
|
|
75
75
|
|
|
76
76
|
return (
|
|
77
77
|
<Card
|
|
78
|
+
className="payment-transaction-item"
|
|
78
79
|
background="neutral0"
|
|
79
80
|
hasRadius
|
|
80
81
|
shadow="filterShadow"
|
|
@@ -147,6 +148,7 @@ const TransactionHistoryItem = ({ transaction }) => {
|
|
|
147
148
|
size="S"
|
|
148
149
|
onClick={() => setIsExpanded(!isExpanded)}
|
|
149
150
|
startIcon={isExpanded ? <ChevronUpIcon size={16} /> : <ChevronDownIcon size={16} />}
|
|
151
|
+
className="payment-button payment-button-primary"
|
|
150
152
|
>
|
|
151
153
|
{isExpanded ? 'Hide Details' : 'Show Details'}
|
|
152
154
|
</Button>
|
|
@@ -154,7 +156,7 @@ const TransactionHistoryItem = ({ transaction }) => {
|
|
|
154
156
|
|
|
155
157
|
{/* Expanded Details */}
|
|
156
158
|
{isExpanded && (
|
|
157
|
-
<Box marginTop={4}>
|
|
159
|
+
<Box marginTop={4} style={{ animation: 'fadeIn 0.3s ease-out' }}>
|
|
158
160
|
<Stack spacing={4}>
|
|
159
161
|
{/* Error Message */}
|
|
160
162
|
{transaction.status === 'ERROR' && (
|
|
@@ -163,6 +165,7 @@ const TransactionHistoryItem = ({ transaction }) => {
|
|
|
163
165
|
padding={3}
|
|
164
166
|
background="danger100"
|
|
165
167
|
hasRadius
|
|
168
|
+
className="payment-alert"
|
|
166
169
|
style={{
|
|
167
170
|
border: '1px solid',
|
|
168
171
|
borderColor: 'var(--strapi-colors-danger200)',
|