strapi-plugin-payone-provider 1.0.1 → 1.1.1

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.
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from "react";
2
- import { useNotification, useFetchClient } from "@strapi/helper-plugin";
2
+ import { useNotification } from "@strapi/helper-plugin";
3
3
  import {
4
4
  Layout,
5
5
  HeaderLayout,
@@ -21,7 +21,6 @@ import PaymentActionsPanel from "./components/PaymentActionsPanel";
21
21
 
22
22
  const App = () => {
23
23
  const toggleNotification = useNotification();
24
- const { get, put } = useFetchClient();
25
24
 
26
25
  const [settings, setSettings] = useState({
27
26
  aid: "",
@@ -89,8 +88,8 @@ const App = () => {
89
88
  const loadSettings = async () => {
90
89
  setIsLoading(true);
91
90
  try {
92
- const { data } = await get(`/payone-provider/settings`);
93
- if (data?.data) setSettings(data.data);
91
+ const response = await payoneRequests.getSettings();
92
+ if (response?.data) setSettings(response.data);
94
93
  } catch (error) {
95
94
  toggleNotification({
96
95
  type: "warning",
@@ -108,7 +107,7 @@ const App = () => {
108
107
  const handleSave = async () => {
109
108
  setIsSaving(true);
110
109
  try {
111
- await put(`/payone-provider/settings`, settings);
110
+ await payoneRequests.updateSettings(settings);
112
111
  toggleNotification({
113
112
  type: "success",
114
113
  message: "Settings saved successfully"
@@ -1,5 +1,5 @@
1
1
  import pluginPkg from "../../package.json";
2
2
 
3
- const pluginId = pluginPkg.name.replace(/^@strapi\/plugin-/i, "");
3
+ const pluginId = pluginPkg.name.replace(/^(@[^-,.][\w,-]+\/|strapi-)plugin-/i, '');
4
4
 
5
- export default pluginId;
5
+ export default `strapi-plugin-${pluginId.replace(/-provider$/, '')}`;
package/package.json CHANGED
@@ -1,20 +1,15 @@
1
1
  {
2
2
  "name": "strapi-plugin-payone-provider",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Strapi plugin for Payone payment gateway integration",
5
5
  "license": "MIT",
6
- "author": {
7
- "name": "Strapi Payone Provider Developer"
8
- },
9
6
  "maintainers": [
10
7
  {
11
- "name": "Strapi Payone Provider Developer"
8
+ "name": "NewProWeb Community",
9
+ "email": "abror.abdullaev@newproweb.com"
12
10
  }
13
11
  ],
14
12
  "dependencies": {
15
- "@strapi/design-system": "^1.6.3",
16
- "@strapi/helper-plugin": "^4.6.0",
17
- "@strapi/icons": "^1.6.3",
18
13
  "axios": "^1.6.2",
19
14
  "prop-types": "^15.7.2"
20
15
  },
@@ -25,15 +20,26 @@
25
20
  "styled-components": "^5.3.6"
26
21
  },
27
22
  "peerDependencies": {
23
+ "@strapi/strapi": "^4.0",
28
24
  "react": "^17.0.0 || ^18.0.0",
29
25
  "react-dom": "^17.0.0 || ^18.0.0",
30
26
  "react-router-dom": "^5.2.0",
31
27
  "styled-components": "^5.2.1"
32
28
  },
33
29
  "engines": {
34
- "node": ">=18.0.0 <=20.x.x",
30
+ "node": ">=18.0.0",
35
31
  "npm": ">=6.0.0"
36
32
  },
33
+ "authors": [
34
+ {
35
+ "name": "NewProWeb <Aliev Davlatbek>",
36
+ "email": "mamurjonov.davlatbek@newproweb.com"
37
+ },
38
+ {
39
+ "name": "Akromjon Rahimjonov",
40
+ "email": "akromjon.rahimjonov@newproweb.com"
41
+ }
42
+ ],
37
43
  "strapi": {
38
44
  "name": "strapi-plugin-payone-provider",
39
45
  "description": "Integrates Strapi Payone payment gateway with Strapi",
@@ -5,7 +5,7 @@ module.exports = async ({ strapi }) => {
5
5
  const pluginStore = strapi.store({
6
6
  environment: "",
7
7
  type: "plugin",
8
- name: "payone-provider"
8
+ name: "strapi-plugin-payone"
9
9
  });
10
10
 
11
11
  // Initialize default settings if not already set
@@ -4,7 +4,7 @@ module.exports = ({ strapi }) => ({
4
4
  async getSettings(ctx) {
5
5
  try {
6
6
  const settings = await strapi
7
- .plugin("payone-provider")
7
+ .plugin("strapi-plugin-payone")
8
8
  .service("payone")
9
9
  .getSettings();
10
10
 
@@ -23,7 +23,7 @@ module.exports = ({ strapi }) => ({
23
23
  const { body } = ctx.request;
24
24
 
25
25
  const currentSettings = await strapi
26
- .plugin("payone-provider")
26
+ .plugin("strapi-plugin-payone")
27
27
  .service("payone")
28
28
  .getSettings();
29
29
 
@@ -32,7 +32,7 @@ module.exports = ({ strapi }) => ({
32
32
  }
33
33
 
34
34
  const settings = await strapi
35
- .plugin("payone-provider")
35
+ .plugin("strapi-plugin-payone")
36
36
  .service("payone")
37
37
  .updateSettings(body);
38
38
 
@@ -50,7 +50,7 @@ module.exports = ({ strapi }) => ({
50
50
  try {
51
51
  const params = ctx.request.body;
52
52
  const result = await strapi
53
- .plugin("payone-provider")
53
+ .plugin("strapi-plugin-payone")
54
54
  .service("payone")
55
55
  .preauthorization(params);
56
56
 
@@ -66,7 +66,7 @@ module.exports = ({ strapi }) => ({
66
66
  strapi.log.info("Payone authorization controller called with:", params);
67
67
 
68
68
  const result = await strapi
69
- .plugin("payone-provider")
69
+ .plugin("strapi-plugin-payone")
70
70
  .service("payone")
71
71
  .authorization(params);
72
72
 
@@ -81,7 +81,7 @@ module.exports = ({ strapi }) => ({
81
81
  try {
82
82
  const params = ctx.request.body;
83
83
  const result = await strapi
84
- .plugin("payone-provider")
84
+ .plugin("strapi-plugin-payone")
85
85
  .service("payone")
86
86
  .capture(params);
87
87
 
@@ -95,7 +95,7 @@ module.exports = ({ strapi }) => ({
95
95
  try {
96
96
  const params = ctx.request.body;
97
97
  const result = await strapi
98
- .plugin("payone-provider")
98
+ .plugin("strapi-plugin-payone")
99
99
  .service("payone")
100
100
  .refund(params);
101
101
 
@@ -109,7 +109,7 @@ module.exports = ({ strapi }) => ({
109
109
  try {
110
110
  const filters = ctx.query || {};
111
111
  const history = await strapi
112
- .plugin("payone-provider")
112
+ .plugin("strapi-plugin-payone")
113
113
  .service("payone")
114
114
  .getTransactionHistory(filters);
115
115
 
@@ -122,7 +122,7 @@ module.exports = ({ strapi }) => ({
122
122
  async testConnection(ctx) {
123
123
  try {
124
124
  const result = await strapi
125
- .plugin("payone-provider")
125
+ .plugin("strapi-plugin-payone")
126
126
  .service("payone")
127
127
  .testConnection();
128
128
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  module.exports = {
4
- isSuperAdmin: require("./isSuperAdmin"),
5
- isAuth: require("./isAuth")
4
+ "is-auth": require("./is-auth"),
5
+ "is-super-admin": require("./isSuperAdmin")
6
6
  };
@@ -15,7 +15,7 @@ module.exports = async (ctx, config, { strapi }) => {
15
15
  return true;
16
16
  }
17
17
  } catch (e) {
18
- strapi.log.warn("payone-provider isAuth policy error:", e.message);
18
+ strapi.log.warn("strapi-plugin-payone isAuth policy error:", e.message);
19
19
  }
20
20
  }
21
21
 
@@ -36,7 +36,6 @@ module.exports = {
36
36
  policies: ["admin::isAuthenticatedAdmin"]
37
37
  }
38
38
  },
39
-
40
39
  {
41
40
  method: "POST",
42
41
  path: "/preauthorization",
@@ -71,6 +70,7 @@ module.exports = {
71
70
  }
72
71
  ]
73
72
  },
73
+
74
74
  "content-api": {
75
75
  type: "content-api",
76
76
  routes: [
@@ -79,7 +79,7 @@ module.exports = {
79
79
  path: "/preauthorization",
80
80
  handler: "payone.preauthorization",
81
81
  config: {
82
- policies: ["plugin::payone-provider.isAuth"],
82
+ policies: ["plugin::strapi-plugin-payone.is-auth"],
83
83
  auth: false
84
84
  }
85
85
  },
@@ -88,7 +88,7 @@ module.exports = {
88
88
  path: "/authorization",
89
89
  handler: "payone.authorization",
90
90
  config: {
91
- policies: ["plugin::payone-provider.isAuth"],
91
+ policies: ["plugin::strapi-plugin-payone.is-auth"],
92
92
  auth: false
93
93
  }
94
94
  },
@@ -97,7 +97,7 @@ module.exports = {
97
97
  path: "/capture",
98
98
  handler: "payone.capture",
99
99
  config: {
100
- policies: ["plugin::payone-provider.isAuth"],
100
+ policies: ["plugin::strapi-plugin-payone.is-auth"],
101
101
  auth: false
102
102
  }
103
103
  },
@@ -106,7 +106,7 @@ module.exports = {
106
106
  path: "/refund",
107
107
  handler: "payone.refund",
108
108
  config: {
109
- policies: ["plugin::payone-provider.isAuth"],
109
+ policies: ["plugin::strapi-plugin-payone.is-auth"],
110
110
  auth: false
111
111
  }
112
112
  },
@@ -115,7 +115,7 @@ module.exports = {
115
115
  path: "/test-connection",
116
116
  handler: "payone.testConnection",
117
117
  config: {
118
- policies: ["plugin::payone-provider.isAuth"],
118
+ policies: ["plugin::strapi-plugin-payone.is-auth"],
119
119
  auth: false
120
120
  }
121
121
  }
@@ -66,7 +66,7 @@ module.exports = ({ strapi }) => ({
66
66
  const pluginStore = strapi.store({
67
67
  environment: "",
68
68
  type: "plugin",
69
- name: "payone-provider"
69
+ name: "strapi-plugin-payone"
70
70
  });
71
71
  return await pluginStore.get({ key: "settings" });
72
72
  },
@@ -75,7 +75,7 @@ module.exports = ({ strapi }) => ({
75
75
  const pluginStore = strapi.store({
76
76
  environment: "",
77
77
  type: "plugin",
78
- name: "payone-provider"
78
+ name: "strapi-plugin-payone"
79
79
  });
80
80
  await pluginStore.set({
81
81
  key: "settings",
@@ -350,7 +350,7 @@ module.exports = ({ strapi }) => ({
350
350
  const pluginStore = strapi.store({
351
351
  environment: "",
352
352
  type: "plugin",
353
- name: "payone-provider"
353
+ name: "strapi-plugin-payone"
354
354
  });
355
355
 
356
356
  let transactionHistory =
@@ -400,7 +400,7 @@ module.exports = ({ strapi }) => ({
400
400
  const pluginStore = strapi.store({
401
401
  environment: "",
402
402
  type: "plugin",
403
- name: "payone-provider"
403
+ name: "strapi-plugin-payone"
404
404
  });
405
405
 
406
406
  let transactionHistory =