Update subscriptions

This commit is contained in:
Juan Pablo Vial
2025-07-03 16:37:33 -04:00
parent 4980839568
commit cb0731b67d
8 changed files with 182 additions and 9 deletions

View File

@ -146,4 +146,24 @@ class Toku extends Controller
}
return $this->withJson($response, $output);
}
public function update(ServerRequestInterface $request, ResponseInterface $response,
Service\Venta\MediosPago\Toku $tokuService, ?string $type = null): ResponseInterface
{
$body = $request->getBody()->getContents();
$input = json_decode($body, true);
$output = [
'type' => $type,
'input' => $input,
'success' => false
];
try {
$tokuService->update($input, $type);
$output['success'] = true;
} catch (Exception $exception) {
$this->logger->error($exception);
}
return $this->withJson($response, $output);
}
}