From a4d512c55f43a578d9fe3abe92d20842c0509c88 Mon Sep 17 00:00:00 2001 From: cbeauvoi Date: Tue, 16 Jul 2019 18:15:10 +0200 Subject: [PATCH] update redirect to control on redirect to service --- BillingBundle/Controller/BillingController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BillingBundle/Controller/BillingController.php b/BillingBundle/Controller/BillingController.php index 760db6a..6e4e2c0 100644 --- a/BillingBundle/Controller/BillingController.php +++ b/BillingBundle/Controller/BillingController.php @@ -33,7 +33,13 @@ class BillingController extends AbstractController if ($event->type == 'checkout.session.completed') { $session = $event->data->object; - return $this->redirectToRoute($this->container->getParameter('payment_confirmation_route'), (array) $session); + $serviceToCall = $this->container->getParameter('payment_confirmation_service'); + + $srv = new $serviceToCall(); + + $srv->handlePayment($session); + + return $this->json("OK", 200); } } catch(\UnexpectedValueException $e) {