Open dunglas opened 2 years ago
Sorry for the late response. Thank you for the suggestion. I'm convinced this would be useful to add. Quote PDF is a special case because the API contains /v1/quotes/:quote/pdf
which contains the PDF, but /v1/invoices/:invoice/pdf
does not exist (yet?) so the implementation would have to be different. I'm imagining something like
\Stripe\Util::download_file($invoice_pdf)
which would be provided for convenience but would just use curl.
A helper method is provided to download the PDF of a quote (
$quote->pdf()
), but not for an invoice. Unfortunately, doingfile_get_contents($invoice->invoice_pdf)
to download the PDF doesn't work anymore because PHP doesn't handle the redirection to S3 properly.Using
curl
is a working workaround (see https://github.com/dunglas/stripe-invoice-exporter/pull/1), but a dedicated helper method could be convenient.Best regards,