strapi-plugin-payone-provider 5.6.13 → 5.6.14

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.
Files changed (39) hide show
  1. package/admin/src/index.js +14 -20
  2. package/admin/src/pages/App/components/AppHeader.jsx +16 -17
  3. package/admin/src/pages/App/components/AppTabs.jsx +14 -15
  4. package/admin/src/pages/App/components/ApplePayBtn.jsx +9 -14
  5. package/admin/src/pages/App/components/ApplePayConfig.jsx +25 -26
  6. package/admin/src/pages/App/components/ApplePayConfigPanel.jsx +4 -4
  7. package/admin/src/pages/App/components/DocsPanel.jsx +8 -21
  8. package/admin/src/pages/App/components/GooglePayConfig.jsx +16 -14
  9. package/admin/src/pages/App/components/GooglePayConfigPanel.jsx +4 -4
  10. package/admin/src/pages/App/components/GooglePaybutton.jsx +6 -5
  11. package/admin/src/pages/App/components/configuration/ConfigurationFields.jsx +39 -47
  12. package/admin/src/pages/App/components/configuration/ConfigurationPanel.jsx +5 -4
  13. package/admin/src/pages/App/components/configuration/TestConnection.jsx +19 -36
  14. package/admin/src/pages/App/components/payment-actions/ApplePayPanel.jsx +4 -4
  15. package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +12 -19
  16. package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +15 -23
  17. package/admin/src/pages/App/components/payment-actions/CardDetailsInput.jsx +20 -19
  18. package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +13 -24
  19. package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +8 -6
  20. package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +6 -10
  21. package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +12 -19
  22. package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +15 -22
  23. package/admin/src/pages/App/components/transaction-history/FiltersPanel.jsx +83 -84
  24. package/admin/src/pages/App/components/transaction-history/HistoryPanel.jsx +7 -17
  25. package/admin/src/pages/App/components/transaction-history/ImportExportBar.jsx +153 -0
  26. package/admin/src/pages/App/components/transaction-history/TransactionTable.jsx +22 -15
  27. package/admin/src/pages/hooks/usePluginTranslations.js +12 -0
  28. package/admin/src/pages/utils/api.js +27 -0
  29. package/admin/src/translations/de.json +235 -0
  30. package/admin/src/translations/en.json +235 -0
  31. package/admin/src/translations/fr.json +235 -0
  32. package/admin/src/translations/ru.json +235 -0
  33. package/admin/src/utils/prefixPluginTranslations.js +13 -0
  34. package/package.json +2 -2
  35. package/server/controllers/payone.js +70 -0
  36. package/server/routes/index.js +16 -0
  37. package/server/services/payone.js +8 -0
  38. package/server/services/transactionService.js +80 -1
  39. package/server/utils/csvTransactions.js +82 -0
@@ -9,6 +9,7 @@ import {
9
9
  } from "@strapi/design-system";
10
10
  import { Check } from "@strapi/icons";
11
11
  import GooglePayConfig from "./GooglePayConfig";
12
+ import { usePluginTranslations } from "../../hooks/usePluginTranslations";
12
13
 
