strapi-plugin-payone-provider 5.6.13 → 5.6.15
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/index.js +14 -20
- package/admin/src/pages/App/components/AppHeader.jsx +16 -17
- package/admin/src/pages/App/components/AppTabs.jsx +14 -15
- package/admin/src/pages/App/components/ApplePayBtn.jsx +9 -14
- package/admin/src/pages/App/components/ApplePayConfig.jsx +25 -26
- package/admin/src/pages/App/components/ApplePayConfigPanel.jsx +4 -4
- package/admin/src/pages/App/components/DocsPanel.jsx +8 -21
- package/admin/src/pages/App/components/GooglePayConfig.jsx +16 -14
- package/admin/src/pages/App/components/GooglePayConfigPanel.jsx +4 -4
- package/admin/src/pages/App/components/GooglePaybutton.jsx +6 -5
- package/admin/src/pages/App/components/configuration/ConfigurationFields.jsx +39 -47
- package/admin/src/pages/App/components/configuration/ConfigurationPanel.jsx +5 -4
- package/admin/src/pages/App/components/configuration/TestConnection.jsx +19 -36
- package/admin/src/pages/App/components/payment-actions/ApplePayPanel.jsx +4 -4
- package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +12 -19
- package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +15 -23
- package/admin/src/pages/App/components/payment-actions/CardDetailsInput.jsx +20 -19
- package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +13 -24
- package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +8 -6
- package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +6 -10
- package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +12 -19
- package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +15 -22
- package/admin/src/pages/App/components/transaction-history/FiltersPanel.jsx +83 -84
- package/admin/src/pages/App/components/transaction-history/HistoryPanel.jsx +7 -17
- package/admin/src/pages/App/components/transaction-history/ImportExportBar.jsx +153 -0
- package/admin/src/pages/App/components/transaction-history/TransactionTable.jsx +22 -15
- package/admin/src/pages/hooks/usePluginTranslations.js +12 -0
- package/admin/src/pages/utils/api.js +27 -0
- package/admin/src/translations/de.json +235 -0
- package/admin/src/translations/en.json +235 -0
- package/admin/src/translations/fr.json +235 -0
- package/admin/src/translations/ru.json +235 -0
- package/admin/src/utils/prefixPluginTranslations.js +13 -0
- package/package.json +1 -1
- package/server/controllers/payone.js +76 -5
- package/server/policies/is-payone-notification.js +34 -8
- package/server/routes/index.js +16 -0
- package/server/services/payone.js +8 -0
- package/server/services/transactionService.js +80 -1
- package/server/services/transactionStatusService.js +1 -1
- package/server/utils/csvTransactions.js +82 -0
package/admin/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import pluginPkg from '../../package.json';
|
|
3
3
|
import pluginId from './pluginId';
|
|
4
|
-
import Initializer from
|
|
5
|
-
import PluginIcon from
|
|
6
|
-
import { injectGooglePayScript } from
|
|
7
|
-
import { injectApplePayScript } from
|
|
8
|
-
|
|
4
|
+
import Initializer from './components/Initializer';
|
|
5
|
+
import PluginIcon from './components/PluginIcon';
|
|
6
|
+
import { injectGooglePayScript } from './pages/utils/injectGooglePayScript';
|
|
7
|
+
import { injectApplePayScript } from './pages/utils/injectApplePayScript';
|
|
8
|
+
import { prefixPluginTranslations } from './utils/prefixPluginTranslations';
|
|
9
9
|
|
|
10
10
|
const name = pluginPkg.strapi.name;
|
|
11
11
|
|
|
@@ -33,30 +33,24 @@ export default {
|
|
|
33
33
|
});
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
-
bootstrap(
|
|
36
|
+
bootstrap() {
|
|
37
37
|
injectGooglePayScript();
|
|
38
38
|
injectApplePayScript();
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
async registerTrads({ locales }) {
|
|
42
42
|
const importedTrads = await Promise.all(
|
|
43
|
-
locales.map(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
data,
|
|
43
|
+
locales.map((locale) =>
|
|
44
|
+
import(`./translations/${locale}.json`)
|
|
45
|
+
.then(({ default: data }) => ({
|
|
46
|
+
data: prefixPluginTranslations(data, pluginId),
|
|
51
47
|
locale,
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return {
|
|
48
|
+
}))
|
|
49
|
+
.catch(() => ({
|
|
55
50
|
data: {},
|
|
56
51
|
locale,
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
})
|
|
52
|
+
}))
|
|
53
|
+
)
|
|
60
54
|
);
|
|
61
55
|
|
|
62
56
|
return Promise.resolve(importedTrads);
|
|
@@ -2,29 +2,28 @@ import * as React from '@strapi/strapi/admin';
|
|
|
2
2
|
import { Button } from "@strapi/design-system";
|
|
3
3
|
import { Layouts } from "@strapi/strapi/admin";
|
|
4
4
|
import { Check, ArrowLeft } from "@strapi/icons";
|
|
5
|
+
import { usePluginTranslations } from "../../hooks/usePluginTranslations";
|
|
5
6
|
|
|
6
7
|
const AppHeader = ({ activeTab, isSaving, onSave, title, onBack }) => {
|
|
7
|
-
const
|
|
8
|
+
const { t } = usePluginTranslations();
|
|
9
|
+
const pluginName = t("plugin.name", "Payone Provider");
|
|
10
|
+
const isConfigPage = title && title !== pluginName;
|
|
11
|
+
|
|
12
|
+
const subtitle =
|
|
13
|
+
title === "Apple Pay Configuration"
|
|
14
|
+
? t("header.subtitleApplePay", "Configure Apple Pay settings for your payment gateway")
|
|
15
|
+
: title === "Google Pay Configuration"
|
|
16
|
+
? t("header.subtitleGooglePay", "Configure Google Pay settings for your payment gateway")
|
|
17
|
+
: t("header.subtitle", "Configure your Payone integration and manage payment transactions");
|
|
8
18
|
|
|
9
19
|
return (
|
|
10
20
|
<Layouts.Header
|
|
11
|
-
title={title ||
|
|
12
|
-
subtitle={
|
|
13
|
-
title === "Apple Pay Configuration"
|
|
14
|
-
? "Configure Apple Pay settings for your payment gateway"
|
|
15
|
-
: title === "Google Pay Configuration"
|
|
16
|
-
? "Configure Google Pay settings for your payment gateway"
|
|
17
|
-
: "Configure your Payone integration and manage payment transactions"
|
|
18
|
-
}
|
|
21
|
+
title={title || pluginName}
|
|
22
|
+
subtitle={subtitle}
|
|
19
23
|
primaryAction={
|
|
20
24
|
isConfigPage ? (
|
|
21
|
-
<Button
|
|
22
|
-
|
|
23
|
-
startIcon={<ArrowLeft />}
|
|
24
|
-
size="L"
|
|
25
|
-
variant="secondary"
|
|
26
|
-
>
|
|
27
|
-
Back to Main
|
|
25
|
+
<Button onClick={onBack} startIcon={<ArrowLeft />} size="L" variant="secondary">
|
|
26
|
+
{t("header.backToMain", "Back to Main")}
|
|
28
27
|
</Button>
|
|
29
28
|
) : activeTab === 2 ? (
|
|
30
29
|
<Button
|
|
@@ -35,7 +34,7 @@ const AppHeader = ({ activeTab, isSaving, onSave, title, onBack }) => {
|
|
|
35
34
|
variant="default"
|
|
36
35
|
className="payment-button payment-button-success"
|
|
37
36
|
>
|
|
38
|
-
Save Configuration
|
|
37
|
+
{t("header.saveConfiguration", "Save Configuration")}
|
|
39
38
|
</Button>
|
|
40
39
|
) : null
|
|
41
40
|
}
|
|
@@ -4,6 +4,7 @@ import ConfigurationPanel from "./configuration/ConfigurationPanel";
|
|
|
4
4
|
import HistoryPanel from "./transaction-history/HistoryPanel";
|
|
5
5
|
import PaymentActionsPanel from "./payment-actions/PaymentActionsPanel";
|
|
6
6
|
import DocsPanel from "./DocsPanel";
|
|
7
|
+
import { usePluginTranslations } from "../../hooks/usePluginTranslations";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Error boundary to prevent a single tab's error from crashing the entire plugin.
|
|
@@ -31,18 +32,15 @@ class TabErrorBoundary extends React.Component {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
render() {
|
|
35
|
+
const { t } = this.props;
|
|
34
36
|
if (this.state.hasError) {
|
|
35
37
|
return (
|
|
36
38
|
<Box padding={6} style={{ textAlign: "center" }}>
|
|
37
39
|
<Typography variant="beta" textColor="danger600">
|
|
38
|
-
Something went wrong loading this tab.
|
|
40
|
+
{t ? t("error.tabError", "Something went wrong loading this tab.") : "Something went wrong loading this tab."}
|
|
39
41
|
</Typography>
|
|
40
|
-
<Typography
|
|
41
|
-
|
|
42
|
-
textColor="neutral600"
|
|
43
|
-
style={{ marginTop: "8px", display: "block" }}
|
|
44
|
-
>
|
|
45
|
-
Try switching to another tab or reload the page.
|
|
42
|
+
<Typography variant="pi" textColor="neutral600" style={{ marginTop: "8px", display: "block" }}>
|
|
43
|
+
{t ? t("error.tabErrorHint", "Try switching to another tab or reload the page.") : "Try switching to another tab or reload the page."}
|
|
46
44
|
</Typography>
|
|
47
45
|
</Box>
|
|
48
46
|
);
|
|
@@ -58,6 +56,7 @@ const AppTabs = ({
|
|
|
58
56
|
settings,
|
|
59
57
|
paymentActions
|
|
60
58
|
}) => {
|
|
59
|
+
const { t } = usePluginTranslations();
|
|
61
60
|
return (
|
|
62
61
|
<Tabs.Root
|
|
63
62
|
value={`tab-${activeTab}`}
|
|
@@ -67,18 +66,18 @@ const AppTabs = ({
|
|
|
67
66
|
}
|
|
68
67
|
>
|
|
69
68
|
<Tabs.List style={{ width: "100%" }}>
|
|
70
|
-
<Tabs.Trigger value="tab-1">Transaction History</Tabs.Trigger>
|
|
71
|
-
<Tabs.Trigger value="tab-2">Configuration</Tabs.Trigger>
|
|
72
|
-
<Tabs.Trigger value="tab-3">Payment Actions</Tabs.Trigger>
|
|
73
|
-
<Tabs.Trigger value="tab-4">Documentation</Tabs.Trigger>
|
|
69
|
+
<Tabs.Trigger value="tab-1">{t("tabs.history", "Transaction History")}</Tabs.Trigger>
|
|
70
|
+
<Tabs.Trigger value="tab-2">{t("tabs.configuration", "Configuration")}</Tabs.Trigger>
|
|
71
|
+
<Tabs.Trigger value="tab-3">{t("tabs.paymentActions", "Payment Actions")}</Tabs.Trigger>
|
|
72
|
+
<Tabs.Trigger value="tab-4">{t("tabs.documentation", "Documentation")}</Tabs.Trigger>
|
|
74
73
|
</Tabs.List>
|
|
75
74
|
<Tabs.Content value="tab-1">
|
|
76
|
-
<TabErrorBoundary activeTab={activeTab}>
|
|
75
|
+
<TabErrorBoundary activeTab={activeTab} t={t}>
|
|
77
76
|
<HistoryPanel />
|
|
78
77
|
</TabErrorBoundary>
|
|
79
78
|
</Tabs.Content>
|
|
80
79
|
<Tabs.Content value="tab-2">
|
|
81
|
-
<TabErrorBoundary activeTab={activeTab}>
|
|
80
|
+
<TabErrorBoundary activeTab={activeTab} t={t}>
|
|
82
81
|
<ConfigurationPanel
|
|
83
82
|
settings={settings}
|
|
84
83
|
onNavigateToConfig={onNavigateToConfig}
|
|
@@ -86,7 +85,7 @@ const AppTabs = ({
|
|
|
86
85
|
</TabErrorBoundary>
|
|
87
86
|
</Tabs.Content>
|
|
88
87
|
<Tabs.Content value="tab-3">
|
|
89
|
-
<TabErrorBoundary activeTab={activeTab}>
|
|
88
|
+
<TabErrorBoundary activeTab={activeTab} t={t}>
|
|
90
89
|
<PaymentActionsPanel
|
|
91
90
|
onNavigateToConfig={onNavigateToConfig}
|
|
92
91
|
settings={settings}
|
|
@@ -95,7 +94,7 @@ const AppTabs = ({
|
|
|
95
94
|
</TabErrorBoundary>
|
|
96
95
|
</Tabs.Content>
|
|
97
96
|
<Tabs.Content value="tab-4">
|
|
98
|
-
<TabErrorBoundary activeTab={activeTab}>
|
|
97
|
+
<TabErrorBoundary activeTab={activeTab} t={t}>
|
|
99
98
|
<DocsPanel settings={settings} paymentActions={paymentActions} />
|
|
100
99
|
</TabErrorBoundary>
|
|
101
100
|
</Tabs.Content>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import ApplePayButton from "apple-pay-button";
|
|
3
3
|
import { Box, Typography, Alert } from "@strapi/design-system";
|
|
4
4
|
import { getFetchClient } from "@strapi/strapi/admin";
|
|
5
5
|
import pluginId from "../../../pluginId";
|
|
6
|
+
import { usePluginTranslations } from "../../hooks/usePluginTranslations";
|
|
6
7
|
|
|
7
8
|
const ApplePayBtn = ({
|
|
8
9
|
amount,
|
|
@@ -12,6 +13,7 @@ const ApplePayBtn = ({
|
|
|
12
13
|
buttonStyle = "black",
|
|
13
14
|
type = "pay",
|
|
14
15
|
}) => {
|
|
16
|
+
const { t } = usePluginTranslations();
|
|
15
17
|
const handleEventsForApplePay = (session, amountValue, currencyCode) => {
|
|
16
18
|
session.onvalidatemerchant = async (event) => {
|
|
17
19
|
try {
|
|
@@ -284,12 +286,9 @@ const ApplePayBtn = ({
|
|
|
284
286
|
if (!settings?.mid) {
|
|
285
287
|
return (
|
|
286
288
|
<Box>
|
|
287
|
-
<Alert closeLabel="Close" title="Merchant ID Missing" variant="warning">
|
|
289
|
+
<Alert closeLabel="Close" title={t("applePayBtn.merchantIdMissingTitle", "Merchant ID Missing")} variant="warning">
|
|
288
290
|
<Typography variant="pi" marginTop={2}>
|
|
289
|
-
Merchant ID is not configured. Please set Merchant ID in plugin
|
|
290
|
-
settings. You can find your merchantIdentifier in PMI at:
|
|
291
|
-
CONFIGURATION → PAYMENT PORTALS → [Your Portal] → Payment type
|
|
292
|
-
configuration tab.
|
|
291
|
+
{t("applePayBtn.merchantIdMissing", "Merchant ID is not configured. Please set Merchant ID in plugin settings.")} {t("applePayBtn.merchantIdHint", "You can find your merchantIdentifier in PMI at: CONFIGURATION → PAYMENT PORTALS → [Your Portal] → Payment type configuration tab.")}
|
|
293
292
|
</Typography>
|
|
294
293
|
</Alert>
|
|
295
294
|
</Box>
|
|
@@ -301,17 +300,14 @@ const ApplePayBtn = ({
|
|
|
301
300
|
<Box>
|
|
302
301
|
<Alert
|
|
303
302
|
closeLabel="Close"
|
|
304
|
-
title=" Apple Pay Only Works in Live Mode"
|
|
303
|
+
title={t("applePayBtn.liveModeOnly", "Apple Pay Only Works in Live Mode")}
|
|
305
304
|
variant="danger"
|
|
306
305
|
>
|
|
307
306
|
<Typography variant="pi" marginTop={2}>
|
|
308
|
-
|
|
309
|
-
to Payone documentation, test mode support will be available at a
|
|
310
|
-
later time.
|
|
307
|
+
{t("applePayBtn.liveModeMessage", "Apple Pay is only supported in live mode. According to Payone documentation, test mode support will be available at a later time.")}
|
|
311
308
|
</Typography>
|
|
312
309
|
<Typography variant="pi" style={{ marginLeft: "8px" }}>
|
|
313
|
-
Please switch to
|
|
314
|
-
use Apple Pay.
|
|
310
|
+
{t("applePayBtn.switchToLive", "Please switch to live mode in plugin settings to use Apple Pay.")}
|
|
315
311
|
</Typography>
|
|
316
312
|
</Alert>
|
|
317
313
|
</Box>
|
|
@@ -350,8 +346,7 @@ const ApplePayBtn = ({
|
|
|
350
346
|
textColor="neutral600"
|
|
351
347
|
style={{ fontSize: "12px", marginTop: "8px", marginRight: "6px" }}
|
|
352
348
|
>
|
|
353
|
-
Apple Pay does NOT work on localhost. Use a production domain with
|
|
354
|
-
HTTPS.
|
|
349
|
+
{t("applePayBtn.noLocalhost", "Apple Pay does NOT work on localhost. Use a production domain with HTTPS.")}
|
|
355
350
|
</Typography>
|
|
356
351
|
</Box>
|
|
357
352
|
);
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Divider,
|
|
8
8
|
} from "@strapi/design-system";
|
|
9
9
|
import RenderInput from "./RenderInput";
|
|
10
|
+
import { usePluginTranslations } from "../../hooks/usePluginTranslations";
|
|
10
11
|
import {
|
|
11
12
|
APPLE_PAY_SUPPORTED_COUNTRIES,
|
|
12
13
|
APPLE_PAY_SUPPORTED_NETWORKS,
|
|
@@ -19,6 +20,7 @@ import {
|
|
|
19
20
|
} from "../../utils/applePayConstants";
|
|
20
21
|
|
|
21
22
|
const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
23
|
+
const { t } = usePluginTranslations();
|
|
22
24
|
const {
|
|
23
25
|
countryCode = DEFAULT_APPLE_PAY_CONFIG.countryCode,
|
|
24
26
|
currencyCode = DEFAULT_APPLE_PAY_CONFIG.currencyCode,
|
|
@@ -94,7 +96,7 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
94
96
|
<Box>
|
|
95
97
|
<RenderInput
|
|
96
98
|
name="countryCode"
|
|
97
|
-
label="Country Code"
|
|
99
|
+
label={t("applePayConfig.countryCode", "Country Code")}
|
|
98
100
|
value={countryCode || ""}
|
|
99
101
|
onChange={(e) => {
|
|
100
102
|
const value = e.target?.value || e;
|
|
@@ -102,7 +104,7 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
102
104
|
}}
|
|
103
105
|
inputType="select"
|
|
104
106
|
required
|
|
105
|
-
tooltipContent="Select the country where your business operates"
|
|
107
|
+
tooltipContent={t("applePayConfig.countryTooltip", "Select the country where your business operates")}
|
|
106
108
|
options={APPLE_PAY_SUPPORTED_COUNTRIES.map((country) => ({
|
|
107
109
|
value: country.code,
|
|
108
110
|
label: `${country.name} (${country.code})`,
|
|
@@ -113,7 +115,7 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
113
115
|
<Box>
|
|
114
116
|
<RenderInput
|
|
115
117
|
name="currencyCode"
|
|
116
|
-
label="Currency Code"
|
|
118
|
+
label={t("applePayConfig.currencyCode", "Currency Code")}
|
|
117
119
|
value={currencyCode || ""}
|
|
118
120
|
onChange={(e) => {
|
|
119
121
|
const value = e.target?.value || e;
|
|
@@ -121,7 +123,7 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
121
123
|
}}
|
|
122
124
|
inputType="select"
|
|
123
125
|
required
|
|
124
|
-
tooltipContent={
|
|
126
|
+
tooltipContent={t("applePayConfig.currencyTooltip", "Supported currencies for {{country}}", { country: countryCode })}
|
|
125
127
|
options={supportedCurrencies.map((currency) => ({
|
|
126
128
|
value: currency.code,
|
|
127
129
|
label: `${currency.name} (${currency.code}) ${currency.symbol}`,
|
|
@@ -133,22 +135,21 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
133
135
|
textColor="danger600"
|
|
134
136
|
style={{ marginTop: "4px" }}
|
|
135
137
|
>
|
|
136
|
-
No supported currencies for this country. Please select a
|
|
137
|
-
different country.
|
|
138
|
+
{t("applePayConfig.noCurrencies", "No supported currencies for this country. Please select a different country.")}
|
|
138
139
|
</Typography>
|
|
139
140
|
)}
|
|
140
141
|
</Box>
|
|
141
142
|
<Box>
|
|
142
143
|
<RenderInput
|
|
143
144
|
name="buttonStyle"
|
|
144
|
-
label="Button Style"
|
|
145
|
+
label={t("applePayConfig.buttonStyle", "Button Style")}
|
|
145
146
|
value={buttonStyle || ""}
|
|
146
147
|
onChange={(e) => {
|
|
147
148
|
const value = e.target?.value || e;
|
|
148
149
|
onConfigChange({ ...config, buttonStyle: value });
|
|
149
150
|
}}
|
|
150
151
|
inputType="select"
|
|
151
|
-
tooltipContent="Visual style of the Apple Pay button"
|
|
152
|
+
tooltipContent={t("applePayConfig.buttonStyleTooltip", "Visual style of the Apple Pay button")}
|
|
152
153
|
options={APPLE_PAY_BUTTON_STYLES.map((style) => ({
|
|
153
154
|
value: style.code,
|
|
154
155
|
label: style.name,
|
|
@@ -159,14 +160,14 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
159
160
|
<Box>
|
|
160
161
|
<RenderInput
|
|
161
162
|
name="buttonType"
|
|
162
|
-
label="Button Type"
|
|
163
|
+
label={t("applePayConfig.buttonType", "Button Type")}
|
|
163
164
|
value={buttonType || ""}
|
|
164
165
|
onChange={(e) => {
|
|
165
166
|
const value = e.target?.value || e;
|
|
166
167
|
onConfigChange({ ...config, buttonType: value });
|
|
167
168
|
}}
|
|
168
169
|
inputType="select"
|
|
169
|
-
tooltipContent="Type of action the button represents"
|
|
170
|
+
tooltipContent={t("applePayConfig.buttonTypeTooltip", "Type of action the button represents")}
|
|
170
171
|
options={APPLE_PAY_BUTTON_TYPES.map((type) => ({
|
|
171
172
|
value: type.code,
|
|
172
173
|
label: type.name,
|
|
@@ -180,10 +181,10 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
180
181
|
<Box>
|
|
181
182
|
<div style={{ display: "flex", flexDirection: "column", gap: "4px" }}>
|
|
182
183
|
<Typography variant="pi" fontWeight="semiBold">
|
|
183
|
-
Supported Networks
|
|
184
|
+
{t("applePayConfig.supportedNetworks", "Supported Networks")}
|
|
184
185
|
</Typography>
|
|
185
186
|
<Typography variant="pi" textColor="neutral600">
|
|
186
|
-
Select payment networks supported in {countryCode}
|
|
187
|
+
{t("applePayConfig.supportedNetworksHint", "Select payment networks supported in {{country}}", { country: countryCode })}
|
|
187
188
|
</Typography>
|
|
188
189
|
</div>
|
|
189
190
|
<Flex wrap="wrap" gap={4} style={{ marginTop: "12px" }}>
|
|
@@ -211,7 +212,7 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
211
212
|
textColor="neutral500"
|
|
212
213
|
style={{ marginLeft: "8px" }}
|
|
213
214
|
>
|
|
214
|
-
(Not available)
|
|
215
|
+
{t("applePayConfig.notAvailable", "(Not available)")}
|
|
215
216
|
</Typography>
|
|
216
217
|
)}
|
|
217
218
|
</Checkbox>
|
|
@@ -225,7 +226,7 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
225
226
|
textColor="danger600"
|
|
226
227
|
style={{ marginTop: "8px" }}
|
|
227
228
|
>
|
|
228
|
-
At least one network must be selected
|
|
229
|
+
{t("applePayConfig.atLeastOneNetwork", "At least one network must be selected")}
|
|
229
230
|
</Typography>
|
|
230
231
|
)}
|
|
231
232
|
</Box>
|
|
@@ -240,15 +241,14 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
240
241
|
fontWeight="semiBold"
|
|
241
242
|
style={{ marginLeft: "2px" }}
|
|
242
243
|
>
|
|
243
|
-
Merchant Capabilities
|
|
244
|
+
{t("applePayConfig.merchantCapabilities", "Merchant Capabilities")}
|
|
244
245
|
</Typography>
|
|
245
246
|
<Typography
|
|
246
247
|
variant="pi"
|
|
247
248
|
textColor="neutral600"
|
|
248
249
|
style={{ marginLeft: "2px" }}
|
|
249
250
|
>
|
|
250
|
-
Select payment capabilities. "3D Secure" is required for most
|
|
251
|
-
payment methods.
|
|
251
|
+
{t("applePayConfig.merchantCapabilitiesHint", "Select payment capabilities. \"3D Secure\" is required for most payment methods.")}
|
|
252
252
|
</Typography>
|
|
253
253
|
</div>
|
|
254
254
|
<Flex wrap="wrap" gap={4} style={{ marginTop: "12px" }}>
|
|
@@ -281,8 +281,7 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
281
281
|
textColor="danger600"
|
|
282
282
|
style={{ marginTop: "8px" }}
|
|
283
283
|
>
|
|
284
|
-
At least one capability must be selected. "supports3DS" is
|
|
285
|
-
recommended.
|
|
284
|
+
{t("applePayConfig.atLeastOneCapability", "At least one capability must be selected. \"supports3DS\" is recommended.")}
|
|
286
285
|
</Typography>
|
|
287
286
|
)}
|
|
288
287
|
</Box>
|
|
@@ -302,15 +301,15 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
302
301
|
gap={4}
|
|
303
302
|
>
|
|
304
303
|
<Typography variant="pi" fontWeight="bold" textColor="warning700">
|
|
305
|
-
⚠️ Domain Verification File Required
|
|
304
|
+
⚠️ {t("applePayConfig.domainVerificationTitle", "Domain Verification File Required")}
|
|
306
305
|
</Typography>
|
|
307
306
|
<Typography variant="pi" textColor="neutral700">
|
|
308
|
-
<strong>Download the Apple Pay domain verification file</strong>{" "}
|
|
309
|
-
from your Payone documentation:
|
|
307
|
+
<strong>{t("applePayConfig.domainVerificationDesc", "Download the Apple Pay domain verification file")}</strong>{" "}
|
|
308
|
+
{t("applePayConfig.domainVerificationDescSuffix", "from your Payone documentation:")}
|
|
310
309
|
</Typography>
|
|
311
310
|
<Box padding={2} background="neutral0" borderRadius="4px">
|
|
312
311
|
<Typography variant="pi" style={{ fontSize: "12px" }}>
|
|
313
|
-
<strong>Download URL
|
|
312
|
+
<strong>{t("applePayConfig.downloadUrl", "Download URL:")}</strong>{" "}
|
|
314
313
|
<a
|
|
315
314
|
href="https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev"
|
|
316
315
|
target="_blank"
|
|
@@ -322,7 +321,7 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
322
321
|
</Typography>
|
|
323
322
|
</Box>
|
|
324
323
|
<Typography variant="pi" textColor="neutral700">
|
|
325
|
-
<strong>Place the file at
|
|
324
|
+
<strong>{t("applePayConfig.placeFileAt", "Place the file at:")}</strong>
|
|
326
325
|
</Typography>
|
|
327
326
|
<Box padding={2} background="neutral0" borderRadius="4px">
|
|
328
327
|
<Typography
|
|
@@ -341,13 +340,13 @@ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
|
|
|
341
340
|
</Typography>
|
|
342
341
|
</Box>
|
|
343
342
|
<Typography variant="pi" textColor="neutral700" marginTop={2}>
|
|
344
|
-
The file must be accessible at:{" "}
|
|
343
|
+
{t("applePayConfig.fileMustBeAccessible", "The file must be accessible at:")}{" "}
|
|
345
344
|
<code>
|
|
346
345
|
https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
|
|
347
346
|
</code>
|
|
348
347
|
</Typography>
|
|
349
348
|
<Typography variant="pi" fontWeight="bold" textColor="danger600">
|
|
350
|
-
Without this file, Apple Pay will NOT work on your domain!
|
|
349
|
+
{t("applePayConfig.withoutFileWarning", "Without this file, Apple Pay will NOT work on your domain!")}
|
|
351
350
|
</Typography>
|
|
352
351
|
</Flex>
|
|
353
352
|
</Flex>
|
|
@@ -9,8 +9,10 @@ import {
|
|
|
9
9
|
} from "@strapi/design-system";
|
|
10
10
|
import { Check } from "@strapi/icons";
|
|
11
11
|
import ApplePayConfig from "./ApplePayConfig";
|
|
12
|
+
import { usePluginTranslations } from "../../hooks/usePluginTranslations";
|
|
12
13
|
|
|
13
14
|
const ApplePayConfigPanel = ({ settings, onInputChange, isSaving, onSave }) => {
|
|
15
|
+
const { t } = usePluginTranslations();
|
|
14
16
|
const [applePayConfig, setApplePayConfig] = React.useState(
|
|
15
17
|
settings?.applePayConfig || {}
|
|
16
18
|
);
|
|
@@ -36,9 +38,7 @@ const ApplePayConfigPanel = ({ settings, onInputChange, isSaving, onSave }) => {
|
|
|
36
38
|
|
|
37
39
|
<Flex direction="column" gap={4} alignItems="stretch" paddingTop={4}>
|
|
38
40
|
<Typography variant="sigma" textColor="neutral600">
|
|
39
|
-
Note: Apple Pay configuration is used for Apple Pay payment requests.
|
|
40
|
-
Make sure to configure the correct merchant identifier, supported
|
|
41
|
-
networks, and capabilities for your region.
|
|
41
|
+
{t("applePayConfigPanel.note", "Note: Apple Pay configuration is used for Apple Pay payment requests. Make sure to configure the correct merchant identifier, supported networks, and capabilities for your region.")}
|
|
42
42
|
</Typography>
|
|
43
43
|
<Button
|
|
44
44
|
loading={isSaving}
|
|
@@ -48,7 +48,7 @@ const ApplePayConfigPanel = ({ settings, onInputChange, isSaving, onSave }) => {
|
|
|
48
48
|
variant="default"
|
|
49
49
|
maxWidth={"220px"}
|
|
50
50
|
>
|
|
51
|
-
Save Configuration
|
|
51
|
+
{t("applePayConfigPanel.save", "Save Configuration")}
|
|
52
52
|
</Button>
|
|
53
53
|
</Flex>
|
|
54
54
|
</Flex>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Box, Flex, Typography, Accordion
|
|
3
|
-
import CodeBlock from "./docs/CodeBlock";
|
|
2
|
+
import { Box, Flex, Typography, Accordion } from "@strapi/design-system";
|
|
4
3
|
import TableOfContents from "./docs/TableOfContents";
|
|
5
4
|
import BaseUrlSection from "./docs/BaseUrlSection";
|
|
6
5
|
import PaymentMethodsSection from "./docs/PaymentMethodsSection";
|
|
@@ -11,29 +10,18 @@ import ApplePaySection from "./docs/ApplePaySection";
|
|
|
11
10
|
import ThreeDSecureSection from "./docs/ThreeDSecureSection";
|
|
12
11
|
import CaptureRefundSection from "./docs/CaptureRefundSection";
|
|
13
12
|
import TestCredentialsSection from "./docs/TestCredentialsSection";
|
|
13
|
+
import { usePluginTranslations } from "../../hooks/usePluginTranslations";
|
|
14
14
|
|
|
15
15
|
const DocsPanel = ({ settings, paymentActions }) => {
|
|
16
|
+
const { t } = usePluginTranslations();
|
|
16
17
|
return (
|
|
17
18
|
<Flex direction="column" alignItems="stretch" gap={6} padding={8}>
|
|
18
19
|
<Box>
|
|
19
|
-
<Typography
|
|
20
|
-
|
|
21
|
-
as="h2"
|
|
22
|
-
fontWeight="bold"
|
|
23
|
-
className="payment-title"
|
|
24
|
-
style={{ fontSize: "20px", marginBottom: "4px" }}
|
|
25
|
-
>
|
|
26
|
-
Payone Provider Plugin - Frontend Integration Guide
|
|
20
|
+
<Typography variant="beta" as="h2" fontWeight="bold" className="payment-title" style={{ fontSize: "20px", marginBottom: "4px" }}>
|
|
21
|
+
{t("docs.title", "Payone Provider Plugin - Frontend Integration Guide")}
|
|
27
22
|
</Typography>
|
|
28
|
-
<Typography
|
|
29
|
-
|
|
30
|
-
textColor="neutral600"
|
|
31
|
-
marginTop={2}
|
|
32
|
-
className="payment-subtitle"
|
|
33
|
-
style={{ fontSize: "14px" }}
|
|
34
|
-
>
|
|
35
|
-
Complete documentation for integrating Payone payment methods in your
|
|
36
|
-
frontend application
|
|
23
|
+
<Typography variant="pi" textColor="neutral600" marginTop={2} className="payment-subtitle" style={{ fontSize: "14px" }}>
|
|
24
|
+
{t("docs.subtitle", "Complete documentation for integrating Payone payment methods in your frontend application")}
|
|
37
25
|
</Typography>
|
|
38
26
|
</Box>
|
|
39
27
|
|
|
@@ -55,8 +43,7 @@ const DocsPanel = ({ settings, paymentActions }) => {
|
|
|
55
43
|
|
|
56
44
|
<Box paddingTop={4}>
|
|
57
45
|
<Typography variant="sigma" textColor="neutral600">
|
|
58
|
-
For more information, visit the Payone documentation or contact your
|
|
59
|
-
Payone account manager.
|
|
46
|
+
{t("docs.moreInfo", "For more information, visit the Payone documentation or contact your Payone account manager.")}
|
|
60
47
|
</Typography>
|
|
61
48
|
</Box>
|
|
62
49
|
</Flex>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as React from "
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { Box, Flex, Typography, Checkbox } from "@strapi/design-system";
|
|
3
3
|
import RenderInput from "./RenderInput";
|
|
4
|
+
import { usePluginTranslations } from "../../hooks/usePluginTranslations";
|
|
4
5
|
import {
|
|
5
6
|
GOOGLE_PAY_SUPPORTED_COUNTRIES,
|
|
6
7
|
GOOGLE_PAY_SUPPORTED_CURRENCIES,
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
} from "../../utils/googlePayConstants";
|
|
11
12
|
|
|
12
13
|
const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
14
|
+
const { t } = usePluginTranslations();
|
|
13
15
|
const {
|
|
14
16
|
countryCode = DEFAULT_GOOGLE_PAY_CONFIG.countryCode,
|
|
15
17
|
currencyCode = DEFAULT_GOOGLE_PAY_CONFIG.currencyCode,
|
|
@@ -76,7 +78,7 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
76
78
|
<Box>
|
|
77
79
|
<RenderInput
|
|
78
80
|
name="countryCode"
|
|
79
|
-
label="Country Code"
|
|
81
|
+
label={t("googlePayConfig.countryCode", "Country Code")}
|
|
80
82
|
value={countryCode || ""}
|
|
81
83
|
onChange={(e) => {
|
|
82
84
|
const value = e.target?.value || e;
|
|
@@ -84,7 +86,7 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
84
86
|
}}
|
|
85
87
|
inputType="select"
|
|
86
88
|
required
|
|
87
|
-
tooltipContent="Select the country where your business operates"
|
|
89
|
+
tooltipContent={t("googlePayConfig.countryTooltip", "Select the country where your business operates")}
|
|
88
90
|
options={GOOGLE_PAY_SUPPORTED_COUNTRIES.map((country) => ({
|
|
89
91
|
value: country.code,
|
|
90
92
|
label: `${country.name} (${country.code})`,
|
|
@@ -95,7 +97,7 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
95
97
|
<Box>
|
|
96
98
|
<RenderInput
|
|
97
99
|
name="currencyCode"
|
|
98
|
-
label="Currency Code"
|
|
100
|
+
label={t("googlePayConfig.currencyCode", "Currency Code")}
|
|
99
101
|
value={currencyCode || ""}
|
|
100
102
|
onChange={(e) => {
|
|
101
103
|
const value = e.target?.value || e;
|
|
@@ -103,7 +105,7 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
103
105
|
}}
|
|
104
106
|
inputType="select"
|
|
105
107
|
required
|
|
106
|
-
tooltipContent="Select the currency for transactions"
|
|
108
|
+
tooltipContent={t("googlePayConfig.currencyTooltip", "Select the currency for transactions")}
|
|
107
109
|
options={GOOGLE_PAY_SUPPORTED_CURRENCIES.map((currency) => ({
|
|
108
110
|
value: currency.code,
|
|
109
111
|
label: `${currency.name} (${currency.code}) ${currency.symbol}`,
|
|
@@ -113,14 +115,14 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
113
115
|
<Box>
|
|
114
116
|
<RenderInput
|
|
115
117
|
name="merchantName"
|
|
116
|
-
label="Merchant Name"
|
|
118
|
+
label={t("googlePayConfig.merchantName", "Merchant Name")}
|
|
117
119
|
value={merchantName || ""}
|
|
118
120
|
onChange={(e) =>
|
|
119
121
|
onConfigChange({ ...config, merchantName: e.target.value })
|
|
120
122
|
}
|
|
121
123
|
inputType="textInput"
|
|
122
|
-
placeholder="Your Store Name"
|
|
123
|
-
tooltipContent="The name of your business as it will appear in Google Pay"
|
|
124
|
+
placeholder={t("googlePayConfig.merchantNamePlaceholder", "Your Store Name")}
|
|
125
|
+
tooltipContent={t("googlePayConfig.merchantNameTooltip", "The name of your business as it will appear in Google Pay")}
|
|
124
126
|
/>
|
|
125
127
|
</Box>
|
|
126
128
|
</Box>
|
|
@@ -129,10 +131,10 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
129
131
|
<Box width="100%" marginBottom={4} marginTop={4}>
|
|
130
132
|
<div style={{ display: "flex", flexDirection: "column", gap: "4px" }}>
|
|
131
133
|
<Typography variant="pi" fontWeight="semiBold">
|
|
132
|
-
Allowed Card Networks
|
|
134
|
+
{t("googlePayConfig.allowedNetworks", "Allowed Card Networks")}
|
|
133
135
|
</Typography>
|
|
134
136
|
<Typography variant="pi" textColor="neutral600">
|
|
135
|
-
Select payment card networks to accept
|
|
137
|
+
{t("googlePayConfig.allowedNetworksHint", "Select payment card networks to accept")}
|
|
136
138
|
</Typography>
|
|
137
139
|
</div>
|
|
138
140
|
<Flex
|
|
@@ -165,7 +167,7 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
165
167
|
textColor="danger600"
|
|
166
168
|
style={{ marginTop: "8px" }}
|
|
167
169
|
>
|
|
168
|
-
At least one card network must be selected
|
|
170
|
+
{t("googlePayConfig.atLeastOneNetwork", "At least one card network must be selected")}
|
|
169
171
|
</Typography>
|
|
170
172
|
)}
|
|
171
173
|
</Box>
|
|
@@ -174,10 +176,10 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
174
176
|
<Box width="100%">
|
|
175
177
|
<div style={{ display: "flex", flexDirection: "column", gap: "4px" }}>
|
|
176
178
|
<Typography variant="pi" fontWeight="semiBold">
|
|
177
|
-
Allowed Authentication Methods
|
|
179
|
+
{t("googlePayConfig.allowedAuthMethods", "Allowed Authentication Methods")}
|
|
178
180
|
</Typography>
|
|
179
181
|
<Typography variant="pi" textColor="neutral600">
|
|
180
|
-
Select authentication methods for card payments
|
|
182
|
+
{t("googlePayConfig.allowedAuthMethodsHint", "Select authentication methods for card payments")}
|
|
181
183
|
</Typography>
|
|
182
184
|
</div>
|
|
183
185
|
<Flex
|
|
@@ -210,7 +212,7 @@ const GooglePayConfig = ({ config, onConfigChange }) => {
|
|
|
210
212
|
textColor="danger600"
|
|
211
213
|
style={{ marginTop: "8px" }}
|
|
212
214
|
>
|
|
213
|
-
At least one authentication method must be selected
|
|
215
|
+
{t("googlePayConfig.atLeastOneAuth", "At least one authentication method must be selected")}
|
|
214
216
|
</Typography>
|
|
215
217
|
)}
|
|
216
218
|
</Box>
|