add debug to try/catch block Controller

This commit is contained in:
Cyprian Beauvois 2019-07-16 16:05:47 +02:00
parent b69638a417
commit b282287d23
1 changed files with 4 additions and 4 deletions

View File

@ -19,9 +19,9 @@ class BillingController extends AbstractController
public function webhook() public function webhook()
{ {
\Stripe\Stripe::setApiKey($this->getParameter('stripe_api_key_secret')); \Stripe\Stripe::setApiKey($this->container->getParameter('stripe_api_key_secret'));
$endpoint_secret = $this->getParameter('stripe_webhook_key'); $endpoint_secret = $this->container->getParameter('stripe_webhook_key');
$payload = @file_get_contents('php://input'); $payload = @file_get_contents('php://input');
$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE']; $sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];
@ -31,10 +31,10 @@ class BillingController extends AbstractController
$event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); $event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret);
} catch(\UnexpectedValueException $e) { } catch(\UnexpectedValueException $e) {
$logger->error($e->getMessage()); $this->logger->error($e->getMessage());
exit(); exit();
} catch(\Stripe\Error\SignatureVerification $e) { } catch(\Stripe\Error\SignatureVerification $e) {
$logger->error($e->getMessage()); $this->logger->error($e->getMessage());
exit(); exit();
} }