1 00:00:00,900 --> 00:00:01,560 Welcome back. 2 00:00:02,040 --> 00:00:06,660 So now it's time to start integrating people into our project. 3 00:00:07,020 --> 00:00:13,710 And the first step is that you need to log into your developer PayPal account and then we need to select 4 00:00:13,710 --> 00:00:14,510 one of the options. 5 00:00:14,790 --> 00:00:20,370 So first of all, you need to know that in order to integrate people into your project, there are so 6 00:00:20,370 --> 00:00:24,090 many options and I'm going to be using an option called checkout. 7 00:00:24,090 --> 00:00:30,870 So you need after you log in, you need to click on docs, just hover over it and then here click on 8 00:00:30,870 --> 00:00:39,000 Get Started here, click on Get Started and after you click on Get Started, just click on accept payments, 9 00:00:39,210 --> 00:00:42,660 accept payments and then click on checkout. 10 00:00:43,050 --> 00:00:48,990 So this is the method that I'm going to be using is called check out, and this method is going to allow 11 00:00:48,990 --> 00:00:52,350 us to receive payments from customers. 12 00:00:52,980 --> 00:00:58,710 So after you click on check out, just click on set up standard payments, click on it. 13 00:01:00,580 --> 00:01:09,940 And as you can see, this method is going to allow us to add a button that we can customize and add 14 00:01:10,030 --> 00:01:15,400 the the the amount of money that we want to receive from customers. 15 00:01:15,910 --> 00:01:22,160 And all you need to do now is that you need to click on integrate PayPal checkout for online payments. 16 00:01:22,180 --> 00:01:22,810 Click on it. 17 00:01:23,800 --> 00:01:31,120 And here it's going to give you a very long steps here, a very long guide. 18 00:01:31,480 --> 00:01:34,810 But the problem with PayPal is that it's very complicated. 19 00:01:34,870 --> 00:01:40,930 Therefore, I'm going to make the process very easy for you by just dividing the steps into short and 20 00:01:40,930 --> 00:01:41,680 easy steps. 21 00:01:41,980 --> 00:01:47,770 So the first step is that here in this page, all you need to do is that we need to get a good piece 22 00:01:47,770 --> 00:01:53,620 of code that's going to generate the button that you have that you have seen shortly, which is this 23 00:01:53,620 --> 00:01:53,950 button. 24 00:01:54,490 --> 00:01:59,830 That code is going to generate that button into our website, into our project, and then we will be 25 00:01:59,830 --> 00:02:02,170 able to receive payments from our customers. 26 00:02:02,650 --> 00:02:11,090 Before I continue, you need to know that people regularly and consistently changes the location of, 27 00:02:11,650 --> 00:02:17,110 of this of the, of, of this method in their website. 28 00:02:17,120 --> 00:02:22,360 So you need to sometimes you might not find it here, so you need to look for it. 29 00:02:22,360 --> 00:02:25,870 You need to click again on dock's and then get started and then look for it. 30 00:02:27,040 --> 00:02:32,920 But it's the method is called checkout and then just set up standard payments are then integrate. 31 00:02:33,400 --> 00:02:36,460 Now the first step is that we need to get the code from PayPal. 32 00:02:36,910 --> 00:02:37,960 So the code is this code. 33 00:02:38,020 --> 00:02:38,740 This is the code. 34 00:02:38,740 --> 00:02:39,280 Let me show you. 35 00:02:39,280 --> 00:02:39,850 Where does it go? 36 00:02:39,880 --> 00:02:40,510 This is the code. 37 00:02:42,000 --> 00:02:49,290 The code starts from here, so you need to start copying from here to this script and all the way down 38 00:02:49,620 --> 00:02:51,210 to the end of the script. 39 00:02:51,210 --> 00:02:55,230 You need to scroll and copy all of this good news. 40 00:02:55,470 --> 00:02:56,790 You need to copy all of this code. 41 00:02:56,790 --> 00:02:59,070 Let me copy all of this. 42 00:02:59,070 --> 00:02:59,490 Good. 43 00:03:03,110 --> 00:03:04,640 We copy all of this code. 44 00:03:05,840 --> 00:03:06,920 So we need to get all of this. 45 00:03:07,070 --> 00:03:09,110 Let me copy it. 46 00:03:10,410 --> 00:03:11,700 So we need this code. 47 00:03:12,210 --> 00:03:13,020 Don't copy. 48 00:03:13,290 --> 00:03:14,700 Don't copy the other parts. 49 00:03:14,700 --> 00:03:19,220 Just copy something from the script all the way to the end of the script. 50 00:03:19,230 --> 00:03:19,830 Copy it. 51 00:03:20,670 --> 00:03:21,630 Just copy it. 52 00:03:22,290 --> 00:03:26,340 And then you need to hand it over to your project and paste it. 53 00:03:26,340 --> 00:03:31,380 And I'm going to show you where you need to paste because you of course, you shouldn't paste it any 54 00:03:31,740 --> 00:03:33,720 at any file. 55 00:03:33,720 --> 00:03:36,090 You need to paste it at a specific location. 56 00:03:37,260 --> 00:03:45,390 So now in my in my project, what you need to do is that you need to open up the payment dot B2B payment 57 00:03:45,390 --> 00:03:46,920 again, that's payment that B2B. 58 00:03:47,310 --> 00:03:48,840 And then where should you pasted. 59 00:03:49,200 --> 00:03:53,210 You should pasted above the footer, above the future. 60 00:03:53,220 --> 00:03:54,240 That would be here. 61 00:03:54,240 --> 00:03:55,200 You should paste it here. 62 00:03:55,890 --> 00:03:57,190 Just paste that code here. 63 00:03:57,960 --> 00:03:59,190 So now we have this good. 64 00:03:59,730 --> 00:04:00,690 So this is the first step. 65 00:04:01,140 --> 00:04:05,370 So again, the first step is to get this this code is going to generate the button that you have seen. 66 00:04:06,480 --> 00:04:07,890 The second step. 67 00:04:09,000 --> 00:04:09,660 Is that two? 68 00:04:09,840 --> 00:04:12,060 Is that going to get the client ID? 69 00:04:12,720 --> 00:04:14,280 So where should we get the client it? 70 00:04:14,370 --> 00:04:20,160 We should we should get the client from the from our from your account. 71 00:04:20,160 --> 00:04:23,340 So let me hit it over back to the to the PayPal. 72 00:04:24,060 --> 00:04:29,550 So in PayPal, just say the over again to your account and log in and then click on your project, the 73 00:04:29,550 --> 00:04:35,310 project that you are using for this, the project that you have created for this project. 74 00:04:35,310 --> 00:04:36,300 So I'm going to click on it. 75 00:04:39,760 --> 00:04:44,020 So once you click on it, you will find the sandbox account and the client ID. 76 00:04:44,470 --> 00:04:51,430 You need to copy your client I.D. and heading over back to the to the to the to the project. 77 00:04:51,430 --> 00:04:53,900 So let me copy let me copy my client I.D.. 78 00:04:57,160 --> 00:05:00,850 Now in your project, you need to pace the client, but we should you based it. 79 00:05:01,720 --> 00:05:02,770 You should base it here. 80 00:05:03,400 --> 00:05:04,690 And instead of this test. 81 00:05:06,330 --> 00:05:06,950 Here it is. 82 00:05:06,960 --> 00:05:11,250 Client hyphen ID is equal to test, so we need to remove this test. 83 00:05:12,940 --> 00:05:15,100 I'm based based here. 84 00:05:16,060 --> 00:05:16,660 Based here? 85 00:05:16,660 --> 00:05:18,190 Your client. 86 00:05:18,460 --> 00:05:19,690 As you can see, this is my client. 87 00:05:20,380 --> 00:05:24,970 Again, you need to be very careful because if you get this wrong, it's not going to work again. 88 00:05:25,300 --> 00:05:31,150 Double check your client and make sure that you copied your client ID correctly and pasted your client 89 00:05:31,200 --> 00:05:34,200 I.D. client like it is equal to you. 90 00:05:34,270 --> 00:05:35,620 Were delighted that you pasted. 91 00:05:36,250 --> 00:05:37,660 This is very, very important. 92 00:05:38,940 --> 00:05:43,730 Now what I'm going to do is that I'm going to show you and I'm going to walk you through the record 93 00:05:43,920 --> 00:05:50,340 is like this the u r l is just going to connect people with u r l that contains your client a d and 94 00:05:50,340 --> 00:05:53,000 then below this we have here a dev. 95 00:05:53,640 --> 00:05:58,520 We need to move this dev, but I'm going to let me do this because it's going to take a little bit of 96 00:05:58,530 --> 00:06:00,000 time and you need to understand it. 97 00:06:00,900 --> 00:06:01,880 Here we have this script. 98 00:06:01,890 --> 00:06:04,410 So this script has a people. 99 00:06:04,410 --> 00:06:07,830 It connects to the people and it uses this function called buttons. 100 00:06:08,310 --> 00:06:13,230 This function is going to be the button and this function is going to have a value key. 101 00:06:13,230 --> 00:06:16,020 And that value is the amount of money that you will receive. 102 00:06:16,470 --> 00:06:21,360 And we need to change this amount depending upon the total amount that the user should pay us. 103 00:06:21,990 --> 00:06:23,940 And then we have an approved function. 104 00:06:24,420 --> 00:06:32,370 This function will be called if we get the if we if the payment has been processed successfully, we 105 00:06:32,370 --> 00:06:41,550 will get here a a data from the people telling us that payment was processed successfully and money 106 00:06:41,550 --> 00:06:46,350 was transferred from the from the customer to our account. 107 00:06:47,370 --> 00:06:52,830 And in case of error, also, this is going to handle errors in case we have any errors here, this 108 00:06:52,830 --> 00:06:54,750 is going to handle any problems. 109 00:06:55,500 --> 00:06:58,080 Now, let me show you the button. 110 00:06:58,080 --> 00:07:00,120 So the button is this is this. 111 00:07:00,690 --> 00:07:05,640 So what I'm going to do is that first I'm going to copy this dev and then I'm going to remove it from 112 00:07:05,640 --> 00:07:05,940 here. 113 00:07:09,740 --> 00:07:10,400 And then. 114 00:07:14,160 --> 00:07:15,260 I'm going to paste it here. 115 00:07:17,090 --> 00:07:19,740 I'm going to paste it here just for now. 116 00:07:19,760 --> 00:07:20,870 I'm going to be here for now. 117 00:07:22,580 --> 00:07:24,320 Now let me head on over to the browser. 118 00:07:24,740 --> 00:07:27,260 So now there in the browser let me go to four. 119 00:07:27,260 --> 00:07:35,480 Slash B meant that beach B and if you go to payment that beach B, you should find the bottom. 120 00:07:35,480 --> 00:07:39,140 If you if you can't find the button, then then there is a problem. 121 00:07:39,440 --> 00:07:45,470 But you should find the button as long as you follow the steps that I show that they have shown you, 122 00:07:45,470 --> 00:07:46,310 you will find a button. 123 00:07:46,310 --> 00:07:47,450 And as you can see, this is the button. 124 00:07:48,320 --> 00:07:53,780 So now as you can see, the button is being displayed even though you here it says you don't have an 125 00:07:53,780 --> 00:07:54,260 order. 126 00:07:54,290 --> 00:07:55,550 Therefore we need to fix this. 127 00:07:56,030 --> 00:07:57,740 So let me show you how we can fix this. 128 00:07:58,220 --> 00:08:04,160 To fix this, what we need to do is that instead of displaying our button, remember this input, which 129 00:08:04,160 --> 00:08:08,000 is our button, we can comment about an out. 130 00:08:08,000 --> 00:08:09,320 We no longer need a button. 131 00:08:09,710 --> 00:08:11,420 I'm going to comment the button out. 132 00:08:12,590 --> 00:08:15,380 And instead I'm going to paste people's button. 133 00:08:15,770 --> 00:08:16,970 I'm going to be this good. 134 00:08:17,810 --> 00:08:18,920 I'm going to paste this good. 135 00:08:19,670 --> 00:08:21,980 So, Laney, here, copy it again. 136 00:08:21,980 --> 00:08:25,320 Let me copy it from here and then remove it from here. 137 00:08:25,610 --> 00:08:27,500 And then we need to place it in two locations. 138 00:08:27,710 --> 00:08:28,760 We need to base it here. 139 00:08:29,850 --> 00:08:30,930 And we need to sit here. 140 00:08:31,380 --> 00:08:35,400 So we need to sit here because here. 141 00:08:36,340 --> 00:08:38,230 Here first in the first if statement. 142 00:08:38,770 --> 00:08:42,960 This means that the court is is not empty here. 143 00:08:42,970 --> 00:08:46,960 It means that the user wants to pay for an order that they made earlier. 144 00:08:47,560 --> 00:08:48,700 So here, only here. 145 00:08:48,700 --> 00:08:52,030 We need to display the we need to display babelsberg leaving. 146 00:08:52,540 --> 00:08:55,690 Let me now save and hit it over back to the browser and test. 147 00:08:57,600 --> 00:09:02,910 Now in the browser, if I refresh the button will be gone because the button will only be displayed 148 00:09:02,910 --> 00:09:04,380 in case we have something in the cart. 149 00:09:04,710 --> 00:09:07,260 So let's add something to the cart real quick. 150 00:09:07,420 --> 00:09:11,340 So I'm going to go back to the homepage and now in the home page, I'm going to add something to the 151 00:09:11,340 --> 00:09:13,230 cart such as this. 152 00:09:14,870 --> 00:09:16,670 And then I'm going to click on Add to Cart. 153 00:09:17,850 --> 00:09:22,470 Then I'm going to click on check out and I'm going to fill out this form. 154 00:09:22,620 --> 00:09:28,740 So if you fill out this form and click on place order, the order will be will be placed in case you 155 00:09:28,740 --> 00:09:29,190 are logged. 156 00:09:29,340 --> 00:09:31,170 In case you are logged in, but am not logged in. 157 00:09:31,170 --> 00:09:32,490 So let me log in first. 158 00:09:47,220 --> 00:09:49,290 And then I'm going to go to the checkout page. 159 00:09:49,740 --> 00:09:56,250 And from the checkout lane, he fell to the floor one more time, and then I'm going to click on Place 160 00:09:56,250 --> 00:09:56,670 Order. 161 00:09:57,870 --> 00:09:59,790 Now, if I click on Place Order, guess what? 162 00:10:00,210 --> 00:10:04,080 Now we have PayPal's button being displayed here and it looks amazing. 163 00:10:04,440 --> 00:10:07,230 Now the button is being displayed and here it says total payment. 164 00:10:07,230 --> 00:10:11,310 So the user will be able to pay now if they click on it. 165 00:10:11,310 --> 00:10:16,140 But of course we still need to handle a few things before this. 166 00:10:16,500 --> 00:10:23,580 This button becomes fully functioning because we need to tell people, hey people, we want the user 167 00:10:23,580 --> 00:10:29,160 to pay this amount because this because people now doesn't know about this amount yet.