How to make stripe invoices downloadable for my users?
I am trying to figure out how to make my invoices downloadable. I read the docs https://laravel.com/docs/master/billing#generating-invoice-pdfs and did it like so but this gives the user the receipts. What I want is the invoice pdf like it is on laracasts.
This is the method in my Invoicecontroller which provides the download function for the user to download his receipt.
public function download(Request $request, $invoiceId) {
return $request->user()->downloadInvoice($invoiceId, [
'vendor' => '',
'product' => '',
]);
}
Would prefer the invoice because it is highly customizable. Maybe someone got stuck on that too and knows how to do that?
@smoketm I'll say why don't give the option to download from the stripe customer dashboard portal. FYI https://stripe.com/docs/api/customer_portal if you do that you don't need to do any customization. It's a cool feature rolled by Stripe. Hope it'll help you! Cheers!
Thanks for your answer! Looks like this is something to look into for the next project but I implemented the whole process already like creating, updating and deleting subscriptions. Do you know if this is the way laracasts generates the invoices? There should be a easy way to get the invoices like it is for the receipts? I dont know maybe there is something in cashier but cant find something in the docs.
@lenardo this does not really help there should be a link for the users to get their invoices like it is for the receipts. Cant figure out how laracasts is doing it.
Thanks @timtom this looks promising, but what makes me wonder is why there is nothing from cashier provided. Something like for the receipts. Maybe I should stick with the receipts and edit the receipt.blade.php?
I will not show you the code but you have all your payments in your database, so you can juste create a route who display view with data of payment. (Like a receipt)