strapi-plugin-payone-provider 1.6.1 → 1.6.2

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 (46) hide show
  1. package/admin/src/pages/App/components/ApplePayBtn.jsx +15 -13
  2. package/admin/src/pages/App/components/PaymentActionsPanel.jsx +68 -17
  3. package/admin/src/pages/App/components/paymentActions/AuthorizationForm.jsx +4 -12
  4. package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +163 -86
  5. package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +21 -11
  6. package/admin/src/pages/hooks/usePaymentActions.js +0 -172
  7. package/admin/src/pages/utils/paymentUtils.js +2 -2
  8. package/package.json +1 -1
  9. package/server/bootstrap.js +0 -19
  10. package/server/services/transactionService.js +0 -28
  11. package/admin/src/components/Initializer/index.js +0 -16
  12. package/admin/src/components/PluginIcon/index.js +0 -6
  13. package/admin/src/pages/App/components/AppHeader.js +0 -55
  14. package/admin/src/pages/App/components/AppTabs.js +0 -158
  15. package/admin/src/pages/App/components/ApplePayButton.js +0 -950
  16. package/admin/src/pages/App/components/ApplePayConfig.js +0 -364
  17. package/admin/src/pages/App/components/ApplePayConfigPanel.js +0 -81
  18. package/admin/src/pages/App/components/ConfigurationPanel.js +0 -280
  19. package/admin/src/pages/App/components/DocsPanel.js +0 -1057
  20. package/admin/src/pages/App/components/GooglePayConfig.js +0 -217
  21. package/admin/src/pages/App/components/GooglePayConfigPanel.js +0 -82
  22. package/admin/src/pages/App/components/GooglePaybutton.js +0 -300
  23. package/admin/src/pages/App/components/HistoryPanel.js +0 -285
  24. package/admin/src/pages/App/components/PaymentActionsPanel.js +0 -190
  25. package/admin/src/pages/App/components/StatusBadge.js +0 -24
  26. package/admin/src/pages/App/components/TransactionHistoryItem.js +0 -377
  27. package/admin/src/pages/App/components/icons/BankIcon.js +0 -10
  28. package/admin/src/pages/App/components/icons/ChevronDownIcon.js +0 -9
  29. package/admin/src/pages/App/components/icons/ChevronUpIcon.js +0 -9
  30. package/admin/src/pages/App/components/icons/CreditCardIcon.js +0 -9
  31. package/admin/src/pages/App/components/icons/ErrorIcon.js +0 -10
  32. package/admin/src/pages/App/components/icons/InfoIcon.js +0 -9
  33. package/admin/src/pages/App/components/icons/PaymentIcon.js +0 -10
  34. package/admin/src/pages/App/components/icons/PendingIcon.js +0 -9
  35. package/admin/src/pages/App/components/icons/PersonIcon.js +0 -9
  36. package/admin/src/pages/App/components/icons/SuccessIcon.js +0 -9
  37. package/admin/src/pages/App/components/icons/WalletIcon.js +0 -9
  38. package/admin/src/pages/App/components/icons/index.js +0 -11
  39. package/admin/src/pages/App/components/paymentActions/AuthorizationForm.js +0 -195
  40. package/admin/src/pages/App/components/paymentActions/CaptureForm.js +0 -65
  41. package/admin/src/pages/App/components/paymentActions/CardDetailsInput.js +0 -191
  42. package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.js +0 -156
  43. package/admin/src/pages/App/components/paymentActions/PaymentResult.js +0 -148
  44. package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.js +0 -199
  45. package/admin/src/pages/App/components/paymentActions/RefundForm.js +0 -90
  46. package/admin/src/pages/App/index.js +0 -127
