add func personnalisation on redirect from webhook

This commit is contained in:
Cyprian Beauvois 2019-07-17 16:27:54 +02:00
parent 515a8504b1
commit 06726829fe
1 changed files with 12 additions and 2 deletions

View File

@ -35,9 +35,19 @@ class BillingController extends AbstractController
$serviceToCall = $this->container->getParameter('payment_confirmation_service');
$srv = new $serviceToCall();
list($service, $function) = str_split($serviceToCall, '::');
$srv->handlePayment($session);
$srv = null;
if (class_exists($service))
$srv = new $service();
else
$this->logger->error("Can't find your class to redirect webhook");
if (method_exists($srv, $function))
$srv->{$function}($session);
else
$this->logger->error("Can't find your method in class " . $service);
return $this->json("OK", 200);
}