DDB-1753 #5

Merged
dcherednik merged 21 commits from DDB-1753 into master 2025-03-21 13:37:34 +03:00
2 changed files with 3 additions and 8 deletions
Showing only changes of commit a4a12752b8 - Show all commits

View File

@ -25,13 +25,8 @@ class DigitalSignatureController extends AbstractController
{ {
$token = $request->server->get('HTTP_AUTHORIZATION'); $token = $request->server->get('HTTP_AUTHORIZATION');
$response = $this->digitalSignatureService->getSignature($digitalSignatureRequest, $token); return $this->createJsonResponseFromObject(
$this->digitalSignatureService->getSignature($digitalSignatureRequest, $token)
return $this->createJsonResponse(
[
'hash' => $response->hash,
'content' => base64_encode($response->content),
]
); );
} }
} }

View File

@ -46,7 +46,7 @@ class DigitalSignatureService
return new DigitalSignatureResponse( return new DigitalSignatureResponse(
hash: $response, hash: $response,
content: file_get_contents(sprintf('%s.pdf', $this->document->tempFileName)) content: base64_encode(file_get_contents(sprintf('%s.pdf', $this->document->tempFileName)))
); );
} catch (Exception $e) { } catch (Exception $e) {
throw new RuntimeException($e->getMessage()); throw new RuntimeException($e->getMessage());