diff --git a/src/Controllers/PlaceOrderController.php b/src/Controllers/PlaceOrderController.php index a1463d5b1..84a7df3b2 100644 --- a/src/Controllers/PlaceOrderController.php +++ b/src/Controllers/PlaceOrderController.php @@ -36,7 +36,6 @@ class PlaceOrderController extends LayoutController * @param SessionStorageRepositoryContract $sessionStorageRepository * @param ShopUrls $shopUrls * - * @return \Symfony\Component\HttpFoundation\Response */ public function placeOrder( OrderService $orderService, @@ -115,11 +114,7 @@ function ($event) { ] ); - if(!is_null(ValidateVatNumber::getFallbackStatusServiceUnavailable())) { - /** - * @var NotificationService $notificationService - */ - $notificationService = pluginApp(NotificationService::class); + if (!is_null(ValidateVatNumber::getFallbackStatusServiceUnavailable())) { $notificationService->addNotificationCode('warn', 212); } try { @@ -138,7 +133,8 @@ function ($event) { $request = pluginApp(Request::class); $redirectParam = $request->get('redirectParam', ''); $urlParams = []; - $url = "execute-payment/" . $orderData->order->id; + $orderId = $orderData->order->id; + $url = "execute-payment/".$orderId; $url .= UrlQuery::shouldAppendTrailingSlash() ? '/' : ''; if (strlen($redirectParam)) { @@ -156,7 +152,7 @@ function ($event) { } } - return $this->urlService->redirectTo($url); + return $this->executePayment($orderService, $notificationService, $shopUrls, $orderId); } public function executePayment( diff --git a/src/Middlewares/DetectLanguage.php b/src/Middlewares/DetectLanguage.php index 8ceaace27..eecafef06 100644 --- a/src/Middlewares/DetectLanguage.php +++ b/src/Middlewares/DetectLanguage.php @@ -39,7 +39,7 @@ public function before(Request $request) public function detectLanguage($request, $url = null) { if (!str_starts_with($request->getRequestUri(), self::WEB_AJAX_BASE)) { - $requestUri = $url ?? $request->get('plentyMarkets'); + $requestUri = $url ?? $request->get('plentyMarkets') ?? ''; /** @var WebstoreConfigurationRepositoryContract $webstoreConfigurationRepository */ $webstoreConfigurationRepository = pluginApp(WebstoreConfigurationRepositoryContract::class);