Logging
This commit is contained in:
@ -47,15 +47,20 @@ class Toku extends Controller
|
||||
ResponseFactoryInterface $responseFactory,
|
||||
Service\Venta\MediosPago\Toku $tokuService): ResponseInterface
|
||||
{
|
||||
$body = $request->getBody();
|
||||
$input = json_decode($body->getContents(), true);
|
||||
$body = $request->getBody()->getContents();
|
||||
$input = json_decode($body, true);
|
||||
try {
|
||||
if ($tokuService->successEvent($input)) {
|
||||
return $responseFactory->createResponse(200);
|
||||
}
|
||||
$this->logger->warning("Could not update payment", ['input' => $input]);
|
||||
return $responseFactory->createResponse(409, 'Payment could not be updated');
|
||||
} catch (InvalidResult $exception) {
|
||||
$this->logger->warning($exception);
|
||||
$this->logger->warning($exception, [
|
||||
'uri' => $request->getUri()->getPath(),
|
||||
'body' => $body,
|
||||
'input' => $input
|
||||
]);
|
||||
if (str_contains($exception->getMessage(), 'Customer')) {
|
||||
$message = 'Customer not found';
|
||||
} elseif (str_contains($exception->getMessage(), 'Invoice')) {
|
||||
|
Reference in New Issue
Block a user