laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.37k stars 671 forks source link

Improve Cashier Invoice template #677

Closed driesvints closed 2 years ago

driesvints commented 5 years ago

It would be cool if we could spice up the invoice template a bit with better design, responsiveness and maybe also support to include in emails. I remember @sandervanhooft showing me a library that offers that but can't remember the name.

Maybe replace Dompdf with a different library to achieve this.

sandervanhooft commented 5 years ago

Hi @driesvints,

I am including one in the cashier-mollie to be released later this week. You can adapt that one if you'd like. It's built for responsive and email.

It's built using Maizzle and TailwindCSS, you can find the html generator repo here.

I'm not happy yet with the VAT breakdown positioning.

Due to VAT rounding at invoice line level in Cashier Mollie (which is valid in EU), the VAT breakdown can be a bit misleading in some cases.

Better to have a total VAT between subtotal and total. And display the VAT breakdown somewhere else on the invoice.

kainxspirits commented 5 years ago

Hi @driesvints,

Just a suggestion. Can't we let the choice between the custom invoice or the Stripe pdf ? We can already retrieve the invoice_pdf attribute from the Stripe invoice object.

https://stripe.com/docs/api/invoices/object#invoice_object-invoice_pdf

driesvints commented 5 years ago

@kainxspirits that might be a nice solution yeah. Maybe we can add a new method for that.

smartsyncio commented 5 years ago

I have done exactly this, saves faffing about with Cashiers invoice template when stripes PDF is quite elegant out of the box. Guess it comes down to what customisation you are after.

driesvints commented 5 years ago

@smartsyncio the thing with the Cashier pdfs if that you can customize it to your app's look and feel while the Stripe ones reveal what you use under the hood. Some apps just want a custom look and feel. But the default one which ships with Cashier can be spiced up a little bit imo.

smartsyncio commented 5 years ago

@driesvints This was the exact situation I was in, I wanted something fast to set up and get off the ground quickly. Opting for Stripes PDF was this solution. I can always customise the invoice look down the road using Cashiers :)

One thing I did notice and couldn't see a solution, Is a line item of Stripes invoice would say what the actual purchase was i.e. 'Bronze Subscription' I couldn't work out how to get Cashiers to look the same, altho I didn't spend too much time with it.

driesvints commented 2 years ago

Gonna backlog this one internally.