strapi-plugin-payone-provider 4.6.9 → 5.6.9

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 (99) hide show
  1. package/README.md +24 -11
  2. package/admin/src/components/Initializer/index.jsx +3 -3
  3. package/admin/src/components/PluginIcon/index.jsx +3 -3
  4. package/admin/src/index.js +33 -11
  5. package/admin/src/pages/App/components/AppHeader.jsx +17 -32
  6. package/admin/src/pages/App/components/AppTabs.jsx +36 -162
  7. package/admin/src/pages/App/components/ApplePayBtn.jsx +9 -11
  8. package/admin/src/pages/App/components/ApplePayConfig.jsx +221 -161
  9. package/admin/src/pages/App/components/ApplePayConfigPanel.jsx +33 -45
  10. package/admin/src/pages/App/components/DocsPanel.jsx +66 -1726
  11. package/admin/src/pages/App/components/GooglePayConfig.jsx +136 -169
  12. package/admin/src/pages/App/components/GooglePayConfigPanel.jsx +37 -55
  13. package/admin/src/pages/App/components/GooglePaybutton.jsx +101 -43
  14. package/admin/src/pages/App/components/RenderInput.jsx +94 -0
  15. package/admin/src/pages/App/components/StatusBadge.jsx +24 -71
  16. package/admin/src/pages/App/components/configuration/ConfigurationFields.jsx +255 -0
  17. package/admin/src/pages/App/components/configuration/ConfigurationPanel.jsx +54 -0
  18. package/admin/src/pages/App/components/configuration/TestConnection.jsx +130 -0
  19. package/admin/src/pages/App/components/docs/ApplePaySection.jsx +260 -0
  20. package/admin/src/pages/App/components/docs/BaseUrlSection.jsx +53 -0
  21. package/admin/src/pages/App/components/docs/CaptureRefundSection.jsx +113 -0
  22. package/admin/src/pages/App/components/docs/CodeBlock.jsx +59 -0
  23. package/admin/src/pages/App/components/docs/CreditCardSection.jsx +93 -0
  24. package/admin/src/pages/App/components/docs/GooglePaySection.jsx +248 -0
  25. package/admin/src/pages/App/components/docs/PayPalSection.jsx +116 -0
  26. package/admin/src/pages/App/components/docs/PaymentMethodsSection.jsx +55 -0
  27. package/admin/src/pages/App/components/docs/TableOfContents.jsx +47 -0
  28. package/admin/src/pages/App/components/docs/TestCredentialsSection.jsx +304 -0
  29. package/admin/src/pages/App/components/docs/ThreeDSecureSection.jsx +188 -0
  30. package/admin/src/pages/App/components/icons/BankIcon.jsx +1 -1
  31. package/admin/src/pages/App/components/icons/ChevronDownIcon.jsx +1 -1
  32. package/admin/src/pages/App/components/icons/ChevronUpIcon.jsx +1 -1
  33. package/admin/src/pages/App/components/icons/CreditCardIcon.jsx +1 -1
  34. package/admin/src/pages/App/components/icons/ErrorIcon.jsx +1 -1
  35. package/admin/src/pages/App/components/icons/InfoIcon.jsx +1 -1
  36. package/admin/src/pages/App/components/icons/MarkCircle.jsx +19 -0
  37. package/admin/src/pages/App/components/icons/PaymentIcon.jsx +1 -1
  38. package/admin/src/pages/App/components/icons/PendingIcon.jsx +1 -1
  39. package/admin/src/pages/App/components/icons/PersonIcon.jsx +1 -1
  40. package/admin/src/pages/App/components/icons/SuccessIcon.jsx +1 -1
  41. package/admin/src/pages/App/components/icons/WalletIcon.jsx +1 -1
  42. package/admin/src/pages/App/components/payment-actions/ApplePayPanel.jsx +51 -0
  43. package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +341 -0
  44. package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +128 -0
  45. package/admin/src/pages/App/components/{paymentActions → payment-actions}/CardDetailsInput.jsx +77 -72
  46. package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +194 -0
  47. package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +313 -0
  48. package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +133 -0
  49. package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +280 -0
  50. package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +121 -0
  51. package/admin/src/pages/App/components/transaction-history/FiltersPanel.jsx +145 -0
  52. package/admin/src/pages/App/components/transaction-history/HistoryPanel.jsx +50 -0
  53. package/admin/src/pages/App/components/transaction-history/TransactionTable.jsx +163 -0
  54. package/admin/src/pages/App/components/transaction-history/details/TransactionDetails.jsx +156 -0
  55. package/admin/src/pages/App/components/{TransactionHistoryItem.jsx → transaction-history/details/TransactionHistoryItem.jsx} +16 -28
  56. package/admin/src/pages/App/index.jsx +27 -70
  57. package/admin/src/pages/App/styles.css +46 -169
  58. package/admin/src/pages/constants/paymentConstants.js +52 -16
  59. package/admin/src/pages/hooks/use-system-theme.js +27 -0
  60. package/admin/src/pages/hooks/usePaymentActions.js +273 -210
  61. package/admin/src/pages/hooks/useSettings.js +87 -48
  62. package/admin/src/pages/hooks/useTransactionHistory.js +105 -108
  63. package/admin/src/pages/utils/api.js +57 -72
  64. package/admin/src/pages/utils/applePayConstants.js +2 -28
  65. package/admin/src/pages/utils/countryLanguageUtils.js +280 -0
  66. package/admin/src/pages/utils/getInputComponent.jsx +225 -0
  67. package/admin/src/pages/utils/googlePayConstants.js +2 -9
  68. package/admin/src/pages/utils/paymentUtils.js +13 -25
  69. package/admin/src/pages/utils/tooltipHelpers.js +18 -0
  70. package/admin/src/pages/utils/transactionTableUtils.js +60 -0
  71. package/package.json +8 -14
  72. package/server/config/index.js +18 -2
  73. package/server/controllers/payone.js +80 -31
  74. package/server/policies/is-auth.js +9 -3
  75. package/server/policies/isSuperAdmin.js +7 -5
  76. package/server/services/paymentService.js +6 -22
  77. package/server/services/payone.js +3 -3
  78. package/server/services/settingsService.js +13 -3
  79. package/server/services/testConnectionService.js +11 -73
  80. package/server/services/transactionService.js +63 -98
  81. package/server/utils/normalize.js +0 -12
  82. package/server/utils/paymentMethodParams.js +0 -1
  83. package/server/utils/responseParser.js +9 -14
  84. package/strapi-admin.js +3 -1
  85. package/admin/src/pages/App/components/ConfigurationPanel.jsx +0 -517
  86. package/admin/src/pages/App/components/CustomerInfoPopover.jsx +0 -147
  87. package/admin/src/pages/App/components/HistoryPanel.jsx +0 -94
  88. package/admin/src/pages/App/components/PaymentActionsPanel.jsx +0 -280
  89. package/admin/src/pages/App/components/RawDataPopover.jsx +0 -113
  90. package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTableFilters.jsx +0 -113
  91. package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTablePagination.jsx +0 -180
  92. package/admin/src/pages/App/components/TransactionHistoryTable/index.jsx +0 -225
  93. package/admin/src/pages/App/components/paymentActions/ApplePayPanel.jsx +0 -95
  94. package/admin/src/pages/App/components/paymentActions/AuthorizationForm.jsx +0 -197
  95. package/admin/src/pages/App/components/paymentActions/CaptureForm.jsx +0 -65
  96. package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +0 -306
  97. package/admin/src/pages/App/components/paymentActions/PaymentResult.jsx +0 -192
  98. package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +0 -142
  99. package/admin/src/pages/App/components/paymentActions/RefundForm.jsx +0 -90
