From 64e47dde68d020ee1a74415037958cd1fc899ccd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 13:51:28 +0000 Subject: [PATCH] fix(checkout): send cart total in checkout payload The Flask /checkout endpoint reads `cart["total"]` when an order is fulfilled, but the app only sent `items` and `quantities`, so the request failed with a 500 once the backend reached the success path. Include the cart total (the same value already logged as `totalValue`) so the payload matches the structure the backend expects. Fixes [MOBILE-REACT-NATIVE-62](https://demo.sentry.io/issues/7671831403/) --- src/screens/CheckoutScreen.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/screens/CheckoutScreen.tsx b/src/screens/CheckoutScreen.tsx index 5e70174..f3d67fd 100644 --- a/src/screens/CheckoutScreen.tsx +++ b/src/screens/CheckoutScreen.tsx @@ -141,9 +141,14 @@ const CheckoutScreen = () => { ) as number; Sentry.logger.info(`Adding quantity: ${totalQuantity}`); + const total = cart.reduce( + (sum, item) => sum + item.price * item.quantity, + 0, + ); + const data = { // This is the data structure implemented by application-monitoring-react and flask - cart: {items: cart, quantities}, + cart: {items: cart, quantities, total}, form: contactInfoData, }; @@ -196,10 +201,7 @@ const CheckoutScreen = () => { Sentry.logger.info('Checkout completed successfully', { status: response.status, itemCount: cart.length, - totalValue: cart.reduce( - (sum, item) => sum + item.price * item.quantity, - 0, - ), + totalValue: total, }); uiToast