strapi-plugin-payone-provider 5.7.26 → 5.8.26

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 (83) hide show
  1. package/README.md +1191 -1191
  2. package/admin/src/components/Initializer/index.jsx +16 -16
  3. package/admin/src/components/PluginIcon/index.jsx +17 -17
  4. package/admin/src/index.js +57 -57
  5. package/admin/src/pages/App/components/AppHeader.jsx +45 -45
  6. package/admin/src/pages/App/components/AppTabs.jsx +105 -105
  7. package/admin/src/pages/App/components/ApplePayBtn.jsx +355 -355
  8. package/admin/src/pages/App/components/ApplePayConfig.jsx +357 -357
  9. package/admin/src/pages/App/components/DocsPanel.jsx +53 -53
  10. package/admin/src/pages/App/components/RenderInput.jsx +78 -78
  11. package/admin/src/pages/App/components/StatusBadge.jsx +87 -87
  12. package/admin/src/pages/App/components/icons/BankIcon.jsx +10 -10
  13. package/admin/src/pages/App/components/icons/ChevronDownIcon.jsx +9 -9
  14. package/admin/src/pages/App/components/icons/ChevronUpIcon.jsx +9 -9
  15. package/admin/src/pages/App/components/icons/CreditCardIcon.jsx +9 -9
  16. package/admin/src/pages/App/components/icons/ErrorIcon.jsx +10 -10
  17. package/admin/src/pages/App/components/icons/InfoIcon.jsx +9 -9
  18. package/admin/src/pages/App/components/icons/MarkCircle.jsx +19 -19
  19. package/admin/src/pages/App/components/icons/PaymentIcon.jsx +10 -10
  20. package/admin/src/pages/App/components/icons/PendingIcon.jsx +9 -9
  21. package/admin/src/pages/App/components/icons/PersonIcon.jsx +9 -9
  22. package/admin/src/pages/App/components/icons/SuccessIcon.jsx +9 -9
  23. package/admin/src/pages/App/components/icons/WalletIcon.jsx +9 -9
  24. package/admin/src/pages/App/components/icons/index.jsx +12 -12
  25. package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +334 -334
  26. package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +120 -120
  27. package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +183 -183
  28. package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +315 -315
  29. package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +129 -129
  30. package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +273 -273
  31. package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +114 -114
  32. package/admin/src/pages/App/components/transaction-history/ImportExportBar.jsx +153 -153
  33. package/admin/src/pages/App/components/transaction-history/details/TransactionHistoryItem.jsx +526 -526
  34. package/admin/src/pages/App/index.jsx +96 -96
  35. package/admin/src/pages/App/styles.css +176 -176
  36. package/admin/src/pages/constants/paymentConstants.js +71 -71
  37. package/admin/src/pages/hooks/use-system-theme.js +27 -27
  38. package/admin/src/pages/hooks/usePaymentActions.js +498 -498
  39. package/admin/src/pages/hooks/usePluginTranslations.js +12 -12
  40. package/admin/src/pages/hooks/useSettings.js +183 -183
  41. package/admin/src/pages/hooks/useTransactionHistory.js +148 -148
  42. package/admin/src/pages/utils/api.js +97 -97
  43. package/admin/src/pages/utils/applePayConstants.js +196 -196
  44. package/admin/src/pages/utils/formatTransactionData.js +15 -15
  45. package/admin/src/pages/utils/getInputComponent.jsx +200 -200
  46. package/admin/src/pages/utils/paymentUtils.js +661 -661
  47. package/admin/src/pages/utils/tooltipHelpers.js +18 -18
  48. package/admin/src/pages/utils/transactionTableUtils.js +71 -71
  49. package/admin/src/pluginId.js +9 -9
  50. package/admin/src/translations/de.json +235 -235
  51. package/admin/src/translations/en.json +235 -235
  52. package/admin/src/translations/fr.json +235 -235
  53. package/admin/src/translations/ru.json +235 -235
  54. package/admin/src/utils/prefixPluginTranslations.js +13 -13
  55. package/package.json +45 -45
  56. package/server/bootstrap.js +107 -107
  57. package/server/config/index.js +83 -83
  58. package/server/content-types/index.js +4 -4
  59. package/server/content-types/transactions/index.js +4 -4
  60. package/server/content-types/transactions/schema.json +86 -86
  61. package/server/controllers/index.js +7 -7
  62. package/server/controllers/payone.js +503 -506
  63. package/server/destroy.js +5 -5
  64. package/server/index.js +23 -23
  65. package/server/policies/index.js +7 -7
  66. package/server/policies/is-auth.js +29 -29
  67. package/server/policies/isSuperAdmin.js +20 -20
  68. package/server/register.js +5 -5
  69. package/server/routes/index.js +218 -218
  70. package/server/services/applePayService.js +295 -295
  71. package/server/services/index.js +9 -9
  72. package/server/services/paymentService.js +264 -223
  73. package/server/services/payone.js +78 -78
  74. package/server/services/settingsService.js +59 -59
  75. package/server/services/testConnectionService.js +115 -115
  76. package/server/services/transactionService.js +262 -262
  77. package/server/utils/csvTransactions.js +82 -82
  78. package/server/utils/normalize.js +39 -39
  79. package/server/utils/paymentMethodParams.js +288 -288
  80. package/server/utils/requestBuilder.js +115 -100
  81. package/server/utils/responseParser.js +141 -141
  82. package/strapi-admin.js +4 -4
  83. package/strapi-server.js +3 -3