13
14
  const GooglePayConfigPanel = ({
14
15
  settings,
@@ -17,6 +18,7 @@ const GooglePayConfigPanel = ({
17
18
  onSave,
18
19
  onBack,
19
20
  }) => {
21
+ const { t } = usePluginTranslations();
20
22
  const [googlePayConfig, setGooglePayConfig] = React.useState(
21
23
  settings?.googlePayConfig || {}
22
24
  );
@@ -42,9 +44,7 @@ const GooglePayConfigPanel = ({
42
44
 
43
45
  <Flex direction="column" gap={4} alignItems="stretch" paddingTop={4}>
44
46
  <Typography variant="sigma" textColor="neutral600">
45
- Note: Google Pay configuration is used for Google Pay payment
46
- requests. Make sure to configure the correct card networks,
47
- authentication methods, and merchant information for your region.
47
+ {t("googlePayConfigPanel.note", "Note: Google Pay configuration is used for Google Pay payment requests. Make sure to configure the correct card networks, authentication methods, and merchant information for your region.")}
48
48
  </Typography>
49
49
  <Button
50
50
  loading={isSaving}
@@ -54,7 +54,7 @@ const GooglePayConfigPanel = ({
54
54
  variant="default"
55
55
  maxWidth={"220px"}
56
56
  >
57
- Save Configuration
57
+ {t("googlePayConfigPanel.save", "Save Configuration")}
58
58
  </Button>
59
59
  </Flex>
60
60
  </Flex>
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { Box, Flex, Typography } from "@strapi/design-system";
3
3
  import { injectGooglePayScript } from "../../utils/injectGooglePayScript";
4
+ import { usePluginTranslations } from "../../hooks/usePluginTranslations";
4
5
 
5
6
  const GooglePayButton = ({
6
7
  amount,
@@ -9,6 +10,7 @@ const GooglePayButton = ({
9
10
  onError,
10
11
  settings,
11
12
  }) => {
13
+ const { t } = usePluginTranslations();
12
14
  const [isReady, setIsReady] = React.useState(false);
13
15
  const [isLoading, setIsLoading] = React.useState(true);
14
16
  const buttonContainerRef = React.useRef(null);
@@ -308,7 +310,7 @@ const GooglePayButton = ({
308
310
  textColor="neutral600"
309
311
  style={{ textAlign: "left" }}
310
312
  >
311
- Loading Google Pay...
313
+ {t("googlePay.loading", "Loading Google Pay...")}
312
314
  </Typography>
313
315
  )}
314
316
  {!isLoading && !isReady && (
@@ -317,7 +319,7 @@ const GooglePayButton = ({
317
319
  textColor="neutral600"
318
320
  style={{ textAlign: "left" }}
319
321
  >
320
- Google Pay is not available
322
+ {t("googlePay.notAvailable", "Google Pay is not available")}
321
323
  </Typography>
322
324
  )}
323
325
  {!isLoading && isReady && (
@@ -328,15 +330,14 @@ const GooglePayButton = ({
328
330
  fontWeight="semiBold"
329
331
  style={{ textAlign: "left" }}
330
332
  >
331
- Google Pay Payment
333
+ {t("googlePay.paymentTitle", "Google Pay Payment")}
332
334
  </Typography>
333
335
  <Typography
334
336
  variant="pi"
335
337
  textColor="neutral600"
336
338
  style={{ textAlign: "left" }}
337
339
  >
338
- Click the button below to pay with Google Pay. The token will be
339
- automatically sent to Payone.
340
+ {t("googlePay.paymentHint", "Click the button below to pay with Google Pay. The token will be automatically sent to Payone.")}
340
341
  </Typography>
341
342
  </>
342
343
  )}
@@ -8,6 +8,7 @@ import {
8
8
  } from "@strapi/design-system";
9
9
  import { Cog } from "@strapi/icons";
10
10
  import RenderInput from "../RenderInput";
11
+ import { usePluginTranslations } from "../../../hooks/usePluginTranslations";
11
12
 
12
13
  const ConfigurationFields = ({
13
14
  settings,
@@ -15,6 +16,7 @@ const ConfigurationFields = ({
15
16
  onPaymentMethodToggle,
16
17
  onNavigateToConfig,
17
18
  }) => {
19
+ const { t } = usePluginTranslations();
18
20
  const handleNavigateToApplePayConfig = () => {
19
21
  if (onNavigateToConfig) {
20
22
  onNavigateToConfig("apple-pay-config");
@@ -39,82 +41,79 @@ const ConfigurationFields = ({
39
41
  <Flex direction="column" alignItems={"stretch"} gap={6}>
40
42
  <Flex direction="row" gap={2}>
41
43
  <RenderInput
42
- label="Account ID (aid)"
44
+ label={t("config.fields.aid", "Account ID (aid)")}
43
45
  name="aid"
44
46
  value={settings.aid}
45
47
  onChange={(e) => onInputChange("aid", e.target.value)}
46
48
  required
47
49
  inputType="textInput"
48
- tooltipContent={"Your Payone account ID"}
50
+ tooltipContent={t("config.fields.aidTooltip", "Your Payone account ID")}
49
51
  />
50
-
51
52
  <RenderInput
52
- label="Portal ID"
53
+ label={t("config.fields.portalid", "Portal ID")}
53
54
  name="portalid"
54
55
  value={settings.portalid}
55
56
  onChange={(e) => onInputChange("portalid", e.target.value)}
56
57
  required
57
58
  inputType="textInput"
58
- tooltipContent={"Your Payone portal ID"}
59
+ tooltipContent={t("config.fields.portalidTooltip", "Your Payone portal ID")}
59
60
  />
60
61
  </Flex>
61
62
  <Flex direction="row" gap={2}>
62
63
  <RenderInput
63
- label="Merchant ID (mid)"
64
+ label={t("config.fields.mid", "Merchant ID (mid)")}
64
65
  name="mid"
65
66
  value={settings.mid}
66
67
  onChange={(e) => onInputChange("mid", e.target.value)}
67
68
  required
68
69
  inputType="textInput"
69
- tooltipContent={"Your Payone merchant ID"}
70
+ tooltipContent={t("config.fields.midTooltip", "Your Payone merchant ID")}
70
71
  />
71
-
72
72
  <RenderInput
73
- label="Portal Key"
73
+ label={t("config.fields.key", "Portal Key")}
74
74
  name="key"
75
75
  type="password"
76
76
  value={settings.key}
77
77
  onChange={(e) => onInputChange("key", e.target.value)}
78
78
  required
79
79
  inputType="textInput"
80
- tooltipContent={"Your Payone portal key (will be encrypted)"}
80
+ tooltipContent={t("config.fields.keyTooltip", "Your Payone portal key (will be encrypted)")}
81
81
  />
82
82
  </Flex>
83
83
  <Flex direction="row" gap={2}>
84
84
  <RenderInput
85
- label="Domain Name"
85
+ label={t("config.fields.domainName", "Domain Name")}
86
86
  name="domainName"
87
87
  value={settings.domainName}
88
88
  onChange={(e) => onInputChange("domainName", e.target.value)}
89
89
  inputType="textInput"
90
- tooltipContent={"Your Payone domain name"}
90
+ tooltipContent={t("config.fields.domainNameTooltip", "Your Payone domain name")}
91
91
  />
92
-
93
92
  <RenderInput
94
- label="Display Name"
93
+ label={t("config.fields.displayName", "Display Name")}
95
94
  name="displayName"
96
95
  value={settings.displayName}
97
96
  onChange={(e) => onInputChange("displayName", e.target.value)}
98
97
  inputType="textInput"
99
- tooltipContent={"Display name for payment methods (optional)"}
98
+ tooltipContent={t("config.fields.displayNameTooltip", "Display name for payment methods (optional)")}
100
99
  />
101
100
  </Flex>
102
101
  <Flex direction="row" gap={2}>
103
102
  <RenderInput
104
- label="Mode"
103
+ label={t("config.fields.mode", "Mode")}
105
104
  name="mode"
106
105
  value={settings.mode || "test"}
107
106
  onChange={(e) => onInputChange("mode", e.target.value)}
108
107
  required
109
108
  inputType="select"
110
- tooltipContent={"Select the API mode"}
109
+ tooltipContent={t("config.fields.modeTooltip", "Select the API mode")}
111
110
  options={[
112
- { value: "test", label: "Test" },
113
- { value: "live", label: "Live" },
111
+ { value: "test", label: t("config.fields.modeTest", "Test") },
112
+ { value: "live", label: t("config.fields.modeLive", "Live") },
114
113
  ]}
115
114
  />
116
115
  <RenderInput
117
- label="Enable 3D Secure"
116
+ label={t("config.fields.enable3DSecure", "Enable 3D Secure")}
118
117
  name="enable3DSecure"
119
118
  value={settings.enable3DSecure ? "yes" : "no"}
120
119
  onChange={(e) =>
@@ -122,35 +121,33 @@ const ConfigurationFields = ({
122
121
  }
123
122
  required
124
123
  inputType="select"
125
- tooltipContent={
126
- "Enable 3D Secure authentication for credit card payments"
127
- }
124
+ tooltipContent={t("config.fields.enable3DSecureTooltip", "Enable 3D Secure authentication for credit card payments")}
128
125
  options={[
129
- { value: "yes", label: "Enabled" },
130
- { value: "no", label: "Disabled" },
126
+ { value: "yes", label: t("config.fields.enabled", "Enabled") },
127
+ { value: "no", label: t("config.fields.disabled", "Disabled") },
131
128
  ]}
132
129
  />
133
130
  </Flex>
134
131
  <Flex direction="row">
135
132
  <RenderInput
136
- label="API Version"
133
+ label={t("config.fields.apiVersion", "API Version")}
137
134
  name="api_version"
138
135
  value={settings.api_version || "3.10"}
139
136
  onChange={(e) => onInputChange("api_version", e.target.value)}
140
137
  required
141
138
  inputType="textInput"
142
- tooltipContent={"Payone API version"}
139
+ tooltipContent={t("config.fields.apiVersionTooltip", "Payone API version")}
143
140
  />
144
141
  </Flex>
145
142
  </Flex>
146
143
 
147
144
  <Flex direction="column" alignItems="stretch" gap={4} marginTop={6}>
148
145
  <Typography variant="pi" textColor="neutral600" marginBottom={4}>
149
- Enable or disable payment methods for your Payone integration
146
+ {t("config.paymentMethods.title", "Enable or disable payment methods for your Payone integration")}
150
147
  </Typography>
151
148
 
152
149
  <RenderInput
153
- label="Credit Card (Visa, Mastercard)"
150
+ label={t("config.paymentMethods.creditCard", "Credit Card (Visa, Mastercard)")}
154
151
  name="enableCreditCard"
155
152
  value={settings.enableCreditCard === true}
156
153
  onChange={(selected) =>
@@ -159,11 +156,10 @@ const ConfigurationFields = ({
159
156
  inputType="switch"
160
157
  labelDirection="row"
161
158
  labelStyle={{ fontSize: "16px" }}
162
- tooltipContent="Enable or disable credit card payments"
159
+ tooltipContent={t("config.paymentMethods.creditCardTooltip", "Enable or disable credit card payments")}
163
160
  />
164
-
165
161
  <RenderInput
166
- label="PayPal"
162
+ label={t("config.paymentMethods.paypal", "PayPal")}
167
163
  name="enablePayPal"
168
164
  value={settings.enablePayPal === true}
169
165
  onChange={(selected) =>
@@ -172,11 +168,10 @@ const ConfigurationFields = ({
172
168
  inputType="switch"
173
169
  labelDirection="row"
174
170
  labelStyle={{ fontSize: "16px" }}
175
- tooltipContent="Enable or disable PayPal payments"
171
+ tooltipContent={t("config.paymentMethods.paypalTooltip", "Enable or disable PayPal payments")}
176
172
  />
177
-
178
173
  <RenderInput
179
- label="Google Pay"
174
+ label={t("config.paymentMethods.googlePay", "Google Pay")}
180
175
  name="enableGooglePay"
181
176
  value={settings.enableGooglePay === true}
182
177
  onChange={(selected) =>
@@ -185,11 +180,10 @@ const ConfigurationFields = ({
185
180
  inputType="switch"
186
181
  labelDirection="row"
187
182
  labelStyle={{ fontSize: "16px" }}
188
- tooltipContent="Enable or disable Google Pay payments"
183
+ tooltipContent={t("config.paymentMethods.googlePayTooltip", "Enable or disable Google Pay payments")}
189
184
  />
190
-
191
185
  <RenderInput
192
- label="Apple Pay"
186
+ label={t("config.paymentMethods.applePay", "Apple Pay")}
193
187
  name="enableApplePay"
194
188
  value={settings.enableApplePay === true}
195
189
  onChange={(selected) =>
@@ -198,11 +192,10 @@ const ConfigurationFields = ({
198
192
  inputType="switch"
199
193
  labelDirection="row"
200
194
  labelStyle={{ fontSize: "16px" }}
201
- tooltipContent="Enable or disable Apple Pay payments"
195
+ tooltipContent={t("config.paymentMethods.applePayTooltip", "Enable or disable Apple Pay payments")}
202
196
  />
203
-
204
197
  <RenderInput
205
- label="Sofort Banking"
198
+ label={t("config.paymentMethods.sofort", "Sofort Banking")}
206
199
  name="enableSofort"
207
200
  value={settings.enableSofort === true}
208
201
  onChange={(selected) =>
@@ -211,11 +204,10 @@ const ConfigurationFields = ({
211
204
  inputType="switch"
212
205
  labelDirection="row"
213
206
  labelStyle={{ fontSize: "16px" }}
214
- tooltipContent="Enable or disable Sofort Banking payments"
207
+ tooltipContent={t("config.paymentMethods.sofortTooltip", "Enable or disable Sofort Banking payments")}
215
208
  />
216
-
217
209
  <RenderInput
218
- label="SEPA Direct Debit"
210
+ label={t("config.paymentMethods.sepa", "SEPA Direct Debit")}
219
211
  name="enableSepaDirectDebit"
220
212
  value={settings.enableSepaDirectDebit === true}
221
213
  onChange={(selected) =>
@@ -224,7 +216,7 @@ const ConfigurationFields = ({
224
216
  inputType="switch"
225
217
  labelDirection="row"
226
218
  labelStyle={{ fontSize: "16px" }}
227
- tooltipContent="Enable or disable SEPA Direct Debit payments"
219
+ tooltipContent={t("config.paymentMethods.sepaTooltip", "Enable or disable SEPA Direct Debit payments")}
228
220
  />
229
221
 
230
222
  <Flex direction="row" gap={2} marginTop={10}>
@@ -234,7 +226,7 @@ const ConfigurationFields = ({
234
226
  onClick={handleNavigateToApplePayConfig}
235
227
  className="payment-button"
236
228
  >
237
- Apple Pay Config
229
+ {t("config.buttons.applePayConfig", "Apple Pay Config")}
238
230
  </Button>
239
231
  <Button
240
232
  variant="secondary"
@@ -242,7 +234,7 @@ const ConfigurationFields = ({
242
234
  onClick={handleNavigateToGooglePayConfig}
243
235
  className="payment-button"
244
236
  >
245
- Google Pay Config
237
+ {t("config.buttons.googlePayConfig", "Google Pay Config")}
246
238
  </Button>
247
239
  </Flex>
248
240
  </Flex>
@@ -2,8 +2,10 @@ import * as React from "react";
2
2
  import { Box, Flex, Typography } from "@strapi/design-system";
3
3
  import ConfigurationFields from "./ConfigurationFields";
4
4
  import TestConnection from "./TestConnection";
5
+ import { usePluginTranslations } from "../../../hooks/usePluginTranslations";
5
6
 
6
7
  const ConfigurationPanel = ({ settings, onNavigateToConfig }) => {
8
+ const { t } = usePluginTranslations();
7
9
  return (
8
10
  <Flex direction="column" alignItems="stretch" gap={8} paddingTop={8}>
9
11
  <Box>
@@ -14,7 +16,7 @@ const ConfigurationPanel = ({ settings, onNavigateToConfig }) => {
14
16
  className="payment-title"
15
17
  style={{ fontSize: "20px", marginBottom: "4px" }}
16
18
  >
17
- Payone API Configuration
19
+ {t("config.title", "Payone API Configuration")}
18
20
  </Typography>
19
21
  <Typography
20
22
  variant="pi"
@@ -23,7 +25,7 @@ const ConfigurationPanel = ({ settings, onNavigateToConfig }) => {
23
25
  className="payment-subtitle"
24
26
  style={{ fontSize: "14px" }}
25
27
  >
26
- Configure your Payone payment gateway settings
28
+ {t("config.subtitle", "Configure your Payone payment gateway settings")}
27
29
  </Typography>
28
30
  </Box>
29
31
 
@@ -43,8 +45,7 @@ const ConfigurationPanel = ({ settings, onNavigateToConfig }) => {
43
45
 
44
46
  <Box paddingTop={4}>
45
47
  <Typography variant="sigma" textColor="neutral600">
46
- Note: These settings are used for all Payone API requests. Make sure
47
- to use the correct credentials for your selected mode.
48
+ {t("config.note", "Note: These settings are used for all Payone API requests. Make sure to use the correct credentials for your selected mode.")}
48
49
  </Typography>
49
50
  </Box>
50
51
  </Flex>
@@ -6,9 +6,9 @@ import {
6
6
  CardBody,
7
7
  Flex,
8
8
  Typography,
9
- Alert,
10
9
  } from "@strapi/design-system";
11
10
  import { Play } from "@strapi/icons";
11
+ import { usePluginTranslations } from "../../../hooks/usePluginTranslations";
12
12
 
13
13
  const TestConnection = ({
14
14
  settings,
@@ -16,6 +16,7 @@ const TestConnection = ({
16
16
  testResult,
17
17
  onTestConnection,
18
18
  }) => {
19
+ const { t } = usePluginTranslations();
19
20
  const mode = (settings?.mode || "test").toLowerCase();
20
21
 
21
22
  return (
@@ -23,26 +24,16 @@ const TestConnection = ({
23
24
  <CardBody>
24
25
  <Flex direction="column" alignItems="stretch" gap={6} paddingTop={6}>
25
26
  <Box>
26
- <Typography
27
- variant="delta"
28
- as="h3"
29
- fontWeight="bold"
30
- style={{ marginBottom: "16px" }}
31
- >
32
- Test Connection
27
+ <Typography variant="delta" as="h3" fontWeight="bold" style={{ marginBottom: "16px" }}>
28
+ {t("testConnection.title", "Test Connection")}
33
29
  </Typography>
34
-
35
30
  {mode === "test" ? (
36
31
  <Typography variant="pi" textColor="neutral600">
37
- Verify your Payone configuration by testing the API connection
32
+ {t("testConnection.description", "Verify your Payone configuration by testing the API connection")}
38
33
  </Typography>
39
34
  ) : (
40
- <Typography
41
- variant="pi"
42
- textColor="neutral600"
43
- style={{ marginTop: "8px" }}
44
- >
45
- Test Connection is disabled in live mode.
35
+ <Typography variant="pi" textColor="neutral600" style={{ marginTop: "8px" }}>
36
+ {t("testConnection.disabledInLive", "Test Connection is disabled in live mode.")}
46
37
  </Typography>
47
38
  )}
48
39
  </Box>
@@ -56,16 +47,12 @@ const TestConnection = ({
56
47
  disabled={mode === "live"}
57
48
  style={{ maxWidth: "200px" }}
58
49
  >
59
- {isTesting ? "Testing Connection..." : "Test Connection"}
50
+ {isTesting ? t("testConnection.testing", "Testing Connection...") : t("testConnection.button", "Test Connection")}
60
51
  </Button>
61
52
 
62
53
  {testResult && (
63
- <Flex direction={"column"} alignItems={"stretch"} gap={2}>
64
- <Typography
65
- variant="pi"
66
- fontWeight="medium"
67
- style={{ marginBottom: "16px" }}
68
- >
54
+ <Flex direction="column" alignItems="stretch" gap={2}>
55
+ <Typography variant="pi" fontWeight="medium" style={{ marginBottom: "16px" }}>
69
56
  {testResult.message}
70
57
  </Typography>
71
58
  {testResult.details && Boolean(testResult.success) ? (
@@ -75,18 +62,17 @@ const TestConnection = ({
75
62
  <Flex direction="column" alignItems="stretch" gap={2}>
76
63
  {testResult.details.mode && (
77
64
  <Typography variant="pi" textColor="neutral600">
78
- <strong>Mode:</strong> {testResult.details.mode}
65
+ <strong>{t("testConnection.mode", "Mode")}:</strong> {testResult.details.mode}
79
66
  </Typography>
80
67
  )}
81
68
  {testResult.details.aid && (
82
69
  <Typography variant="pi" textColor="neutral600">
83
- <strong>AID:</strong> {testResult.details.aid}
70
+ <strong>{t("testConnection.aid", "AID")}:</strong> {testResult.details.aid}
84
71
  </Typography>
85
72
  )}
86
73
  {testResult.details.portalid && (
87
74
  <Typography variant="pi" textColor="neutral600">
88
- <strong>Portal ID:</strong>{" "}
89
- {testResult.details.portalid}
75
+ <strong>{t("testConnection.portalid", "Portal ID")}:</strong> {testResult.details.portalid}
90
76
  </Typography>
91
77
  )}
92
78
  </Flex>
@@ -97,22 +83,19 @@ const TestConnection = ({
97
83
  <Card>
98
84
  <CardBody padding={4}>
99
85
  <Flex direction="column" alignItems="stretch" gap={2}>
100
- {testResult.error && (
86
+ {testResult.error?.ErrorCode && (
101
87
  <Typography variant="pi" textColor="neutral600">
102
- <strong>Error Code:</strong>{" "}
103
- {testResult.error.ErrorCode}
88
+ <strong>{t("testConnection.errorCode", "Error Code")}:</strong> {testResult.error.ErrorCode}
104
89
  </Typography>
105
90
  )}
106
- {testResult.error.ErrorMessage && (
91
+ {testResult.error?.ErrorMessage && (
107
92
  <Typography variant="pi" textColor="neutral600">
108
- <strong>Error Message:</strong>{" "}
109
- {testResult.error.ErrorMessage}
93
+ <strong>{t("testConnection.errorMessage", "Error Message")}:</strong> {testResult.error.ErrorMessage}
110
94
  </Typography>
111
95
  )}
112
- {testResult.error.CustomerMessage && (
96
+ {testResult.error?.CustomerMessage && (
113
97
  <Typography variant="pi" textColor="neutral600">
114
- <strong>Customer Message:</strong>{" "}
115
- {testResult.error.CustomerMessage}
98
+ <strong>{t("testConnection.customerMessage", "Customer Message")}:</strong> {testResult.error.CustomerMessage}
116
99
  </Typography>
117
100
  )}
118
101
  </Flex>
@@ -1,7 +1,8 @@
1
- import * as React from "@strapi/strapi/admin";
1
+ import * as React from "react";
2
2
  import { Box, Typography } from "@strapi/design-system";
3
3
  import PaymentMethodSelector from "./PaymentMethodSelector";
4
4
  import AuthorizationForm from "./AuthorizationForm";
5
+ import { usePluginTranslations } from "../../../hooks/usePluginTranslations";
5
6
 
6
7
  const ApplePayOnlyPanel = ({
7
8
  onNavigateToConfig,
@@ -9,6 +10,7 @@ const ApplePayOnlyPanel = ({
9
10
  paymentActions,
10
11
  settings,
11
12
  }) => {
13
+ const { t } = usePluginTranslations();
12
14
  return (
13
15
  <Box
14
16
  style={{
@@ -30,9 +32,7 @@ const ApplePayOnlyPanel = ({
30
32
  fontWeight: "bold",
31
33
  }}
32
34
  >
33
- ⚠️ Apple Pay can only be tested on a production domain with HTTPS and
34
- Live mode. Testing in Strapi admin panel is not supported. Please test
35
- Apple Pay on your production website.
35
+ ⚠️ {t("applePayPanel.warning", "Apple Pay can only be tested on a production domain with HTTPS and Live mode. Testing in Strapi admin panel is not supported. Please test Apple Pay on your production website.")}
36
36
  </Typography>
37
37
 
38
38
  <PaymentMethodSelector
@@ -11,8 +11,10 @@ import {
11
11
  getCurrencyOptions,
12
12
  getCountryOptions,
13
13
  } from "../../../utils/countryLanguageUtils";
14
+ import { usePluginTranslations } from "../../../hooks/usePluginTranslations";
14
15
 
15
16
  const AuthorizationForm = ({ paymentActions, settings }) => {
17
+ const { t } = usePluginTranslations();
16
18
  const handleGooglePayToken = (token) => {
17
19
  if (!token) {
18
20
  return;
@@ -35,7 +37,7 @@ const AuthorizationForm = ({ paymentActions, settings }) => {
35
37
  return Promise.resolve({
36
38
  success: true,
37
39
  message:
38
- "Token received successfully. Please click 'Process Authorization' to complete the payment.",
40
+ `Token received successfully. Please click '${t("auth.submit", "Authorize")}' to complete the payment.`,
39
41
  });
40
42
  };
41
43
 
@@ -59,20 +61,11 @@ const AuthorizationForm = ({ paymentActions, settings }) => {
59
61
  return (
60
62
  <Flex direction="column" alignItems="stretch" gap={4}>
61
63
  <Flex direction="row" gap={2}>
62
- <Typography
63
- variant="omega"
64
- fontWeight="semiBold"
65
- textColor="neutral800"
66
- className="payment-form-title"
67
- >
68
- Authorization
64
+ <Typography variant="omega" fontWeight="semiBold" textColor="neutral800" className="payment-form-title">
65
+ {t("auth.title", "Authorization")}
69
66
  </Typography>
70
- <Typography
71
- variant="pi"
72
- textColor="neutral600"
73
- className="payment-form-description"
74
- >
75
- Authorize and capture an amount immediately.
67
+ <Typography variant="pi" textColor="neutral600" className="payment-form-description">
68
+ {t("auth.description", "Authorize a payment with an existing preauthorization.")}
76
69
  </Typography>
77
70
  </Flex>
78
71
 
@@ -85,15 +78,15 @@ const AuthorizationForm = ({ paymentActions, settings }) => {
85
78
  >
86
79
  <RenderInput
87
80
  name="authAmount"
88
- label="Amount *"
81
+ label={t("common.amount", "Amount *")}
89
82
  value={paymentActions.paymentState.paymentAmount || ""}
90
83
  onChange={(e) =>
91
84
  paymentActions.handleFieldChange("paymentAmount", e.target.value)
92
85
  }
93
86
  inputType="textInput"
94
- placeholder="Enter amount (e.g., 1000 for €10.00)"
87
+ placeholder={t("preauth.amountPlaceholder", "Enter amount (e.g., 1000 for €10.00)")}
95
88
  required
96
- tooltipContent="Amount in cents (e.g., 1000 = €10.00)"
89
+ tooltipContent={t("preauth.amountTooltip", "Amount in cents (e.g., 1000 = €10.00)")}
97
90
  />
98
91
 
99
92
  <RenderInput
@@ -307,7 +300,7 @@ const AuthorizationForm = ({ paymentActions, settings }) => {
307
300
  !paymentActions.paymentState.authReference.trim()
308
301
  }
309
302
  >
310
- Process Authorization
303
+ {t("auth.submit", "Authorize")}
311
304
  </Button>
312
305
  </Box>
313
306
  )}
@@ -331,7 +324,7 @@ const AuthorizationForm = ({ paymentActions, settings }) => {
331
324
  !paymentActions.paymentState.applePayToken)
332
325
  }
333
326
  >
334
- Process Authorization
327
+ {t("auth.submit", "Authorize")}
335
328
  </Button>
336
329
  )}
337
330
  </Flex>