1 00:00:00,560 --> 00:00:01,220 Welcome back. 2 00:00:01,640 --> 00:00:04,880 Now, what we need to do is that we need to get the payments table. 3 00:00:05,210 --> 00:00:10,040 And looking at the payments the table, you need to open the database and then you need to click on 4 00:00:10,040 --> 00:00:10,730 Escorial. 5 00:00:11,030 --> 00:00:13,300 And then I'm going to use you all to clear the table. 6 00:00:13,310 --> 00:00:13,970 So I'm going to paste this. 7 00:00:14,990 --> 00:00:16,580 So this card is going to clear the table. 8 00:00:16,910 --> 00:00:18,020 So let me explain this code. 9 00:00:18,020 --> 00:00:23,180 This this code is going to create the payments table where there will be four columns. 10 00:00:23,540 --> 00:00:30,800 The first column is payment ID and the payment ID is going to be a integer of 11 digits and it's going 11 00:00:30,800 --> 00:00:33,920 to be auto and it's going to be auto increments. 12 00:00:33,920 --> 00:00:34,910 So it's going to be unique. 13 00:00:35,450 --> 00:00:42,320 And then we will have the order ID, the user ID, the transaction I.D. The primary key is the payment 14 00:00:42,320 --> 00:00:42,500 ID. 15 00:00:43,220 --> 00:00:47,510 If you want to use this code, you need to pause the video right now and type this code. 16 00:00:47,540 --> 00:00:51,050 So again, you need to pause and type this in your excuse. 17 00:00:51,050 --> 00:00:59,210 I'll just pause the video and type this command create table if not exists, payments, payment, ID, 18 00:01:00,080 --> 00:01:06,080 etc. So all of this code, you need to type this code and once you are done, just click on go and this 19 00:01:06,080 --> 00:01:09,020 is going to get you the table and you should find the table here. 20 00:01:10,120 --> 00:01:11,170 Among your tables. 21 00:01:11,230 --> 00:01:15,460 As you can see inside a database, you will find that we have a new table now called Payments. 22 00:01:15,880 --> 00:01:18,100 If you click on it, you will find that here. 23 00:01:18,270 --> 00:01:20,380 If you click on this structure, you'll find the structure. 24 00:01:20,710 --> 00:01:28,390 We have payment ID, order I.D., user I.D. and transaction I.D. make sure that payment ID is auto increment. 25 00:01:28,450 --> 00:01:29,470 This is very important. 26 00:01:30,100 --> 00:01:30,550 That's it. 27 00:01:30,580 --> 00:01:32,860 Now we have this payments table. 28 00:01:33,700 --> 00:01:40,270 Now we can use this payments table to complete our store payments. 29 00:01:40,540 --> 00:01:44,200 So let me now there over to the project and work on this. 30 00:01:46,490 --> 00:01:51,000 So not only the project, as you can see, we continued, we finished this record. 31 00:01:51,020 --> 00:01:54,800 I finished working on this, which is complete payment. 32 00:01:55,220 --> 00:01:56,030 Leave me now. 33 00:01:56,300 --> 00:01:57,170 This, this good. 34 00:01:57,650 --> 00:02:00,950 So what I'm going to do is that I'm going to start the process from scratch. 35 00:02:01,610 --> 00:02:02,870 So I'm going to create a new order. 36 00:02:02,870 --> 00:02:04,910 I'm going to go back to the home. 37 00:02:05,360 --> 00:02:09,850 Or alternatively, I can be for an order that I already have. 38 00:02:09,860 --> 00:02:11,720 So as you can see, I have so many orders. 39 00:02:12,200 --> 00:02:13,220 For example, Amy. 40 00:02:14,290 --> 00:02:15,620 You're paying for this order. 41 00:02:15,640 --> 00:02:17,170 Let me click on details. 42 00:02:17,680 --> 00:02:19,480 And here, let me click on paying now. 43 00:02:20,320 --> 00:02:25,830 So if I click on pay now A the PayPal button will be displayed right here. 44 00:02:25,840 --> 00:02:28,480 As you can see, pay a victim payment. 45 00:02:29,110 --> 00:02:30,550 PayPal payment, but only me. 46 00:02:30,550 --> 00:02:36,100 Click on it and they will be connected to PayPal and I need to log in first. 47 00:02:37,240 --> 00:02:43,810 So again, you need to log in with the with the buyer account that you created and then click on next 48 00:02:43,810 --> 00:02:45,580 and then you need to type the password. 49 00:02:47,700 --> 00:02:50,370 And then click on login. 50 00:02:52,380 --> 00:02:54,660 So I should be get 405. 51 00:02:55,470 --> 00:02:57,390 So here I can see 405. 52 00:02:57,900 --> 00:03:02,900 So let me now you let me now you as my balance, do pay. 53 00:03:02,960 --> 00:03:07,350 I'm going to click on pay now and here it says Processing. 54 00:03:11,970 --> 00:03:14,880 And as you can see, what I'm going to get here is that I'm going to get on air. 55 00:03:15,240 --> 00:03:19,980 This is a very, very common error, this error, even though this area is basic. 56 00:03:20,310 --> 00:03:24,240 Many developers fall into this type of error. 57 00:03:24,780 --> 00:03:26,990 So let me show you how to fix this here. 58 00:03:27,330 --> 00:03:33,210 So now remember in the complete basement, that Peachtree here, I said location account that. 59 00:03:34,410 --> 00:03:37,980 However, the account is outside the server. 60 00:03:38,430 --> 00:03:43,800 Therefore we need to say that got and then therefore slash and then account that beach. 61 00:03:44,580 --> 00:03:45,570 This is very important. 62 00:03:46,230 --> 00:03:48,180 Let me click on file at least one more time. 63 00:03:51,320 --> 00:03:55,910 So I'm going to go back and then I'm going to pay for another order. 64 00:03:56,600 --> 00:03:57,440 Let me go back. 65 00:03:58,070 --> 00:03:59,750 And here it is paid. 66 00:04:00,470 --> 00:04:03,980 But it did not redirect me to the correct page to limit this one more time. 67 00:04:03,990 --> 00:04:08,310 I'm going to click here on details and then I'm going to pay for this. 68 00:04:08,330 --> 00:04:10,580 Let me click on pay now and here. 69 00:04:17,170 --> 00:04:19,120 LME now paying for this order. 70 00:04:25,380 --> 00:04:29,070 And as you can see, it was beat successfully and it took me through the speech. 71 00:04:29,700 --> 00:04:32,550 As you can see, it's as you picked paid here. 72 00:04:32,550 --> 00:04:34,140 This order was paid and this order was paid. 73 00:04:34,710 --> 00:04:38,640 But the problem is that we still need to display a success message. 74 00:04:39,000 --> 00:04:41,760 So let's work on displaying a success message. 75 00:04:42,180 --> 00:04:48,960 So in the account here, after we take the user to the account page, we have this valuable payment 76 00:04:48,960 --> 00:04:49,360 message. 77 00:04:49,360 --> 00:04:51,300 So we need to display this payment message. 78 00:04:51,780 --> 00:04:53,850 So in the account, I'm going to open the account. 79 00:04:55,230 --> 00:05:01,440 And then in that count, what I'm going to do is that above above this. 80 00:05:03,400 --> 00:05:05,890 We're going to show you exactly where I'm going to explain the message. 81 00:05:06,550 --> 00:05:08,920 I'm going to explain the message here. 82 00:05:10,400 --> 00:05:11,570 Specifically here. 83 00:05:12,920 --> 00:05:15,800 So here, let me show you where it's going to be displayed. 84 00:05:16,490 --> 00:05:21,170 So I'm going to take your message and then I'm going to save and refresh to show you the location. 85 00:05:22,040 --> 00:05:25,250 So if I refresh here, the message will be displayed here. 86 00:05:25,250 --> 00:05:26,810 But we need to fix the design. 87 00:05:26,810 --> 00:05:34,160 So let me let me here say a glass and then margin top. 88 00:05:35,110 --> 00:05:35,710 Five. 89 00:05:36,620 --> 00:05:38,770 And I'm going to also say text center. 90 00:05:42,230 --> 00:05:43,310 So let me refresh. 91 00:05:47,220 --> 00:05:48,570 And it will be displayed here. 92 00:05:48,570 --> 00:05:50,220 So the message will be displayed here. 93 00:05:50,940 --> 00:05:54,450 So to do this, to display the message we need to use it's BHP. 94 00:05:54,450 --> 00:05:56,760 I'm going to sit here, BHP and then. 95 00:05:58,150 --> 00:05:58,600 Here. 96 00:05:58,660 --> 00:05:59,830 First, we need to check. 97 00:06:00,580 --> 00:06:01,900 I'm going to say if. 98 00:06:03,180 --> 00:06:05,910 If what if gets. 99 00:06:06,690 --> 00:06:10,050 Well, because this is a get payment message. 100 00:06:10,680 --> 00:06:15,240 A set first a set is set gets. 101 00:06:17,830 --> 00:06:18,580 Payment. 102 00:06:19,990 --> 00:06:21,310 Underscore message. 103 00:06:23,040 --> 00:06:23,780 Message. 104 00:06:23,790 --> 00:06:26,430 If we have this message, then clearly. 105 00:06:26,430 --> 00:06:35,640 Brackett And then we need you to open another BHP and then we need to say we need to close the contract 106 00:06:35,640 --> 00:06:40,620 and then I'm going to copy this B paragraph and then I'm going to pass it between you in between. 107 00:06:42,130 --> 00:06:48,820 And what I'm going to do is that I'm just going to add your space to show you the big block of gold, 108 00:06:48,820 --> 00:06:50,480 which is this here. 109 00:06:50,500 --> 00:06:55,540 All you need to do is that you need to say BHP and then echo. 110 00:06:56,740 --> 00:06:58,450 And then get. 111 00:06:59,680 --> 00:07:00,280 Get. 112 00:07:01,200 --> 00:07:07,860 Payment message, payment, underscore message and then semicolon. 113 00:07:09,560 --> 00:07:15,500 And make sure that the payment message key is equal to this one payment message. 114 00:07:15,740 --> 00:07:17,960 Make sure that you don't have any typos. 115 00:07:18,380 --> 00:07:20,330 So let's now test another time. 116 00:07:20,900 --> 00:07:24,170 So to test one more time, let me first refresh. 117 00:07:25,130 --> 00:07:27,290 And here, as you can see, it says paid successfully. 118 00:07:27,300 --> 00:07:30,800 So the reason is because I'm still in the same page. 119 00:07:31,460 --> 00:07:34,850 But let me also add the color to this message. 120 00:07:34,880 --> 00:07:35,400 I'm going to say. 121 00:07:37,280 --> 00:07:38,150 I'm going to say style. 122 00:07:38,150 --> 00:07:38,570 Color. 123 00:07:39,620 --> 00:07:40,130 Color. 124 00:07:41,920 --> 00:07:42,370 Green. 125 00:07:43,690 --> 00:07:45,100 Because this is a success message. 126 00:07:46,330 --> 00:07:52,210 Let me now go back and be for people one of these orders so we have better. 127 00:07:52,840 --> 00:07:55,060 I'm going to click on details and then pay now. 128 00:07:55,690 --> 00:07:59,950 And then I'm going to click on PayPal and let me pay for this order. 129 00:08:06,490 --> 00:08:07,600 Let me click on. 130 00:08:08,770 --> 00:08:09,400 They now? 131 00:08:27,370 --> 00:08:29,830 And as you can see, it's going to stay here successfully. 132 00:08:29,830 --> 00:08:31,510 Thanks for your shopping with us. 133 00:08:32,020 --> 00:08:35,770 And if you scroll, you'll find that the order here, it says. 134 00:08:37,060 --> 00:08:38,350 The process was successful. 135 00:08:38,590 --> 00:08:44,890 And if you click on details, you should never find the pay now button because this order was paid already. 136 00:08:45,370 --> 00:08:46,240 So it's great. 137 00:08:46,240 --> 00:08:46,990 Now it's great. 138 00:08:47,500 --> 00:08:54,280 And you as the you as the owner, you have control over displaying the status so you can now if an order 139 00:08:54,280 --> 00:09:03,310 is paid, if in the database you find if you go to the database and check the orders and find that an 140 00:09:03,310 --> 00:09:07,360 order was paid, you can start shipping that order to the user. 141 00:09:07,370 --> 00:09:12,880 So if you find you need of course, you need to monitor your orders regularly. 142 00:09:12,880 --> 00:09:18,640 And then if you find that an order was paid, you can start shipping it and you can change the status 143 00:09:18,640 --> 00:09:21,640 from B to shipped or delivered. 144 00:09:22,360 --> 00:09:26,230 And it will be it will automatically be displayed to the user. 145 00:09:26,530 --> 00:09:32,560 So for example, if you are the owner and if you changed this to shift, for example, if you say you 146 00:09:32,560 --> 00:09:33,010 shipped. 147 00:09:34,590 --> 00:09:42,330 And if you update this now in the in my account as the customer here is going to say shift so the customer 148 00:09:42,330 --> 00:09:45,000 will know whether the order was shipped or not. 149 00:09:45,360 --> 00:09:50,880 And if it's delivered, you need to say here, delivered, delivered. 150 00:09:52,270 --> 00:09:58,330 And of course, of course, the user will will have received by that time, the user will have received 151 00:09:58,330 --> 00:10:01,740 the order, as you can see, delivered regarding this message. 152 00:10:01,750 --> 00:10:10,090 As soon as you go out, as soon as you go away from this page and go back to your account, the message 153 00:10:10,090 --> 00:10:12,130 will never be displayed again, which is great. 154 00:10:12,280 --> 00:10:15,490 So the system now, repayment system now is complete. 155 00:10:17,040 --> 00:10:18,720 Finally in the payments. 156 00:10:19,260 --> 00:10:25,170 In the payments, if you click on payments, you should find that the order was as you can see, the 157 00:10:25,170 --> 00:10:29,310 order was why the payment was stored. 158 00:10:29,310 --> 00:10:33,390 So the payment to your payment ID, the order ID and the user ID. 159 00:10:33,460 --> 00:10:34,590 So the user I.D. is one? 160 00:10:34,590 --> 00:10:35,220 That's correct. 161 00:10:35,790 --> 00:10:38,370 The order I.D. is five six. 162 00:10:38,370 --> 00:10:41,880 And then you can verify this by going through the orders. 163 00:10:42,900 --> 00:10:45,780 So order number five, paid order. 164 00:10:45,780 --> 00:10:49,650 Number six, paid order number ten paid. 165 00:10:49,650 --> 00:10:54,000 And I changed this to delivered for the transaction ID. 166 00:10:54,870 --> 00:10:58,350 The transaction ID is given by PayPal. 167 00:10:58,350 --> 00:11:01,050 So you cannot you can change this. 168 00:11:01,050 --> 00:11:02,250 It's given by PayPal. 169 00:11:02,460 --> 00:11:03,870 By PayPal. 170 00:11:04,200 --> 00:11:11,280 Besides the transaction ID, it could be a number, it could be a screen, it could be a combination 171 00:11:11,280 --> 00:11:13,290 of numbers and strings. 172 00:11:13,650 --> 00:11:15,180 So you shouldn't change this. 173 00:11:15,180 --> 00:11:21,630 PayPal is going to give you this transaction ID and you need to get the transaction I.D. here from the 174 00:11:21,630 --> 00:11:22,470 get request.