Welcome back.
Now, what we need to do is that we need to store also the date in the payment in the payments table.
So we pay on which the payment took place.
So I'm going to get a new here.
I'm going to add here one column and then I'm going to say and then I'm going to say add after transaction
I.D. I'm going to go and then I'm going to create a new field here called.
Payment underscore debt and it's just going to be added.
And I'd be a date.
And just click on safety to see.
So it is just going to store the date, just like the orders here, the structure in the orders.
You'll find that we have here a date time so you can use date or date time.
It's up to you.
The time is going to display the complete the exact hour and minutes and seconds.
So you can select which you can select one of them, you can select date or the date time if you want
a complete description.
If you want the hour and the minutes, the minutes, the seconds, you can see data and let's use the
time because you might want complete details.
Now we need to hear in the complete payment.
We need to pass the date.
So to pass the date we need remember in the in place, in the police order.
In the police order we used this code so we can copy this line of code.
And then here in the complete payment you can say here payment underscore date is equal to and then
the date and then you can pass the date or you can say order ID transaction ID User ID transaction,
ID Karma payment.
Date.
And then he ordered I.D..
User I.D., transaction I.D. and payment date.
And here I am.
Then the transaction, by the way, is strange.
It's not it's not an integer according to people's documentation.
The transaction is a string, so we need to say yes.
And then it is is also it's not India.
Now, let me see and let me.
Test and see how this is going to work.
So let me go to my account.
Let me pay for one of the orders.
So I have so many orders.
Let me, for example, pay for this order.
You're.
I think this was paid.
This one was paid.
So let me pay for this one.
This won't let me back here.
So let me click on pay now paypal button and let me pay now.
And by the way, if a user closes down this window.
Nothing is nothing.
There is no error.
So it's a great thing that the user will know that there is no error.
If you if you if the user decides to pay, they just would click again on the button and it will start
loading.
And people, by the way, is going to display an error message here automatically if something goes
wrong.
So you don't have to worry about this either.
Because the reason is because this happens outside.
You need to know that this happens outside your website.
As you can see, this is a pop up window that points to people.
So people will take care of the errors here.
Let me click on pay now and see what's going to happen.
So here we have an area that says call to a member function on on Boolean.
So we have a problem on line 28.
So the problem here on line 28 is that I said order I.D. and then user I.D. and then transaction I.D.
and then payment date.
And here I forgot to pass the question mark.
I need to say here, comma and then question mark.
So again, this is a common mistake, but it's a simple mistake.
You can figure this mistake out quickly.
Let me save and test one more time.
And it's great that I'm getting this these errors because you will learn from these errors.
So let me go back and test one more time.
I'm going to go back to the order and then let me pay now.
Let me click on B Pay Now or power button.
Illini now click on pay now.
And as you can see, payment was successful and the year is paid.
And let me check the database now.
So now in the database, in the payments, we should have everything.
Now we should have the date.
As you can see.
Now, it's much better.
We have the date.
We have the transaction, the complete transaction according to people.
Again, this is going to be a string.
So this is why I changed it to I changed this to a string and we got the complete transaction ID.
This is very important because if there is any problem, you can contact people and tell them about
any problem using this transaction I.D. and they will find out about the problem.
If you want extra information using this transaction and the user, you will know the order ID.
You will know who paid for the order.
Everything has been stored here.
And if you go to the if you go to the orders, you should find that the order ID number 11 and why speak?
As you can see, order number 11 be.
And the user who paid was user number one.
So now our payment system is robust and complete.