Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/screens/CheckoutScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down Expand Up @@ -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
Expand Down
Loading