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
@@ -1,107 +1,107 @@
1
- "use strict";
2
-
3
- module.exports = async ({ strapi }) => {
4
- const pluginStore = strapi.store({
5
- environment: "",
6
- type: "plugin",
7
- name: "strapi-plugin-payone-provider"
8
- });
9
-
10
- const settings = await pluginStore.get({ key: "settings" });
11
- if (!settings) {
12
- await pluginStore.set({
13
- key: "settings",
14
- value: {
15
- aid: "",
16
- portalid: "",
17
- mid: "",
18
- key: "",
19
- mode: "test",
20
- api_version: "3.10",
21
- merchantName: "",
22
- displayName: "",
23
- domainName: "",
24
- merchantIdentifier: "",
25
- enableCreditCard: false,
26
- enablePayPal: false,
27
- enableGooglePay: false,
28
- enableApplePay: false,
29
- enableSepaDirectDebit: false
30
- }
31
- });
32
- }
33
-
34
- const pluginName = "strapi-plugin-payone-provider";
35
-
36
- const getController = () => {
37
- return strapi.plugin(pluginName).controller("payone");
38
- };
39
-
40
- const routes = [
41
- "/admin/plugins/strapi-plugin-payone-provider/payment/success",
42
- "/admin/plugins/strapi-plugin-payone-provider/payment/error",
43
- "/admin/plugins/strapi-plugin-payone-provider/payment/back",
44
- "/content-ui/plugins/strapi-plugin-payone-provider/payment/success",
45
- "/content-ui/plugins/strapi-plugin-payone-provider/payment/error",
46
- "/content-ui/plugins/strapi-plugin-payone-provider/payment/back"
47
- ];
48
-
49
- try {
50
- const Router = require('@koa/router');
51
- const router = new Router();
52
- const fs = require('fs');
53
- const path = require('path');
54
-
55
- routes.forEach(route => {
56
- router.get(route, async (ctx) => {
57
- const controller = getController();
58
- return await controller.handle3DSCallback(ctx);
59
- });
60
- });
61
-
62
- router.get('/.well-known/apple-developer-merchantid-domain-association', async (ctx) => {
63
- try {
64
- const pluginRoot = path.resolve(__dirname, '..');
65
- const wellKnownPath = path.join(pluginRoot, '.well-known');
66
- const possiblePaths = [
67
- path.join(wellKnownPath, 'apple-developer-merchantid-domain-association'),
68
- path.join(wellKnownPath, 'apple-developer-merchantid-domain-association.txt'),
69
- path.join(wellKnownPath, 'apple-developer-merchant-id-domain-association.txt'),
70
- ];
71
-
72
- let fileContent = null;
73
- let filePathFound = null;
74
-
75
- for (const filePath of possiblePaths) {
76
- if (fs.existsSync(filePath)) {
77
- filePathFound = filePath;
78
- fileContent = fs.readFileSync(filePath, 'utf8');
79
- break;
80
- }
81
- }
82
-
83
- if (fileContent) {
84
- ctx.type = 'text/plain';
85
- ctx.set('Content-Type', 'text/plain');
86
- ctx.set('Cache-Control', 'public, max-age=31536000');
87
- ctx.body = fileContent.trim();
88
- } else {
89
- ctx.status = 404;
90
- ctx.type = 'text/plain';
91
- ctx.body = 'File not found';
92
- }
93
- } catch (error) {
94
- ctx.status = 500;
95
- ctx.type = 'text/plain';
96
- ctx.body = 'Internal server error';
97
- }
98
- });
99
-
100
- if (strapi.server.app && typeof strapi.server.app.use === 'function') {
101
- strapi.server.app.use(router.routes());
102
- strapi.server.app.use(router.allowedMethods());
103
- }
104
- } catch (error) {
105
- // Silent fail
106
- }
107
- };
1
+ "use strict";
2
+
3
+ module.exports = async ({ strapi }) => {
4
+ const pluginStore = strapi.store({
5
+ environment: "",
6
+ type: "plugin",
7
+ name: "strapi-plugin-payone-provider"
8
+ });
9
+
10
+ const settings = await pluginStore.get({ key: "settings" });
11
+ if (!settings) {
12
+ await pluginStore.set({
13
+ key: "settings",
14
+ value: {
15
+ aid: "",
16
+ portalid: "",
17
+ mid: "",
18
+ key: "",
19
+ mode: "test",
20
+ api_version: "3.10",
21
+ merchantName: "",
22
+ displayName: "",
23
+ domainName: "",
24
+ merchantIdentifier: "",
25
+ enableCreditCard: false,
26
+ enablePayPal: false,
27
+ enableGooglePay: false,
28
+ enableApplePay: false,
29
+ enableSepaDirectDebit: false
30
+ }
31
+ });
32
+ }
33
+
34
+ const pluginName = "strapi-plugin-payone-provider";
35
+
36
+ const getController = () => {
37
+ return strapi.plugin(pluginName).controller("payone");
38
+ };
39
+
40
+ const routes = [
41
+ "/admin/plugins/strapi-plugin-payone-provider/payment/success",
42
+ "/admin/plugins/strapi-plugin-payone-provider/payment/error",
43
+ "/admin/plugins/strapi-plugin-payone-provider/payment/back",
44
+ "/content-ui/plugins/strapi-plugin-payone-provider/payment/success",
45
+ "/content-ui/plugins/strapi-plugin-payone-provider/payment/error",
46
+ "/content-ui/plugins/strapi-plugin-payone-provider/payment/back"
47
+ ];
48
+
49
+ try {
50
+ const Router = require('@koa/router');
51
+ const router = new Router();
52
+ const fs = require('fs');
53
+ const path = require('path');
54
+
55
+ routes.forEach(route => {
56
+ router.get(route, async (ctx) => {
57
+ const controller = getController();
58
+ return await controller.handle3DSCallback(ctx);
59
+ });
60
+ });
61
+
62
+ router.get('/.well-known/apple-developer-merchantid-domain-association', async (ctx) => {
63
+ try {
64
+ const pluginRoot = path.resolve(__dirname, '..');
65
+ const wellKnownPath = path.join(pluginRoot, '.well-known');
66
+ const possiblePaths = [
67
+ path.join(wellKnownPath, 'apple-developer-merchantid-domain-association'),
68
+ path.join(wellKnownPath, 'apple-developer-merchantid-domain-association.txt'),
69
+ path.join(wellKnownPath, 'apple-developer-merchant-id-domain-association.txt'),
70
+ ];
71
+
72
+ let fileContent = null;
73
+ let filePathFound = null;
74
+
75
+ for (const filePath of possiblePaths) {
76
+ if (fs.existsSync(filePath)) {
77
+ filePathFound = filePath;
78
+ fileContent = fs.readFileSync(filePath, 'utf8');
79
+ break;
80
+ }
81
+ }
82
+
83
+ if (fileContent) {
84
+ ctx.type = 'text/plain';
85
+ ctx.set('Content-Type', 'text/plain');
86
+ ctx.set('Cache-Control', 'public, max-age=31536000');
87
+ ctx.body = fileContent.trim();
88
+ } else {
89
+ ctx.status = 404;
90
+ ctx.type = 'text/plain';
91
+ ctx.body = 'File not found';
92
+ }
93
+ } catch (error) {
94
+ ctx.status = 500;
95
+ ctx.type = 'text/plain';
96
+ ctx.body = 'Internal server error';
97
+ }
98
+ });
99
+
100
+ if (strapi.server.app && typeof strapi.server.app.use === 'function') {
101
+ strapi.server.app.use(router.routes());
102
+ strapi.server.app.use(router.allowedMethods());
103
+ }
104
+ } catch (error) {
105
+ // Silent fail
106
+ }
107
+ };
@@ -1,83 +1,83 @@
1
- "use strict";
2
-
3
- const { yup } = require("@strapi/utils");
4
-
5
- module.exports = {
6
- default: {
7
- settings: {
8
- aid: "",
9
- portalid: "",
10
- mid: "",
11
- key: "",
12
- mode: "test",
13
- api_version: "3.10",
14
- // PAYONE Server API (Hosted Tokenization / Server-to-server)
15
- // merchantId/PSPID used in REST endpoints: /v2/{merchantId}/...
16
- serverApiMerchantId: "",
17
- // API Key ID + Secret used for HMAC auth (GCS v1HMAC)
18
- serverApiKeyId: "",
19
- serverApiSecret: "",
20
- // Keep configurable, default PAYONE REST version path
21
- serverApiVersionPath: "/v2",
22
-
23
- // Defaults (Germany)
24
- defaultCountryCode: "DE",
25
- defaultCurrencyCode: "EUR",
26
- defaultLocale: "de_DE",
27
- merchantName: "",
28
- displayName: "",
29
- domainName: "",
30
- merchantIdentifier: "",
31
- enableCreditCard: false,
32
- enablePayPal: false,
33
- enableGooglePay: false,
34
- enableApplePay: false,
35
- enableSofort: false,
36
- enableSepaDirectDebit: false,
37
- }
38
- },
39
- validator(config) {
40
- if (!config || !config.settings) {
41
- return config;
42
- }
43
-
44
- const schema = yup.object({
45
- settings: yup
46
- .object({
47
- aid: yup.string().defined(),
48
- portalid: yup.string().defined(),
49
- mid: yup.string().defined(),
50
- key: yup.string().defined(),
51
- mode: yup.mixed().oneOf(["test", "live"]).defined(),
52
- api_version: yup
53
- .string()
54
- .matches(/^\d+\.\d+$/)
55
- .defined(),
56
- serverApiMerchantId: yup.string().optional(),
57
- serverApiKeyId: yup.string().optional(),
58
- serverApiSecret: yup.string().optional(),
59
- serverApiVersionPath: yup.string().optional(),
60
-
61
- defaultCountryCode: yup.string().optional(),
62
- defaultCurrencyCode: yup.string().optional(),
63
- defaultLocale: yup.string().optional(),
64
- merchantName: yup.string().optional(),
65
- displayName: yup.string().optional(),
66
- domainName: yup.string().optional(),
67
- merchantIdentifier: yup.string().optional(),
68
- enableCreditCard: yup.boolean().optional(),
69
- enablePayPal: yup.boolean().optional(),
70
- enableGooglePay: yup.boolean().optional(),
71
- enableApplePay: yup.boolean().optional(),
72
- enableSofort: yup.boolean().optional(),
73
- enableSepaDirectDebit: yup.boolean().optional(),
74
- })
75
- .defined()
76
- });
77
-
78
- return schema.validateSync(config, {
79
- abortEarly: false,
80
- stripUnknown: true
81
- });
82
- }
83
- };
1
+ "use strict";
2
+
3
+ const { yup } = require("@strapi/utils");
4
+
5
+ module.exports = {
6
+ default: {
7
+ settings: {
8
+ aid: "",
9
+ portalid: "",
10
+ mid: "",
11
+ key: "",
12
+ mode: "test",
13
+ api_version: "3.10",
14
+ // PAYONE Server API (Hosted Tokenization / Server-to-server)
15
+ // merchantId/PSPID used in REST endpoints: /v2/{merchantId}/...
16
+ serverApiMerchantId: "",
17
+ // API Key ID + Secret used for HMAC auth (GCS v1HMAC)
18
+ serverApiKeyId: "",
19
+ serverApiSecret: "",
20
+ // Keep configurable, default PAYONE REST version path
21
+ serverApiVersionPath: "/v2",
22
+
23
+ // Defaults (Germany)
24
+ defaultCountryCode: "DE",
25
+ defaultCurrencyCode: "EUR",
26
+ defaultLocale: "de_DE",
27
+ merchantName: "",
28
+ displayName: "",
29
+ domainName: "",
30
+ merchantIdentifier: "",
31
+ enableCreditCard: false,
32
+ enablePayPal: false,
33
+ enableGooglePay: false,
34
+ enableApplePay: false,
35
+ enableSofort: false,
36
+ enableSepaDirectDebit: false,
37
+ }
38
+ },
39
+ validator(config) {
40
+ if (!config || !config.settings) {
41
+ return config;
42
+ }
43
+
44
+ const schema = yup.object({
45
+ settings: yup
46
+ .object({
47
+ aid: yup.string().defined(),
48
+ portalid: yup.string().defined(),
49
+ mid: yup.string().defined(),
50
+ key: yup.string().defined(),
51
+ mode: yup.mixed().oneOf(["test", "live"]).defined(),
52
+ api_version: yup
53
+ .string()
54
+ .matches(/^\d+\.\d+$/)
55
+ .defined(),
56
+ serverApiMerchantId: yup.string().optional(),
57
+ serverApiKeyId: yup.string().optional(),
58
+ serverApiSecret: yup.string().optional(),
59
+ serverApiVersionPath: yup.string().optional(),
60
+
61
+ defaultCountryCode: yup.string().optional(),
62
+ defaultCurrencyCode: yup.string().optional(),
63
+ defaultLocale: yup.string().optional(),
64
+ merchantName: yup.string().optional(),
65
+ displayName: yup.string().optional(),
66
+ domainName: yup.string().optional(),
67
+ merchantIdentifier: yup.string().optional(),
68
+ enableCreditCard: yup.boolean().optional(),
69
+ enablePayPal: yup.boolean().optional(),
70
+ enableGooglePay: yup.boolean().optional(),
71
+ enableApplePay: yup.boolean().optional(),
72
+ enableSofort: yup.boolean().optional(),
73
+ enableSepaDirectDebit: yup.boolean().optional(),
74
+ })
75
+ .defined()
76
+ });
77
+
78
+ return schema.validateSync(config, {
79
+ abortEarly: false,
80
+ stripUnknown: true
81
+ });
82
+ }
83
+ };
@@ -1,5 +1,5 @@
1
- const transactionsContentType = require('./transactions/index.js')
2
-
3
- module.exports = {
4
- 'transaction': transactionsContentType
1
+ const transactionsContentType = require('./transactions/index.js')
2
+
3
+ module.exports = {
4
+ 'transaction': transactionsContentType
5
5
  }
@@ -1,5 +1,5 @@
1
- const schema = require('./schema.json');
2
-
3
- module.exports = {
4
- schema
1
+ const schema = require('./schema.json');
2
+
3
+ module.exports = {
4
+ schema
5
5
  }
@@ -1,87 +1,87 @@
1
- {
2
- "kind": "collectionType",
3
- "collectionName": "transactions",
4
- "info": {
5
- "singularName": "transaction",
6
- "pluralName": "transactions",
7
- "displayName": "Transaction"
8
- },
9
- "options": {
10
- "draftAndPublish": false
11
- },
12
- "pluginOptions": {
13
- "content-manager": {
14
- "visible": false
15
- },
16
- "content-type-builder": {
17
- "visible": false
18
- }
19
- },
20
- "attributes": {
21
- "txid": {
22
- "type": "string",
23
- "required": false,
24
- "default": "NO TXID"
25
- },
26
- "reference": {
27
- "type": "string",
28
- "required": false,
29
- "default": "NO REFERENCE"
30
- },
31
- "invoiceid": {
32
- "type": "string",
33
- "required": false,
34
- "default": "NO INVOICE ID"
35
- },
36
- "amount": {
37
- "type": "string",
38
- "required": false,
39
- "default": "0"
40
- },
41
- "currency": {
42
- "type": "string",
43
- "required": false,
44
- "default": "EUR"
45
- },
46
- "status": {
47
- "type": "string",
48
- "required": false,
49
- "default": "unknown"
50
- },
51
- "error_code": {
52
- "type": "string",
53
- "required": false,
54
- "default": "NO ERROR CODE"
55
- },
56
- "request_type": {
57
- "type": "string",
58
- "required": false,
59
- "default": "unknown"
60
- },
61
- "error_message": {
62
- "type": "string",
63
- "required": false,
64
- "default": "NO ERROR MESSAGE"
65
- },
66
- "customer_message": {
67
- "type": "string",
68
- "required": false,
69
- "default": "NO CUSTOMER MESSAGE"
70
- },
71
- "body": {
72
- "type": "json",
73
- "required": false,
74
- "default": {}
75
- },
76
- "raw_request": {
77
- "type": "json",
78
- "required": false,
79
- "default": {}
80
- },
81
- "raw_response": {
82
- "type": "json",
83
- "required": false,
84
- "default": {}
85
- }
86
- }
1
+ {
2
+ "kind": "collectionType",
3
+ "collectionName": "transactions",
4
+ "info": {
5
+ "singularName": "transaction",
6
+ "pluralName": "transactions",
7
+ "displayName": "Transaction"
8
+ },
9
+ "options": {
10
+ "draftAndPublish": false
11
+ },
12
+ "pluginOptions": {
13
+ "content-manager": {
14
+ "visible": false
15
+ },
16
+ "content-type-builder": {
17
+ "visible": false
18
+ }
19
+ },
20
+ "attributes": {
21
+ "txid": {
22
+ "type": "string",
23
+ "required": false,
24
+ "default": "NO TXID"
25
+ },
26
+ "reference": {
27
+ "type": "string",
28
+ "required": false,
29
+ "default": "NO REFERENCE"
30
+ },
31
+ "invoiceid": {
32
+ "type": "string",
33
+ "required": false,
34
+ "default": "NO INVOICE ID"
35
+ },
36
+ "amount": {
37
+ "type": "string",
38
+ "required": false,
39
+ "default": "0"
40
+ },
41
+ "currency": {
42
+ "type": "string",
43
+ "required": false,
44
+ "default": "EUR"
45
+ },
46
+ "status": {
47
+ "type": "string",
48
+ "required": false,
49
+ "default": "unknown"
50
+ },
51
+ "error_code": {
52
+ "type": "string",
53
+ "required": false,
54
+ "default": "NO ERROR CODE"
55
+ },
56
+ "request_type": {
57
+ "type": "string",
58
+ "required": false,
59
+ "default": "unknown"
60
+ },
61
+ "error_message": {
62
+ "type": "string",
63
+ "required": false,
64
+ "default": "NO ERROR MESSAGE"
65
+ },
66
+ "customer_message": {
67
+ "type": "string",
68
+ "required": false,
69
+ "default": "NO CUSTOMER MESSAGE"
70
+ },
71
+ "body": {
72
+ "type": "json",
73
+ "required": false,
74
+ "default": {}
75
+ },
76
+ "raw_request": {
77
+ "type": "json",
78
+ "required": false,
79
+ "default": {}
80
+ },
81
+ "raw_response": {
82
+ "type": "json",
83
+ "required": false,
84
+ "default": {}
85
+ }
86
+ }
87
87
  }
@@ -1,7 +1,7 @@
1
- "use strict";
2
-
3
- const payone = require("./payone");
4
-
5
- module.exports = {
6
- payone
7
- };
1
+ "use strict";
2
+
3
+ const payone = require("./payone");
4
+
5
+ module.exports = {
6
+ payone
7
+ };