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.
Files changed (61) hide show
  1. package/README.md +64 -0
  2. package/admin/src/pages/App/components/AppHeader.jsx +3 -2
  3. package/admin/src/pages/App/components/AppTabs.jsx +34 -88
  4. package/admin/src/pages/App/components/DocsPanel.jsx +1726 -1726
  5. package/admin/src/pages/App/components/GooglePaybutton.jsx +300 -300
  6. package/admin/src/pages/App/components/common/InfoTooltip.jsx +16 -0
  7. package/admin/src/pages/App/components/{ApplePayConfig.jsx → configuration/ApplePayConfig.jsx} +191 -62
  8. package/admin/src/pages/App/components/{ApplePayConfigPanel.jsx → configuration/ApplePayConfigPanel.jsx} +71 -70
  9. package/admin/src/pages/App/components/configuration/ConfigurationFields.jsx +408 -0
  10. package/admin/src/pages/App/components/configuration/ConfigurationPanel.jsx +67 -0
  11. package/admin/src/pages/App/components/{GooglePayConfig.jsx → configuration/GooglePayConfig.jsx} +254 -254
  12. package/admin/src/pages/App/components/{GooglePayConfigPanel.jsx → configuration/GooglePayConfigPanel.jsx} +82 -82
  13. package/admin/src/pages/App/components/configuration/TestConnection.jsx +129 -0
  14. package/admin/src/pages/App/components/paymentActions/ApplePayPanel.jsx +137 -95
  15. package/admin/src/pages/App/components/paymentActions/CaptureForm.jsx +119 -14
  16. package/admin/src/pages/App/components/paymentActions/CardDetailsInput.jsx +85 -24
  17. package/admin/src/pages/App/components/paymentActions/PaymentActionsPanel.jsx +361 -0
  18. package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +22 -4
  19. package/admin/src/pages/App/components/paymentActions/RefundForm.jsx +91 -20
  20. package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationForm.jsx +157 -0
  21. package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationFormFields.jsx +308 -0
  22. package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationFormHeader.jsx +27 -0
  23. package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationPaymentButtons.jsx +93 -0
  24. package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationForm.jsx +134 -0
  25. package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationFormFields.jsx +295 -0
  26. package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationFormHeader.jsx +27 -0
  27. package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationPaymentButtons.jsx +53 -0
  28. package/admin/src/pages/App/components/transaction-history/FiltersPanel.jsx +182 -0
  29. package/admin/src/pages/App/components/transaction-history/HistoryPanel.jsx +49 -0
  30. package/admin/src/pages/App/components/transaction-history/TransactionTable.jsx +169 -0
  31. package/admin/src/pages/App/components/transaction-history/TransactionTablePagination.jsx +28 -0
  32. package/admin/src/pages/App/components/transaction-history/details/TransactionDetails.jsx +155 -0
  33. package/admin/src/pages/App/index.jsx +5 -29
  34. package/admin/src/pages/hooks/usePaymentActions.js +87 -11
  35. package/admin/src/pages/hooks/useSettings.js +64 -22
  36. package/admin/src/pages/hooks/useTransactionHistory.js +100 -88
  37. package/admin/src/pages/utils/api.js +31 -3
  38. package/admin/src/pages/utils/countryLanguageUtils.js +236 -0
  39. package/admin/src/pages/utils/transactionTableUtils.js +60 -0
  40. package/package.json +1 -1
  41. package/server/bootstrap.js +6 -6
  42. package/server/controllers/payone.js +27 -3
  43. package/server/policies/index.js +2 -1
  44. package/server/policies/is-payone-notification.js +31 -0
  45. package/server/routes/index.js +10 -0
  46. package/server/services/payone.js +11 -4
  47. package/server/services/settingsService.js +8 -2
  48. package/server/services/testConnectionService.js +11 -72
  49. package/server/services/transactionService.js +58 -78
  50. package/server/services/transactionStatusService.js +87 -0
  51. package/admin/src/pages/App/components/ConfigurationPanel.jsx +0 -517
  52. package/admin/src/pages/App/components/CustomerInfoPopover.jsx +0 -147
  53. package/admin/src/pages/App/components/HistoryPanel.jsx +0 -94
  54. package/admin/src/pages/App/components/PaymentActionsPanel.jsx +0 -280
  55. package/admin/src/pages/App/components/RawDataPopover.jsx +0 -113
  56. package/admin/src/pages/App/components/TransactionHistoryItem.jsx +0 -522
  57. package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTableFilters.jsx +0 -113
  58. package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTablePagination.jsx +0 -180
  59. package/admin/src/pages/App/components/TransactionHistoryTable/index.jsx +0 -225
  60. package/admin/src/pages/App/components/paymentActions/AuthorizationForm.jsx +0 -197
  61. package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +0 -142
