strapi-plugin-payone-provider 1.3.0 → 1.4.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-payone-provider",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Strapi plugin for Payone payment gateway integration",
5
5
  "license": "MIT",
6
6
  "maintainers": [
@@ -43,12 +43,25 @@ module.exports = ({ strapi }) => ({
43
43
  }
44
44
  },
45
45
 
46
+ async getPublicSettings(ctx) {
47
+ try {
48
+ const settings = await getPayoneService(strapi).getSettings();
49
+ ctx.body = {
50
+ data: {
51
+ mid: settings?.mid || null,
52
+ mode: settings?.mode || null
53
+ }
54
+ };
55
+ } catch (error) {
56
+ handleError(ctx, error);
57
+ }
58
+ },
59
+
46
60
  async updateSettings(ctx) {
47
61
  try {
48
62
  const { body } = ctx.request;
49
63
  const currentSettings = await getPayoneService(strapi).getSettings();
50
64
 
51
- // Preserve existing key if hidden or not provided
52
65
  if (body.key === "***HIDDEN***" || !body.key) {
53
66
  body.key = currentSettings?.key;
54
67
  }
@@ -82,6 +82,15 @@ module.exports = {
82
82
  "content-api": {
83
83
  type: "content-api",
84
84
  routes: [
85
+ {
86
+ method: "GET",
87
+ path: "/settings",
88
+ handler: "payone.getPublicSettings",
89
+ config: {
90
+ policies: ["plugin::strapi-plugin-payone-provider.is-auth"],
91
+ auth: false
92
+ }
93
+ },
85
94
  {
86
95
  method: "POST",
87
96
  path: "/preauthorization",