strapi-plugin-payone-provider 1.6.3 → 1.6.5
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/admin/src/pages/App/components/AppHeader.jsx +14 -8
- package/admin/src/pages/App/components/ApplePayBtn.jsx +327 -306
- package/admin/src/pages/App/components/ApplePayConfigPanel.jsx +8 -19
- package/admin/src/pages/App/components/ConfigurationPanel.jsx +74 -16
- package/admin/src/pages/App/components/DocsPanel.jsx +0 -1
- package/admin/src/pages/App/components/GooglePayConfig.jsx +80 -43
- package/admin/src/pages/App/components/PaymentActionsPanel.jsx +40 -55
- package/admin/src/pages/App/components/paymentActions/ApplePayPanel.jsx +51 -0
- package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +2 -9
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +1 -1
- package/admin/src/pages/hooks/usePaymentActions.js +4 -14
- package/admin/src/pages/utils/paymentUtils.js +46 -25
- package/package.json +1 -1
- package/server/bootstrap.js +19 -35
- package/server/controllers/payone.js +67 -15
- package/server/services/applePayService.js +218 -47
- package/server/services/paymentService.js +0 -13
- package/server/services/testConnectionService.js +3 -2
- package/server/utils/paymentMethodParams.js +46 -3
|
@@ -5,18 +5,15 @@ import {
|
|
|
5
5
|
CardBody,
|
|
6
6
|
Flex,
|
|
7
7
|
Typography,
|
|
8
|
-
Button
|
|
8
|
+
Button,
|
|
9
9
|
} from "@strapi/design-system";
|
|
10
10
|
import { Check } from "@strapi/icons";
|
|
11
11
|
import ApplePayConfig from "./ApplePayConfig";
|
|
12
12
|
|
|
13
|
-
const ApplePayConfigPanel = ({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
onSave
|
|
18
|
-
}) => {
|
|
19
|
-
const [applePayConfig, setApplePayConfig] = useState(settings?.applePayConfig || {});
|
|
13
|
+
const ApplePayConfigPanel = ({ settings, onInputChange, isSaving, onSave }) => {
|
|
14
|
+
const [applePayConfig, setApplePayConfig] = useState(
|
|
15
|
+
settings?.applePayConfig || {}
|
|
16
|
+
);
|
|
20
17
|
|
|
21
18
|
useEffect(() => {
|
|
22
19
|
setApplePayConfig(settings?.applePayConfig || {});
|
|
@@ -31,15 +28,6 @@ const ApplePayConfigPanel = ({
|
|
|
31
28
|
paddingRight={8}
|
|
32
29
|
>
|
|
33
30
|
<Flex direction="column" alignItems="stretch" gap={8}>
|
|
34
|
-
<Box>
|
|
35
|
-
<Typography variant="beta" as="h2" fontWeight="bold" className="payment-title" style={{ fontSize: '20px', marginBottom: '4px' }}>
|
|
36
|
-
Apple Pay Configuration
|
|
37
|
-
</Typography>
|
|
38
|
-
<Typography variant="pi" textColor="neutral600" marginTop={2} className="payment-subtitle" style={{ fontSize: '14px' }}>
|
|
39
|
-
Configure Apple Pay settings for your payment gateway
|
|
40
|
-
</Typography>
|
|
41
|
-
</Box>
|
|
42
|
-
|
|
43
31
|
<Box>
|
|
44
32
|
<Card className="payment-card">
|
|
45
33
|
<CardBody padding={6}>
|
|
@@ -68,7 +56,9 @@ const ApplePayConfigPanel = ({
|
|
|
68
56
|
Save Apple Pay Configuration
|
|
69
57
|
</Button>
|
|
70
58
|
<Typography variant="sigma" textColor="neutral600">
|
|
71
|
-
Note: Apple Pay configuration is used for Apple Pay payment
|
|
59
|
+
Note: Apple Pay configuration is used for Apple Pay payment
|
|
60
|
+
requests. Make sure to configure the correct merchant identifier,
|
|
61
|
+
supported networks, and capabilities for your region.
|
|
72
62
|
</Typography>
|
|
73
63
|
</Flex>
|
|
74
64
|
</Box>
|
|
@@ -78,4 +68,3 @@ const ApplePayConfigPanel = ({
|
|
|
78
68
|
};
|
|
79
69
|
|
|
80
70
|
export default ApplePayConfigPanel;
|
|
81
|
-
|
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
TextInput,
|
|
11
11
|
Select,
|
|
12
12
|
Option,
|
|
13
|
-
Alert
|
|
13
|
+
Alert,
|
|
14
14
|
} from "@strapi/design-system";
|
|
15
|
-
import { Play } from "@strapi/icons";
|
|
15
|
+
import { Play, Cog } from "@strapi/icons";
|
|
16
|
+
import { useHistory } from "react-router-dom";
|
|
17
|
+
import pluginId from "../../../pluginId";
|
|
16
18
|
|
|
17
19
|
const ConfigurationPanel = ({
|
|
18
20
|
settings,
|
|
@@ -21,17 +23,22 @@ const ConfigurationPanel = ({
|
|
|
21
23
|
testResult,
|
|
22
24
|
onSave,
|
|
23
25
|
onTestConnection,
|
|
24
|
-
onInputChange
|
|
26
|
+
onInputChange,
|
|
25
27
|
}) => {
|
|
28
|
+
const history = useHistory();
|
|
26
29
|
const mode = (settings?.mode || "test").toLowerCase();
|
|
27
30
|
|
|
28
31
|
useEffect(() => {
|
|
29
|
-
|
|
30
|
-
const currentMode = (settings.mode || "test").toLowerCase();
|
|
31
|
-
console.log("[ConfigurationPanel] Mode updated:", currentMode);
|
|
32
|
-
}
|
|
32
|
+
// Mode updated
|
|
33
33
|
}, [settings?.mode]);
|
|
34
34
|
|
|
35
|
+
const handleNavigateToApplePayConfig = () => {
|
|
36
|
+
history.push(`/plugins/${pluginId}/apple-pay-config`);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const handleNavigateToGooglePayConfig = () => {
|
|
40
|
+
history.push(`/plugins/${pluginId}/google-pay-config`);
|
|
41
|
+
};
|
|
35
42
|
|
|
36
43
|
return (
|
|
37
44
|
<Box
|
|
@@ -43,10 +50,22 @@ const ConfigurationPanel = ({
|
|
|
43
50
|
>
|
|
44
51
|
<Flex direction="column" alignItems="stretch" gap={8}>
|
|
45
52
|
<Box>
|
|
46
|
-
<Typography
|
|
53
|
+
<Typography
|
|
54
|
+
variant="beta"
|
|
55
|
+
as="h2"
|
|
56
|
+
fontWeight="bold"
|
|
57
|
+
className="payment-title"
|
|
58
|
+
style={{ fontSize: "20px", marginBottom: "4px" }}
|
|
59
|
+
>
|
|
47
60
|
Payone API Configuration
|
|
48
61
|
</Typography>
|
|
49
|
-
<Typography
|
|
62
|
+
<Typography
|
|
63
|
+
variant="pi"
|
|
64
|
+
textColor="neutral600"
|
|
65
|
+
marginTop={2}
|
|
66
|
+
className="payment-subtitle"
|
|
67
|
+
style={{ fontSize: "14px" }}
|
|
68
|
+
>
|
|
50
69
|
Configure your Payone payment gateway settings
|
|
51
70
|
</Typography>
|
|
52
71
|
</Box>
|
|
@@ -131,7 +150,12 @@ const ConfigurationPanel = ({
|
|
|
131
150
|
/>
|
|
132
151
|
</Flex>
|
|
133
152
|
|
|
134
|
-
<Flex
|
|
153
|
+
<Flex
|
|
154
|
+
direction="column"
|
|
155
|
+
wrap="wrap"
|
|
156
|
+
gap={1}
|
|
157
|
+
alignItems="flex-start"
|
|
158
|
+
>
|
|
135
159
|
<Select
|
|
136
160
|
label="Enable 3D Secure"
|
|
137
161
|
name="enable3DSecure"
|
|
@@ -146,9 +170,35 @@ const ConfigurationPanel = ({
|
|
|
146
170
|
<Option value="no">Disabled</Option>
|
|
147
171
|
</Select>
|
|
148
172
|
<Typography variant="pi" textColor="neutral600" marginTop={1}>
|
|
149
|
-
When enabled, credit card payments will require 3D Secure
|
|
173
|
+
When enabled, credit card payments will require 3D Secure
|
|
174
|
+
authentication (SCA compliance)
|
|
150
175
|
</Typography>
|
|
151
176
|
</Flex>
|
|
177
|
+
|
|
178
|
+
<Flex
|
|
179
|
+
direction="row"
|
|
180
|
+
gap={2}
|
|
181
|
+
wrap="wrap"
|
|
182
|
+
alignItems="flex-start"
|
|
183
|
+
marginTop={2}
|
|
184
|
+
>
|
|
185
|
+
<Button
|
|
186
|
+
variant="secondary"
|
|
187
|
+
startIcon={<Cog />}
|
|
188
|
+
onClick={handleNavigateToApplePayConfig}
|
|
189
|
+
className="payment-button"
|
|
190
|
+
>
|
|
191
|
+
Apple Pay Config
|
|
192
|
+
</Button>
|
|
193
|
+
<Button
|
|
194
|
+
variant="secondary"
|
|
195
|
+
startIcon={<Cog />}
|
|
196
|
+
onClick={handleNavigateToGooglePayConfig}
|
|
197
|
+
className="payment-button"
|
|
198
|
+
>
|
|
199
|
+
Google Pay Config
|
|
200
|
+
</Button>
|
|
201
|
+
</Flex>
|
|
152
202
|
</Stack>
|
|
153
203
|
</CardBody>
|
|
154
204
|
</Card>
|
|
@@ -179,13 +229,18 @@ const ConfigurationPanel = ({
|
|
|
179
229
|
loading={isTesting}
|
|
180
230
|
startIcon={<Play />}
|
|
181
231
|
className="payment-button payment-button-success"
|
|
182
|
-
disabled={mode ===
|
|
232
|
+
disabled={mode === "live"}
|
|
183
233
|
>
|
|
184
234
|
{isTesting ? "Testing Connection..." : "Test Connection"}
|
|
185
235
|
</Button>
|
|
186
|
-
{mode ===
|
|
187
|
-
<Typography
|
|
188
|
-
|
|
236
|
+
{mode === "live" && (
|
|
237
|
+
<Typography
|
|
238
|
+
variant="pi"
|
|
239
|
+
textColor="neutral600"
|
|
240
|
+
style={{ marginTop: "8px" }}
|
|
241
|
+
>
|
|
242
|
+
Test Connection is disabled in live mode for security
|
|
243
|
+
reasons.
|
|
189
244
|
</Typography>
|
|
190
245
|
)}
|
|
191
246
|
|
|
@@ -222,7 +277,10 @@ const ConfigurationPanel = ({
|
|
|
222
277
|
</CardBody>
|
|
223
278
|
</Card>
|
|
224
279
|
) : (
|
|
225
|
-
<Card
|
|
280
|
+
<Card
|
|
281
|
+
className="payment-card"
|
|
282
|
+
style={{ background: "#fff5f5" }}
|
|
283
|
+
>
|
|
226
284
|
<CardBody padding={4}>
|
|
227
285
|
<Stack spacing={2}>
|
|
228
286
|
{testResult.errorcode && (
|
|
@@ -1,76 +1,71 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Flex,
|
|
5
|
+
Typography,
|
|
6
|
+
Select,
|
|
7
|
+
Option,
|
|
8
|
+
Checkbox,
|
|
9
|
+
Stack,
|
|
10
|
+
} from "@strapi/design-system";
|
|
3
11
|
import {
|
|
4
12
|
GOOGLE_PAY_SUPPORTED_COUNTRIES,
|
|
5
13
|
GOOGLE_PAY_SUPPORTED_CURRENCIES,
|
|
6
14
|
GOOGLE_PAY_SUPPORTED_NETWORKS,
|
|
7
15
|
GOOGLE_PAY_AUTH_METHODS,
|
|
8
|
-
DEFAULT_GOOGLE_PAY_CONFIG
|
|
16
|
+
DEFAULT_GOOGLE_PAY_CONFIG,
|
|
9
17
|
} from "../../utils/googlePayConstants";
|
|
10
18
|
|
|
11
|
-
const GooglePayConfig = ({
|
|
12
|
-
config,
|
|
13
|
-
onConfigChange,
|
|
14
|
-
settings
|
|
15
|
-
}) => {
|
|
19
|
+
const GooglePayConfig = ({ config, onConfigChange, settings }) => {
|
|
16
20
|
const {
|
|
17
21
|
countryCode = DEFAULT_GOOGLE_PAY_CONFIG.countryCode,
|
|
18
22
|
currencyCode = DEFAULT_GOOGLE_PAY_CONFIG.currencyCode,
|
|
19
23
|
allowedCardNetworks = DEFAULT_GOOGLE_PAY_CONFIG.allowedCardNetworks,
|
|
20
24
|
allowedAuthMethods = DEFAULT_GOOGLE_PAY_CONFIG.allowedAuthMethods,
|
|
21
|
-
merchantName = DEFAULT_GOOGLE_PAY_CONFIG.merchantName
|
|
25
|
+
merchantName = DEFAULT_GOOGLE_PAY_CONFIG.merchantName,
|
|
22
26
|
} = config || {};
|
|
23
27
|
|
|
24
28
|
const handleCountryChange = (value) => {
|
|
25
29
|
onConfigChange({
|
|
26
30
|
...config,
|
|
27
|
-
countryCode: value
|
|
31
|
+
countryCode: value,
|
|
28
32
|
});
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
const handleCurrencyChange = (value) => {
|
|
32
36
|
onConfigChange({
|
|
33
37
|
...config,
|
|
34
|
-
currencyCode: value
|
|
38
|
+
currencyCode: value,
|
|
35
39
|
});
|
|
36
40
|
};
|
|
37
41
|
|
|
38
42
|
const handleNetworkToggle = (networkCode) => {
|
|
39
43
|
const currentNetworks = allowedCardNetworks || [];
|
|
40
44
|
const newNetworks = currentNetworks.includes(networkCode)
|
|
41
|
-
? currentNetworks.filter(n => n !== networkCode)
|
|
45
|
+
? currentNetworks.filter((n) => n !== networkCode)
|
|
42
46
|
: [...currentNetworks, networkCode];
|
|
43
47
|
|
|
44
48
|
onConfigChange({
|
|
45
49
|
...config,
|
|
46
|
-
allowedCardNetworks: newNetworks
|
|
50
|
+
allowedCardNetworks: newNetworks,
|
|
47
51
|
});
|
|
48
52
|
};
|
|
49
53
|
|
|
50
54
|
const handleAuthMethodToggle = (authMethodCode) => {
|
|
51
55
|
const currentMethods = allowedAuthMethods || [];
|
|
52
56
|
const newMethods = currentMethods.includes(authMethodCode)
|
|
53
|
-
? currentMethods.filter(m => m !== authMethodCode)
|
|
57
|
+
? currentMethods.filter((m) => m !== authMethodCode)
|
|
54
58
|
: [...currentMethods, authMethodCode];
|
|
55
59
|
|
|
56
60
|
onConfigChange({
|
|
57
61
|
...config,
|
|
58
|
-
allowedAuthMethods: newMethods
|
|
62
|
+
allowedAuthMethods: newMethods,
|
|
59
63
|
});
|
|
60
64
|
};
|
|
61
65
|
|
|
62
66
|
return (
|
|
63
67
|
<Box>
|
|
64
68
|
<Stack spacing={6}>
|
|
65
|
-
<Box>
|
|
66
|
-
<Typography variant="delta" as="h3" fontWeight="bold" style={{ marginBottom: "6px" }}>
|
|
67
|
-
Google Pay Configuration
|
|
68
|
-
</Typography>
|
|
69
|
-
<Typography variant="pi" textColor="neutral600">
|
|
70
|
-
Configure Google Pay settings for your payment gateway
|
|
71
|
-
</Typography>
|
|
72
|
-
</Box>
|
|
73
|
-
|
|
74
69
|
{/* Country and Currency */}
|
|
75
70
|
<Flex gap={4} wrap="wrap">
|
|
76
71
|
<Box style={{ flex: 1, minWidth: "300px" }}>
|
|
@@ -82,7 +77,7 @@ const GooglePayConfig = ({
|
|
|
82
77
|
hint="Select the country where your business operates"
|
|
83
78
|
required
|
|
84
79
|
>
|
|
85
|
-
{GOOGLE_PAY_SUPPORTED_COUNTRIES.map(country => (
|
|
80
|
+
{GOOGLE_PAY_SUPPORTED_COUNTRIES.map((country) => (
|
|
86
81
|
<Option key={country.code} value={country.code}>
|
|
87
82
|
{country.name} ({country.code})
|
|
88
83
|
</Option>
|
|
@@ -99,7 +94,7 @@ const GooglePayConfig = ({
|
|
|
99
94
|
hint="Select the currency for transactions"
|
|
100
95
|
required
|
|
101
96
|
>
|
|
102
|
-
{GOOGLE_PAY_SUPPORTED_CURRENCIES.map(currency => (
|
|
97
|
+
{GOOGLE_PAY_SUPPORTED_CURRENCIES.map((currency) => (
|
|
103
98
|
<Option key={currency.code} value={currency.code}>
|
|
104
99
|
{currency.name} ({currency.code}) {currency.symbol}
|
|
105
100
|
</Option>
|
|
@@ -110,23 +105,33 @@ const GooglePayConfig = ({
|
|
|
110
105
|
|
|
111
106
|
{/* Merchant Name */}
|
|
112
107
|
<Box>
|
|
113
|
-
<Typography
|
|
108
|
+
<Typography
|
|
109
|
+
variant="pi"
|
|
110
|
+
fontWeight="semiBold"
|
|
111
|
+
style={{ marginLeft: "2px" }}
|
|
112
|
+
>
|
|
114
113
|
Merchant Name
|
|
115
114
|
</Typography>
|
|
116
|
-
<Typography
|
|
115
|
+
<Typography
|
|
116
|
+
variant="pi"
|
|
117
|
+
textColor="neutral600"
|
|
118
|
+
style={{ marginLeft: "2px" }}
|
|
119
|
+
>
|
|
117
120
|
The name of your business as it will appear in Google Pay
|
|
118
121
|
</Typography>
|
|
119
122
|
<input
|
|
120
123
|
type="text"
|
|
121
124
|
value={merchantName}
|
|
122
|
-
onChange={(e) =>
|
|
125
|
+
onChange={(e) =>
|
|
126
|
+
onConfigChange({ ...config, merchantName: e.target.value })
|
|
127
|
+
}
|
|
123
128
|
style={{
|
|
124
129
|
width: "100%",
|
|
125
130
|
padding: "8px 12px",
|
|
126
131
|
marginTop: "8px",
|
|
127
132
|
border: "1px solid #dcdce4",
|
|
128
133
|
borderRadius: "4px",
|
|
129
|
-
fontSize: "14px"
|
|
134
|
+
fontSize: "14px",
|
|
130
135
|
}}
|
|
131
136
|
placeholder="Your Store Name"
|
|
132
137
|
/>
|
|
@@ -134,18 +139,29 @@ const GooglePayConfig = ({
|
|
|
134
139
|
|
|
135
140
|
{/* Allowed Card Networks */}
|
|
136
141
|
<Box>
|
|
137
|
-
<Typography
|
|
142
|
+
<Typography
|
|
143
|
+
variant="pi"
|
|
144
|
+
fontWeight="semiBold"
|
|
145
|
+
style={{ marginLeft: "2px" }}
|
|
146
|
+
>
|
|
138
147
|
Allowed Card Networks
|
|
139
148
|
</Typography>
|
|
140
|
-
<Typography
|
|
149
|
+
<Typography
|
|
150
|
+
variant="pi"
|
|
151
|
+
textColor="neutral600"
|
|
152
|
+
style={{ marginLeft: "2px" }}
|
|
153
|
+
>
|
|
141
154
|
Select payment card networks to accept
|
|
142
155
|
</Typography>
|
|
143
156
|
<Flex wrap="wrap" gap={4} style={{ marginTop: "12px" }}>
|
|
144
|
-
{GOOGLE_PAY_SUPPORTED_NETWORKS.map(network => {
|
|
157
|
+
{GOOGLE_PAY_SUPPORTED_NETWORKS.map((network) => {
|
|
145
158
|
const isSelected = allowedCardNetworks?.includes(network.code);
|
|
146
159
|
|
|
147
160
|
return (
|
|
148
|
-
<Box
|
|
161
|
+
<Box
|
|
162
|
+
key={network.code}
|
|
163
|
+
style={{ flex: "0 0 calc(50% - 8px)", minWidth: "250px" }}
|
|
164
|
+
>
|
|
149
165
|
<Checkbox
|
|
150
166
|
name={`network-${network.code}`}
|
|
151
167
|
checked={isSelected}
|
|
@@ -158,7 +174,11 @@ const GooglePayConfig = ({
|
|
|
158
174
|
})}
|
|
159
175
|
</Flex>
|
|
160
176
|
{allowedCardNetworks?.length === 0 && (
|
|
161
|
-
<Typography
|
|
177
|
+
<Typography
|
|
178
|
+
variant="pi"
|
|
179
|
+
textColor="danger600"
|
|
180
|
+
style={{ marginTop: "8px" }}
|
|
181
|
+
>
|
|
162
182
|
At least one card network must be selected
|
|
163
183
|
</Typography>
|
|
164
184
|
)}
|
|
@@ -166,18 +186,29 @@ const GooglePayConfig = ({
|
|
|
166
186
|
|
|
167
187
|
{/* Allowed Authentication Methods */}
|
|
168
188
|
<Box>
|
|
169
|
-
<Typography
|
|
189
|
+
<Typography
|
|
190
|
+
variant="pi"
|
|
191
|
+
fontWeight="semiBold"
|
|
192
|
+
style={{ marginLeft: "2px" }}
|
|
193
|
+
>
|
|
170
194
|
Allowed Authentication Methods
|
|
171
195
|
</Typography>
|
|
172
|
-
<Typography
|
|
196
|
+
<Typography
|
|
197
|
+
variant="pi"
|
|
198
|
+
textColor="neutral600"
|
|
199
|
+
style={{ marginLeft: "2px" }}
|
|
200
|
+
>
|
|
173
201
|
Select authentication methods for card payments
|
|
174
202
|
</Typography>
|
|
175
203
|
<Flex wrap="wrap" gap={4} style={{ marginTop: "12px" }}>
|
|
176
|
-
{GOOGLE_PAY_AUTH_METHODS.map(method => {
|
|
204
|
+
{GOOGLE_PAY_AUTH_METHODS.map((method) => {
|
|
177
205
|
const isSelected = allowedAuthMethods?.includes(method.code);
|
|
178
206
|
|
|
179
207
|
return (
|
|
180
|
-
<Box
|
|
208
|
+
<Box
|
|
209
|
+
key={method.code}
|
|
210
|
+
style={{ flex: "0 0 calc(50% - 8px)", minWidth: "250px" }}
|
|
211
|
+
>
|
|
181
212
|
<Checkbox
|
|
182
213
|
name={`auth-method-${method.code}`}
|
|
183
214
|
checked={isSelected}
|
|
@@ -190,7 +221,11 @@ const GooglePayConfig = ({
|
|
|
190
221
|
})}
|
|
191
222
|
</Flex>
|
|
192
223
|
{allowedAuthMethods?.length === 0 && (
|
|
193
|
-
<Typography
|
|
224
|
+
<Typography
|
|
225
|
+
variant="pi"
|
|
226
|
+
textColor="danger600"
|
|
227
|
+
style={{ marginTop: "8px" }}
|
|
228
|
+
>
|
|
194
229
|
At least one authentication method must be selected
|
|
195
230
|
</Typography>
|
|
196
231
|
)}
|
|
@@ -198,14 +233,17 @@ const GooglePayConfig = ({
|
|
|
198
233
|
|
|
199
234
|
{/* Gateway Merchant ID Info */}
|
|
200
235
|
<Box>
|
|
201
|
-
<Typography
|
|
236
|
+
<Typography
|
|
237
|
+
variant="pi"
|
|
238
|
+
fontWeight="semiBold"
|
|
239
|
+
style={{ marginLeft: "2px" }}
|
|
240
|
+
>
|
|
202
241
|
Gateway Merchant ID
|
|
203
242
|
</Typography>
|
|
204
243
|
<Typography variant="pi" textColor="neutral600">
|
|
205
244
|
{settings?.mid || settings?.portalid
|
|
206
245
|
? `Using: ${settings.mid || settings.portalid}`
|
|
207
|
-
: "Gateway merchant ID will be obtained from your Payone Merchant ID (MID) or Portal ID. Make sure these are configured in the main Configuration tab."
|
|
208
|
-
}
|
|
246
|
+
: "Gateway merchant ID will be obtained from your Payone Merchant ID (MID) or Portal ID. Make sure these are configured in the main Configuration tab."}
|
|
209
247
|
</Typography>
|
|
210
248
|
</Box>
|
|
211
249
|
</Stack>
|
|
@@ -214,4 +252,3 @@ const GooglePayConfig = ({
|
|
|
214
252
|
};
|
|
215
253
|
|
|
216
254
|
export default GooglePayConfig;
|
|
217
|
-
|
|
@@ -6,6 +6,7 @@ import AuthorizationForm from "./paymentActions/AuthorizationForm";
|
|
|
6
6
|
import CaptureForm from "./paymentActions/CaptureForm";
|
|
7
7
|
import RefundForm from "./paymentActions/RefundForm";
|
|
8
8
|
import PaymentResult from "./paymentActions/PaymentResult";
|
|
9
|
+
import ApplePayPanel from "./paymentActions/ApplePayPanel";
|
|
9
10
|
|
|
10
11
|
const PaymentActionsPanel = ({
|
|
11
12
|
paymentAmount,
|
|
@@ -57,66 +58,52 @@ const PaymentActionsPanel = ({
|
|
|
57
58
|
style={{
|
|
58
59
|
display: "flex",
|
|
59
60
|
flexDirection: "column",
|
|
60
|
-
alignItems: "
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
justifyContent: "center",
|
|
63
|
+
gap: "8px",
|
|
64
|
+
marginTop: "44px",
|
|
64
65
|
}}
|
|
65
66
|
>
|
|
66
|
-
<Typography
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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.
|
|
67
|
+
<Typography variant="pi" textColor="neutral600">
|
|
68
|
+
Test Payments are only works in test mode.
|
|
69
|
+
</Typography>
|
|
70
|
+
<Typography variant="pi" textColor="neutral600">
|
|
71
|
+
Please switch to test mode in plugin settings to use test payments.
|
|
79
72
|
</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
73
|
</Box>
|
|
117
74
|
);
|
|
118
75
|
}
|
|
119
76
|
|
|
77
|
+
if (paymentMethod === "apl") {
|
|
78
|
+
return (
|
|
79
|
+
<ApplePayPanel
|
|
80
|
+
paymentAmount={paymentAmount}
|
|
81
|
+
setPaymentAmount={setPaymentAmount}
|
|
82
|
+
authReference={authReference}
|
|
83
|
+
setAuthReference={setAuthReference}
|
|
84
|
+
isProcessingPayment={isProcessingPayment}
|
|
85
|
+
onAuthorization={onAuthorization}
|
|
86
|
+
paymentMethod={paymentMethod}
|
|
87
|
+
setPaymentMethod={setPaymentMethod}
|
|
88
|
+
captureMode={captureMode}
|
|
89
|
+
setCaptureMode={setCaptureMode}
|
|
90
|
+
settings={settings}
|
|
91
|
+
setGooglePayToken={setGooglePayToken}
|
|
92
|
+
applePayToken={applePayToken}
|
|
93
|
+
setApplePayToken={setApplePayToken}
|
|
94
|
+
cardtype={cardtype}
|
|
95
|
+
setCardtype={setCardtype}
|
|
96
|
+
cardpan={cardpan}
|
|
97
|
+
setCardpan={setCardpan}
|
|
98
|
+
cardexpiredate={cardexpiredate}
|
|
99
|
+
setCardexpiredate={setCardexpiredate}
|
|
100
|
+
cardcvc2={cardcvc2}
|
|
101
|
+
setCardcvc2={setCardcvc2}
|
|
102
|
+
onNavigateToConfig={onNavigateToConfig}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
120
107
|
return (
|
|
121
108
|
<Box
|
|
122
109
|
className="payment-container"
|
|
@@ -181,7 +168,6 @@ const PaymentActionsPanel = ({
|
|
|
181
168
|
onPreauthorization={onPreauthorization}
|
|
182
169
|
paymentMethod={paymentMethod}
|
|
183
170
|
settings={settings}
|
|
184
|
-
googlePayToken={googlePayToken}
|
|
185
171
|
setGooglePayToken={setGooglePayToken}
|
|
186
172
|
applePayToken={applePayToken}
|
|
187
173
|
setApplePayToken={setApplePayToken}
|
|
@@ -209,7 +195,6 @@ const PaymentActionsPanel = ({
|
|
|
209
195
|
onAuthorization={onAuthorization}
|
|
210
196
|
paymentMethod={paymentMethod}
|
|
211
197
|
settings={settings}
|
|
212
|
-
googlePayToken={googlePayToken}
|
|
213
198
|
setGooglePayToken={setGooglePayToken}
|
|
214
199
|
applePayToken={applePayToken}
|
|
215
200
|
setApplePayToken={setApplePayToken}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Typography } from "@strapi/design-system";
|
|
3
|
+
import PaymentMethodSelector from "./PaymentMethodSelector";
|
|
4
|
+
import AuthorizationForm from "./AuthorizationForm";
|
|
5
|
+
|
|
6
|
+
const ApplePayOnlyPanel = ({
|
|
7
|
+
paymentMethod,
|
|
8
|
+
setPaymentMethod,
|
|
9
|
+
captureMode,
|
|
10
|
+
setCaptureMode,
|
|
11
|
+
onNavigateToConfig,
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
<Box
|
|
15
|
+
style={{
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexDirection: "column",
|
|
18
|
+
alignItems: "flex-start",
|
|
19
|
+
gap: "16px",
|
|
20
|
+
marginTop: "24px",
|
|
21
|
+
width: "100%",
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
<Typography
|
|
25
|
+
variant="pi"
|
|
26
|
+
textColor="warning600"
|
|
27
|
+
style={{
|
|
28
|
+
fontSize: "14px",
|
|
29
|
+
marginTop: "12px",
|
|
30
|
+
marginBottom: "12px",
|
|
31
|
+
fontWeight: "bold",
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
⚠️ Apple Pay can only be tested on a production domain with HTTPS and
|
|
35
|
+
Live mode. Testing in Strapi admin panel is not supported. Please test
|
|
36
|
+
Apple Pay on your production website.
|
|
37
|
+
</Typography>
|
|
38
|
+
|
|
39
|
+
<PaymentMethodSelector
|
|
40
|
+
paymentMethod={paymentMethod}
|
|
41
|
+
setPaymentMethod={setPaymentMethod}
|
|
42
|
+
captureMode={captureMode}
|
|
43
|
+
setCaptureMode={setCaptureMode}
|
|
44
|
+
onNavigateToConfig={onNavigateToConfig}
|
|
45
|
+
isLiveMode={false}
|
|
46
|
+
/>
|
|
47
|
+
</Box>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default ApplePayOnlyPanel;
|