DavidAJohn / PhotoPortfolio

Personal photo portfolio .NET web application which implements a Blazor and Tailwind CSS user interface with a MongoDb database, and includes integration with Stripe Checkout and Prodigi Print API
0 stars 1 forks source link

Remove redundant Stripe data from Order model #14

Closed DavidAJohn closed 1 year ago

DavidAJohn commented 1 year ago

Now that the line items from an order are being saved to our database before we go to Stripe Checkout - we just pass them the generated order number as metadata - there really isn't any need to store the details from Stripe in our database as well. I was going for a kind of 'belt and braces' approach, but on reflection I think it's unnecessary.

All of the data is available in the Stripe Dashboard anyway, plus it's complex and difficult to model. As well as that, it created an insurmountable deserialisation problem when retrieving an Order so that the full details could be shown on the checkout success page.

So let's remove it, thus simplifying the application and reducing the database size.

The following files will be affected:

Order class OrderDetailsDto class (redundant?) PaymentsController OrderService (server) OrderService (client)