So here what I'm going to do is that I'm going to store the order in in the in the session or we can
pass it.
But I think in the session would be better.
I'm going to say session.
Event.
Order underscore it is equal to order 80.
And then in the basement, in the pavement here, we need to do what we need to do is that in case the
user came from the order details, we can keep up and then order.
Order I.D. would be equal to.
Lost.
Order 80.
And if you user came from the from the cart, what we need to do is that we need to do the same thing
when this time.
The order and order, it is going to be equal to session order 80.
Session.
Ordering.
I mean, you don't forget the semicolon.
That's it.
Now we need to pass the order in, so we have to pass the order in.
And that's it.
Now we need to hit an over to the complete payment.
So I'm going to create now a complete payment that would be here in this file view file, complete underscore
payment.
Not BHP.
I think the complete theme that BHP, what we need to do is that we need to do two things.
We need to change the order.
We need to.
Let me add a comment.
Change.
Order.
Status.
To be.
And the second thing is to store payment and full payment and in database.
That's it's very, very, very simple.
And then just go to user account.
Very simple.
So in order to do all of all of these first here in the payment, we have the the transaction ID and
transaction ID and the order ID.
So I'm going to again go to, by the way, we need the user I.D., but the user ID is stored in the
the user ID is stored in decision, so we don't have to worry about it.
So what I'm going to do is that I'm going to go to the complete payment and then I'm going to say if.
If.
Is said.
Get.
And then transaction.
Transaction ID and.
And.
Is said.
Order I.D. and get your I.D..
Order in.
Then we need you to complete and do everything.
So here are the comments and sign this statement here and then here.
And then here.
Eliminating movies.
And also remove it from here.
So the first thing that we need to do is that we need to change the order status.
So to change the order status, we need to access the order table.
So I'm going to copy accounts from the police order because we already have them.
But first we need to connect to the database and start a session.
So I'm going to copy these two and then I'm going to be sitting at the top here.
We need to say session, start and include connection.
And then we need to.
Update.
So to update.
We need.
We have I think we have a code that updates in the account, remember.
In that account.
We have a code that we already used here.
Here this update.
So I'm going to copy this.
I'm going to copy this, these two lines, and then I'm going to pasted a paste them here.
And then we need to say connection.
Let me push this, because this must be inside.
Maybe push these.
So here I'm going to say connection, prepare, update orders and then set order status.
I mean, question mark, where are order 80?
Order 80.
So we need to say by interim order status SE and I will order it.
And then we need to say here.
Order.
Status.
An already.
And he order.
I'd.
Is equal to the order it gets.
All right.
And the order, status, order, order underscore status is going to be equal to paint.
At this point, it hasn't been paid.
And this transaction we also need to see from.
Such an ID.
I.D. is equal to your card transaction, maybe.
And here we update, we update this and then we need to say excuse.
Here is the empty excuse.
So this the first step.
The second step is that we need to store the payment info so it is stored in the payment info we need
to say is the empty and then it is the empty one.
Now another, another statement of we need to say gone and then prepare and then insert.
But instead of click and you think this goes from scratch, let me get it from here.
So here we have this insert.
So let me get I think this is shorter.
So I'm going to get this one.
I'm going to give this one and then I'm going to sit here in the.
Complete payment.
And then I'm going to say statement one so is the empty one is equal to is equal to conviction.
Prepare insert into payments.
And then what we want to insert is that we want to insert the order in order underscore it.
And we need to insert the order status, the user I.D. and the transaction item.
The order status is not important here.
The order status is not important by the user.
It is very important.
The order is also very important to the transaction.
It is also important we don't need this.
We don't need any of this.
And we don't actually we don't need the order order status because payments, it means that the obviously
we aren't storing something that hasn't been built.
We are storing only payments.
So I'm going to to you three question marks.
We need the order.
I need the user I.D. and the transaction I.D. And then here we need to say that statements one and then
bind where we need to bind II and we need to bind order ID and user ID user which, which doesn't exist
yet.
This transaction I.
Transaction.
And we need to remove all of these things.
So we need to get the user I.D..
Where's the user?
I need the user I.D. is in the session.
So I'm going to say user ID is equal to session.
User I.D..
And then we say here, statement, one statement, one statement, and then excuse.
Finally, we go to user account.
So I'm going to say, hey there and then location.
And then count that HP And then you can pass even a parameter say remember in that count, let me go
to the account in that count we have in the bottom here.
We have.
I think at up not in the bottom.
We have a user name, user email message.
I think our message let's say your message.
The men.
So since all is equal to our payment message.
I'm going to say payment.
Message is equal to.
Beat.
So successfully.
Thanks for your big.
Thanks for your.
Shocking.
With us.
And that's it.
Now we need to clear the payments table in order to be able to continue.
And else.
We need to exit this page and take the user to it and then location.
Index.
That BHP and then exit.