@@ -0,0 +1,408 @@
1
+ import React from "react";
2
+ import {
3
+ Box,
4
+ Button,
5
+ Card,
6
+ CardBody,
7
+ Flex,
8
+ Stack,
9
+ Typography,
10
+ TextInput,
11
+ Select,
12
+ Option,
13
+ Switch,
14
+ } from "@strapi/design-system";
15
+ import { Cog } from "@strapi/icons";
16
+ import { useHistory } from "react-router-dom";
17
+ import pluginId from "../../../../pluginId";
18
+ import InfoTooltip from "../common/InfoTooltip";
19
+
20
+ const ConfigurationFields = ({
21
+ settings,
22
+ onInputChange,
23
+ onPaymentMethodToggle,
24
+ }) => {
25
+ const history = useHistory();
26
+
27
+ const handleNavigateToApplePayConfig = () => {
28
+ history.push(`/plugins/${pluginId}/apple-pay-config`);
29
+ };
30
+
31
+ const handleNavigateToGooglePayConfig = () => {
32
+ history.push(`/plugins/${pluginId}/google-pay-config`);
33
+ };
34
+
35
+ return (
36
+ <Box
37
+ style={{
38
+ display: "flex",
39
+ flexDirection: "row",
40
+ gap: "16px",
41
+ flexWrap: "wrap",
42
+ }}
43
+ >
44
+ <Card className="payment-card" id="config-card-1">
45
+ <CardBody padding={6}>
46
+ <Stack spacing={6} id="config-stack-1">
47
+ <Flex gap={4} wrap="wrap">
48
+ <TextInput
49
+ label="Account ID (aid)"
50
+ name="aid"
51
+ value={settings.aid || ""}
52
+ onChange={(e) => onInputChange("aid", e.target.value)}
53
+ required
54
+ className="payment-input"
55
+ style={{ flex: 1, minWidth: "300px" }}
56
+ endAction={
57
+ <InfoTooltip
58
+ label="Account ID"
59
+ description="Your Payone account ID (aid). Found in your Payone merchant portal."
60
+ id="aid-tooltip"
61
+ />
62
+ }
63
+ />
64
+
65
+ <TextInput
66
+ label="Portal ID"
67
+ name="portalid"
68
+ value={settings.portalid || ""}
69
+ onChange={(e) => onInputChange("portalid", e.target.value)}
70
+ required
71
+ className="payment-input"
72
+ style={{ flex: 1, minWidth: "300px" }}
73
+ endAction={
74
+ <InfoTooltip
75
+ label="Portal ID"
76
+ description="Your Payone portal ID. Found in your Payone merchant portal."
77
+ id="portalid-tooltip"
78
+ />
79
+ }
80
+ />
81
+ </Flex>
82
+
83
+ <Flex gap={4} wrap="wrap">
84
+ <TextInput
85
+ label="Merchant ID (mid)"
86
+ name="mid"
87
+ value={settings.mid || ""}
88
+ onChange={(e) => onInputChange("mid", e.target.value)}
89
+ required
90
+ className="payment-input"
91
+ style={{ flex: 1, minWidth: "300px" }}
92
+ endAction={
93
+ <InfoTooltip
94
+ label="Merchant ID"
95
+ description="Your Payone merchant ID (mid). Found in your Payone merchant portal."
96
+ id="mid-tooltip"
97
+ />
98
+ }
99
+ />
100
+
101
+ <TextInput
102
+ label="Portal Key"
103
+ name="key"
104
+ type="password"
105
+ value={settings.key || ""}
106
+ onChange={(e) => onInputChange("key", e.target.value)}
107
+ required
108
+ className="payment-input"
109
+ style={{ flex: 1, minWidth: "300px" }}
110
+ endAction={
111
+ <InfoTooltip
112
+ label="Portal Key"
113
+ description="Your Payone portal key (will be encrypted for security). Found in your Payone merchant portal."
114
+ id="key-tooltip"
115
+ />
116
+ }
117
+ />
118
+ </Flex>
119
+
120
+ <Flex gap={4} wrap="wrap">
121
+ <TextInput
122
+ label="Domain Name"
123
+ name="domainName"
124
+ value={settings.domainName || ""}
125
+ onChange={(e) => onInputChange("domainName", e.target.value)}
126
+ className="payment-input"
127
+ style={{ flex: 1, minWidth: "300px" }}
128
+ endAction={
129
+ <InfoTooltip
130
+ label="Domain Name"
131
+ description="Your domain name (optional). Used for payment method configuration."
132
+ id="domainName-tooltip"
133
+ />
134
+ }
135
+ />
136
+
137
+ <TextInput
138
+ label="Display Name"
139
+ name="displayName"
140
+ value={settings.displayName || ""}
141
+ onChange={(e) => onInputChange("displayName", e.target.value)}
142
+ className="payment-input"
143
+ style={{ flex: 1, minWidth: "300px" }}
144
+ endAction={
145
+ <InfoTooltip
146
+ label="Display Name"
147
+ description="Display name for payment methods (optional). Shown to customers during checkout."
148
+ id="displayName-tooltip"
149
+ />
150
+ }
151
+ />
152
+ </Flex>
153
+
154
+ <Flex gap={4} wrap="wrap">
155
+ <Select
156
+ label="Mode"
157
+ name="mode"
158
+ value={settings.mode || "test"}
159
+ onChange={(value) => onInputChange("mode", value)}
160
+ className="payment-input"
161
+ style={{ flex: 1, minWidth: "300px" }}
162
+ labelAction={
163
+ <InfoTooltip
164
+ label="Mode"
165
+ description="Select the API mode: Test for development/testing, Live for production"
166
+ id="mode-tooltip"
167
+ />
168
+ }
169
+ >
170
+ <Option value="test" multi={false}>
171
+ Test
172
+ </Option>
173
+ <Option value="live" multi={false}>
174
+ Live
175
+ </Option>
176
+ </Select>
177
+
178
+ <TextInput
179
+ label="API Version"
180
+ name="api_version"
181
+ value={settings.api_version || "3.10"}
182
+ onChange={(e) => onInputChange("api_version", e.target.value)}
183
+ className="payment-input"
184
+ style={{ flex: 1, minWidth: "300px" }}
185
+ endAction={
186
+ <InfoTooltip
187
+ label="API Version"
188
+ description="Payone API version (e.g., 3.10). Check Payone documentation for latest version."
189
+ id="api_version-tooltip"
190
+ />
191
+ }
192
+ />
193
+ </Flex>
194
+
195
+ <Flex
196
+ direction="column"
197
+ wrap="wrap"
198
+ gap={1}
199
+ alignItems="flex-start"
200
+ >
201
+ <Select
202
+ label="Enable 3D Secure"
203
+ name="enable3DSecure"
204
+ value={settings.enable3DSecure ? "yes" : "no"}
205
+ onChange={(value) =>
206
+ onInputChange("enable3DSecure", value === "yes")
207
+ }
208
+ className="payment-input"
209
+ labelAction={
210
+ <InfoTooltip
211
+ label="Enable 3D Secure"
212
+ description="Enable 3D Secure authentication for credit card payments. Required for SCA compliance in Europe."
213
+ id="enable3DSecure-tooltip"
214
+ />
215
+ }
216
+ >
217
+ <Option value="yes" multi={false}>
218
+ Enabled
219
+ </Option>
220
+ <Option value="no" multi={false}>
221
+ Disabled
222
+ </Option>
223
+ </Select>
224
+ <Typography variant="pi" textColor="neutral600" marginTop={1}>
225
+ When enabled, credit card payments will require 3D Secure
226
+ authentication (SCA compliance)
227
+ </Typography>
228
+ </Flex>
229
+ </Stack>
230
+ </CardBody>
231
+ </Card>
232
+
233
+ <Card className="payment-card" id="config-card-2">
234
+ <CardBody padding={6}>
235
+ <Stack spacing={6} id="config-stack-2">
236
+ <Box>
237
+ <Typography
238
+ variant="delta"
239
+ as="h3"
240
+ fontWeight="bold"
241
+ marginBottom={4}
242
+ >
243
+ Payment Methods
244
+ </Typography>
245
+ <Typography variant="pi" textColor="neutral600" marginBottom={4}>
246
+ Enable or disable payment methods for your Payone integration
247
+ </Typography>
248
+ </Box>
249
+
250
+ <Stack spacing={4} id="config-stack-3">
251
+ <Flex
252
+ direction="row"
253
+ justifyContent="space-between"
254
+ alignItems="center"
255
+ gap={4}
256
+ >
257
+ <Typography variant="omega" fontWeight="semiBold">
258
+ Credit Card (Visa, Mastercard)
259
+ </Typography>
260
+ <Switch
261
+ label="Credit Card"
262
+ selected={settings.enableCreditCard !== false}
263
+ onChange={() =>
264
+ onPaymentMethodToggle(
265
+ "enableCreditCard",
266
+ !settings.enableCreditCard
267
+ )
268
+ }
269
+ />
270
+ </Flex>
271
+
272
+ <Flex
273
+ direction="row"
274
+ justifyContent="space-between"
275
+ alignItems="center"
276
+ gap={4}
277
+ >
278
+ <Typography variant="omega" fontWeight="semiBold">
279
+ PayPal
280
+ </Typography>
281
+ <Switch
282
+ label="PayPal"
283
+ selected={settings.enablePayPal !== false}
284
+ onChange={() =>
285
+ onPaymentMethodToggle(
286
+ "enablePayPal",
287
+ !settings.enablePayPal
288
+ )
289
+ }
290
+ />
291
+ </Flex>
292
+
293
+ <Flex
294
+ direction="row"
295
+ justifyContent="space-between"
296
+ alignItems="center"
297
+ gap={4}
298
+ >
299
+ <Typography variant="omega" fontWeight="semiBold">
300
+ Google Pay
301
+ </Typography>
302
+ <Switch
303
+ label="Google Pay"
304
+ selected={settings.enableGooglePay !== false}
305
+ onChange={() =>
306
+ onPaymentMethodToggle(
307
+ "enableGooglePay",
308
+ !settings.enableGooglePay
309
+ )
310
+ }
311
+ />
312
+ </Flex>
313
+
314
+ <Flex
315
+ direction="row"
316
+ justifyContent="space-between"
317
+ alignItems="center"
318
+ gap={4}
319
+ >
320
+ <Typography variant="omega" fontWeight="semiBold">
321
+ Apple Pay
322
+ </Typography>
323
+ <Switch
324
+ label="Apple Pay"
325
+ selected={settings.enableApplePay !== false}
326
+ onChange={() =>
327
+ onPaymentMethodToggle(
328
+ "enableApplePay",
329
+ !settings.enableApplePay
330
+ )
331
+ }
332
+ />
333
+ </Flex>
334
+
335
+ <Flex
336
+ direction="row"
337
+ justifyContent="space-between"
338
+ alignItems="center"
339
+ gap={4}
340
+ >
341
+ <Typography variant="omega" fontWeight="semiBold">
342
+ Sofort Banking
343
+ </Typography>
344
+ <Switch
345
+ label="Sofort Banking"
346
+ selected={settings.enableSofort !== false}
347
+ onChange={() =>
348
+ onPaymentMethodToggle(
349
+ "enableSofort",
350
+ !settings.enableSofort
351
+ )
352
+ }
353
+ />
354
+ </Flex>
355
+
356
+ <Flex
357
+ direction="row"
358
+ justifyContent="space-between"
359
+ alignItems="center"
360
+ gap={4}
361
+ >
362
+ <Typography variant="omega" fontWeight="semiBold">
363
+ SEPA Direct Debit
364
+ </Typography>
365
+ <Switch
366
+ label="SEPA Direct Debit"
367
+ selected={settings.enableSepaDirectDebit !== false}
368
+ onChange={() =>
369
+ onPaymentMethodToggle(
370
+ "enableSepaDirectDebit",
371
+ !settings.enableSepaDirectDebit
372
+ )
373
+ }
374
+ />
375
+ </Flex>
376
+ </Stack>
377
+ <Flex
378
+ direction="row"
379
+ gap={2}
380
+ wrap="wrap"
381
+ alignItems="flex-start"
382
+ marginTop={2}
383
+ >
384
+ <Button
385
+ variant="secondary"
386
+ startIcon={<Cog />}
387
+ onClick={handleNavigateToApplePayConfig}
388
+ className="payment-button"
389
+ >
390
+ Apple Pay Config
391
+ </Button>
392
+ <Button
393
+ variant="secondary"
394
+ startIcon={<Cog />}
395
+ onClick={handleNavigateToGooglePayConfig}
396
+ className="payment-button"
397
+ >
398
+ Google Pay Config
399
+ </Button>
400
+ </Flex>
401
+ </Stack>
402
+ </CardBody>
403
+ </Card>
404
+ </Box>
405
+ );
406
+ };
407
+
408
+ export default ConfigurationFields;
@@ -0,0 +1,67 @@
1
+ import { Box, Flex, Typography } from "@strapi/design-system";
2
+ import ConfigurationFields from "./ConfigurationFields.jsx";
3
+ import TestConnection from "./TestConnection.jsx";
4
+
5
+ const ConfigurationPanel = ({
6
+ settings,
7
+ isTesting,
8
+ testResult,
9
+ onTestConnection,
10
+ onInputChange,
11
+ onPaymentMethodToggle,
12
+ }) => {
13
+ return (
14
+ <Box
15
+ className="payment-container"
16
+ paddingTop={8}
17
+ paddingBottom={8}
18
+ paddingLeft={8}
19
+ paddingRight={8}
20
+ >
21
+ <Flex direction="column" alignItems="stretch" gap={8}>
22
+ <Box>
23
+ <Typography
24
+ variant="beta"
25
+ as="h2"
26
+ fontWeight="bold"
27
+ className="payment-title"
28
+ style={{ fontSize: "20px", marginBottom: "4px" }}
29
+ >
30
+ Payone API Configuration
31
+ </Typography>
32
+ <Typography
33
+ variant="pi"
34
+ textColor="neutral600"
35
+ marginTop={2}
36
+ className="payment-subtitle"
37
+ style={{ fontSize: "14px" }}
38
+ >
39
+ Configure your Payone payment gateway settings
40
+ </Typography>
41
+ </Box>
42
+
43
+ <ConfigurationFields
44
+ settings={settings}
45
+ onInputChange={onInputChange}
46
+ onPaymentMethodToggle={onPaymentMethodToggle}
47
+ />
48
+
49
+ <TestConnection
50
+ settings={settings}
51
+ isTesting={isTesting}
52
+ testResult={testResult}
53
+ onTestConnection={onTestConnection}
54
+ />
55
+
56
+ <Box paddingTop={4}>
57
+ <Typography variant="sigma" textColor="neutral600">
58
+ Note: These settings are used for all Payone API requests. Make sure
59
+ to use the correct credentials for your selected mode.
60
+ </Typography>
61
+ </Box>
62
+ </Flex>
63
+ </Box>
64
+ );
65
+ };
66
+
67
+ export default ConfigurationPanel;