strapi-plugin-payone-provider 1.6.7 → 5.6.9
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/README.md +24 -11
- package/admin/src/components/Initializer/index.jsx +3 -3
- package/admin/src/components/PluginIcon/index.jsx +3 -3
- package/admin/src/index.js +33 -11
- package/admin/src/pages/App/components/AppHeader.jsx +17 -32
- package/admin/src/pages/App/components/AppTabs.jsx +36 -156
- package/admin/src/pages/App/components/ApplePayBtn.jsx +9 -11
- package/admin/src/pages/App/components/ApplePayConfig.jsx +221 -161
- package/admin/src/pages/App/components/ApplePayConfigPanel.jsx +33 -45
- package/admin/src/pages/App/components/DocsPanel.jsx +66 -1726
- package/admin/src/pages/App/components/GooglePayConfig.jsx +136 -169
- package/admin/src/pages/App/components/GooglePayConfigPanel.jsx +37 -55
- package/admin/src/pages/App/components/GooglePaybutton.jsx +101 -43
- package/admin/src/pages/App/components/RenderInput.jsx +94 -0
- package/admin/src/pages/App/components/StatusBadge.jsx +27 -16
- package/admin/src/pages/App/components/configuration/ConfigurationFields.jsx +255 -0
- package/admin/src/pages/App/components/configuration/ConfigurationPanel.jsx +54 -0
- package/admin/src/pages/App/components/configuration/TestConnection.jsx +130 -0
- package/admin/src/pages/App/components/docs/ApplePaySection.jsx +260 -0
- package/admin/src/pages/App/components/docs/BaseUrlSection.jsx +53 -0
- package/admin/src/pages/App/components/docs/CaptureRefundSection.jsx +113 -0
- package/admin/src/pages/App/components/docs/CodeBlock.jsx +59 -0
- package/admin/src/pages/App/components/docs/CreditCardSection.jsx +93 -0
- package/admin/src/pages/App/components/docs/GooglePaySection.jsx +248 -0
- package/admin/src/pages/App/components/docs/PayPalSection.jsx +116 -0
- package/admin/src/pages/App/components/docs/PaymentMethodsSection.jsx +55 -0
- package/admin/src/pages/App/components/docs/TableOfContents.jsx +47 -0
- package/admin/src/pages/App/components/docs/TestCredentialsSection.jsx +304 -0
- package/admin/src/pages/App/components/docs/ThreeDSecureSection.jsx +188 -0
- package/admin/src/pages/App/components/icons/BankIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/ChevronDownIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/ChevronUpIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/CreditCardIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/ErrorIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/InfoIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/MarkCircle.jsx +19 -0
- package/admin/src/pages/App/components/icons/PaymentIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/PendingIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/PersonIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/SuccessIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/WalletIcon.jsx +1 -1
- package/admin/src/pages/App/components/payment-actions/ApplePayPanel.jsx +51 -0
- package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +341 -0
- package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +128 -0
- package/admin/src/pages/App/components/{paymentActions → payment-actions}/CardDetailsInput.jsx +77 -72
- package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +194 -0
- package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +313 -0
- package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +133 -0
- package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +280 -0
- package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +121 -0
- package/admin/src/pages/App/components/transaction-history/FiltersPanel.jsx +145 -0
- package/admin/src/pages/App/components/transaction-history/HistoryPanel.jsx +50 -0
- package/admin/src/pages/App/components/transaction-history/TransactionTable.jsx +163 -0
- package/admin/src/pages/App/components/transaction-history/details/TransactionDetails.jsx +156 -0
- package/admin/src/pages/App/components/{TransactionHistoryItem.jsx → transaction-history/details/TransactionHistoryItem.jsx} +16 -28
- package/admin/src/pages/App/index.jsx +27 -67
- package/admin/src/pages/App/styles.css +46 -169
- package/admin/src/pages/constants/paymentConstants.js +52 -16
- package/admin/src/pages/hooks/use-system-theme.js +27 -0
- package/admin/src/pages/hooks/usePaymentActions.js +273 -210
- package/admin/src/pages/hooks/useSettings.js +87 -48
- package/admin/src/pages/hooks/useTransactionHistory.js +109 -47
- package/admin/src/pages/utils/api.js +57 -72
- package/admin/src/pages/utils/applePayConstants.js +2 -28
- package/admin/src/pages/utils/countryLanguageUtils.js +280 -0
- package/admin/src/pages/utils/getInputComponent.jsx +225 -0
- package/admin/src/pages/utils/googlePayConstants.js +2 -9
- package/admin/src/pages/utils/paymentUtils.js +13 -25
- package/admin/src/pages/utils/tooltipHelpers.js +18 -0
- package/admin/src/pages/utils/transactionTableUtils.js +60 -0
- package/package.json +7 -12
- package/server/config/index.js +18 -2
- package/server/controllers/payone.js +80 -31
- package/server/policies/is-auth.js +9 -3
- package/server/policies/isSuperAdmin.js +7 -5
- package/server/services/paymentService.js +6 -22
- package/server/services/payone.js +3 -3
- package/server/services/settingsService.js +13 -3
- package/server/services/testConnectionService.js +11 -73
- package/server/services/transactionService.js +61 -32
- package/server/utils/normalize.js +0 -12
- package/server/utils/paymentMethodParams.js +0 -1
- package/server/utils/responseParser.js +9 -14
- package/strapi-admin.js +3 -1
- package/admin/src/pages/App/components/ConfigurationPanel.jsx +0 -517
- package/admin/src/pages/App/components/HistoryPanel.jsx +0 -312
- package/admin/src/pages/App/components/PaymentActionsPanel.jsx +0 -280
- package/admin/src/pages/App/components/paymentActions/ApplePayPanel.jsx +0 -95
- package/admin/src/pages/App/components/paymentActions/AuthorizationForm.jsx +0 -197
- package/admin/src/pages/App/components/paymentActions/CaptureForm.jsx +0 -65
- package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +0 -306
- package/admin/src/pages/App/components/paymentActions/PaymentResult.jsx +0 -192
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +0 -142
- package/admin/src/pages/App/components/paymentActions/RefundForm.jsx +0 -90
|
@@ -1,517 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Box,
|
|
4
|
-
Button,
|
|
5
|
-
Card,
|
|
6
|
-
CardBody,
|
|
7
|
-
Flex,
|
|
8
|
-
Stack,
|
|
9
|
-
Typography,
|
|
10
|
-
TextInput,
|
|
11
|
-
Select,
|
|
12
|
-
Option,
|
|
13
|
-
Alert,
|
|
14
|
-
Switch,
|
|
15
|
-
} from "@strapi/design-system";
|
|
16
|
-
import { Play, Cog } from "@strapi/icons";
|
|
17
|
-
import { useHistory } from "react-router-dom";
|
|
18
|
-
import pluginId from "../../../pluginId";
|
|
19
|
-
|
|
20
|
-
const ConfigurationPanel = ({
|
|
21
|
-
settings,
|
|
22
|
-
isTesting,
|
|
23
|
-
testResult,
|
|
24
|
-
onTestConnection,
|
|
25
|
-
onInputChange,
|
|
26
|
-
onPaymentMethodToggle,
|
|
27
|
-
}) => {
|
|
28
|
-
const history = useHistory();
|
|
29
|
-
const mode = (settings?.mode || "test").toLowerCase();
|
|
30
|
-
|
|
31
|
-
const handleNavigateToApplePayConfig = () => {
|
|
32
|
-
history.push(`/plugins/${pluginId}/apple-pay-config`);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const handleNavigateToGooglePayConfig = () => {
|
|
36
|
-
history.push(`/plugins/${pluginId}/google-pay-config`);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<Box
|
|
41
|
-
className="payment-container"
|
|
42
|
-
paddingTop={8}
|
|
43
|
-
paddingBottom={8}
|
|
44
|
-
paddingLeft={8}
|
|
45
|
-
paddingRight={8}
|
|
46
|
-
>
|
|
47
|
-
<Flex direction="column" alignItems="stretch" gap={8}>
|
|
48
|
-
<Box>
|
|
49
|
-
<Typography
|
|
50
|
-
variant="beta"
|
|
51
|
-
as="h2"
|
|
52
|
-
fontWeight="bold"
|
|
53
|
-
className="payment-title"
|
|
54
|
-
style={{ fontSize: "20px", marginBottom: "4px" }}
|
|
55
|
-
>
|
|
56
|
-
Payone API Configuration
|
|
57
|
-
</Typography>
|
|
58
|
-
<Typography
|
|
59
|
-
variant="pi"
|
|
60
|
-
textColor="neutral600"
|
|
61
|
-
marginTop={2}
|
|
62
|
-
className="payment-subtitle"
|
|
63
|
-
style={{ fontSize: "14px" }}
|
|
64
|
-
>
|
|
65
|
-
Configure your Payone payment gateway settings
|
|
66
|
-
</Typography>
|
|
67
|
-
</Box>
|
|
68
|
-
<Box
|
|
69
|
-
style={{
|
|
70
|
-
display: "flex",
|
|
71
|
-
flexDirection: "row",
|
|
72
|
-
gap: "16px",
|
|
73
|
-
flexWrap: "wrap",
|
|
74
|
-
}}
|
|
75
|
-
>
|
|
76
|
-
<Card className="payment-card">
|
|
77
|
-
<CardBody padding={6}>
|
|
78
|
-
<Stack spacing={6}>
|
|
79
|
-
<Flex gap={4} wrap="wrap">
|
|
80
|
-
<TextInput
|
|
81
|
-
label="Account ID (aid)"
|
|
82
|
-
name="aid"
|
|
83
|
-
value={settings.aid || ""}
|
|
84
|
-
onChange={(e) => onInputChange("aid", e.target.value)}
|
|
85
|
-
required
|
|
86
|
-
hint="Your Payone account ID"
|
|
87
|
-
className="payment-input"
|
|
88
|
-
style={{ flex: 1, minWidth: "300px" }}
|
|
89
|
-
/>
|
|
90
|
-
|
|
91
|
-
<TextInput
|
|
92
|
-
label="Portal ID"
|
|
93
|
-
name="portalid"
|
|
94
|
-
value={settings.portalid || ""}
|
|
95
|
-
onChange={(e) => onInputChange("portalid", e.target.value)}
|
|
96
|
-
required
|
|
97
|
-
hint="Your Payone portal ID"
|
|
98
|
-
className="payment-input"
|
|
99
|
-
style={{ flex: 1, minWidth: "300px" }}
|
|
100
|
-
/>
|
|
101
|
-
</Flex>
|
|
102
|
-
|
|
103
|
-
<Flex gap={4} wrap="wrap">
|
|
104
|
-
<TextInput
|
|
105
|
-
label="Merchant ID (mid)"
|
|
106
|
-
name="mid"
|
|
107
|
-
value={settings.mid || ""}
|
|
108
|
-
onChange={(e) => onInputChange("mid", e.target.value)}
|
|
109
|
-
required
|
|
110
|
-
hint="Your Payone merchant ID"
|
|
111
|
-
className="payment-input"
|
|
112
|
-
style={{ flex: 1, minWidth: "300px" }}
|
|
113
|
-
/>
|
|
114
|
-
|
|
115
|
-
<TextInput
|
|
116
|
-
label="Portal Key"
|
|
117
|
-
name="key"
|
|
118
|
-
type="password"
|
|
119
|
-
value={settings.key || ""}
|
|
120
|
-
onChange={(e) => onInputChange("key", e.target.value)}
|
|
121
|
-
required
|
|
122
|
-
hint="Your Payone portal key (will be encrypted)"
|
|
123
|
-
className="payment-input"
|
|
124
|
-
style={{ flex: 1, minWidth: "300px" }}
|
|
125
|
-
/>
|
|
126
|
-
</Flex>
|
|
127
|
-
|
|
128
|
-
<Flex gap={4} wrap="wrap">
|
|
129
|
-
<TextInput
|
|
130
|
-
label="Domain Name"
|
|
131
|
-
name="domainName"
|
|
132
|
-
value={settings.domainName || ""}
|
|
133
|
-
onChange={(e) =>
|
|
134
|
-
onInputChange("domainName", e.target.value)
|
|
135
|
-
}
|
|
136
|
-
hint="Your domain name (optional)"
|
|
137
|
-
className="payment-input"
|
|
138
|
-
style={{ flex: 1, minWidth: "300px" }}
|
|
139
|
-
/>
|
|
140
|
-
|
|
141
|
-
<TextInput
|
|
142
|
-
label="Display Name"
|
|
143
|
-
name="displayName"
|
|
144
|
-
value={settings.displayName || ""}
|
|
145
|
-
onChange={(e) =>
|
|
146
|
-
onInputChange("displayName", e.target.value)
|
|
147
|
-
}
|
|
148
|
-
hint="Display name for payment methods (optional)"
|
|
149
|
-
className="payment-input"
|
|
150
|
-
style={{ flex: 1, minWidth: "300px" }}
|
|
151
|
-
/>
|
|
152
|
-
</Flex>
|
|
153
|
-
|
|
154
|
-
<Flex gap={4} wrap="wrap">
|
|
155
|
-
<Select
|
|
156
|
-
label="Mode"
|
|
157
|
-
name="mode"
|
|
158
|
-
value={settings.mode || "test"}
|
|
159
|
-
onChange={(value) => onInputChange("mode", value)}
|
|
160
|
-
hint="Select the API mode"
|
|
161
|
-
className="payment-input"
|
|
162
|
-
style={{ flex: 1, minWidth: "300px" }}
|
|
163
|
-
>
|
|
164
|
-
<Option value="test">Test</Option>
|
|
165
|
-
<Option value="live">Live</Option>
|
|
166
|
-
</Select>
|
|
167
|
-
|
|
168
|
-
<TextInput
|
|
169
|
-
label="API Version"
|
|
170
|
-
name="api_version"
|
|
171
|
-
value={settings.api_version || "3.10"}
|
|
172
|
-
onChange={(e) =>
|
|
173
|
-
onInputChange("api_version", e.target.value)
|
|
174
|
-
}
|
|
175
|
-
hint="Payone API version"
|
|
176
|
-
className="payment-input"
|
|
177
|
-
style={{ flex: 1, minWidth: "300px" }}
|
|
178
|
-
/>
|
|
179
|
-
</Flex>
|
|
180
|
-
|
|
181
|
-
<Flex
|
|
182
|
-
direction="column"
|
|
183
|
-
wrap="wrap"
|
|
184
|
-
gap={1}
|
|
185
|
-
alignItems="flex-start"
|
|
186
|
-
>
|
|
187
|
-
<Select
|
|
188
|
-
label="Enable 3D Secure"
|
|
189
|
-
name="enable3DSecure"
|
|
190
|
-
value={settings.enable3DSecure ? "yes" : "no"}
|
|
191
|
-
onChange={(value) =>
|
|
192
|
-
onInputChange("enable3DSecure", value === "yes")
|
|
193
|
-
}
|
|
194
|
-
hint="Enable 3D Secure authentication for credit card payments"
|
|
195
|
-
className="payment-input"
|
|
196
|
-
>
|
|
197
|
-
<Option value="yes">Enabled</Option>
|
|
198
|
-
<Option value="no">Disabled</Option>
|
|
199
|
-
</Select>
|
|
200
|
-
<Typography variant="pi" textColor="neutral600" marginTop={1}>
|
|
201
|
-
When enabled, credit card payments will require 3D Secure
|
|
202
|
-
authentication (SCA compliance)
|
|
203
|
-
</Typography>
|
|
204
|
-
</Flex>
|
|
205
|
-
|
|
206
|
-
<Flex
|
|
207
|
-
direction="row"
|
|
208
|
-
gap={2}
|
|
209
|
-
wrap="wrap"
|
|
210
|
-
alignItems="flex-start"
|
|
211
|
-
marginTop={2}
|
|
212
|
-
>
|
|
213
|
-
<Button
|
|
214
|
-
variant="secondary"
|
|
215
|
-
startIcon={<Cog />}
|
|
216
|
-
onClick={handleNavigateToApplePayConfig}
|
|
217
|
-
className="payment-button"
|
|
218
|
-
>
|
|
219
|
-
Apple Pay Config
|
|
220
|
-
</Button>
|
|
221
|
-
<Button
|
|
222
|
-
variant="secondary"
|
|
223
|
-
startIcon={<Cog />}
|
|
224
|
-
onClick={handleNavigateToGooglePayConfig}
|
|
225
|
-
className="payment-button"
|
|
226
|
-
>
|
|
227
|
-
Google Pay Config
|
|
228
|
-
</Button>
|
|
229
|
-
</Flex>
|
|
230
|
-
</Stack>
|
|
231
|
-
</CardBody>
|
|
232
|
-
</Card>
|
|
233
|
-
|
|
234
|
-
<Card className="payment-card">
|
|
235
|
-
<CardBody padding={6}>
|
|
236
|
-
<Stack spacing={6}>
|
|
237
|
-
<Box>
|
|
238
|
-
<Typography
|
|
239
|
-
variant="delta"
|
|
240
|
-
as="h3"
|
|
241
|
-
fontWeight="bold"
|
|
242
|
-
marginBottom={4}
|
|
243
|
-
>
|
|
244
|
-
Payment Methods
|
|
245
|
-
</Typography>
|
|
246
|
-
<Typography
|
|
247
|
-
variant="pi"
|
|
248
|
-
textColor="neutral600"
|
|
249
|
-
marginBottom={4}
|
|
250
|
-
>
|
|
251
|
-
Enable or disable payment methods for your Payone
|
|
252
|
-
integration
|
|
253
|
-
</Typography>
|
|
254
|
-
</Box>
|
|
255
|
-
|
|
256
|
-
<Stack spacing={4}>
|
|
257
|
-
<Flex
|
|
258
|
-
direction="row"
|
|
259
|
-
justifyContent="space-between"
|
|
260
|
-
alignItems="center"
|
|
261
|
-
gap={4}
|
|
262
|
-
>
|
|
263
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
264
|
-
Credit Card (Visa, Mastercard)
|
|
265
|
-
</Typography>
|
|
266
|
-
<Switch
|
|
267
|
-
label="Credit Card"
|
|
268
|
-
selected={settings.enableCreditCard !== false}
|
|
269
|
-
onChange={() =>
|
|
270
|
-
onPaymentMethodToggle(
|
|
271
|
-
"enableCreditCard",
|
|
272
|
-
!settings.enableCreditCard
|
|
273
|
-
)
|
|
274
|
-
}
|
|
275
|
-
/>
|
|
276
|
-
</Flex>
|
|
277
|
-
|
|
278
|
-
<Flex
|
|
279
|
-
direction="row"
|
|
280
|
-
justifyContent="space-between"
|
|
281
|
-
alignItems="center"
|
|
282
|
-
gap={4}
|
|
283
|
-
>
|
|
284
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
285
|
-
PayPal
|
|
286
|
-
</Typography>
|
|
287
|
-
<Switch
|
|
288
|
-
label="PayPal"
|
|
289
|
-
selected={settings.enablePayPal !== false}
|
|
290
|
-
onChange={() =>
|
|
291
|
-
onPaymentMethodToggle(
|
|
292
|
-
"enablePayPal",
|
|
293
|
-
!settings.enablePayPal
|
|
294
|
-
)
|
|
295
|
-
}
|
|
296
|
-
/>
|
|
297
|
-
</Flex>
|
|
298
|
-
|
|
299
|
-
<Flex
|
|
300
|
-
direction="row"
|
|
301
|
-
justifyContent="space-between"
|
|
302
|
-
alignItems="center"
|
|
303
|
-
gap={4}
|
|
304
|
-
>
|
|
305
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
306
|
-
Google Pay
|
|
307
|
-
</Typography>
|
|
308
|
-
<Switch
|
|
309
|
-
label="Google Pay"
|
|
310
|
-
selected={settings.enableGooglePay !== false}
|
|
311
|
-
onChange={() =>
|
|
312
|
-
onPaymentMethodToggle(
|
|
313
|
-
"enableGooglePay",
|
|
314
|
-
!settings.enableGooglePay
|
|
315
|
-
)
|
|
316
|
-
}
|
|
317
|
-
/>
|
|
318
|
-
</Flex>
|
|
319
|
-
|
|
320
|
-
<Flex
|
|
321
|
-
direction="row"
|
|
322
|
-
justifyContent="space-between"
|
|
323
|
-
alignItems="center"
|
|
324
|
-
gap={4}
|
|
325
|
-
>
|
|
326
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
327
|
-
Apple Pay
|
|
328
|
-
</Typography>
|
|
329
|
-
<Switch
|
|
330
|
-
label="Apple Pay"
|
|
331
|
-
selected={settings.enableApplePay !== false}
|
|
332
|
-
onChange={() =>
|
|
333
|
-
onPaymentMethodToggle(
|
|
334
|
-
"enableApplePay",
|
|
335
|
-
!settings.enableApplePay
|
|
336
|
-
)
|
|
337
|
-
}
|
|
338
|
-
/>
|
|
339
|
-
</Flex>
|
|
340
|
-
|
|
341
|
-
<Flex
|
|
342
|
-
direction="row"
|
|
343
|
-
justifyContent="space-between"
|
|
344
|
-
alignItems="center"
|
|
345
|
-
gap={4}
|
|
346
|
-
>
|
|
347
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
348
|
-
Sofort Banking
|
|
349
|
-
</Typography>
|
|
350
|
-
<Switch
|
|
351
|
-
label="Sofort Banking"
|
|
352
|
-
selected={settings.enableSofort !== false}
|
|
353
|
-
onChange={() =>
|
|
354
|
-
onPaymentMethodToggle(
|
|
355
|
-
"enableSofort",
|
|
356
|
-
!settings.enableSofort
|
|
357
|
-
)
|
|
358
|
-
}
|
|
359
|
-
/>
|
|
360
|
-
</Flex>
|
|
361
|
-
|
|
362
|
-
<Flex
|
|
363
|
-
direction="row"
|
|
364
|
-
justifyContent="space-between"
|
|
365
|
-
alignItems="center"
|
|
366
|
-
gap={4}
|
|
367
|
-
>
|
|
368
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
369
|
-
SEPA Direct Debit
|
|
370
|
-
</Typography>
|
|
371
|
-
<Switch
|
|
372
|
-
label="SEPA Direct Debit"
|
|
373
|
-
selected={settings.enableSepaDirectDebit !== false}
|
|
374
|
-
onChange={() =>
|
|
375
|
-
onPaymentMethodToggle(
|
|
376
|
-
"enableSepaDirectDebit",
|
|
377
|
-
!settings.enableSepaDirectDebit
|
|
378
|
-
)
|
|
379
|
-
}
|
|
380
|
-
/>
|
|
381
|
-
</Flex>
|
|
382
|
-
</Stack>
|
|
383
|
-
</Stack>
|
|
384
|
-
</CardBody>
|
|
385
|
-
</Card>
|
|
386
|
-
</Box>
|
|
387
|
-
<Box paddingTop={6}>
|
|
388
|
-
<Card className="payment-card">
|
|
389
|
-
<CardBody padding={6}>
|
|
390
|
-
<Stack spacing={6}>
|
|
391
|
-
<Box>
|
|
392
|
-
<Typography
|
|
393
|
-
variant="delta"
|
|
394
|
-
as="h3"
|
|
395
|
-
fontWeight="bold"
|
|
396
|
-
marginBottom={2}
|
|
397
|
-
>
|
|
398
|
-
Test Connection
|
|
399
|
-
</Typography>
|
|
400
|
-
<Typography variant="pi" textColor="neutral600">
|
|
401
|
-
Verify your Payone configuration by testing the API
|
|
402
|
-
connection
|
|
403
|
-
</Typography>
|
|
404
|
-
</Box>
|
|
405
|
-
|
|
406
|
-
<Button
|
|
407
|
-
variant="default"
|
|
408
|
-
onClick={onTestConnection}
|
|
409
|
-
loading={isTesting}
|
|
410
|
-
startIcon={<Play />}
|
|
411
|
-
className="payment-button payment-button-success"
|
|
412
|
-
disabled={mode === "live"}
|
|
413
|
-
>
|
|
414
|
-
{isTesting ? "Testing Connection..." : "Test Connection"}
|
|
415
|
-
</Button>
|
|
416
|
-
{mode === "live" && (
|
|
417
|
-
<Typography
|
|
418
|
-
variant="pi"
|
|
419
|
-
textColor="neutral600"
|
|
420
|
-
style={{ marginTop: "8px" }}
|
|
421
|
-
>
|
|
422
|
-
Test Connection is disabled in live mode for security
|
|
423
|
-
reasons.
|
|
424
|
-
</Typography>
|
|
425
|
-
)}
|
|
426
|
-
|
|
427
|
-
{testResult && (
|
|
428
|
-
<Alert
|
|
429
|
-
variant={Boolean(testResult.success) ? "success" : "danger"}
|
|
430
|
-
title={
|
|
431
|
-
Boolean(testResult.success)
|
|
432
|
-
? "Connection Successful"
|
|
433
|
-
: "Connection Failed"
|
|
434
|
-
}
|
|
435
|
-
className="payment-alert"
|
|
436
|
-
>
|
|
437
|
-
<Typography
|
|
438
|
-
variant="pi"
|
|
439
|
-
fontWeight="medium"
|
|
440
|
-
marginBottom={2}
|
|
441
|
-
>
|
|
442
|
-
{testResult.message}
|
|
443
|
-
</Typography>
|
|
444
|
-
{testResult.details && (
|
|
445
|
-
<Box paddingTop={3}>
|
|
446
|
-
{Boolean(testResult.success) ? (
|
|
447
|
-
<Card className="payment-card">
|
|
448
|
-
<CardBody padding={4}>
|
|
449
|
-
<Typography variant="pi">
|
|
450
|
-
<strong>Mode:</strong> {testResult.details.mode}{" "}
|
|
451
|
-
|<strong> AID:</strong> {testResult.details.aid}{" "}
|
|
452
|
-
|<strong> Portal ID:</strong>{" "}
|
|
453
|
-
{testResult.details.portalid} |
|
|
454
|
-
<strong> Merchant ID:</strong>{" "}
|
|
455
|
-
{testResult.details.mid || ""}
|
|
456
|
-
</Typography>
|
|
457
|
-
</CardBody>
|
|
458
|
-
</Card>
|
|
459
|
-
) : (
|
|
460
|
-
<Card
|
|
461
|
-
className="payment-card"
|
|
462
|
-
style={{ background: "#fff5f5" }}
|
|
463
|
-
>
|
|
464
|
-
<CardBody padding={4}>
|
|
465
|
-
<Stack spacing={2}>
|
|
466
|
-
{testResult.errorcode && (
|
|
467
|
-
<Typography
|
|
468
|
-
variant="pi"
|
|
469
|
-
textColor="neutral600"
|
|
470
|
-
>
|
|
471
|
-
<strong>Error Code:</strong>{" "}
|
|
472
|
-
{testResult.errorcode}
|
|
473
|
-
</Typography>
|
|
474
|
-
)}
|
|
475
|
-
{testResult.details.errorCode && (
|
|
476
|
-
<Typography
|
|
477
|
-
variant="pi"
|
|
478
|
-
textColor="neutral600"
|
|
479
|
-
>
|
|
480
|
-
<strong>Error Code:</strong>{" "}
|
|
481
|
-
{testResult.details.errorCode}
|
|
482
|
-
</Typography>
|
|
483
|
-
)}
|
|
484
|
-
{testResult.details &&
|
|
485
|
-
testResult.details.rawResponse && (
|
|
486
|
-
<Typography
|
|
487
|
-
variant="pi"
|
|
488
|
-
textColor="neutral600"
|
|
489
|
-
>
|
|
490
|
-
<strong>Debug Info:</strong>{" "}
|
|
491
|
-
{testResult.details.rawResponse}
|
|
492
|
-
</Typography>
|
|
493
|
-
)}
|
|
494
|
-
</Stack>
|
|
495
|
-
</CardBody>
|
|
496
|
-
</Card>
|
|
497
|
-
)}
|
|
498
|
-
</Box>
|
|
499
|
-
)}
|
|
500
|
-
</Alert>
|
|
501
|
-
)}
|
|
502
|
-
</Stack>
|
|
503
|
-
</CardBody>
|
|
504
|
-
</Card>
|
|
505
|
-
</Box>
|
|
506
|
-
<Box paddingTop={4}>
|
|
507
|
-
<Typography variant="sigma" textColor="neutral600">
|
|
508
|
-
Note: These settings are used for all Payone API requests. Make sure
|
|
509
|
-
to use the correct credentials for your selected mode.
|
|
510
|
-
</Typography>
|
|
511
|
-
</Box>
|
|
512
|
-
</Flex>
|
|
513
|
-
</Box>
|
|
514
|
-
);
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
export default ConfigurationPanel;
|