strapi-plugin-payone-provider 4.6.10 → 4.6.12
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/StatusBadge.jsx +1 -1
- 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 +199 -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 +121 -85
- 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 +2 -2
- package/server/bootstrap.js +6 -6
- package/server/content-types/index.js +5 -0
- package/server/content-types/transactions/index.js +5 -0
- package/server/content-types/transactions/schema.json +87 -0
- package/server/controllers/payone.js +29 -3
- package/server/index.js +2 -1
- 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/applePayService.js +0 -2
- package/server/services/payone.js +16 -4
- package/server/services/settingsService.js +8 -2
- package/server/services/testConnectionService.js +11 -72
- package/server/services/transactionService.js +147 -154
- package/server/services/transactionStatusService.js +63 -0
- package/server/utils/sanitize.js +41 -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
package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationForm.jsx
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Box, Flex } from "@strapi/design-system";
|
|
2
|
+
import PreauthorizationFormHeader from "./PreauthorizationFormHeader";
|
|
3
|
+
import PreauthorizationFormFields from "./PreauthorizationFormFields";
|
|
4
|
+
import PreauthorizationPaymentButtons from "./PreauthorizationPaymentButtons";
|
|
5
|
+
import CardDetailsInput from "../CardDetailsInput";
|
|
6
|
+
|
|
7
|
+
const PreauthorizationForm = ({
|
|
8
|
+
paymentAmount,
|
|
9
|
+
setPaymentAmount,
|
|
10
|
+
preauthReference,
|
|
11
|
+
setPreauthReference,
|
|
12
|
+
isProcessingPayment,
|
|
13
|
+
onPreauthorization,
|
|
14
|
+
paymentMethod,
|
|
15
|
+
settings,
|
|
16
|
+
setGooglePayToken,
|
|
17
|
+
cardtype,
|
|
18
|
+
setCardtype,
|
|
19
|
+
cardpan,
|
|
20
|
+
setCardpan,
|
|
21
|
+
cardexpiredate,
|
|
22
|
+
setCardexpiredate,
|
|
23
|
+
cardcvc2,
|
|
24
|
+
setCardcvc2,
|
|
25
|
+
isLiveMode = false,
|
|
26
|
+
firstname,
|
|
27
|
+
setFirstname,
|
|
28
|
+
lastname,
|
|
29
|
+
setLastname,
|
|
30
|
+
email,
|
|
31
|
+
setEmail,
|
|
32
|
+
telephonenumber,
|
|
33
|
+
setTelephonenumber,
|
|
34
|
+
gender,
|
|
35
|
+
setGender,
|
|
36
|
+
salutation,
|
|
37
|
+
setSalutation,
|
|
38
|
+
country,
|
|
39
|
+
setCountry,
|
|
40
|
+
currency,
|
|
41
|
+
setCurrency,
|
|
42
|
+
city,
|
|
43
|
+
setCity,
|
|
44
|
+
street,
|
|
45
|
+
setStreet,
|
|
46
|
+
zip,
|
|
47
|
+
setZip,
|
|
48
|
+
}) => {
|
|
49
|
+
const handleGooglePayToken = (token, paymentData) => {
|
|
50
|
+
if (!token) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
setGooglePayToken(token);
|
|
54
|
+
onPreauthorization(token);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleGooglePayError = (error) => {
|
|
58
|
+
console.error("Google Pay error:", error);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const isCardDetailsValid =
|
|
62
|
+
!!cardtype && !!cardpan && !!cardexpiredate && !!cardcvc2;
|
|
63
|
+
|
|
64
|
+
const isDisabled =
|
|
65
|
+
!paymentAmount.trim() ||
|
|
66
|
+
(paymentMethod === "cc" &&
|
|
67
|
+
settings?.enable3DSecure !== false &&
|
|
68
|
+
!isCardDetailsValid);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<Flex direction="column" alignItems="stretch" gap={4}>
|
|
72
|
+
<PreauthorizationFormHeader />
|
|
73
|
+
|
|
74
|
+
<PreauthorizationFormFields
|
|
75
|
+
paymentAmount={paymentAmount}
|
|
76
|
+
setPaymentAmount={setPaymentAmount}
|
|
77
|
+
preauthReference={preauthReference}
|
|
78
|
+
setPreauthReference={setPreauthReference}
|
|
79
|
+
firstname={firstname}
|
|
80
|
+
setFirstname={setFirstname}
|
|
81
|
+
lastname={lastname}
|
|
82
|
+
setLastname={setLastname}
|
|
83
|
+
email={email}
|
|
84
|
+
setEmail={setEmail}
|
|
85
|
+
telephonenumber={telephonenumber}
|
|
86
|
+
setTelephonenumber={setTelephonenumber}
|
|
87
|
+
gender={gender}
|
|
88
|
+
setGender={setGender}
|
|
89
|
+
salutation={salutation}
|
|
90
|
+
setSalutation={setSalutation}
|
|
91
|
+
country={country}
|
|
92
|
+
setCountry={setCountry}
|
|
93
|
+
currency={currency}
|
|
94
|
+
setCurrency={setCurrency}
|
|
95
|
+
city={city}
|
|
96
|
+
setCity={setCity}
|
|
97
|
+
street={street}
|
|
98
|
+
setStreet={setStreet}
|
|
99
|
+
zip={zip}
|
|
100
|
+
setZip={setZip}
|
|
101
|
+
paymentMethod={paymentMethod}
|
|
102
|
+
/>
|
|
103
|
+
|
|
104
|
+
{paymentMethod === "cc" && settings?.enable3DSecure && (
|
|
105
|
+
<Box marginTop={4}>
|
|
106
|
+
<CardDetailsInput
|
|
107
|
+
cardtype={cardtype}
|
|
108
|
+
setCardtype={setCardtype}
|
|
109
|
+
cardpan={cardpan}
|
|
110
|
+
setCardpan={setCardpan}
|
|
111
|
+
cardexpiredate={cardexpiredate}
|
|
112
|
+
setCardexpiredate={setCardexpiredate}
|
|
113
|
+
cardcvc2={cardcvc2}
|
|
114
|
+
setCardcvc2={setCardcvc2}
|
|
115
|
+
/>
|
|
116
|
+
</Box>
|
|
117
|
+
)}
|
|
118
|
+
|
|
119
|
+
<PreauthorizationPaymentButtons
|
|
120
|
+
paymentMethod={paymentMethod}
|
|
121
|
+
paymentAmount={paymentAmount}
|
|
122
|
+
isProcessingPayment={isProcessingPayment}
|
|
123
|
+
onPreauthorization={onPreauthorization}
|
|
124
|
+
settings={settings}
|
|
125
|
+
handleGooglePayToken={handleGooglePayToken}
|
|
126
|
+
handleGooglePayError={handleGooglePayError}
|
|
127
|
+
isDisabled={isDisabled}
|
|
128
|
+
/>
|
|
129
|
+
</Flex>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export default PreauthorizationForm;
|
|
134
|
+
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { Box, TextInput, Select, Option } from "@strapi/design-system";
|
|
2
|
+
import {
|
|
3
|
+
getSalutationOptions,
|
|
4
|
+
getGenderOptions,
|
|
5
|
+
getCurrencyOptions,
|
|
6
|
+
getCountryOptions,
|
|
7
|
+
} from "../../../../utils/countryLanguageUtils";
|
|
8
|
+
import InfoTooltip from "../../common/InfoTooltip";
|
|
9
|
+
|
|
10
|
+
const PreauthorizationFormFields = ({
|
|
11
|
+
paymentAmount,
|
|
12
|
+
setPaymentAmount,
|
|
13
|
+
preauthReference,
|
|
14
|
+
setPreauthReference,
|
|
15
|
+
firstname,
|
|
16
|
+
setFirstname,
|
|
17
|
+
lastname,
|
|
18
|
+
setLastname,
|
|
19
|
+
email,
|
|
20
|
+
setEmail,
|
|
21
|
+
telephonenumber,
|
|
22
|
+
setTelephonenumber,
|
|
23
|
+
gender,
|
|
24
|
+
setGender,
|
|
25
|
+
salutation,
|
|
26
|
+
setSalutation,
|
|
27
|
+
country,
|
|
28
|
+
setCountry,
|
|
29
|
+
currency,
|
|
30
|
+
setCurrency,
|
|
31
|
+
city,
|
|
32
|
+
setCity,
|
|
33
|
+
street,
|
|
34
|
+
setStreet,
|
|
35
|
+
zip,
|
|
36
|
+
setZip,
|
|
37
|
+
paymentMethod,
|
|
38
|
+
}) => {
|
|
39
|
+
const countryOptions = getCountryOptions(paymentMethod);
|
|
40
|
+
const salutationOptions = getSalutationOptions(country || "US");
|
|
41
|
+
const genderOptions = getGenderOptions(country || "US");
|
|
42
|
+
const currencyOptions = getCurrencyOptions();
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Box
|
|
46
|
+
style={{
|
|
47
|
+
display: "grid",
|
|
48
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))",
|
|
49
|
+
gap: "16px",
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<TextInput
|
|
53
|
+
label="Amount *"
|
|
54
|
+
name="paymentAmount"
|
|
55
|
+
value={paymentAmount}
|
|
56
|
+
onChange={(e) => setPaymentAmount(e.target.value)}
|
|
57
|
+
placeholder="Enter amount (e.g., 1000 for €10.00)"
|
|
58
|
+
required
|
|
59
|
+
endAction={
|
|
60
|
+
<InfoTooltip
|
|
61
|
+
label="Amount"
|
|
62
|
+
description="Amount in cents (e.g., 1000 = €10.00)"
|
|
63
|
+
id="paymentAmount-tooltip"
|
|
64
|
+
/>
|
|
65
|
+
}
|
|
66
|
+
/>
|
|
67
|
+
<TextInput
|
|
68
|
+
label="Reference *"
|
|
69
|
+
name="preauthReference"
|
|
70
|
+
value={preauthReference}
|
|
71
|
+
onChange={(e) => setPreauthReference(e.target.value)}
|
|
72
|
+
placeholder="Auto-generated if empty"
|
|
73
|
+
className="payment-input"
|
|
74
|
+
endAction={
|
|
75
|
+
<InfoTooltip
|
|
76
|
+
label="Reference"
|
|
77
|
+
description="Reference will be auto-generated if left empty"
|
|
78
|
+
id="preauthReference-tooltip"
|
|
79
|
+
/>
|
|
80
|
+
}
|
|
81
|
+
/>
|
|
82
|
+
<TextInput
|
|
83
|
+
label="First Name"
|
|
84
|
+
name="firstname"
|
|
85
|
+
value={firstname || ""}
|
|
86
|
+
onChange={(e) => setFirstname(e.target.value)}
|
|
87
|
+
placeholder="John"
|
|
88
|
+
className="payment-input"
|
|
89
|
+
endAction={
|
|
90
|
+
<InfoTooltip
|
|
91
|
+
label="First Name"
|
|
92
|
+
description="Customer first name"
|
|
93
|
+
id="firstname-tooltip"
|
|
94
|
+
/>
|
|
95
|
+
}
|
|
96
|
+
/>
|
|
97
|
+
<TextInput
|
|
98
|
+
label="Last Name"
|
|
99
|
+
name="lastname"
|
|
100
|
+
value={lastname || ""}
|
|
101
|
+
onChange={(e) => setLastname(e.target.value)}
|
|
102
|
+
placeholder="Doe"
|
|
103
|
+
className="payment-input"
|
|
104
|
+
endAction={
|
|
105
|
+
<InfoTooltip
|
|
106
|
+
label="Last Name"
|
|
107
|
+
description="Customer last name"
|
|
108
|
+
id="lastname-tooltip"
|
|
109
|
+
/>
|
|
110
|
+
}
|
|
111
|
+
/>
|
|
112
|
+
<TextInput
|
|
113
|
+
label="Email"
|
|
114
|
+
name="email"
|
|
115
|
+
value={email || ""}
|
|
116
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
117
|
+
placeholder="john.doe@example.com"
|
|
118
|
+
className="payment-input"
|
|
119
|
+
endAction={
|
|
120
|
+
<InfoTooltip
|
|
121
|
+
label="Email"
|
|
122
|
+
description="Customer email address"
|
|
123
|
+
id="email-tooltip"
|
|
124
|
+
/>
|
|
125
|
+
}
|
|
126
|
+
/>
|
|
127
|
+
<TextInput
|
|
128
|
+
label="Phone Number"
|
|
129
|
+
name="telephonenumber"
|
|
130
|
+
value={telephonenumber || ""}
|
|
131
|
+
onChange={(e) => setTelephonenumber(e.target.value)}
|
|
132
|
+
placeholder="+4917512345678"
|
|
133
|
+
className="payment-input"
|
|
134
|
+
endAction={
|
|
135
|
+
<InfoTooltip
|
|
136
|
+
label="Phone Number"
|
|
137
|
+
description={`Customer phone number. Format should match selected country: ${
|
|
138
|
+
country || "US"
|
|
139
|
+
} (e.g., +4917512345678 for Germany, +12125551234 for US)`}
|
|
140
|
+
id="telephonenumber-tooltip"
|
|
141
|
+
/>
|
|
142
|
+
}
|
|
143
|
+
/>
|
|
144
|
+
<Select
|
|
145
|
+
label="Gender"
|
|
146
|
+
name="gender"
|
|
147
|
+
value={gender || ""}
|
|
148
|
+
onChange={(value) => setGender(value)}
|
|
149
|
+
placeholder="Select gender"
|
|
150
|
+
labelAction={
|
|
151
|
+
<InfoTooltip
|
|
152
|
+
label="Gender"
|
|
153
|
+
description={`Customer gender. Options depend on selected country: ${
|
|
154
|
+
country || "US"
|
|
155
|
+
}`}
|
|
156
|
+
id="gender-tooltip"
|
|
157
|
+
/>
|
|
158
|
+
}
|
|
159
|
+
>
|
|
160
|
+
<Option value="" multi={false}>
|
|
161
|
+
Select gender
|
|
162
|
+
</Option>
|
|
163
|
+
{genderOptions.map((option) => (
|
|
164
|
+
<Option key={option.value} value={option.value} multi={false}>
|
|
165
|
+
{option.label}
|
|
166
|
+
</Option>
|
|
167
|
+
))}
|
|
168
|
+
</Select>
|
|
169
|
+
<Select
|
|
170
|
+
label="Salutation"
|
|
171
|
+
name="salutation"
|
|
172
|
+
value={salutation || ""}
|
|
173
|
+
onChange={(value) => setSalutation(value)}
|
|
174
|
+
placeholder="Select salutation"
|
|
175
|
+
labelAction={
|
|
176
|
+
<InfoTooltip
|
|
177
|
+
label="Salutation"
|
|
178
|
+
description={`Customer salutation (e.g., Mr., Mrs., Ms.). Options depend on selected country: ${
|
|
179
|
+
country || "US"
|
|
180
|
+
}`}
|
|
181
|
+
id="salutation-tooltip"
|
|
182
|
+
/>
|
|
183
|
+
}
|
|
184
|
+
>
|
|
185
|
+
<Option value="" multi={false}>
|
|
186
|
+
Select salutation
|
|
187
|
+
</Option>
|
|
188
|
+
{salutationOptions.map((option) => (
|
|
189
|
+
<Option key={option.value} value={option.value} multi={false}>
|
|
190
|
+
{option.label}
|
|
191
|
+
</Option>
|
|
192
|
+
))}
|
|
193
|
+
</Select>
|
|
194
|
+
<Select
|
|
195
|
+
label="Country"
|
|
196
|
+
name="country"
|
|
197
|
+
value={country || ""}
|
|
198
|
+
onChange={(value) => setCountry(value)}
|
|
199
|
+
placeholder="Select country"
|
|
200
|
+
labelAction={
|
|
201
|
+
<InfoTooltip
|
|
202
|
+
label="Country"
|
|
203
|
+
description="Billing address country. This affects available currencies, phone number formats, and ZIP code formats."
|
|
204
|
+
id="country-tooltip"
|
|
205
|
+
/>
|
|
206
|
+
}
|
|
207
|
+
>
|
|
208
|
+
<Option value="" multi={false}>
|
|
209
|
+
Select country
|
|
210
|
+
</Option>
|
|
211
|
+
{countryOptions.map((option) => (
|
|
212
|
+
<Option
|
|
213
|
+
key={option.value}
|
|
214
|
+
value={option.value}
|
|
215
|
+
disabled={option.disabled}
|
|
216
|
+
multi={false}
|
|
217
|
+
>
|
|
218
|
+
{option.label}
|
|
219
|
+
</Option>
|
|
220
|
+
))}
|
|
221
|
+
</Select>
|
|
222
|
+
<Select
|
|
223
|
+
label="Currency"
|
|
224
|
+
name="currency"
|
|
225
|
+
value={currency || "EUR"}
|
|
226
|
+
onChange={(value) => setCurrency(value)}
|
|
227
|
+
placeholder="Select currency"
|
|
228
|
+
labelAction={
|
|
229
|
+
<InfoTooltip
|
|
230
|
+
label="Currency"
|
|
231
|
+
description={`Currency code (e.g., EUR, USD, GBP). Should match the selected country: ${
|
|
232
|
+
country || "US"
|
|
233
|
+
}`}
|
|
234
|
+
id="currency-tooltip"
|
|
235
|
+
/>
|
|
236
|
+
}
|
|
237
|
+
>
|
|
238
|
+
{currencyOptions.map((option) => (
|
|
239
|
+
<Option key={option.value} value={option.value} multi={false}>
|
|
240
|
+
{option.label}
|
|
241
|
+
</Option>
|
|
242
|
+
))}
|
|
243
|
+
</Select>
|
|
244
|
+
<TextInput
|
|
245
|
+
label="City"
|
|
246
|
+
name="city"
|
|
247
|
+
value={city || ""}
|
|
248
|
+
onChange={(e) => setCity(e.target.value)}
|
|
249
|
+
placeholder="Berlin"
|
|
250
|
+
className="payment-input"
|
|
251
|
+
endAction={
|
|
252
|
+
<InfoTooltip
|
|
253
|
+
label="City"
|
|
254
|
+
description={`Billing address city for country: ${country || "US"}`}
|
|
255
|
+
id="city-tooltip"
|
|
256
|
+
/>
|
|
257
|
+
}
|
|
258
|
+
/>
|
|
259
|
+
<TextInput
|
|
260
|
+
label="Street"
|
|
261
|
+
name="street"
|
|
262
|
+
value={street || ""}
|
|
263
|
+
onChange={(e) => setStreet(e.target.value)}
|
|
264
|
+
placeholder="Main Street 123"
|
|
265
|
+
className="payment-input"
|
|
266
|
+
endAction={
|
|
267
|
+
<InfoTooltip
|
|
268
|
+
label="Street"
|
|
269
|
+
description="Billing address street"
|
|
270
|
+
id="street-tooltip"
|
|
271
|
+
/>
|
|
272
|
+
}
|
|
273
|
+
/>
|
|
274
|
+
<TextInput
|
|
275
|
+
label="ZIP Code"
|
|
276
|
+
name="zip"
|
|
277
|
+
value={zip || ""}
|
|
278
|
+
onChange={(e) => setZip(e.target.value)}
|
|
279
|
+
placeholder="12345"
|
|
280
|
+
className="payment-input"
|
|
281
|
+
endAction={
|
|
282
|
+
<InfoTooltip
|
|
283
|
+
label="ZIP Code"
|
|
284
|
+
description={`Billing address ZIP/postal code. Format should match selected country: ${
|
|
285
|
+
country || "US"
|
|
286
|
+
} (e.g., 12345 for US, 10115 for Germany)`}
|
|
287
|
+
id="zip-tooltip"
|
|
288
|
+
/>
|
|
289
|
+
}
|
|
290
|
+
/>
|
|
291
|
+
</Box>
|
|
292
|
+
);
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export default PreauthorizationFormFields;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Flex, Typography } from "@strapi/design-system";
|
|
2
|
+
|
|
3
|
+
const PreauthorizationFormHeader = () => {
|
|
4
|
+
return (
|
|
5
|
+
<Flex direction="row" gap={2}>
|
|
6
|
+
<Typography
|
|
7
|
+
variant="omega"
|
|
8
|
+
fontWeight="semiBold"
|
|
9
|
+
textColor="neutral800"
|
|
10
|
+
className="payment-form-title"
|
|
11
|
+
>
|
|
12
|
+
Preauthorization
|
|
13
|
+
</Typography>
|
|
14
|
+
<Typography
|
|
15
|
+
variant="pi"
|
|
16
|
+
textColor="neutral600"
|
|
17
|
+
className="payment-form-description"
|
|
18
|
+
>
|
|
19
|
+
Reserve an amount on a credit card without capturing it immediately.
|
|
20
|
+
</Typography>
|
|
21
|
+
</Flex>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default PreauthorizationFormHeader;
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Box, Button, Typography } from "@strapi/design-system";
|
|
2
|
+
import { Play } from "@strapi/icons";
|
|
3
|
+
import GooglePayButton from "../../GooglePaybutton";
|
|
4
|
+
|
|
5
|
+
const PreauthorizationPaymentButtons = ({
|
|
6
|
+
paymentMethod,
|
|
7
|
+
paymentAmount,
|
|
8
|
+
isProcessingPayment,
|
|
9
|
+
onPreauthorization,
|
|
10
|
+
settings,
|
|
11
|
+
handleGooglePayToken,
|
|
12
|
+
handleGooglePayError,
|
|
13
|
+
isDisabled,
|
|
14
|
+
}) => {
|
|
15
|
+
if (paymentMethod === "gpp") {
|
|
16
|
+
return (
|
|
17
|
+
<GooglePayButton
|
|
18
|
+
amount={paymentAmount}
|
|
19
|
+
currency="EUR"
|
|
20
|
+
onTokenReceived={handleGooglePayToken}
|
|
21
|
+
onError={handleGooglePayError}
|
|
22
|
+
settings={settings}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (paymentMethod === "apl") {
|
|
28
|
+
return (
|
|
29
|
+
<Box>
|
|
30
|
+
<Typography variant="pi" textColor="neutral600">
|
|
31
|
+
Apple Pay is only supported for Authorization, not Preauthorization.
|
|
32
|
+
</Typography>
|
|
33
|
+
</Box>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Button
|
|
39
|
+
variant="default"
|
|
40
|
+
onClick={onPreauthorization}
|
|
41
|
+
loading={isProcessingPayment}
|
|
42
|
+
startIcon={<Play />}
|
|
43
|
+
style={{ maxWidth: "200px" }}
|
|
44
|
+
className="payment-button payment-button-primary"
|
|
45
|
+
disabled={isDisabled}
|
|
46
|
+
>
|
|
47
|
+
Process Preauthorization
|
|
48
|
+
</Button>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default PreauthorizationPaymentButtons;
|
|
53
|
+
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Button,
|
|
5
|
+
TextInput,
|
|
6
|
+
SingleSelect,
|
|
7
|
+
SingleSelectOption,
|
|
8
|
+
Typography,
|
|
9
|
+
} from "@strapi/design-system";
|
|
10
|
+
import { Refresh, Search } from "@strapi/icons";
|
|
11
|
+
import InfoTooltip from "../common/InfoTooltip";
|
|
12
|
+
|
|
13
|
+
const FiltersPanel = ({ filters, handleFiltersChange, isLoading }) => {
|
|
14
|
+
const getDefaultDateFrom = () => {
|
|
15
|
+
const date = new Date();
|
|
16
|
+
date.setDate(date.getDate() - 30);
|
|
17
|
+
return date.toISOString().split("T")[0];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getDefaultDateTo = () => {
|
|
21
|
+
const date = new Date();
|
|
22
|
+
date.setDate(date.getDate() + 1);
|
|
23
|
+
return date.toISOString().split("T")[0];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const handleReset = () => {
|
|
27
|
+
handleFiltersChange({
|
|
28
|
+
search: "",
|
|
29
|
+
status: "",
|
|
30
|
+
request_type: "",
|
|
31
|
+
payment_method: "",
|
|
32
|
+
date_from: getDefaultDateFrom(),
|
|
33
|
+
date_to: getDefaultDateTo(),
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handleFilterChange = (field, value) => {
|
|
38
|
+
handleFiltersChange({ [field]: value });
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Box
|
|
43
|
+
style={{
|
|
44
|
+
display: "grid",
|
|
45
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))",
|
|
46
|
+
gap: "16px",
|
|
47
|
+
alignItems: "end",
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<TextInput
|
|
51
|
+
label="Search"
|
|
52
|
+
name="search"
|
|
53
|
+
value={filters?.search || ""}
|
|
54
|
+
onChange={(e) => handleFilterChange("search", e.target.value)}
|
|
55
|
+
placeholder="Search by reference or transaction ID"
|
|
56
|
+
endAction={
|
|
57
|
+
<InfoTooltip
|
|
58
|
+
label="Search"
|
|
59
|
+
description="Search by reference or transaction ID"
|
|
60
|
+
id="search-tooltip"
|
|
61
|
+
/>
|
|
62
|
+
}
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<SingleSelect
|
|
66
|
+
name="status"
|
|
67
|
+
label="Status"
|
|
68
|
+
value={filters?.status || ""}
|
|
69
|
+
onChange={(value) => handleFilterChange("status", value)}
|
|
70
|
+
placeholder="All Statuses"
|
|
71
|
+
labelAction={
|
|
72
|
+
<InfoTooltip
|
|
73
|
+
label="Status"
|
|
74
|
+
description="Filter transactions by status"
|
|
75
|
+
id="status-tooltip"
|
|
76
|
+
/>
|
|
77
|
+
}
|
|
78
|
+
>
|
|
79
|
+
<SingleSelectOption value="">All Statuses</SingleSelectOption>
|
|
80
|
+
<SingleSelectOption value="APPROVED">Approved</SingleSelectOption>
|
|
81
|
+
<SingleSelectOption value="ERROR">Error</SingleSelectOption>
|
|
82
|
+
<SingleSelectOption value="REDIRECT">Redirect</SingleSelectOption>
|
|
83
|
+
<SingleSelectOption value="INVALID">Invalid</SingleSelectOption>
|
|
84
|
+
<SingleSelectOption value="PENDING">Pending</SingleSelectOption>
|
|
85
|
+
<SingleSelectOption value="CANCELLED">Cancelled</SingleSelectOption>
|
|
86
|
+
</SingleSelect>
|
|
87
|
+
|
|
88
|
+
<SingleSelect
|
|
89
|
+
name="request_type"
|
|
90
|
+
label="Request Type"
|
|
91
|
+
value={filters?.request_type || ""}
|
|
92
|
+
onChange={(value) => handleFilterChange("request_type", value)}
|
|
93
|
+
placeholder="All Types"
|
|
94
|
+
labelAction={
|
|
95
|
+
<InfoTooltip
|
|
96
|
+
label="Request Type"
|
|
97
|
+
description="Filter by payment request type"
|
|
98
|
+
id="request_type-tooltip"
|
|
99
|
+
/>
|
|
100
|
+
}
|
|
101
|
+
>
|
|
102
|
+
<SingleSelectOption value="">All Types</SingleSelectOption>
|
|
103
|
+
<SingleSelectOption value="preauthorization">
|
|
104
|
+
Preauthorization
|
|
105
|
+
</SingleSelectOption>
|
|
106
|
+
<SingleSelectOption value="authorization">
|
|
107
|
+
Authorization
|
|
108
|
+
</SingleSelectOption>
|
|
109
|
+
<SingleSelectOption value="capture">Capture</SingleSelectOption>
|
|
110
|
+
<SingleSelectOption value="refund">Refund</SingleSelectOption>
|
|
111
|
+
</SingleSelect>
|
|
112
|
+
|
|
113
|
+
<SingleSelect
|
|
114
|
+
name="payment_method"
|
|
115
|
+
label="Payment Method"
|
|
116
|
+
value={filters?.payment_method || ""}
|
|
117
|
+
onChange={(value) => handleFilterChange("payment_method", value)}
|
|
118
|
+
placeholder="All Methods"
|
|
119
|
+
labelAction={
|
|
120
|
+
<InfoTooltip
|
|
121
|
+
label="Payment Method"
|
|
122
|
+
description="Filter by payment method"
|
|
123
|
+
id="payment_method-tooltip"
|
|
124
|
+
/>
|
|
125
|
+
}
|
|
126
|
+
>
|
|
127
|
+
<SingleSelectOption value="">All Methods</SingleSelectOption>
|
|
128
|
+
<SingleSelectOption value="credit_card">Credit Card</SingleSelectOption>
|
|
129
|
+
<SingleSelectOption value="paypal">PayPal</SingleSelectOption>
|
|
130
|
+
<SingleSelectOption value="google_pay">Google Pay</SingleSelectOption>
|
|
131
|
+
<SingleSelectOption value="apple_pay">Apple Pay</SingleSelectOption>
|
|
132
|
+
<SingleSelectOption value="sofort">Sofort Banking</SingleSelectOption>
|
|
133
|
+
<SingleSelectOption value="sepa">SEPA Direct Debit</SingleSelectOption>
|
|
134
|
+
</SingleSelect>
|
|
135
|
+
|
|
136
|
+
<TextInput
|
|
137
|
+
label="Date From"
|
|
138
|
+
name="date_from"
|
|
139
|
+
type="date"
|
|
140
|
+
value={filters?.date_from || ""}
|
|
141
|
+
onChange={(e) => handleFilterChange("date_from", e.target.value)}
|
|
142
|
+
placeholder="YYYY-MM-DD"
|
|
143
|
+
endAction={
|
|
144
|
+
<InfoTooltip
|
|
145
|
+
label="Date From"
|
|
146
|
+
description="Filter transactions from this date"
|
|
147
|
+
id="date_from-tooltip"
|
|
148
|
+
/>
|
|
149
|
+
}
|
|
150
|
+
/>
|
|
151
|
+
|
|
152
|
+
<TextInput
|
|
153
|
+
label="Date To"
|
|
154
|
+
name="date_to"
|
|
155
|
+
type="date"
|
|
156
|
+
value={filters?.date_to || ""}
|
|
157
|
+
onChange={(e) => handleFilterChange("date_to", e.target.value)}
|
|
158
|
+
placeholder="YYYY-MM-DD"
|
|
159
|
+
endAction={
|
|
160
|
+
<InfoTooltip
|
|
161
|
+
label="Date To"
|
|
162
|
+
description="Filter transactions until this date"
|
|
163
|
+
id="date_to-tooltip"
|
|
164
|
+
/>
|
|
165
|
+
}
|
|
166
|
+
/>
|
|
167
|
+
|
|
168
|
+
<Button
|
|
169
|
+
variant="secondary"
|
|
170
|
+
onClick={handleReset}
|
|
171
|
+
startIcon={<Refresh />}
|
|
172
|
+
loading={isLoading}
|
|
173
|
+
size="S"
|
|
174
|
+
maxWidth="100px"
|
|
175
|
+
>
|
|
176
|
+
Reset
|
|
177
|
+
</Button>
|
|
178
|
+
</Box>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export default FiltersPanel;
|