From 1de3ba0115d7f898cb4b57ba5199e9f992588587 Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Wed, 16 Jul 2025 13:47:16 +0200 Subject: [PATCH] Update PaymentSuccess component to set redirect hash based on payment status: '#orders' for successful payments and '#cart' for failed payments. --- src/components/PaymentSuccess.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/PaymentSuccess.js b/src/components/PaymentSuccess.js index 1f76978..c9899d5 100644 --- a/src/components/PaymentSuccess.js +++ b/src/components/PaymentSuccess.js @@ -108,8 +108,8 @@ class PaymentSuccess extends Component { profileUrl.searchParams.set('mollie_order_id', response.order.orderId.toString()); } - // Set hash to cart tab - profileUrl.hash = '#cart'; + // Set hash based on payment success: orders for successful payments, cart for failed payments + profileUrl.hash = response.payment.isPaid ? '#orders' : '#cart'; this.setState({ redirectUrl: profileUrl.pathname + profileUrl.search + profileUrl.hash,