package/server/destroy.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";
2
-
3
- module.exports = ({ strapi }) => {
4
- // Cleanup when plugin is destroyed
5
- };
1
+ "use strict";
2
+
3
+ module.exports = ({ strapi }) => {
4
+ // Cleanup when plugin is destroyed
5
+ };
package/server/index.js CHANGED
@@ -1,23 +1,23 @@
1
- "use strict";
2
-
3
- const register = require("./register");
4
- const bootstrap = require("./bootstrap");
5
- const destroy = require("./destroy");
6
- const config = require("./config");
7
- const controllers = require("./controllers");
8
- const routes = require("./routes");
9
- const services = require("./services");
10
- const policies = require("./policies");
11
- const contentTypes = require("./content-types");
12
-
13
- module.exports = {
14
- register,
15
- bootstrap,
16
- destroy,
17
- config,
18
- controllers,
19
- contentTypes,
20
- routes,
21
- services,
22
- policies
23
- };
1
+ "use strict";
2
+
3
+ const register = require("./register");
4
+ const bootstrap = require("./bootstrap");
5
+ const destroy = require("./destroy");
6
+ const config = require("./config");
7
+ const controllers = require("./controllers");
8
+ const routes = require("./routes");
9
+ const services = require("./services");
10
+ const policies = require("./policies");
11
+ const contentTypes = require("./content-types");
12
+
13
+ module.exports = {
14
+ register,
15
+ bootstrap,
16
+ destroy,
17
+ config,
18
+ controllers,
19
+ contentTypes,
20
+ routes,
21
+ services,
22
+ policies
23
+ };
@@ -1,7 +1,7 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- "is-auth": require("./is-auth"),
5
- "is-super-admin": require("./isSuperAdmin"),
6
- "is-payone-notification": require("./is-payone-notification")
7
- };
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ "is-auth": require("./is-auth"),
5
+ "is-super-admin": require("./isSuperAdmin"),
6
+ "is-payone-notification": require("./is-payone-notification")
7
+ };
@@ -1,29 +1,29 @@
1
- "use strict";
2
-
3
- module.exports = async (policyContext, config, { strapi }) => {
4
- const { authorization } = policyContext.request.header || {};
5
-
6
- if (authorization && authorization.startsWith("Bearer ")) {
7
- const token = authorization.split(" ")[1];
8
-
9
- try {
10
- const apiTokenService = strapi.service("admin::api-token");
11
-
12
- if (!apiTokenService) {
13
- strapi.log.warn("strapi-plugin-payone-provider: api-token service not found");
14
- return false;
15
- }
16
-
17
- const accessKey = await apiTokenService.hash(token);
18
- const storedToken = await apiTokenService.getBy({ accessKey });
19
-
20
- if (storedToken) {
21
- return true;
22
- }
23
- } catch (e) {
24
- strapi.log.warn("strapi-plugin-payone-provider isAuth policy error:", e.message);
25
- }
26
- }
27
-
28
- return false;
29
- };
1
+ "use strict";
2
+
3
+ module.exports = async (policyContext, config, { strapi }) => {
4
+ const { authorization } = policyContext.request.header || {};
5
+
6
+ if (authorization && authorization.startsWith("Bearer ")) {
7
+ const token = authorization.split(" ")[1];
8
+
9
+ try {
10
+ const apiTokenService = strapi.service("admin::api-token");
11
+
12
+ if (!apiTokenService) {
13
+ strapi.log.warn("strapi-plugin-payone-provider: api-token service not found");
14
+ return false;
15
+ }
16
+
17
+ const accessKey = await apiTokenService.hash(token);
18
+ const storedToken = await apiTokenService.getBy({ accessKey });
19
+
20
+ if (storedToken) {
21
+ return true;
22
+ }
23
+ } catch (e) {
24
+ strapi.log.warn("strapi-plugin-payone-provider isAuth policy error:", e.message);
25
+ }
26
+ }
27
+
28
+ return false;
29
+ };
@@ -1,20 +1,20 @@
1
- "use strict";
2
-
3
- module.exports = async (policyContext, config, { strapi }) => {
4
- const adminUser = policyContext.state && policyContext.state.user;
5
-
6
- if (!adminUser) {
7
- policyContext.unauthorized("Admin authentication required");
8
- return false;
9
- }
10
-
11
- const roles = Array.isArray(adminUser.roles) ? adminUser.roles : [];
12
- const isSuperAdmin = roles.some((role) => role.code === "strapi-super-admin");
13
-
14
- if (!isSuperAdmin) {
15
- policyContext.forbidden("Only super admins can access this resource");
16
- return false;
17
- }
18
-
19
- return true;
20
- };
1
+ "use strict";
2
+
3
+ module.exports = async (policyContext, config, { strapi }) => {
4
+ const adminUser = policyContext.state && policyContext.state.user;
5
+
6
+ if (!adminUser) {
7
+ policyContext.unauthorized("Admin authentication required");
8
+ return false;
9
+ }
10
+
11
+ const roles = Array.isArray(adminUser.roles) ? adminUser.roles : [];
12
+ const isSuperAdmin = roles.some((role) => role.code === "strapi-super-admin");
13
+
14
+ if (!isSuperAdmin) {
15
+ policyContext.forbidden("Only super admins can access this resource");
16
+ return false;
17
+ }
18
+
19
+ return true;
20
+ };
@@ -1,5 +1,5 @@
1
- "use strict";
2
-
3
- module.exports = ({ strapi }) => {
4
- // Register the plugin with Strapi
5
- };
1
+ "use strict";
2
+
3
+ module.exports = ({ strapi }) => {
4
+ // Register the plugin with Strapi
5
+ };
@@ -1,218 +1,218 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- admin: {
5
- type: "admin",
6
- routes: [
7
- {
8
- method: "GET",
9
- path: "/settings",
10
- handler: "payone.getSettings",
11
- config: {
12
- policies: ["admin::isAuthenticatedAdmin"]
13
- }
14
- },
15
- {
16
- method: "PUT",
17
- path: "/settings",
18
- handler: "payone.updateSettings",
19
- config: {
20
- policies: ["admin::isAuthenticatedAdmin"]
21
- }
22
- },
23
- {
24
- method: "GET",
25
- path: "/transaction-history",
26
- handler: "payone.getTransactionHistory",
27
- config: {
28
- policies: ["admin::isAuthenticatedAdmin"]
29
- }
30
- },
31
- {
32
- method: "GET",
33
- path: "/transactions/export",
34
- handler: "payone.exportTransactions",
35
- config: {
36
- policies: ["admin::isAuthenticatedAdmin"]
37
- }
38
- },
39
- {
40
- method: "POST",
41
- path: "/transactions/import",
42
- handler: "payone.importTransactions",
43
- config: {
44
- policies: ["admin::isAuthenticatedAdmin"]
45
- }
46
- },
47
- {
48
- method: "POST",
49
- path: "/test-connection",
50
- handler: "payone.testConnection",
51
- config: {
52
- policies: ["admin::isAuthenticatedAdmin"]
53
- }
54
- },
55
- {
56
- method: "POST",
57
- path: "/preauthorization",
58
- handler: "payone.preauthorization",
59
- config: {
60
- policies: ["admin::isAuthenticatedAdmin"]
61
- }
62
- },
63
- {
64
- method: "POST",
65
- path: "/authorization",
66
- handler: "payone.authorization",
67
- config: {
68
- policies: ["admin::isAuthenticatedAdmin"]
69
- }
70
- },
71
- {
72
- method: "POST",
73
- path: "/capture",
74
- handler: "payone.capture",
75
- config: {
76
- policies: ["admin::isAuthenticatedAdmin"]
77
- }
78
- },
79
- {
80
- method: "POST",
81
- path: "/refund",
82
- handler: "payone.refund",
83
- config: {
84
- policies: ["admin::isAuthenticatedAdmin"]
85
- }
86
- },
87
- {
88
- method: "POST",
89
- path: "/3ds-callback",
90
- handler: "payone.handle3DSCallback",
91
- config: {
92
- policies: ["admin::isAuthenticatedAdmin"]
93
- }
94
- },
95
- {
96
- method: "POST",
97
- path: "/validate-apple-pay-merchant",
98
- handler: "payone.validateApplePayMerchant",
99
- config: {
100
- policies: ["admin::isAuthenticatedAdmin"]
101
- }
102
- },
103
- {
104
- method: "POST",
105
- path: "/hash384",
106
- handler: "payone.hash384",
107
- config: {
108
- policies: ["admin::isAuthenticatedAdmin"]
109
- }
110
- }
111
- ]
112
- },
113
-
114
- "content-api": {
115
- type: "content-api",
116
- routes: [
117
- {
118
- method: "GET",
119
- path: "/settings",
120
- handler: "payone.getPublicSettings",
121
- config: {
122
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
123
- auth: false
124
- }
125
- },
126
- {
127
- method: "POST",
128
- path: "/preauthorization",
129
- handler: "payone.preauthorization",
130
- config: {
131
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
132
- auth: false
133
- }
134
- },
135
- {
136
- method: "POST",
137
- path: "/authorization",
138
- handler: "payone.authorization",
139
- config: {
140
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
141
- auth: false
142
- }
143
- },
144
- {
145
- method: "POST",
146
- path: "/capture",
147
- handler: "payone.capture",
148
- config: {
149
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
150
- auth: false
151
- }
152
- },
153
- {
154
- method: "POST",
155
- path: "/refund",
156
- handler: "payone.refund",
157
- config: {
158
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
159
- auth: false
160
- }
161
- },
162
- {
163
- method: "POST",
164
- path: "/test-connection",
165
- handler: "payone.testConnection",
166
- config: {
167
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
168
- auth: false
169
- }
170
- },
171
- {
172
- method: "POST",
173
- path: "/3ds-callback",
174
- handler: "payone.handle3DSCallback",
175
- config: {
176
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
177
- auth: false
178
- }
179
- },
180
- {
181
- method: "POST",
182
- path: "/validate-apple-pay-merchant",
183
- handler: "payone.validateApplePayMerchant",
184
- config: {
185
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
186
- auth: false
187
- }
188
- },
189
- {
190
- method: "POST",
191
- path: "/hosted-tokenization/jwt",
192
- handler: "payone.hostedTokenizationJwt",
193
- config: {
194
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
195
- auth: false
196
- }
197
- },
198
- {
199
- method: "POST",
200
- path: "/hash384",
201
- handler: "payone.hash384",
202
- config: {
203
- policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
204
- auth: false
205
- }
206
- },
207
- {
208
- method: "POST",
209
- path: "/transaction-status",
210
- handler: "payone.handleTransactionStatus",
211
- config: {
212
- // policies: ["plugin::strapi-plugin-payone-provider.is-payone-notification"],
213
- auth: false
214
- }
215
- }
216
- ]
217
- }
218
- };
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ admin: {
5
+ type: "admin",
6
+ routes: [
7
+ {
8
+ method: "GET",
9
+ path: "/settings",
10
+ handler: "payone.getSettings",
11
+ config: {
12
+ policies: ["admin::isAuthenticatedAdmin"]
13
+ }
14
+ },
15
+ {
16
+ method: "PUT",
17
+ path: "/settings",
18
+ handler: "payone.updateSettings",
19
+ config: {
20
+ policies: ["admin::isAuthenticatedAdmin"]
21
+ }
22
+ },
23
+ {
24
+ method: "GET",
25
+ path: "/transaction-history",
26
+ handler: "payone.getTransactionHistory",
27
+ config: {
28
+ policies: ["admin::isAuthenticatedAdmin"]
29
+ }
30
+ },
31
+ {
32
+ method: "GET",
33
+ path: "/transactions/export",
34
+ handler: "payone.exportTransactions",
35
+ config: {
36
+ policies: ["admin::isAuthenticatedAdmin"]
37
+ }
38
+ },
39
+ {
40
+ method: "POST",
41
+ path: "/transactions/import",
42
+ handler: "payone.importTransactions",
43
+ config: {
44
+ policies: ["admin::isAuthenticatedAdmin"]
45
+ }
46
+ },
47
+ {
48
+ method: "POST",
49
+ path: "/test-connection",
50
+ handler: "payone.testConnection",
51
+ config: {
52
+ policies: ["admin::isAuthenticatedAdmin"]
53
+ }
54
+ },
55
+ {
56
+ method: "POST",
57
+ path: "/preauthorization",
58
+ handler: "payone.preauthorization",
59
+ config: {
60
+ policies: ["admin::isAuthenticatedAdmin"]
61
+ }
62
+ },
63
+ {
64
+ method: "POST",
65
+ path: "/authorization",
66
+ handler: "payone.authorization",
67
+ config: {
68
+ policies: ["admin::isAuthenticatedAdmin"]
69
+ }
70
+ },
71
+ {
72
+ method: "POST",
73
+ path: "/capture",
74
+ handler: "payone.capture",
75
+ config: {
76
+ policies: ["admin::isAuthenticatedAdmin"]
77
+ }
78
+ },
79
+ {
80
+ method: "POST",
81
+ path: "/refund",
82
+ handler: "payone.refund",
83
+ config: {
84
+ policies: ["admin::isAuthenticatedAdmin"]
85
+ }
86
+ },
87
+ {
88
+ method: "POST",
89
+ path: "/3ds-callback",
90
+ handler: "payone.handle3DSCallback",
91
+ config: {
92
+ policies: ["admin::isAuthenticatedAdmin"]
93
+ }
94
+ },
95
+ {
96
+ method: "POST",
97
+ path: "/validate-apple-pay-merchant",
98
+ handler: "payone.validateApplePayMerchant",
99
+ config: {
100
+ policies: ["admin::isAuthenticatedAdmin"]
101
+ }
102
+ },
103
+ {
104
+ method: "POST",
105
+ path: "/hash384",
106
+ handler: "payone.hash384",
107
+ config: {
108
+ policies: ["admin::isAuthenticatedAdmin"]
109
+ }
110
+ }
111
+ ]
112
+ },
113
+
114
+ "content-api": {
115
+ type: "content-api",
116
+ routes: [
117
+ {
118
+ method: "GET",
119
+ path: "/settings",
120
+ handler: "payone.getPublicSettings",
121
+ config: {
122
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
123
+ auth: false
124
+ }
125
+ },
126
+ {
127
+ method: "POST",
128
+ path: "/preauthorization",
129
+ handler: "payone.preauthorization",
130
+ config: {
131
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
132
+ auth: false
133
+ }
134
+ },
135
+ {
136
+ method: "POST",
137
+ path: "/authorization",
138
+ handler: "payone.authorization",
139
+ config: {
140
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
141
+ auth: false
142
+ }
143
+ },
144
+ {
145
+ method: "POST",
146
+ path: "/capture",
147
+ handler: "payone.capture",
148
+ config: {
149
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
150
+ auth: false
151
+ }
152
+ },
153
+ {
154
+ method: "POST",
155
+ path: "/refund",
156
+ handler: "payone.refund",
157
+ config: {
158
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
159
+ auth: false
160
+ }
161
+ },
162
+ {
163
+ method: "POST",
164
+ path: "/test-connection",
165
+ handler: "payone.testConnection",
166
+ config: {
167
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
168
+ auth: false
169
+ }
170
+ },
171
+ {
172
+ method: "POST",
173
+ path: "/3ds-callback",
174
+ handler: "payone.handle3DSCallback",
175
+ config: {
176
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
177
+ auth: false
178
+ }
179
+ },
180
+ {
181
+ method: "POST",
182
+ path: "/validate-apple-pay-merchant",
183
+ handler: "payone.validateApplePayMerchant",
184
+ config: {
185
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
186
+ auth: false
187
+ }
188
+ },
189
+ {
190
+ method: "POST",
191
+ path: "/hosted-tokenization/jwt",
192
+ handler: "payone.hostedTokenizationJwt",
193
+ config: {
194
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
195
+ auth: false
196
+ }
197
+ },
198
+ {
199
+ method: "POST",
200
+ path: "/hash384",
201
+ handler: "payone.hash384",
202
+ config: {
203
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
204
+ auth: false
205
+ }
206
+ },
207
+ {
208
+ method: "POST",
209
+ path: "/transaction-status",
210
+ handler: "payone.handleTransactionStatus",
211
+ config: {
212
+ // policies: ["plugin::strapi-plugin-payone-provider.is-payone-notification"],
213
+ auth: false
214
+ }
215
+ }
216
+ ]
217
+ }
218
+ };