Mas logging
This commit is contained in:
@ -49,8 +49,11 @@ class Toku extends Controller
|
||||
ResponseFactoryInterface $responseFactory,
|
||||
Service\Venta\MediosPago\Toku $tokuService): ResponseInterface
|
||||
{
|
||||
$body = $request->getBody()->getContents();
|
||||
$input = json_decode($body, true);
|
||||
$input = $request->getParsedBody();
|
||||
if ($input === null) {
|
||||
$body = $request->getBody()->getContents();
|
||||
$input = json_decode($body, true);
|
||||
}
|
||||
$this->logger->info('Toku payment success', ['input' => $input]);
|
||||
try {
|
||||
if ($tokuService->successEvent($input)) {
|
||||
@ -111,6 +114,7 @@ class Toku extends Controller
|
||||
if (!$container->has('TOKU_ENV') or strtolower($container->get('TOKU_ENV')) !== 'sandbox') {
|
||||
return $this->withJson($response, ['success' => false], 409);
|
||||
}
|
||||
$this->logger->info('Toku reset');
|
||||
$input = $request->getParsedBody();
|
||||
$output = [
|
||||
'input' => $input,
|
||||
@ -119,7 +123,9 @@ class Toku extends Controller
|
||||
try {
|
||||
$tokuService->reset($input['skips'] ?? []);
|
||||
$output['success'] = true;
|
||||
} catch (Exception $exception) {}
|
||||
} catch (Exception $exception) {
|
||||
$this->logger->error($exception);
|
||||
}
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
public function enqueue(ServerRequestInterface $request, ResponseInterface $response,
|
||||
|
Reference in New Issue
Block a user