strapi-plugin-payone-provider 1.6.5 → 1.6.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.
@@ -8,7 +8,9 @@ import {
8
8
  Stack,
9
9
  Typography,
10
10
  TextInput,
11
- Divider
11
+ Select,
12
+ Option,
13
+ Divider,
12
14
  } from "@strapi/design-system";
13
15
  import { Search } from "@strapi/icons";
14
16
  import TransactionHistoryItem from "./TransactionHistoryItem";
@@ -24,9 +26,8 @@ const HistoryPanel = ({
24
26
  totalPages,
25
27
  pageSize,
26
28
  onRefresh,
27
- onPageChange
29
+ onPageChange,
28
30
  }) => {
29
-
30
31
  return (
31
32
  <Box
32
33
  className="payment-container"
@@ -37,10 +38,20 @@ const HistoryPanel = ({
37
38
  >
38
39
  <Flex direction="column" alignItems="stretch" gap={8}>
39
40
  <Box>
40
- <Typography variant="beta" as="h2" className="payment-title" style={{ fontSize: '20px', marginBottom: '4px' }}>
41
+ <Typography
42
+ variant="beta"
43
+ as="h2"
44
+ className="payment-title"
45
+ style={{ fontSize: "20px", marginBottom: "4px" }}
46
+ >
41
47
  Transaction Management
42
48
  </Typography>
43
- <Typography variant="pi" textColor="neutral600" className="payment-subtitle" style={{ fontSize: '14px', marginTop: '4px' }}>
49
+ <Typography
50
+ variant="pi"
51
+ textColor="neutral600"
52
+ className="payment-subtitle"
53
+ style={{ fontSize: "14px", marginTop: "4px" }}
54
+ >
44
55
  View and filter all payment transactions processed through Payone
45
56
  </Typography>
46
57
  </Box>
@@ -59,66 +70,69 @@ const HistoryPanel = ({
59
70
  <Stack spacing={4}>
60
71
  <Flex gap={4} wrap="wrap" alignItems="center">
61
72
  <TextInput
62
- label="Status"
63
- name="status"
64
- value={filters.status}
65
- onChange={(e) => onFilterChange("status", e.target.value)}
66
- placeholder="APPROVED, ERROR, etc."
73
+ label="Search"
74
+ name="search"
75
+ value={filters.search || ""}
76
+ onChange={(e) => onFilterChange("search", e.target.value)}
77
+ placeholder="Search by Status, Transaction ID, or Reference"
67
78
  className="payment-input"
68
- style={{ flex: 1, minWidth: "200px" }}
79
+ style={{ flex: 1, minWidth: "250px" }}
69
80
  />
70
- <TextInput
81
+ <Select
71
82
  label="Request Type"
72
83
  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"
84
+ value={filters.request_type || ""}
85
+ onChange={(value) => onFilterChange("request_type", value)}
86
+ placeholder="Select request type"
87
87
  className="payment-input"
88
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)
89
+ >
90
+ <Option value="">All Types</Option>
91
+ <Option value="preauthorization">Preauthorization</Option>
92
+ <Option value="authorization">Authorization</Option>
93
+ <Option value="capture">Capture</Option>
94
+ <Option value="refund">Refund</Option>
95
+ </Select>
96
+ <Select
97
+ label="Payment Method"
98
+ name="payment_method"
99
+ value={filters.payment_method || ""}
100
+ onChange={(value) =>
101
+ onFilterChange("payment_method", value)
96
102
  }
97
- placeholder="Enter reference"
103
+ placeholder="Select payment method"
98
104
  className="payment-input"
99
105
  style={{ flex: 1, minWidth: "200px" }}
100
- />
106
+ >
107
+ <Option value="">All Methods</Option>
108
+ <Option value="credit_card">Credit Card</Option>
109
+ <Option value="paypal">PayPal</Option>
110
+ <Option value="google_pay">Google Pay</Option>
111
+ <Option value="apple_pay">Apple Pay</Option>
112
+ <Option value="sofort">Sofort Banking</Option>
113
+ <Option value="sepa">SEPA Direct Debit</Option>
114
+ </Select>
101
115
  <TextInput
102
116
  label="Date From"
103
117
  name="date_from"
104
- value={filters.date_from}
118
+ value={filters.date_from || ""}
105
119
  onChange={(e) =>
106
120
  onFilterChange("date_from", e.target.value)
107
121
  }
108
122
  placeholder="YYYY-MM-DD"
109
123
  type="date"
110
124
  className="payment-input"
111
- style={{ flex: 1, minWidth: "200px" }}
125
+ style={{ flex: 1, minWidth: "150px" }}
112
126
  />
113
127
  <TextInput
114
128
  label="Date To"
115
129
  name="date_to"
116
- value={filters.date_to}
130
+ value={filters.date_to || ""}
117
131
  onChange={(e) => onFilterChange("date_to", e.target.value)}
118
132
  placeholder="YYYY-MM-DD"
119
133
  type="date"
120
134
  className="payment-input"
121
- style={{ flex: 1, minWidth: "200px" }}
135
+ style={{ flex: 1, minWidth: "150px" }}
122
136
  />
123
137
  <Button
124
138
  variant="default"
@@ -193,7 +207,7 @@ const HistoryPanel = ({
193
207
  <CardBody padding={4}>
194
208
  <Flex justifyContent="space-between" alignItems="center">
195
209
  {transactionHistory.length > pageSize &&
196
- totalPages > 1 ? (
210
+ totalPages > 1 ? (
197
211
  <Flex gap={3} alignItems="center">
198
212
  <Button
199
213
  variant="default"
@@ -202,10 +216,13 @@ const HistoryPanel = ({
202
216
  onPageChange(Math.max(1, currentPage - 1))
203
217
  }
204
218
  disabled={currentPage === 1}
205
- className={`payment-button ${currentPage === 1 ? '' : 'payment-button-success'}`}
219
+ className={`payment-button ${
220
+ currentPage === 1 ? "" : "payment-button-success"
221
+ }`}
206
222
  style={{
207
- background: currentPage === 1 ? "#f6f6f9" : undefined,
208
- color: currentPage === 1 ? "#666687" : undefined
223
+ background:
224
+ currentPage === 1 ? "#f6f6f9" : undefined,
225
+ color: currentPage === 1 ? "#666687" : undefined,
209
226
  }}
210
227
  >
211
228
  ← Previous
@@ -234,10 +251,20 @@ const HistoryPanel = ({
234
251
  )
235
252
  }
236
253
  disabled={currentPage === totalPages}
237
- className={`payment-button ${currentPage === totalPages ? '' : 'payment-button-success'}`}
254
+ className={`payment-button ${
255
+ currentPage === totalPages
256
+ ? ""
257
+ : "payment-button-success"
258
+ }`}
238
259
  style={{
239
- background: currentPage === totalPages ? "#f6f6f9" : undefined,
240
- color: currentPage === totalPages ? "#666687" : undefined
260
+ background:
261
+ currentPage === totalPages
262
+ ? "#f6f6f9"
263
+ : undefined,
264
+ color:
265
+ currentPage === totalPages
266
+ ? "#666687"
267
+ : undefined,
241
268
  }}
242
269
  >
243
270
  Next →
@@ -35,7 +35,6 @@ const PaymentActionsPanel = ({
35
35
  onCapture,
36
36
  onRefund,
37
37
  settings,
38
- googlePayToken,
39
38
  setGooglePayToken,
40
39
  applePayToken,
41
40
  setApplePayToken,
@@ -52,7 +51,13 @@ const PaymentActionsPanel = ({
52
51
  const mode = (settings?.mode || "test").toLowerCase();
53
52
  const isLiveMode = mode === "live";
54
53
 
55
- if (isLiveMode) {
54
+ React.useEffect(() => {
55
+ if (isLiveMode && paymentMethod !== "apl") {
56
+ setPaymentMethod("apl");
57
+ }
58
+ }, [isLiveMode, paymentMethod]);
59
+
60
+ if (isLiveMode && paymentMethod !== "apl") {
56
61
  return (
57
62
  <Box
58
63
  style={{
@@ -100,6 +105,7 @@ const PaymentActionsPanel = ({
100
105
  cardcvc2={cardcvc2}
101
106
  setCardcvc2={setCardcvc2}
102
107
  onNavigateToConfig={onNavigateToConfig}
108
+ isLiveMode={isLiveMode}
103
109
  />
104
110
  );
105
111
  }