diff --git a/src/pages/PaymentCancelPage.tsx b/src/pages/PaymentCancelPage.tsx index 8c37f8b..99dd51e 100644 --- a/src/pages/PaymentCancelPage.tsx +++ b/src/pages/PaymentCancelPage.tsx @@ -27,6 +27,7 @@ export function PaymentCancelPage({ useEffect(() => { localStorage.removeItem('pendingBookingId'); sessionStorage.removeItem('pendingBookingId'); + document.cookie = 'pendingBookingId=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; }, []); return ( diff --git a/src/pages/PaymentDetailsPage.tsx b/src/pages/PaymentDetailsPage.tsx index 2d6950b..59961d3 100644 --- a/src/pages/PaymentDetailsPage.tsx +++ b/src/pages/PaymentDetailsPage.tsx @@ -289,6 +289,13 @@ export function PaymentDetailsPage({ const { checkoutPageUrl } = payResponse; + + const setCookie = (name: string, value: string, days = 1) => { + const expires = new Date(); + expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000); + document.cookie = `${name}=${value};expires=${expires.toUTCString()};path=/;SameSite=Lax`; + }; + setCookie('pendingBookingId', bookingId); localStorage.setItem('pendingBookingId', bookingId); sessionStorage.setItem('pendingBookingId', bookingId); @@ -317,7 +324,7 @@ export function PaymentDetailsPage({
+ We couldn't automatically retrieve your booking ID. Please enter it below to confirm your payment.
+
+ (Check your email or order history for the Booking ID)
+