hannah-finch / isabelles-bead-shop

E-commerce site for a small jewelry shop
MIT License
3 stars 1 forks source link

Stripe return, Stock update, Receipt page #111

Closed swokamoto closed 6 days ago

swokamoto commented 1 week ago

MAYBE TEST THE BRANCH ON LIVE FIRST!!

(only tested on local devmode)

image

Displays successful orders.

Updates the stock in database. IT IS USING the "name" field to match. This is because the item on the stripe side is not defined.

(my current understanding) We would need to look into migrating and syncing the databases with stripe. But, for now it will grab the "description" the stripe item, then check that against the names in our db to .findOne( {name: description} )

there is a flag in local storage that will flip when the update has occurred for each checkout Session ID. I think in the future you would have to have a flag on the server side to avoid any funny business (since you can just reset the localstorage and refresh the page to trigger another update event. Im sure theres Redux or some nonsense thatll work as well.

Quick and dirty tailwind to pad it out.