You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method Recurly_Invoice::getInvoicePdf($invoiceNumber) doesn't validate the response code which means that if the server returns any status code >=400 then the method returns a HTML document instead of the pdf content.
This is not so much an issue for 404 or similar errors because we can validate that the invoice exists before downloading it but is more of an issues for 5XX errors.
@glaubinix Thank you again for reporting this issue. We have updated the error handling for the pdf requests and an updated client will be published soon.
I'd also like to point out that we just launched a new version of the PHP client library that leverages the v3 API. The current 3.0.0 version of the library requires at least PHP 7.3, but I've dropped that requirement down to 7.2 in #473. Take a look and see if that is something that you'd be interested in using.
Describe the bug
The method
Recurly_Invoice::getInvoicePdf($invoiceNumber)
doesn't validate the response code which means that if the server returns any status code >=400 then the method returns a HTML document instead of the pdf content.This is not so much an issue for 404 or similar errors because we can validate that the invoice exists before downloading it but is more of an issues for 5XX errors.
To Reproduce
Recurly_Invoice::getInvoicePdf($nonExistingInvoiceNumber)
Expected behavior
The method throws an exception like other methods in the library if an unexpected response code was received.
Your Environment
The text was updated successfully, but these errors were encountered: