In this episode, we add a brand new invoices section to our subscription page so users can see all their previous invoices. We start by creating a new partial view just for invoices, making sure it's included at the bottom of the subscription page.
Next up, we dig into how to actually get the list of invoices for the user. We use the user's invoices
method, which returns a collection of invoice objects (these are basically wrappers around data from Stripe). We take a quick pause to debug and double-check what data we get back, and then move forward to displaying things on the page.
We then update our partial to list out each invoice, showing the date (nicely formatted!) and the total amount. For now, we add a placeholder link where users will eventually be able to download each invoice – but that feature will come in the next episode.
All in all, by the end of the video, you’ll have a neat list of invoices showing all the important details. No fancy styling (yet!), but this gives us a solid foundation for handling invoices in our app.