From 7213dd0abac25d7ec94a6c81c65b15f10d651c5f Mon Sep 17 00:00:00 2001 From: Serreau Jovann Date: Sun, 11 Jan 2026 14:33:18 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(PaymentClient):=20Configure=20?= =?UTF-8?q?l'URL=20du=20client=20de=20paiement=20en=20fonction=20de=20l'en?= =?UTF-8?q?vironnement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 1 + src/Service/Payments/PaymentClient.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 3ece1ea..f4f06b5 100644 --- a/.env +++ b/.env @@ -52,6 +52,7 @@ STRIPE_PK=pk_test_51SUA22173W4aeFB1nO6oFfDZ12HOTffDKtCshhZ8rkUg6kUO2ZaQC0tK72rhE STRIPE_SK=sk_test_51SUA22173W4aeFB16EB2LxGI0hNvNJzFshDI98zRImWBIhSfzqOGAz5TlPxSpUWbj3x4COm6kmSsaal9FpQR1A7M0022DvjbbR STRIPE_WEBHOOKS_SIGN=whsec_0DOZJAwgMwkcHl2RWXI8h8YItj9q7v3A DEV_URL=https://240fba7426df.ngrok-free.app +PROD_URL=https://www.e-cosplay.fr VAPID_PK=DsOg7jToRSD-VpNSV1Gt3YAhSwz4l-nqeu7yFvzbSxg VAPID_PC=BKz0kdcsG6kk9KxciPpkfP8kEDAd408inZecij5kBDbQ1ZGZSNwS4KZ8FerC28LFXvgSqpDXtor3ePo0zBCdNqo diff --git a/src/Service/Payments/PaymentClient.php b/src/Service/Payments/PaymentClient.php index d8a8502..1539d17 100644 --- a/src/Service/Payments/PaymentClient.php +++ b/src/Service/Payments/PaymentClient.php @@ -14,8 +14,9 @@ class PaymentClient public function __construct(private readonly RequestStack $requestStack, private readonly UrlGeneratorInterface $urlGenerator, private readonly EntityManagerInterface $em) { - if($_ENV['APP_ENV'] == "prod") - $this->url = $this->requestStack->getCurrentRequest()->getSchemeAndHttpHost(); + $this->url = ""; + if($_ENV['APP_ENV'] == "prod"); + $this->url = $_ENV['PROD_URL']; else $this->url = $_ENV['DEV_URL']; }