add debug to try/catch block Controller
This commit is contained in:
parent
8445ce1e34
commit
5453a69312
|
@ -30,6 +30,15 @@ class BillingController extends AbstractController
|
||||||
try {
|
try {
|
||||||
$event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret);
|
$event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret);
|
||||||
|
|
||||||
|
if ($event->type == 'checkout.session.completed') {
|
||||||
|
$session = $event->data->object;
|
||||||
|
|
||||||
|
// Fulfill the purchase...
|
||||||
|
if (file_put_contents("/tmp/return_stripe_session", json_encode($session)) !== false)
|
||||||
|
return $this->json("OK", 200);
|
||||||
|
return $this->json("KO", 500);
|
||||||
|
}
|
||||||
|
|
||||||
} catch(\UnexpectedValueException $e) {
|
} catch(\UnexpectedValueException $e) {
|
||||||
$this->logger->error($e->getMessage());
|
$this->logger->error($e->getMessage());
|
||||||
exit();
|
exit();
|
||||||
|
@ -38,14 +47,6 @@ class BillingController extends AbstractController
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($event->type == 'checkout.session.completed') {
|
return $this->json("KO", 500);
|
||||||
$session = $event->data->object;
|
|
||||||
|
|
||||||
// Fulfill the purchase...
|
|
||||||
file_put_contents("/tmp/return_stripe_session", json_encode($session));
|
|
||||||
//handle_checkout_session($session);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->json("OK", 200);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue