Update subscriptions
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user