1 00:00:01,050 --> 00:00:01,650 Welcome back. 2 00:00:02,040 --> 00:00:08,580 Now, what we need to do is that we need to store also the date in the payment in the payments table. 3 00:00:08,880 --> 00:00:11,790 So we pay on which the payment took place. 4 00:00:11,820 --> 00:00:13,170 So I'm going to get a new here. 5 00:00:13,620 --> 00:00:19,580 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 6 00:00:19,600 --> 00:00:24,090 I.D. I'm going to go and then I'm going to create a new field here called. 7 00:00:25,820 --> 00:00:31,240 Payment underscore debt and it's just going to be added. 8 00:00:32,220 --> 00:00:33,320 And I'd be a date. 9 00:00:34,980 --> 00:00:39,030 And just click on safety to see. 10 00:00:40,330 --> 00:00:46,270 So it is just going to store the date, just like the orders here, the structure in the orders. 11 00:00:46,720 --> 00:00:51,700 You'll find that we have here a date time so you can use date or date time. 12 00:00:51,700 --> 00:00:52,690 It's up to you. 13 00:00:53,110 --> 00:00:59,380 The time is going to display the complete the exact hour and minutes and seconds. 14 00:00:59,380 --> 00:01:05,680 So you can select which you can select one of them, you can select date or the date time if you want 15 00:01:05,680 --> 00:01:06,880 a complete description. 16 00:01:06,880 --> 00:01:12,760 If you want the hour and the minutes, the minutes, the seconds, you can see data and let's use the 17 00:01:12,760 --> 00:01:17,260 time because you might want complete details. 18 00:01:18,010 --> 00:01:20,530 Now we need to hear in the complete payment. 19 00:01:21,460 --> 00:01:22,540 We need to pass the date. 20 00:01:22,540 --> 00:01:27,790 So to pass the date we need remember in the in place, in the police order. 21 00:01:28,690 --> 00:01:32,470 In the police order we used this code so we can copy this line of code. 22 00:01:33,070 --> 00:01:42,280 And then here in the complete payment you can say here payment underscore date is equal to and then 23 00:01:42,280 --> 00:01:49,330 the date and then you can pass the date or you can say order ID transaction ID User ID transaction, 24 00:01:49,330 --> 00:01:51,850 ID Karma payment. 25 00:01:53,710 --> 00:01:54,160 Date. 26 00:01:56,540 --> 00:01:58,010 And then he ordered I.D.. 27 00:01:59,000 --> 00:02:04,760 User I.D., transaction I.D. and payment date. 28 00:02:05,360 --> 00:02:06,590 And here I am. 29 00:02:06,590 --> 00:02:09,470 Then the transaction, by the way, is strange. 30 00:02:09,590 --> 00:02:14,870 It's not it's not an integer according to people's documentation. 31 00:02:15,170 --> 00:02:17,660 The transaction is a string, so we need to say yes. 32 00:02:18,230 --> 00:02:20,840 And then it is is also it's not India. 33 00:02:21,620 --> 00:02:23,510 Now, let me see and let me. 34 00:02:24,570 --> 00:02:28,770 Test and see how this is going to work. 35 00:02:28,770 --> 00:02:30,750 So let me go to my account. 36 00:02:31,260 --> 00:02:33,300 Let me pay for one of the orders. 37 00:02:33,300 --> 00:02:34,340 So I have so many orders. 38 00:02:34,350 --> 00:02:37,020 Let me, for example, pay for this order. 39 00:02:38,970 --> 00:02:39,580 You're. 40 00:02:39,630 --> 00:02:41,040 I think this was paid. 41 00:02:41,940 --> 00:02:42,630 This one was paid. 42 00:02:42,630 --> 00:02:43,890 So let me pay for this one. 43 00:02:45,730 --> 00:02:46,960 This won't let me back here. 44 00:02:49,090 --> 00:02:53,440 So let me click on pay now paypal button and let me pay now. 45 00:02:59,770 --> 00:03:02,830 And by the way, if a user closes down this window. 46 00:03:04,120 --> 00:03:05,440 Nothing is nothing. 47 00:03:05,680 --> 00:03:06,350 There is no error. 48 00:03:06,370 --> 00:03:10,360 So it's a great thing that the user will know that there is no error. 49 00:03:10,960 --> 00:03:16,930 If you if you if the user decides to pay, they just would click again on the button and it will start 50 00:03:16,930 --> 00:03:17,440 loading. 51 00:03:19,260 --> 00:03:23,670 And people, by the way, is going to display an error message here automatically if something goes 52 00:03:23,670 --> 00:03:23,910 wrong. 53 00:03:23,910 --> 00:03:25,800 So you don't have to worry about this either. 54 00:03:28,100 --> 00:03:31,250 Because the reason is because this happens outside. 55 00:03:31,340 --> 00:03:33,740 You need to know that this happens outside your website. 56 00:03:34,340 --> 00:03:37,280 As you can see, this is a pop up window that points to people. 57 00:03:37,820 --> 00:03:40,910 So people will take care of the errors here. 58 00:03:41,450 --> 00:03:44,480 Let me click on pay now and see what's going to happen. 59 00:03:48,480 --> 00:03:54,480 So here we have an area that says call to a member function on on Boolean. 60 00:03:54,480 --> 00:03:57,150 So we have a problem on line 28. 61 00:03:57,690 --> 00:04:04,270 So the problem here on line 28 is that I said order I.D. and then user I.D. and then transaction I.D. 62 00:04:04,290 --> 00:04:06,060 and then payment date. 63 00:04:06,600 --> 00:04:12,720 And here I forgot to pass the question mark. 64 00:04:12,720 --> 00:04:15,450 I need to say here, comma and then question mark. 65 00:04:15,900 --> 00:04:19,290 So again, this is a common mistake, but it's a simple mistake. 66 00:04:19,290 --> 00:04:21,210 You can figure this mistake out quickly. 67 00:04:21,900 --> 00:04:23,340 Let me save and test one more time. 68 00:04:23,820 --> 00:04:27,810 And it's great that I'm getting this these errors because you will learn from these errors. 69 00:04:28,680 --> 00:04:31,050 So let me go back and test one more time. 70 00:04:31,770 --> 00:04:35,430 I'm going to go back to the order and then let me pay now. 71 00:04:37,860 --> 00:04:41,400 Let me click on B Pay Now or power button. 72 00:04:46,970 --> 00:04:48,800 Illini now click on pay now. 73 00:04:54,490 --> 00:04:58,540 And as you can see, payment was successful and the year is paid. 74 00:04:59,050 --> 00:05:00,880 And let me check the database now. 75 00:05:01,120 --> 00:05:04,690 So now in the database, in the payments, we should have everything. 76 00:05:05,110 --> 00:05:06,090 Now we should have the date. 77 00:05:06,100 --> 00:05:06,580 As you can see. 78 00:05:06,580 --> 00:05:07,510 Now, it's much better. 79 00:05:08,050 --> 00:05:08,770 We have the date. 80 00:05:08,770 --> 00:05:12,550 We have the transaction, the complete transaction according to people. 81 00:05:12,560 --> 00:05:14,050 Again, this is going to be a string. 82 00:05:14,980 --> 00:05:20,260 So this is why I changed it to I changed this to a string and we got the complete transaction ID. 83 00:05:20,380 --> 00:05:25,960 This is very important because if there is any problem, you can contact people and tell them about 84 00:05:25,960 --> 00:05:30,850 any problem using this transaction I.D. and they will find out about the problem. 85 00:05:30,860 --> 00:05:36,970 If you want extra information using this transaction and the user, you will know the order ID. 86 00:05:37,600 --> 00:05:39,600 You will know who paid for the order. 87 00:05:39,610 --> 00:05:42,520 Everything has been stored here. 88 00:05:42,880 --> 00:05:49,510 And if you go to the if you go to the orders, you should find that the order ID number 11 and why speak? 89 00:05:49,540 --> 00:05:51,790 As you can see, order number 11 be. 90 00:05:52,750 --> 00:05:55,600 And the user who paid was user number one. 91 00:05:56,920 --> 00:06:00,940 So now our payment system is robust and complete.