@@ -1,4 +1,7 @@
1
- /* Payment System UI - Minimalistic & Professional Styles */
1
+ [data-state="inactive"],
2
+ [data-state="active"] {
3
+ background: transparent !important;
4
+ }
2
5
 
3
6
  /* ===== Global Animations ===== */
4
7
  @keyframes fadeIn {
@@ -47,83 +50,68 @@
47
50
  }
48
51
  }
49
52
 
50
- /* ===== Container Styles ===== */
51
-
52
- /* ===== Card Styles ===== */
53
- .payment-card {
54
- transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
55
- }
56
-
57
53
 
58
- /* ===== Button Styles ===== */
59
- .payment-button {
60
- border-radius: 8px;
61
- font-weight: 500;
62
- letter-spacing: 0.01em;
54
+ /* Tab Button Base Styles */
55
+ button[role="tab"] {
56
+ box-shadow: none !important;
63
57
  border: none !important;
64
- }
58
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
59
+ position: relative;
60
+ background: transparent !important;
61
+ outline: none !important;
62
+ transform: scale(1) !important;
65
63
 
66
- .payment-button-primary {
67
- background: linear-gradient(135deg, #4945ff 0%, #7b3af4 100%);
68
- color: white;
69
64
  }
70
65
 
71
66
 
72
- .payment-button-success {
73
- background: linear-gradient(135deg, #10b981 0%, #059669 100%);
74
- color: white;
75
- }
76
67
 
77
- .payment-button-primary:hover {
78
- background: linear-gradient(135deg, #4945ff 0%, #7b3af4 100%);
79
- color: white;
68
+ button[role="tab"]:active {
69
+ transform: scale(1) !important;
80
70
  }
81
71
 
82
-
83
- .payment-button-success:hover {
84
- background: linear-gradient(135deg, #10b981 0%, #059669 100%);
85
- color: white;
72
+ /* Remove shake animation */
73
+ button[role="tab"]:focus,
74
+ button[role="tab"]:focus-visible {
75
+ outline: none !important;
76
+ box-shadow: none !important;
77
+ transform: none !important;
86
78
  }
87
79
 
88
-
89
- /* ===== Input Styles ===== */
90
- .payment-input {
91
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
92
- border-radius: 8px;
80
+ button[role="tab"][data-state="active"] {
81
+ background: linear-gradient(180deg, rgba(73, 69, 255, 0.05) 0%, transparent 100%) !important;
82
+ color: #4945ff !important;
83
+ font-weight: 600 !important;
84
+ box-shadow: none !important;
85
+ border: none !important;
93
86
  }
94
87
 
95
- .payment-input:focus-within {
96
- border-color: #4945ff;
97
- box-shadow: 0 0 0 3px rgba(73, 69, 255, 0.1);
88
+ button[role="tab"][data-state="inactive"] {
89
+ background: transparent !important;
90
+ color: #6b7280 !important;
91
+ box-shadow: none !important;
92
+ border: none !important;
98
93
  }
99
94
 
100
- /* ===== Tab Styles ===== */
101
- .payment-tab {
102
- transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
103
- position: relative;
104
- padding: 12px 20px;
105
- font-weight: 500;
106
- color: #6b7280;
95
+ button[role="tab"][data-state="inactive"]::after {
96
+ background: transparent;
107
97
  }
108
98
 
109
- .payment-tab:hover {
110
- color: #4945ff;
99
+ button[role="tab"][data-state="inactive"]:hover {
100
+ background: linear-gradient(180deg, rgba(73, 69, 255, 0.02) 0%, transparent 100%) !important;
101
+ box-shadow: none !important;
111
102
  }
112
103
 
113
- .payment-tab-active {
114
- color: #4945ff;
115
- font-weight: 600;
116
- }
104
+ /* Border animation */
105
+ @keyframes borderSlideIn {
106
+ 0% {
107
+ transform: scaleX(0);
108
+ opacity: 0;
109
+ }
117
110
 
118
- .payment-tab-active::after {
119
- content: '';
120
- position: absolute;
121
- bottom: -2px;
122
- left: 0;
123
- right: 0;
124
- height: 2px;
125
- background: linear-gradient(90deg, #4945ff 0%, #7b3af4 100%);
126
- animation: slideIn 0.3s ease-out;
111
+ 100% {
112
+ transform: scaleX(1);
113
+ opacity: 1;
114
+ }
127
115
  }
128
116
 
129
117
  /* ===== Form Section Styles ===== */
@@ -161,120 +149,9 @@
161
149
  animation: fadeIn 0.4s ease-out;
162
150
  }
163
151
 
164
- /* ===== Status Badge Styles ===== */
165
- .payment-status-badge {
166
- display: inline-flex;
167
- align-items: center;
168
- padding: 6px 12px;
169
- border-radius: 6px;
170
- font-size: 12px;
171
- font-weight: 500;
172
- letter-spacing: 0.02em;
173
- animation: fadeIn 0.3s ease-out;
174
- transition: all 0.2s ease;
175
- }
176
152
 
177
- .payment-status-badge:hover {
178
- transform: scale(1.05);
179
- }
180
153
 
181
- /* ===== Loading States ===== */
182
- .payment-loading {
183
- position: relative;
184
- overflow: hidden;
185
- }
186
154
 
187
- .payment-loading::after {
188
- content: '';
189
- position: absolute;
190
- top: 0;
191
- left: -100%;
192
- width: 100%;
193
- height: 100%;
194
- background: linear-gradient(90deg,
195
- transparent,
196
- rgba(255, 255, 255, 0.4),
197
- transparent);
198
- animation: shimmer 1.5s infinite;
199
- }
200
-
201
- /* ===== Alert/Notification Styles ===== */
202
- .payment-alert {
203
- animation: slideIn 0.3s ease-out;
204
- transition: all 0.2s ease;
205
- }
206
-
207
- .payment-alert:hover {
208
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
209
- }
210
-
211
- /* ===== Result Card Styles ===== */
212
- .payment-result-card {
213
- animation: fadeIn 0.5s ease-out;
214
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
215
- }
216
-
217
- .payment-result-card:hover {
218
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
219
- transform: translateY(-2px);
220
- }
221
-
222
- /* ===== Transaction Item Styles ===== */
223
- .payment-transaction-item {
224
- margin-bottom: 12px;
225
- animation: fadeIn 0.4s ease-out;
226
- cursor: pointer;
227
- }
228
-
229
- .payment-transaction-item:hover {
230
- box-shadow: 0 4px 12px rgba(73, 69, 255, 0.1);
231
- }
232
-
233
- /* ===== Typography Styles ===== */
234
- .payment-title {
235
- font-size: 24px;
236
- font-weight: 700;
237
- letter-spacing: -0.02em;
238
- margin-bottom: 8px;
239
- animation: fadeIn 0.4s ease-out;
240
- }
241
-
242
- .payment-subtitle {
243
- font-size: 15px;
244
- line-height: 1.6;
245
- animation: fadeIn 0.5s ease-out;
246
- }
247
-
248
- .payment-section-title {
249
- font-size: 16px;
250
- font-weight: 600;
251
- margin-bottom: 4px;
252
- letter-spacing: -0.01em;
253
- }
254
-
255
- /* ===== Grid & Layout ===== */
256
- .payment-grid {
257
- display: grid;
258
- gap: 20px;
259
- animation: fadeIn 0.5s ease-out;
260
- }
261
-
262
- .payment-grid-2 {
263
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
264
- }
265
-
266
- .payment-grid-3 {
267
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
268
- }
269
-
270
- /* ===== Smooth Transitions ===== */
271
-
272
- /* ===== Focus States ===== */
273
- .payment-focus:focus-visible {
274
- outline: 2px solid #4945ff;
275
- outline-offset: 2px;
276
- border-radius: 6px;
277
- }
278
155
 
279
156
  /* ===== Responsive ===== */
280
157
  @media (max-width: 768px) {
@@ -1,13 +1,4 @@
1
- /**
2
- * Default payment data for testing
3
- * Used across all payment operations
4
- *
5
- * Note: successurl, errorurl, and backurl are only required for:
6
- * - 3D Secure enabled credit card payments
7
- * - Redirect-based payment methods (PayPal, Google Pay, Apple Pay, Sofort)
8
- *
9
- * For non-redirect payments (3DS disabled credit card, SEPA), these URLs are optional
10
- */
1
+
11
2
  export const DEFAULT_PAYMENT_DATA = {
12
3
  firstname: "John",
13
4
  lastname: "Doe",
@@ -24,13 +15,58 @@ export const DEFAULT_PAYMENT_DATA = {
24
15
  language: "de"
25
16
  };
26
17
 
27
- /**
28
- * Default currency
29
- */
18
+
30
19
  export const DEFAULT_CURRENCY = "EUR";
31
20
 
32
- /**
33
- * Default page size for pagination
34
- */
21
+
35
22
  export const DEFAULT_PAGE_SIZE = 10;
36
23
 
24
+ export const filterOptions = [
25
+ {
26
+ name: "status",
27
+ label: "Status",
28
+ type: "enumeration",
29
+ options: [
30
+ { value: "APPROVED", label: "Approved" },
31
+ { value: "ERROR", label: "Error" },
32
+ { value: "REDIRECT", label: "Redirect" },
33
+ { value: "INVALID", label: "Invalid" },
34
+ { value: "PENDING", label: "Pending" },
35
+ { value: "CANCELLED", label: "Cancelled" },
36
+ ],
37
+ },
38
+ {
39
+ name: "request_type",
40
+ label: "Request Type",
41
+ type: "enumeration",
42
+ options: [
43
+ { value: "preauthorization", label: "Preauthorization" },
44
+ { value: "authorization", label: "Authorization" },
45
+ { value: "capture", label: "Capture" },
46
+ { value: "refund", label: "Refund" },
47
+ ],
48
+ },
49
+ {
50
+ name: "payment_method",
51
+ label: "Payment Method",
52
+ type: "enumeration",
53
+ options: [
54
+ { value: "credit_card", label: "Credit Card" },
55
+ { value: "paypal", label: "PayPal" },
56
+ { value: "google_pay", label: "Google Pay" },
57
+ { value: "apple_pay", label: "Apple Pay" },
58
+ { value: "sofort", label: "Sofort Banking" },
59
+ { value: "sepa", label: "SEPA Direct Debit" },
60
+ ],
61
+ },
62
+ {
63
+ name: "date_from",
64
+ label: "Date From",
65
+ type: "date",
66
+ },
67
+ {
68
+ name: "date_to",
69
+ label: "Date To",
70
+ type: "date",
71
+ },
72
+ ];
@@ -0,0 +1,27 @@
1
+
2
+ import { useEffect, useState } from 'react';
3
+
4
+ export function useSystemTheme() {
5
+ const getCurrentTheme = () =>
6
+ window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
7
+ ? 'dark'
8
+ : 'light';
9
+
10
+ const [theme, setTheme] = useState(getCurrentTheme);
11
+
12
+ useEffect(() => {
13
+ const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
14
+
15
+ const handleChange = () => {
16
+ setTheme(mediaQuery.matches ? 'dark' : 'light');
17
+ };
18
+
19
+ // Add event listener for changes
20
+ mediaQuery.addEventListener('change', handleChange);
21
+
22
+ // Cleanup listener on unmount
23
+ return () => mediaQuery.removeEventListener('change', handleChange);
24
+ }, []);
25
+
26
+ return theme;
27
+ }