From aa51170d7db7e66d0ae4b338cfbdc1958ad3201f Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Tue, 25 Jun 2024 13:23:30 +0200 Subject: [PATCH] Add GatewayController to handle redirections --- src/Controller/GatewayController.php | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/Controller/GatewayController.php diff --git a/src/Controller/GatewayController.php b/src/Controller/GatewayController.php new file mode 100644 index 0000000..a94f2d0 --- /dev/null +++ b/src/Controller/GatewayController.php @@ -0,0 +1,36 @@ +gatewayLocator->getGateway($request->query->get('gateway')); + $checkout = $gateway->handleRedirect($request); + + $this->entityManager->persist($checkout); + $this->entityManager->flush(); + + // TO-DO: This should redirect the user to a GUI + return new RedirectResponse($this->iriConverter->getIriFromResource($checkout)); + } +}