This repository was archived by the owner on Aug 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -117,10 +117,14 @@ private function createJsonBody(array $parameters): ?string
117117 * @return mixed
118118 * @throws DomainException
119119 */
120- protected function handleResponse (ResponseInterface $ response , string $ class )
120+ protected function handleResponse (ResponseInterface $ response , ? string $ class = null )
121121 {
122122 $ this ->handleErrors ($ response );
123123
124+ if (null === $ class ) {
125+ return $ response ->getBody ()->__toString ();
126+ }
127+
124128 $ response = $ this ->hydrator ->hydrate ($ response , $ class );
125129
126130 if ($ response instanceof Collection) {
Original file line number Diff line number Diff line change @@ -21,6 +21,18 @@ public function invoice(int $id): Invoice
2121 return $ this ->handleResponse ($ response , InvoiceFactory::class);
2222 }
2323
24+ /**
25+ * @see https://apidocs.cuentica.com/versions/latest_release/#customer-id
26+ * @throws DomainException
27+ * @throws ClientExceptionInterface
28+ */
29+ public function pdf (int $ id ): string
30+ {
31+ $ response = $ this ->httpGet ('/invoice/ ' .$ id .'/pdf ' );
32+
33+ return $ this ->handleResponse ($ response );
34+ }
35+
2436 /**
2537 * @see https://apidocs.cuentica.com/versions/latest_release/#customer
2638 * @throws DomainException
You can’t perform that action at this time.
0 commit comments