strapi-plugin-payone-provider 1.6.0 → 1.6.2

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.
@@ -224,8 +224,8 @@ const ApplePayBtn = ({
224
224
  session.begin();
225
225
  };
226
226
 
227
- const mode = (settings?.mode || 'test').toLowerCase();
228
- const isLiveMode = mode === 'live';
227
+ const mode = (settings?.mode || "test").toLowerCase();
228
+ const isLiveMode = mode === "live";
229
229
 
230
230
  if (!settings?.mid) {
231
231
  return (
@@ -245,15 +245,19 @@ const ApplePayBtn = ({
245
245
  if (!isLiveMode) {
246
246
  return (
247
247
  <Box>
248
- <Alert closeLabel="Close" title="⚠️ Apple Pay Only Works in Live Mode" variant="danger">
248
+ <Alert
249
+ closeLabel="Close"
250
+ title=" Apple Pay Only Works in Live Mode"
251
+ variant="danger"
252
+ >
249
253
  <Typography variant="pi" marginTop={2}>
250
- <strong>Apple Pay is only supported in live mode.</strong> According to Payone documentation, test mode support will be available at a later time.
254
+ <strong>Apple Pay is only supported in live mode.</strong> According
255
+ to Payone documentation, test mode support will be available at a
256
+ later time.
251
257
  </Typography>
252
- <Typography variant="pi" marginTop={2}>
253
- Please switch to <strong>live mode</strong> in plugin settings to use Apple Pay.
254
- </Typography>
255
- <Typography variant="pi" marginTop={2} fontWeight="bold" textColor="danger600">
256
- ⚠️ Apple Pay will NOT work in test mode!
258
+ <Typography variant="pi" style={{ marginLeft: "8px" }}>
259
+ Please switch to <strong>live mode</strong> in plugin settings to
260
+ use Apple Pay.
257
261
  </Typography>
258
262
  </Alert>
259
263
  </Box>
@@ -284,11 +288,9 @@ const ApplePayBtn = ({
284
288
  onClick={handleApplePayClick}
285
289
  buttonStyle={nativeButtonStyle}
286
290
  type={nativeButtonType}
287
- style={{
288
- width: "100%",
289
- borderRadius: "8px",
290
- }}
291
+ style={{ width: "220px", height: "40px" }}
291
292
  />
293
+ <br /> <br />
292
294
  <Typography
293
295
  variant="pi"
294
296
  textColor="neutral600"
@@ -51,6 +51,72 @@ const PaymentActionsPanel = ({
51
51
  const mode = (settings?.mode || "test").toLowerCase();
52
52
  const isLiveMode = mode === "live";
53
53
 
54
+ if (isLiveMode) {
55
+ return (
56
+ <Box
57
+ style={{
58
+ display: "flex",
59
+ flexDirection: "column",
60
+ alignItems: "flex-start",
61
+ gap: "16px",
62
+ marginTop: "24px",
63
+ width: "100%",
64
+ }}
65
+ >
66
+ <Typography
67
+ variant="pi"
68
+ textColor="danger600"
69
+ style={{
70
+ fontSize: "14px",
71
+ marginTop: "12px",
72
+ marginBottom: "12px",
73
+ fontWeight: "bold",
74
+ }}
75
+ >
76
+ ⚠️ Payment Actions are disabled in live mode for security reasons. but
77
+ you can test apple pay in live mode. For testing other payment
78
+ methods, please use test mode.
79
+ </Typography>
80
+
81
+ <PaymentMethodSelector
82
+ paymentMethod={paymentMethod}
83
+ setPaymentMethod={setPaymentMethod}
84
+ captureMode={captureMode}
85
+ setCaptureMode={setCaptureMode}
86
+ onNavigateToConfig={onNavigateToConfig}
87
+ settings={settings}
88
+ isLiveMode={isLiveMode}
89
+ />
90
+
91
+ <hr className="payment-divider" />
92
+ <Box className="payment-form-section">
93
+ <AuthorizationForm
94
+ paymentAmount={paymentAmount}
95
+ setPaymentAmount={setPaymentAmount}
96
+ authReference={authReference}
97
+ setAuthReference={setAuthReference}
98
+ isProcessingPayment={isProcessingPayment}
99
+ onAuthorization={onAuthorization}
100
+ paymentMethod={paymentMethod}
101
+ settings={settings}
102
+ googlePayToken={googlePayToken}
103
+ setGooglePayToken={setGooglePayToken}
104
+ applePayToken={applePayToken}
105
+ setApplePayToken={setApplePayToken}
106
+ cardtype={cardtype}
107
+ setCardtype={setCardtype}
108
+ cardpan={cardpan}
109
+ setCardpan={setCardpan}
110
+ cardexpiredate={cardexpiredate}
111
+ setCardexpiredate={setCardexpiredate}
112
+ cardcvc2={cardcvc2}
113
+ setCardcvc2={setCardcvc2}
114
+ />
115
+ </Box>
116
+ </Box>
117
+ );
118
+ }
119
+
54
120
  return (
55
121
  <Box
56
122
  className="payment-container"
@@ -85,16 +151,6 @@ const PaymentActionsPanel = ({
85
151
  Process payments, captures, and refunds with multiple payment
86
152
  methods
87
153
  </Typography>
88
- {isLiveMode && (
89
- <Typography
90
- variant="pi"
91
- textColor="danger600"
92
- style={{ fontSize: "14px", marginTop: "8px", fontWeight: "bold" }}
93
- >
94
- ⚠️ Payment Actions are disabled in live mode for security reasons.
95
- Please use test mode for testing.
96
- </Typography>
97
- )}
98
154
  </Box>
99
155
 
100
156
  <PaymentMethodSelector
@@ -104,6 +160,7 @@ const PaymentActionsPanel = ({
104
160
  setCaptureMode={setCaptureMode}
105
161
  onNavigateToConfig={onNavigateToConfig}
106
162
  settings={settings}
163
+ isLiveMode={isLiveMode}
107
164
  />
108
165
 
109
166
  <hr className="payment-divider" />
@@ -142,13 +199,7 @@ const PaymentActionsPanel = ({
142
199
 
143
200
  <hr className="payment-divider" />
144
201
 
145
- <Box
146
- className="payment-form-section"
147
- style={{
148
- opacity: isLiveMode ? 0.5 : 1,
149
- pointerEvents: isLiveMode ? "none" : "auto",
150
- }}
151
- >
202
+ <Box className="payment-form-section">
152
203
  <AuthorizationForm
153
204
  paymentAmount={paymentAmount}
154
205
  setPaymentAmount={setPaymentAmount}
@@ -31,7 +31,6 @@ const AuthorizationForm = ({
31
31
  setCardexpiredate,
32
32
  cardcvc2,
33
33
  setCardcvc2,
34
- isLiveMode = false,
35
34
  }) => {
36
35
  const handleGooglePayToken = (token, paymentData) => {
37
36
  if (!token) {
@@ -42,9 +41,7 @@ const AuthorizationForm = ({
42
41
  };
43
42
 
44
43
  const handleGooglePayError = (error) => {
45
- if (onError) {
46
- onError(error);
47
- }
44
+ console.error("[AuthorizationForm] Google Pay error:", error);
48
45
  };
49
46
 
50
47
  const handleApplePayToken = async (token, paymentData) => {
@@ -62,9 +59,7 @@ const AuthorizationForm = ({
62
59
  };
63
60
 
64
61
  const handleApplePayError = (error) => {
65
- if (onError) {
66
- onError(error);
67
- }
62
+ console.error("[AuthorizationForm] Apple Pay error:", error);
68
63
  };
69
64
 
70
65
  return (
@@ -168,9 +163,7 @@ const AuthorizationForm = ({
168
163
  loading={isProcessingPayment}
169
164
  startIcon={<Play />}
170
165
  style={{ maxWidth: "200px" }}
171
- disabled={
172
- !paymentAmount.trim() || !authReference.trim() || isLiveMode
173
- }
166
+ disabled={!paymentAmount.trim() || !authReference.trim()}
174
167
  className="payment-button payment-button-primary"
175
168
  >
176
169
  Process Authorization
@@ -191,8 +184,7 @@ const AuthorizationForm = ({
191
184
  (paymentMethod === "cc" &&
192
185
  settings?.enable3DSecure !== false &&
193
186
  (!cardtype || !cardpan || !cardexpiredate || !cardcvc2)) ||
194
- (paymentMethod === "apl" && !applePayToken) ||
195
- isLiveMode
187
+ (paymentMethod === "apl" && !applePayToken)
196
188
  }
197
189
  >
198
190
  Process Authorization
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useEffect } from "react";
2
2
  import {
3
3
  Box,
4
4
  Flex,
@@ -22,10 +22,14 @@ const PaymentMethodSelector = ({
22
22
  captureMode,
23
23
  setCaptureMode,
24
24
  onNavigateToConfig,
25
- settings,
25
+ isLiveMode,
26
26
  }) => {
27
- const mode = (settings?.mode || "test").toLowerCase();
28
- const isLiveMode = mode === "live";
27
+ useEffect(() => {
28
+ if (isLiveMode && paymentMethod !== "apl") {
29
+ setPaymentMethod("apl");
30
+ }
31
+ // eslint-disable-next-line react-hooks/exhaustive-deps
32
+ }, [isLiveMode]);
29
33
 
30
34
  return (
31
35
  <Box>
@@ -37,7 +41,7 @@ const PaymentMethodSelector = ({
37
41
  onChange={(value) => setPaymentMethod(value)}
38
42
  hint={`Current: ${getPaymentMethodDisplayName(paymentMethod)}`}
39
43
  >
40
- {getPaymentMethodOptions().map((option) => (
44
+ {getPaymentMethodOptions(isLiveMode).map((option) => (
41
45
  <Option key={option.value} value={option.value}>
42
46
  {option.label}
43
47
  </Option>
@@ -45,96 +49,169 @@ const PaymentMethodSelector = ({
45
49
  </Select>
46
50
  {paymentMethod === "apl" && onNavigateToConfig && (
47
51
  <>
48
- <Alert
49
- closeLabel="Close"
50
- title="⚠️ Important: Middleware Configuration Required"
51
- variant="warning"
52
+ <Box
53
+ style={{ display: "flex", flexDirection: "column", gap: "16px" }}
52
54
  >
53
- <Typography variant="pi" marginTop={2}>
54
- <strong>Apple Pay requires middleware configuration</strong> to
55
- work properly. You must configure Content Security Policy (CSP)
56
- in <code>config/middlewares.js</code> to allow Apple Pay
57
- scripts, otherwise Apple Pay will NOT work.
58
- </Typography>
59
- <Typography variant="pi" marginTop={2}>
60
- Required CSP directives for Apple Pay:
61
- </Typography>
62
55
  <Box
63
- marginTop={2}
64
- padding={2}
65
- background="neutral100"
66
- borderRadius="4px"
56
+ style={{
57
+ background: "transparent",
58
+ padding: "16px",
59
+ borderRadius: "4px",
60
+ border: "1px solid #eaeaea",
61
+ }}
67
62
  >
68
- <Typography
69
- variant="pi"
70
- style={{ fontFamily: "monospace", fontSize: "12px" }}
71
- >
72
- 'script-src': ['https://applepay.cdn-apple.com',
73
- 'https://www.apple.com']
74
- <br />
75
- 'connect-src': ['https://applepay.cdn-apple.com',
76
- 'https://www.apple.com']
77
- <br />
78
- 'frame-src': ['https://applepay.cdn-apple.com']
63
+ <Typography variant="pi" style={{ lineHeight: "1.6" }}>
64
+ <strong>Apple Pay requires middleware configuration</strong>{" "}
65
+ to work properly. You must configure Content Security Policy
66
+ (CSP) in{" "}
67
+ <code
68
+ style={{
69
+ padding: "2px 6px",
70
+ borderRadius: "3px",
71
+ fontSize: "13px",
72
+ }}
73
+ >
74
+ config/middlewares.js
75
+ </code>{" "}
76
+ to allow Apple Pay scripts.
79
77
  </Typography>
78
+
79
+ <Box style={{ marginTop: "16px" }}>
80
+ <Typography
81
+ variant="pi"
82
+ style={{
83
+ fontWeight: "600",
84
+ marginBottom: "8px",
85
+ display: "block",
86
+ }}
87
+ >
88
+ Required CSP directives:
89
+ </Typography>
90
+
91
+ <Box>
92
+ <Typography
93
+ variant="pi"
94
+ style={{
95
+ fontFamily: "monospace",
96
+ fontSize: "12px",
97
+ lineHeight: "1.8",
98
+ }}
99
+ >
100
+ <div>
101
+ 'script-src': ['https://applepay.cdn-apple.com',
102
+ 'https://www.apple.com']
103
+ </div>
104
+ <div>
105
+ 'connect-src': ['https://applepay.cdn-apple.com',
106
+ 'https://www.apple.com']
107
+ </div>
108
+ <div>'frame-src': ['https://applepay.cdn-apple.com']</div>
109
+ </Typography>
110
+ </Box>
111
+ </Box>
112
+
113
+ <Box
114
+ padding={2}
115
+ background="warning100"
116
+ style={{
117
+ marginTop: "16px",
118
+ borderRadius: "4px",
119
+ borderLeft: "3px solid #f29d41",
120
+ }}
121
+ >
122
+ <Typography variant="pi" style={{ fontWeight: "600" }}>
123
+ ⚠️ Without this configuration, Apple Pay will NOT work!
124
+ </Typography>
125
+ </Box>
80
126
  </Box>
81
- <Typography variant="pi" marginTop={2} fontWeight="bold">
82
- Without this configuration, Apple Pay will NOT work!
83
- </Typography>
84
- </Alert>
85
- <Alert
86
- closeLabel="Close"
87
- title="📥 Apple Pay Domain Verification File Required"
88
- variant="default"
89
- >
90
- <Typography variant="pi" marginTop={2}>
91
- <strong>Download the Apple Pay domain verification file</strong>{" "}
92
- from your Payone merchant portal and place it in:
93
- </Typography>
127
+
94
128
  <Box
95
- marginTop={2}
96
- padding={2}
97
- background="neutral100"
98
- borderRadius="4px"
129
+ style={{
130
+ background: "transparent",
131
+ padding: "16px",
132
+ borderRadius: "4px",
133
+ border: "1px solid #eaeaea",
134
+ }}
99
135
  >
100
- <Typography
101
- variant="pi"
102
- style={{ fontFamily: "monospace", fontSize: "12px" }}
103
- >
104
- <strong>Strapi:</strong>{" "}
105
- <code>
106
- public/.well-known/apple-developer-merchantid-domain-association
107
- </code>
108
- <br />
109
- <strong>Frontend:</strong>{" "}
110
- <code>
111
- public/.well-known/apple-developer-merchantid-domain-association
112
- </code>
136
+ <Typography variant="pi" style={{ lineHeight: "1.6" }}>
137
+ <strong>Download the domain verification file</strong> from
138
+ your Payone merchant portal and place it in the following
139
+ locations:
113
140
  </Typography>
114
- </Box>
115
- <Typography variant="pi" marginTop={2}>
116
- <strong>Download URL:</strong> Download the domain verification
117
- file from Payone documentation:{" "}
118
- <Link
119
- href="https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev"
120
- target="_blank"
121
- rel="noopener noreferrer"
122
- style={{ color: "#0066ff", textDecoration: "underline" }}
141
+
142
+ <Box>
143
+ <Typography
144
+ variant="pi"
145
+ style={{
146
+ fontFamily: "monospace",
147
+ fontSize: "12px",
148
+ lineHeight: "1.8",
149
+ }}
150
+ >
151
+ <div style={{ marginBottom: "8px" }}>
152
+ <strong>Strapi:</strong>{" "}
153
+ <code>
154
+ public/.well-known/apple-developer-merchantid-domain-association
155
+ </code>
156
+ </div>
157
+ <div>
158
+ <strong>Frontend:</strong>{" "}
159
+ <code>
160
+ public/.well-known/apple-developer-merchantid-domain-association
161
+ </code>
162
+ </div>
163
+ </Typography>
164
+ </Box>
165
+
166
+ <Box style={{ marginTop: "16px" }}>
167
+ <Typography variant="pi" style={{ lineHeight: "1.6" }}>
168
+ <strong>Download URL:</strong> Get the domain verification
169
+ file from Payone documentation:
170
+ </Typography>
171
+ <Box
172
+ padding={2}
173
+ background="primary100"
174
+ style={{ marginTop: "8px", borderRadius: "4px" }}
175
+ >
176
+ <Link
177
+ href="https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev"
178
+ target="_blank"
179
+ rel="noopener noreferrer"
180
+ style={{
181
+ color: "#4945ff",
182
+ textDecoration: "none",
183
+ fontWeight: "500",
184
+ fontSize: "14px",
185
+ }}
186
+ >
187
+
188
+ https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev
189
+ </Link>
190
+ </Box>
191
+ </Box>
192
+
193
+ <Box
194
+ padding={2}
195
+ background="danger100"
196
+ style={{
197
+ marginTop: "16px",
198
+ borderRadius: "4px",
199
+ borderLeft: "3px solid #d02b20",
200
+ }}
123
201
  >
124
- https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev
125
- </Link>
126
- </Typography>
127
- <br />
128
- <Typography
129
- variant="pi"
130
- marginTop={2}
131
- fontWeight="bold"
132
- textColor="danger600"
133
- >
134
- Without this file, Apple Pay will NOT work on your domain!
135
- </Typography>
136
- </Alert>
137
- <Box padding={3} background="neutral100" borderRadius="4px">
202
+ <Typography
203
+ variant="pi"
204
+ textColor="danger600"
205
+ style={{ fontWeight: "600" }}
206
+ >
207
+ ⚠️ Without this file, Apple Pay will NOT work on your
208
+ domain!
209
+ </Typography>
210
+ </Box>
211
+ </Box>
212
+ </Box>
213
+
214
+ <Box padding={3} borderRadius="4px">
138
215
  <Typography variant="pi" textColor="neutral600">
139
216
  Configure Apple Pay settings:{" "}
140
217
  <Link
@@ -1,5 +1,11 @@
1
1
  import React from "react";
2
- import { Box, Flex, Typography, TextInput, Button } from "@strapi/design-system";
2
+ import {
3
+ Box,
4
+ Flex,
5
+ Typography,
6
+ TextInput,
7
+ Button,
8
+ } from "@strapi/design-system";
3
9
  import { Play } from "@strapi/icons";
4
10
  import GooglePayButton from "../GooglePaybutton";
5
11
  import CardDetailsInput from "./CardDetailsInput";
@@ -22,7 +28,7 @@ const PreauthorizationForm = ({
22
28
  setCardexpiredate,
23
29
  cardcvc2,
24
30
  setCardcvc2,
25
- isLiveMode = false
31
+ isLiveMode = false,
26
32
  }) => {
27
33
  const handleGooglePayToken = (token, paymentData) => {
28
34
  if (!token) {
@@ -33,20 +39,25 @@ const PreauthorizationForm = ({
33
39
  };
34
40
 
35
41
  const handleGooglePayError = (error) => {
36
- if (onError) {
37
- onError(error);
38
- }
42
+ console.error("[PreauthorizationForm] Google Pay error:", error);
39
43
  };
40
44
 
41
-
42
-
43
45
  return (
44
46
  <Flex direction="column" alignItems="stretch" gap={4}>
45
47
  <Flex direction="row" gap={2}>
46
- <Typography variant="omega" fontWeight="semiBold" textColor="neutral800" className="payment-form-title">
48
+ <Typography
49
+ variant="omega"
50
+ fontWeight="semiBold"
51
+ textColor="neutral800"
52
+ className="payment-form-title"
53
+ >
47
54
  Preauthorization
48
55
  </Typography>
49
- <Typography variant="pi" textColor="neutral600" className="payment-form-description">
56
+ <Typography
57
+ variant="pi"
58
+ textColor="neutral600"
59
+ className="payment-form-description"
60
+ >
50
61
  Reserve an amount on a credit card without capturing it immediately.
51
62
  </Typography>
52
63
  </Flex>
@@ -111,7 +122,7 @@ const PreauthorizationForm = ({
111
122
  onClick={onPreauthorization}
112
123
  loading={isProcessingPayment}
113
124
  startIcon={<Play />}
114
- style={{ maxWidth: '200px' }}
125
+ style={{ maxWidth: "200px" }}
115
126
  className="payment-button payment-button-primary"
116
127
  disabled={
117
128
  !paymentAmount.trim() ||
@@ -129,4 +140,3 @@ const PreauthorizationForm = ({
129
140
  };
130
141
 
131
142
  export default PreauthorizationForm;
132
-
@@ -80,7 +80,6 @@ const usePaymentActions = () => {
80
80
  paymentMethod,
81
81
  amount: paymentAmount
82
82
  });
83
-
84
83
  setIsProcessingPayment(true);
85
84
  setPaymentError(null);
86
85
  setPaymentResult(null);
@@ -368,8 +368,8 @@ export const getPaymentMethodDisplayName = (paymentMethod) => {
368
368
  };
369
369
 
370
370
 
371
- export const getPaymentMethodOptions = () => {
372
- return [
371
+ export const getPaymentMethodOptions = (isLiveMode = false) => {
372
+ return isLiveMode ? [{ value: "apl", label: "Apple Pay" }] : [
373
373
  { value: "cc", label: "Credit Card (Visa, Mastercard)" },
374
374
  { value: "wlt", label: "PayPal" },
375
375
  { value: "gpp", label: "Google Pay" },
package/package.json CHANGED
@@ -1,49 +1,49 @@
1
- {
2
- "name": "strapi-plugin-payone-provider",
3
- "version": "1.6.0",
4
- "description": "Strapi plugin for Payone payment gateway integration",
5
- "license": "MIT",
6
- "maintainers": [
7
- {
8
- "name": "NewProWeb Community",
9
- "email": "abror.abdullaev@newproweb.com"
10
- }
11
- ],
12
- "dependencies": {
13
- "axios": "^1.6.3",
14
- "prop-types": "^15.7.2"
15
- },
16
- "devDependencies": {
17
- "react": "^18.2.0",
18
- "react-dom": "^18.2.0",
19
- "react-router-dom": "^5.3.4",
20
- "styled-components": "^5.3.6"
21
- },
22
- "peerDependencies": {
23
- "@strapi/strapi": "^4.0",
24
- "react": "^17.0.0 || ^18.0.0",
25
- "react-dom": "^17.0.0 || ^18.0.0",
26
- "react-router-dom": "^5.2.0",
27
- "styled-components": "^5.2.1"
28
- },
29
- "engines": {
30
- "node": ">=18.0.0",
31
- "npm": ">=6.0.0"
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
- ],
43
- "strapi": {
44
- "name": "strapi-plugin-payone-provider",
45
- "description": "Integrates Strapi Payone payment gateway with Strapi",
46
- "kind": "plugin",
47
- "displayName": "Strapi Payone Provider"
48
- }
49
- }
1
+ {
2
+ "name": "strapi-plugin-payone-provider",
3
+ "version": "1.6.2",
4
+ "description": "Strapi plugin for Payone payment gateway integration",
5
+ "license": "MIT",
6
+ "maintainers": [
7
+ {
8
+ "name": "NewProWeb Community",
9
+ "email": "abror.abdullaev@newproweb.com"
10
+ }
11
+ ],
12
+ "dependencies": {
13
+ "axios": "^1.6.3",
14
+ "prop-types": "^15.7.2"
15
+ },
16
+ "devDependencies": {
17
+ "react": "^18.2.0",
18
+ "react-dom": "^18.2.0",
19
+ "react-router-dom": "^5.3.4",
20
+ "styled-components": "^5.3.6"
21
+ },
22
+ "peerDependencies": {
23
+ "@strapi/strapi": "^4.0",
24
+ "react": "^17.0.0 || ^18.0.0",
25
+ "react-dom": "^17.0.0 || ^18.0.0",
26
+ "react-router-dom": "^5.2.0",
27
+ "styled-components": "^5.2.1"
28
+ },
29
+ "engines": {
30
+ "node": ">=18.0.0",
31
+ "npm": ">=6.0.0"
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
+ ],
43
+ "strapi": {
44
+ "name": "strapi-plugin-payone-provider",
45
+ "description": "Integrates Strapi Payone payment gateway with Strapi",
46
+ "kind": "plugin",
47
+ "displayName": "Strapi Payone Provider"
48
+ }
49
+ }
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  module.exports = async ({ strapi }) => {
4
- // Initialize plugin settings store
5
4
  const pluginStore = strapi.store({
6
5
  environment: "",
7
6
  type: "plugin",
8
7
  name: "strapi-plugin-payone-provider"
9
8
  });
10
9
 
11
- // Initialize default settings if not already set
12
10
  const settings = await pluginStore.get({ key: "settings" });
13
11
  if (!settings) {
14
12
  await pluginStore.set({
@@ -28,18 +26,12 @@ module.exports = async ({ strapi }) => {
28
26
  });
29
27
  }
30
28
 
31
- // Register custom routes for 3DS redirects at root level
32
- // These routes handle redirects from Payone after 3DS authentication
33
- // They work with both /admin/ and /content-ui/ paths
34
29
  const pluginName = "strapi-plugin-payone-provider";
35
30
 
36
- // Get the controller
37
31
  const getController = () => {
38
32
  return strapi.plugin(pluginName).controller("payone");
39
33
  };
40
34
 
41
- // All routes use the same handler - it detects success/error/back from URL path
42
- // Routes match the plugin's internal payment callback URLs
43
35
  const routes = [
44
36
  "/admin/plugins/strapi-plugin-payone-provider/payment/success",
45
37
  "/admin/plugins/strapi-plugin-payone-provider/payment/error",
@@ -49,7 +41,6 @@ module.exports = async ({ strapi }) => {
49
41
  "/content-ui/plugins/strapi-plugin-payone-provider/payment/back"
50
42
  ];
51
43
 
52
- // Register routes using Koa router
53
44
  try {
54
45
  const Router = require('@koa/router');
55
46
  const router = new Router();
@@ -63,7 +54,6 @@ module.exports = async ({ strapi }) => {
63
54
  });
64
55
  });
65
56
 
66
- // Register route for Apple Pay .well-known file
67
57
  router.get('/.well-known/apple-developer-merchantid-domain-association', async (ctx) => {
68
58
  try {
69
59
  const publicPath = path.join(process.cwd(), 'public');
@@ -74,12 +64,10 @@ module.exports = async ({ strapi }) => {
74
64
  let fileContent = null;
75
65
  let filePathFound = null;
76
66
 
77
- // Try main file first
78
67
  if (fs.existsSync(filePath)) {
79
68
  filePathFound = filePath;
80
69
  fileContent = fs.readFileSync(filePath, 'utf8');
81
70
  }
82
- // Try alternative file name
83
71
  else if (fs.existsSync(filePathTxt)) {
84
72
  filePathFound = filePathTxt;
85
73
  fileContent = fs.readFileSync(filePathTxt, 'utf8');
@@ -6,13 +6,11 @@ const getPayoneService = (strapi) => {
6
6
  return strapi.plugin(PLUGIN_NAME).service("payone");
7
7
  };
8
8
 
9
-
10
9
  const handleError = (ctx, error) => {
11
10
  ctx.strapi.log.error("Payone controller error:", error);
12
11
  ctx.throw(500, error);
13
12
  };
14
13
 
15
-
16
14
  const hideKey = (settings) => {
17
15
  if (settings && settings.key) {
18
16
  settings.key = "***HIDDEN***";
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
2
 
3
- /**
4
- * Add payment method specific parameters
5
- * @param {Object} params - Request parameters
6
- * @param {Object} logger - Logger instance
7
- * @returns {Object} Updated parameters with payment method defaults
8
- */
3
+
9
4
  const addPaymentMethodParams = (params, logger) => {
10
5
  const updated = { ...params };
11
6
  const clearingtype = updated.clearingtype || "cc";
@@ -152,7 +147,6 @@ const addPaymentMethodParams = (params, logger) => {
152
147
  updated.wallettype = "PPE";
153
148
  }
154
149
  }
155
-
156
150
  if (updated.clearingtype === "wlt" && updated.cardtype) {
157
151
  delete updated.cardtype;
158
152
  }