feat: Add User-Agent header to Allegro API requests

- Implemented buildUserAgent() method in AllegroApiClient, AllegroOAuthClient, and AllegroTrackingService to include User-Agent header in all HTTP requests to Allegro API.
- Updated .env.example to include APP_VERSION and ALLEGRO_USER_AGENT_URL for configuration.
- Created public /info page to provide application details required by Allegro, including app name, version, description, and contact information.
- Added minimalist layout for public pages to ensure a professional appearance.
- Ensured all changes comply with Allegro's API requirements for User-Agent header.
This commit is contained in:
2026-04-08 20:59:55 +02:00
parent 0f7742f10d
commit c5b2885b44
21 changed files with 827 additions and 22 deletions

View File

@@ -0,0 +1,98 @@
<style>
.info-header {
margin-bottom: 32px;
padding-bottom: 24px;
border-bottom: 2px solid #e2e8f0;
}
.info-header h1 {
font-size: 28px;
font-weight: 700;
color: #1a202c;
margin-bottom: 4px;
}
.info-header .version {
font-size: 14px;
color: #718096;
font-weight: 400;
}
.info-section {
margin-bottom: 28px;
}
.info-section h2 {
font-size: 18px;
font-weight: 600;
color: #2d3748;
margin-bottom: 10px;
padding-bottom: 6px;
border-bottom: 1px solid #e2e8f0;
}
.info-section p {
font-size: 15px;
color: #4a5568;
margin-bottom: 8px;
}
.info-section ul {
list-style: none;
padding: 0;
}
.info-section ul li {
font-size: 15px;
color: #4a5568;
padding: 4px 0 4px 20px;
position: relative;
}
.info-section ul li::before {
content: "\2022";
color: #4299e1;
font-weight: 700;
position: absolute;
left: 4px;
}
.info-footer {
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #e2e8f0;
font-size: 13px;
color: #a0aec0;
}
</style>
<div class="info-header">
<h1><?= $e($appName) ?> <span class="version">v<?= $e($appVersion) ?></span></h1>
</div>
<div class="info-section">
<h2>O aplikacji</h2>
<p>
<?= $e($appName) ?> to wewnętrzna aplikacja firmy Project PRO do zarządzania
zamówieniami z wielu kanałów sprzedaży. Umożliwia centralne przetwarzanie zamówień,
generowanie etykiet przewozowych, śledzenie przesyłek oraz automatyzację
procesów sprzedażowych.
</p>
<p>
Aplikacja jest przeznaczona wyłącznie do użytku wewnętrznego firmy Project PRO
i nie jest udostępniana publicznie.
</p>
</div>
<div class="info-section">
<h2>Integracja z Allegro REST API</h2>
<p>Aplikacja korzysta z Allegro REST API w następującym zakresie:</p>
<ul>
<li>Import zamówień (checkout forms)</li>
<li>Zarządzanie przesyłkami (shipment management)</li>
<li>Synchronizacja statusów realizacji zamówień</li>
<li>Przekazywanie numerów przesyłek (waybill)</li>
<li>Śledzenie statusów dostawy</li>
</ul>
</div>
<div class="info-section">
<h2>Operator</h2>
<p>Project PRO</p>
<p>E-mail: kontakt@projectpro.pl</p>
</div>
<div class="info-footer">
<?= $e($appName) ?> v<?= $e($appVersion) ?> &middot; &copy; <?= date('Y') ?> Project PRO
</div>

View File

@@ -0,0 +1,34 @@
<!doctype html>
<html lang="pl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= $e($title ?? 'orderPRO') ?></title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Roboto', sans-serif;
background: #f5f7fa;
color: #2d3748;
line-height: 1.6;
min-height: 100vh;
}
.public-page {
max-width: 720px;
margin: 0 auto;
padding: 48px 24px;
}
@media (max-width: 768px) {
.public-page { padding: 24px 16px; }
}
</style>
</head>
<body>
<main class="public-page">
<?= $content ?>
</main>
</body>
</html>