getRedirectResponse example


    }

    public function getRedirectResponse(): ?RedirectResponse
    {
        return $this->object->get('redirectResponse');
    }

    public function getObject(): Struct
    {
        return new ArrayStruct([
            'redirectUrl' => $this->getRedirectResponse() ? $this->getRedirectResponse()->getTargetUrl() : null,
        ]);
    }
}
$handlePaymentRequest->request->set('errorUrl', $errorUrl);
        $handlePaymentRequest->request->add($request->request->all());

        $handlePaymentMethodRouteRequestEvent = new HandlePaymentMethodRouteRequestEvent($request$handlePaymentRequest$context);
        $this->eventDispatcher->dispatch($handlePaymentMethodRouteRequestEvent);

        try {
            $routeResponse = $this->handlePaymentMethodRoute->load(
                $handlePaymentMethodRouteRequestEvent->getStoreApiRequest(),
                $context
            );
            $response = $routeResponse->getRedirectResponse();
        } catch (PaymentProcessException) {
            return $this->forwardToRoute(
                'frontend.checkout.finish.page',
                ['orderId' => $orderId, 'changedPayment' => true, 'paymentFailed' => true]
            );
        }

        return $response ?? $this->redirectToRoute(
            'frontend.checkout.finish.page',
            ['orderId' => $orderId, 'changedPayment' => true]
        );
    }
Home | Imprint | This part of the site doesn't use cookies.