@@ -1,285 +0,0 @@
1
- import React from "react";
2
- import {
3
- Box,
4
- Button,
5
- Card,
6
- CardBody,
7
- Flex,
8
- Stack,
9
- Typography,
10
- TextInput,
11
- Divider
12
- } from "@strapi/design-system";
13
- import { Search } from "@strapi/icons";
14
- import TransactionHistoryItem from "./TransactionHistoryItem";
15
-
16
- const HistoryPanel = ({
17
- filters,
18
- onFilterChange,
19
- onFilterApply,
20
- isLoadingHistory,
21
- transactionHistory,
22
- paginatedTransactions,
23
- currentPage,
24
- totalPages,
25
- pageSize,
26
- onRefresh,
27
- onPageChange
28
- }) => {
29
-
30
- return (
31
- <Box
32
- className="payment-container"
33
- paddingTop={8}
34
- paddingBottom={8}
35
- paddingLeft={8}
36
- paddingRight={8}
37
- >
38
- <Flex direction="column" alignItems="stretch" gap={8}>
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>
47
- {/* Filters */}
48
- <Box>
49
- <Box marginBottom={4}>
50
- <Typography variant="delta" as="h3" fontWeight="bold">
51
- Transaction Filters
52
- </Typography>
53
- <Typography variant="pi" textColor="neutral600" marginTop={2}>
54
- Filter transactions by status, type, date range, and more
55
- </Typography>
56
- </Box>
57
- <Card className="payment-card">
58
- <CardBody padding={6}>
59
- <Stack spacing={4}>
60
- <Flex gap={4} wrap="wrap" alignItems="center">
61
- <TextInput
62
- label="Status"
63
- name="status"
64
- value={filters.status}
65
- onChange={(e) => onFilterChange("status", e.target.value)}
66
- placeholder="APPROVED, ERROR, etc."
67
- className="payment-input"
68
- style={{ flex: 1, minWidth: "200px" }}
69
- />
70
- <TextInput
71
- label="Request Type"
72
- name="request_type"
73
- value={filters.request_type}
74
- onChange={(e) =>
75
- onFilterChange("request_type", e.target.value)
76
- }
77
- placeholder="preauthorization, authorization, etc."
78
- className="payment-input"
79
- style={{ flex: 1, minWidth: "200px" }}
80
- />
81
- <TextInput
82
- label="Transaction ID"
83
- name="txid"
84
- value={filters.txid}
85
- onChange={(e) => onFilterChange("txid", e.target.value)}
86
- placeholder="Enter TxId"
87
- className="payment-input"
88
- style={{ flex: 1, minWidth: "200px" }}
89
- />
90
- <TextInput
91
- label="Reference"
92
- name="reference"
93
- value={filters.reference}
94
- onChange={(e) =>
95
- onFilterChange("reference", e.target.value)
96
- }
97
- placeholder="Enter reference"
98
- className="payment-input"
99
- style={{ flex: 1, minWidth: "200px" }}
100
- />
101
- <TextInput
102
- label="Date From"
103
- name="date_from"
104
- value={filters.date_from}
105
- onChange={(e) =>
106
- onFilterChange("date_from", e.target.value)
107
- }
108
- placeholder="YYYY-MM-DD"
109
- type="date"
110
- className="payment-input"
111
- style={{ flex: 1, minWidth: "200px" }}
112
- />
113
- <TextInput
114
- label="Date To"
115
- name="date_to"
116
- value={filters.date_to}
117
- onChange={(e) => onFilterChange("date_to", e.target.value)}
118
- placeholder="YYYY-MM-DD"
119
- type="date"
120
- className="payment-input"
121
- style={{ flex: 1, minWidth: "200px" }}
122
- />
123
- <Button
124
- variant="default"
125
- onClick={onFilterApply}
126
- loading={isLoadingHistory}
127
- startIcon={<Search />}
128
- className="payment-button payment-button-primary"
129
- >
130
- Apply Filters
131
- </Button>
132
- </Flex>
133
- </Stack>
134
- </CardBody>
135
- </Card>
136
- </Box>
137
-
138
- <Divider />
139
-
140
- {/* Transaction History */}
141
- <Box>
142
- <Box marginBottom={6}>
143
- <Flex
144
- justifyContent="space-between"
145
- alignItems="center"
146
- marginBottom={4}
147
- >
148
- <Box>
149
- <Typography variant="delta" as="h3" fontWeight="bold">
150
- Transaction History
151
- </Typography>
152
- <Typography variant="pi" textColor="neutral600" marginTop={2}>
153
- {transactionHistory.length} total transactions •{" "}
154
- {paginatedTransactions.length} on page {currentPage} of{" "}
155
- {totalPages}
156
- </Typography>
157
- </Box>
158
- <Button
159
- variant="default"
160
- onClick={onRefresh}
161
- loading={isLoadingHistory}
162
- startIcon={<Search />}
163
- size="S"
164
- className="payment-button payment-button-success"
165
- >
166
- Refresh
167
- </Button>
168
- </Flex>
169
- </Box>
170
-
171
- {isLoadingHistory ? (
172
- <Box padding={4} textAlign="center">
173
- <Typography>Loading transactions...</Typography>
174
- </Box>
175
- ) : transactionHistory.length === 0 ? (
176
- <Box padding={4} textAlign="center">
177
- <Typography textColor="neutral600">
178
- No transactions found
179
- </Typography>
180
- </Box>
181
- ) : (
182
- <Box>
183
- {paginatedTransactions.map((transaction) => (
184
- <TransactionHistoryItem
185
- key={transaction.id}
186
- transaction={transaction}
187
- />
188
- ))}
189
-
190
- {/* Pagination */}
191
- <Box paddingTop={6} paddingBottom={4}>
192
- <Card className="payment-card">
193
- <CardBody padding={4}>
194
- <Flex justifyContent="space-between" alignItems="center">
195
- {transactionHistory.length > pageSize &&
196
- totalPages > 1 ? (
197
- <Flex gap={3} alignItems="center">
198
- <Button
199
- variant="default"
200
- size="S"
201
- onClick={() =>
202
- onPageChange(Math.max(1, currentPage - 1))
203
- }
204
- disabled={currentPage === 1}
205
- className={`payment-button ${currentPage === 1 ? '' : 'payment-button-success'}`}
206
- style={{
207
- background: currentPage === 1 ? "#f6f6f9" : undefined,
208
- color: currentPage === 1 ? "#666687" : undefined
209
- }}
210
- >
211
- ← Previous
212
- </Button>
213
-
214
- <Box
215
- padding={2}
216
- background="#f6f6f9"
217
- borderRadius="6px"
218
- >
219
- <Typography
220
- variant="pi"
221
- textColor="neutral600"
222
- fontWeight="bold"
223
- >
224
- Page {currentPage} of {totalPages}
225
- </Typography>
226
- </Box>
227
-
228
- <Button
229
- variant="default"
230
- size="S"
231
- onClick={() =>
232
- onPageChange(
233
- Math.min(totalPages, currentPage + 1)
234
- )
235
- }
236
- disabled={currentPage === totalPages}
237
- className={`payment-button ${currentPage === totalPages ? '' : 'payment-button-success'}`}
238
- style={{
239
- background: currentPage === totalPages ? "#f6f6f9" : undefined,
240
- color: currentPage === totalPages ? "#666687" : undefined
241
- }}
242
- >
243
- Next →
244
- </Button>
245
- </Flex>
246
- ) : (
247
- <Typography
248
- variant="pi"
249
- textColor="neutral600"
250
- fontWeight="medium"
251
- >
252
- {transactionHistory.length <= pageSize
253
- ? "All transactions shown"
254
- : "No pagination needed"}
255
- </Typography>
256
- )}
257
- </Flex>
258
- </CardBody>
259
- </Card>
260
- <Typography
261
- variant="pi"
262
- textColor="neutral600"
263
- fontWeight="medium"
264
- >
265
- Showing {paginatedTransactions.length} of{" "}
266
- {transactionHistory.length} transactions
267
- </Typography>
268
- </Box>
269
- </Box>
270
- )}
271
- </Box>
272
-
273
- <Box paddingTop={4}>
274
- <Typography variant="sigma" textColor="neutral600">
275
- Note: This shows all Payone transactions processed through this
276
- plugin. Transactions are automatically logged with detailed
277
- request/response data.
278
- </Typography>
279
- </Box>
280
- </Flex>
281
- </Box>
282
- );
283
- };
284
-
285
- export default HistoryPanel;
@@ -1,190 +0,0 @@
1
- import React from "react";
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";
9
-
10
- const PaymentActionsPanel = ({
11
- paymentAmount,
12
- setPaymentAmount,
13
- preauthReference,
14
- setPreauthReference,
15
- authReference,
16
- setAuthReference,
17
- captureTxid,
18
- setCaptureTxid,
19
- refundTxid,
20
- setRefundTxid,
21
- refundSequenceNumber,
22
- setRefundSequenceNumber,
23
- refundReference,
24
- setRefundReference,
25
- paymentMethod,
26
- setPaymentMethod,
27
- captureMode,
28
- setCaptureMode,
29
- isProcessingPayment,
30
- paymentError,
31
- paymentResult,
32
- onPreauthorization,
33
- onAuthorization,
34
- onCapture,
35
- onRefund,
36
- settings,
37
- googlePayToken,
38
- setGooglePayToken,
39
- applePayToken,
40
- setApplePayToken,
41
- cardtype,
42
- setCardtype,
43
- cardpan,
44
- setCardpan,
45
- cardexpiredate,
46
- setCardexpiredate,
47
- cardcvc2,
48
- setCardcvc2,
49
- onNavigateToConfig
50
- }) => {
51
- const mode = (settings?.mode || 'test').toLowerCase();
52
- const isLiveMode = mode === 'live';
53
-
54
- return (
55
- <Box
56
- className="payment-container"
57
- paddingTop={8}
58
- paddingBottom={8}
59
- paddingLeft={8}
60
- paddingRight={8}
61
- >
62
- <Flex direction="column" alignItems="stretch" gap={6}>
63
- <Box style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: '8px' }}>
64
- <Typography variant="beta" as="h2" className="payment-title" style={{ fontSize: '20px', marginBottom: '4px' }}>
65
- Payment Actions
66
- </Typography>
67
- <Typography variant="pi" textColor="neutral600" className="payment-subtitle" style={{ fontSize: '14px' }}>
68
- Process payments, captures, and refunds with multiple payment methods
69
- </Typography>
70
- {isLiveMode && (
71
- <Typography variant="pi" textColor="danger600" style={{ fontSize: '14px', marginTop: '8px', fontWeight: 'bold' }}>
72
- ⚠️ Payment Actions are disabled in live mode for security reasons. Please use test mode for testing.
73
- </Typography>
74
- )}
75
- </Box>
76
-
77
- <PaymentMethodSelector
78
- paymentMethod={paymentMethod}
79
- setPaymentMethod={setPaymentMethod}
80
- captureMode={captureMode}
81
- setCaptureMode={setCaptureMode}
82
- onNavigateToConfig={onNavigateToConfig}
83
- />
84
-
85
- <hr className="payment-divider" />
86
-
87
- <Box className="payment-form-section" style={{ opacity: isLiveMode ? 0.5 : 1, pointerEvents: isLiveMode ? 'none' : 'auto' }}>
88
- <PreauthorizationForm
89
- paymentAmount={paymentAmount}
90
- setPaymentAmount={setPaymentAmount}
91
- preauthReference={preauthReference}
92
- setPreauthReference={setPreauthReference}
93
- isProcessingPayment={isProcessingPayment}
94
- onPreauthorization={onPreauthorization}
95
- paymentMethod={paymentMethod}
96
- settings={settings}
97
- googlePayToken={googlePayToken}
98
- setGooglePayToken={setGooglePayToken}
99
- applePayToken={applePayToken}
100
- setApplePayToken={setApplePayToken}
101
- cardtype={cardtype}
102
- setCardtype={setCardtype}
103
- cardpan={cardpan}
104
- setCardpan={setCardpan}
105
- cardexpiredate={cardexpiredate}
106
- setCardexpiredate={setCardexpiredate}
107
- cardcvc2={cardcvc2}
108
- setCardcvc2={setCardcvc2}
109
- isLiveMode={isLiveMode}
110
- />
111
- </Box>
112
-
113
- <hr className="payment-divider" />
114
-
115
- <Box className="payment-form-section" style={{ opacity: isLiveMode ? 0.5 : 1, pointerEvents: isLiveMode ? 'none' : 'auto' }}>
116
- <AuthorizationForm
117
- paymentAmount={paymentAmount}
118
- setPaymentAmount={setPaymentAmount}
119
- authReference={authReference}
120
- setAuthReference={setAuthReference}
121
- isProcessingPayment={isProcessingPayment}
122
- onAuthorization={onAuthorization}
123
- paymentMethod={paymentMethod}
124
- settings={settings}
125
- googlePayToken={googlePayToken}
126
- setGooglePayToken={setGooglePayToken}
127
- applePayToken={applePayToken}
128
- setApplePayToken={setApplePayToken}
129
- cardtype={cardtype}
130
- setCardtype={setCardtype}
131
- cardpan={cardpan}
132
- setCardpan={setCardpan}
133
- cardexpiredate={cardexpiredate}
134
- setCardexpiredate={setCardexpiredate}
135
- cardcvc2={cardcvc2}
136
- setCardcvc2={setCardcvc2}
137
- isLiveMode={isLiveMode}
138
- />
139
- </Box>
140
-
141
- <hr className="payment-divider" />
142
-
143
- <Box className="payment-form-section" style={{ opacity: isLiveMode ? 0.5 : 1, pointerEvents: isLiveMode ? 'none' : 'auto' }}>
144
- <CaptureForm
145
- paymentAmount={paymentAmount}
146
- setPaymentAmount={setPaymentAmount}
147
- captureTxid={captureTxid}
148
- setCaptureTxid={setCaptureTxid}
149
- isProcessingPayment={isProcessingPayment}
150
- onCapture={onCapture}
151
- />
152
- </Box>
153
-
154
- <hr className="payment-divider" />
155
-
156
- <Box className="payment-form-section" style={{ opacity: isLiveMode ? 0.5 : 1, pointerEvents: isLiveMode ? 'none' : 'auto' }}>
157
- <RefundForm
158
- paymentAmount={paymentAmount}
159
- setPaymentAmount={setPaymentAmount}
160
- refundTxid={refundTxid}
161
- setRefundTxid={setRefundTxid}
162
- refundSequenceNumber={refundSequenceNumber}
163
- setRefundSequenceNumber={setRefundSequenceNumber}
164
- refundReference={refundReference}
165
- setRefundReference={setRefundReference}
166
- isProcessingPayment={isProcessingPayment}
167
- onRefund={onRefund}
168
- />
169
- </Box>
170
-
171
- <hr className="payment-divider" />
172
-
173
- <PaymentResult
174
- paymentError={paymentError}
175
- paymentResult={paymentResult}
176
- />
177
-
178
- <Box paddingTop={4}>
179
- <Typography variant="sigma" textColor="neutral600">
180
- Note: These payment actions allow you to test the complete payment
181
- flow: Preauthorization → Capture → Refund. Make sure to use valid
182
- Transaction IDs for capture and refund operations.
183
- </Typography>
184
- </Box>
185
- </Flex>
186
- </Box>
187
- );
188
- };
189
-
190
- export default PaymentActionsPanel;
@@ -1,24 +0,0 @@
1
- import React from "react";
2
- import { Badge } from "@strapi/design-system";
3
-
4
- const StatusBadge = ({ status }) => {
5
- const statusColors = {
6
- APPROVED: "success",
7
- PENDING: "warning",
8
- ERROR: "danger",
9
- FAILED: "danger",
10
- INVALID: "danger",
11
- REDIRECT: "secondary"
12
- };
13
-
14
- return (
15
- <Badge
16
- textColor="neutral0"
17
- backgroundColor={statusColors[status] || "default"}
18
- >
19
- {status}
20
- </Badge>
21
- );
22
- };
23
-
24
- export default StatusBadge;