File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,14 @@ public function __construct(FapiRestClient $client)
2727 $ this ->resources = 'invoices ' ;
2828 }
2929
30- public function getPdf (int $ id )
30+ /**
31+ * @param int $id
32+ * @param mixed[] $parameters
33+ * @return string|null
34+ */
35+ public function getPdf (int $ id , array $ parameters = [])
3136 {
32- return $ this ->client ->getInvoicePdf ($ id );
37+ return $ this ->client ->getInvoicePdf ($ id, $ parameters );
3338 }
3439
3540 /**
Original file line number Diff line number Diff line change @@ -223,11 +223,18 @@ public function generateQrCode(int $id): array
223223
224224 /**
225225 * @param int $id
226+ * @param mixed[] $parameters
226227 * @return string|null
227228 */
228- public function getInvoicePdf (int $ id )
229+ public function getInvoicePdf (int $ id, array $ parameters = [] )
229230 {
230- $ httpResponse = $ this ->sendHttpRequest (HttpMethod::GET , '/invoices/ ' . $ id . '.pdf ' );
231+ $ path = '/invoices/ ' . $ id . '.pdf ' ;
232+
233+ if ($ parameters ) {
234+ $ path .= '? ' . $ this ->formatUrlParameters ($ parameters );
235+ }
236+
237+ $ httpResponse = $ this ->sendHttpRequest (HttpMethod::GET , $ path );
231238
232239 if ($ httpResponse ->getStatusCode () === HttpStatusCode::S200_OK ) {
233240 return (string ) $ httpResponse ->getBody ();
You can’t perform that action at this time.
0 commit comments