“okay so um the the checkout thing is broken again so when a user applies a promo code on the cart page and then goes back and like changes the quantity the total doesn't update it still shows the old discount and then stripe charges the wrong amount wait no stripe charges the right amount but the receipt email shows the old one so that's actually the bug i think it's in use cart or maybe in the web hook handler new paragraph can you um do this bullet point check where the total gets calculated and whether we're caching it in red is bullet point fix it so there's only one place that computes the total bullet point add a test for the promo code plus quantity change case bullet point and uh don't touch the payment intent code we just refactored that last week bullet point oh and run the type check before you commit”
The checkout thing is broken again. When a user applies a promo code on the cart page, then goes back and changes the quantity, the total doesn't update. It still shows the old discount. Stripe charges the right amount, but the receipt email shows the old one, so that's actually the bug. I think it's in `useCart` or maybe in the webhook handler.
- Check where the total gets calculated and whether we're caching it in Redis.
- Fix it so there's only one place that computes the total.
- Add a test for the promo code plus quantity change case.
- Don't touch the payment intent code. We just refactored that last week.
- Run the type check before you commit.