Index: src/main/resources/static/FlightSearch.html
===================================================================
--- src/main/resources/static/FlightSearch.html	(revision 986830465c15053d3a25484f02e6e5ef26ceae2e)
+++ src/main/resources/static/FlightSearch.html	(revision de83113e09d4c6a32e066d85e3adf027088a2433)
@@ -252,5 +252,5 @@
             <h2>Available Flights</h2>
             <div class="flights-list">
-                <div class="flight-item" v-for="flight in flights" :key="flight.flightId">
+                <div class="flight-item" v-for="flight in flights" :key="flight.flightID">
                     <input type="checkbox" v-model="flight.selected" />
                     <span>{{ flight.departureTime }} | {{ flight.arrivalTime }} | ${{ flight.price }} | {{ flight.availableSeats }}</span>
@@ -295,5 +295,6 @@
             showReturnDate: false,
             showPopup: false,
-            issueDescription: ""
+            issueDescription: '',
+            userId:''
         },
         computed: {
@@ -302,4 +303,5 @@
             }
         },
+
         methods: {
             async searchFlights() {
@@ -337,17 +339,19 @@
 
                 const flight = this.selectedFlights[0];
+                console.log(flight);
                 const totalCost = flight.price;
+
                 const bookingData = {
-                    flightId: flight.flightId,
+                    flightId: flight.flightID,
                     bookingDate: new Date().toISOString().split('T')[0],
                     status: 'PENDING',
-                    totalCost: totalCost
+                    totalCost: totalCost,
+                    userId:this.userId
                 };
-
                 axios.post('/api/bookings', bookingData)
                     .then(response => {
-                        const bookingID = response.data.bookingID;
+                        const bookingID = response.data.bookingId;
                         alert("Booked successfully!");
-                        window.location.href = `/transaction?amount=${encodeURIComponent(totalCost)}&bookingId=${encodeURIComponent(bookingID)}&flightId=${encodeURIComponent(flight.flightId)}`;
+                        window.location.href = `/transaction?amount=${encodeURIComponent(totalCost)}&bookingId=${encodeURIComponent(bookingID)}&flightId=${encodeURIComponent(flight.flightID)}&userId=${encodeURIComponent(this.userId)}`;
                     })
                     .catch(error => {
@@ -383,5 +387,5 @@
                 if (this.issueDescription.trim()) {
                     const reviewData = {
-                        userID: 1,
+                        userID: this.userId,
                         subject: "Issue Report",
                         description: this.issueDescription
@@ -413,4 +417,6 @@
         mounted() {
             this.fetchFlights();
+            const params = new URLSearchParams(window.location.search);
+            this.userId = params.get("userId");
             axios.get('api/flights')
                 .then(response => {
@@ -420,4 +426,5 @@
                     console.error("Error fetching flights", error);
                 });
+
         }
     });
Index: src/main/resources/static/TransactionPage.html
===================================================================
--- src/main/resources/static/TransactionPage.html	(revision 986830465c15053d3a25484f02e6e5ef26ceae2e)
+++ src/main/resources/static/TransactionPage.html	(revision de83113e09d4c6a32e066d85e3adf027088a2433)
@@ -263,16 +263,7 @@
             expiration: '',
             amount: '',
-            paymentSuccess: false
-        },
-        created(){
-            const urlParams = new URLSearchParams(window.location.search);
-            this.flightId = urlParams.get('flightId');
-            this.amount = urlParams.get('amount');
-            this.bookingId = urlParams.get('bookingId')
-
-            const user = JSON.parse(localStorage.getItem("user"));
-            if(user){
-                this.userId = user.id;
-            }
+            paymentSuccess: false,
+            flightId:'',
+            userId:''
         },
         methods: {
@@ -282,7 +273,7 @@
                     transaction_date:paymentDate,
                     payment_status:'SUCCESS',
-                    amount:this.amount,
-                    userId:this.userId,
-                    bookingId:this.bookingId
+                    amount:Number(this.amount) || null,
+                    userId:Number(this.userId) || null,
+                    bookingId:Number(this.bookingId) || null
                 };
                 console.log(transaction);
@@ -291,10 +282,27 @@
                         console.log(response.data);
                         this.paymentSuccess = true;
+                        this.updateBooking();
                         setTimeout(() => window.location.href = '/flights',2000);
                 })
                     .catch(error => console.error("Payment failed", error));
             },
+            updateBooking() {
+                const booking = {
+                    bookingDate: new Date().toISOString().split('T')[0],
+                    flightId:this.flightId,
+                    payment_status:'SUCCESS',
+                    total_cost:Number(this.amount) || null,
+                    userId:Number(this.userId) || null,
+                    bookingId:Number(this.bookingId) || null
+                };
+                console.log(booking);
+                axios.put(`api/flights/${this.bookingId}`, booking)
+                    .then(response => {
+                        console.log(response.data);
+                    })
+                    .catch(error => console.error("Booking update failed", error));
+            },
             cancelPayment() {
-                window.location.href = '/flights'; // Redirecting to flight search on cancel
+                window.location.href = '/flights';
             },
             validateForm() {
@@ -305,4 +313,11 @@
                 );
             }
+        },
+        mounted(){
+            const params = new URLSearchParams(window.location.search);
+            this.userId = params.get("userId");
+            this.bookingId = params.get("bookingId");
+            this.flightId = params.get("flightId");
+            this.amount=params.get("amount");
         }
     });
