diff --git a/src/pages/PaymentResult.js b/src/pages/PaymentResult.js index a7f4896..92f816e 100644 --- a/src/pages/PaymentResult.js +++ b/src/pages/PaymentResult.js @@ -40,7 +40,11 @@ const PaymentResult = () => { navigate('/booking', { state: { paymentSuccess: true, - orderNumber: orderNumber + orderNumber: orderNumber, + bookingDetails: result.bookingDetails || {}, + spaceId: result.spaceId, + spaceName: result.spaceName, + price: result.price } }); }, 1500); @@ -70,8 +74,11 @@ const PaymentResult = () => { }; useEffect(() => { - processPayment(); - }, []); // eslint-disable-line react-hooks/exhaustive-deps + const paymentSuccess = location.state?.paymentSuccess; + if (paymentSuccess) { + setStep(4); + } + }, [location]); return (