Hi again Donquick. I'll start with your part A questions. 1) Yes, that code from the "step 6 - verify the transaction" page should go in the paypal-transaction-complete.php file (or whatever you name it). However as you noticed it depends on files from the SDK. I strongly recommend you use the SDK, but I think you might have the wrong one which is causing part of your troubles here. More on that later. 2) In the particular flow I was describing above (which isn't the only possibility, but it seems to be what the docs recommend) the database work would be done in the paypal-transaction-complete file. Let me describe the general flow: - The customer loads the checkout.php page on your server. It doesn't need any PHP code in it except to get the price they owe. Mainly it just contains javascript code that runs in the customer's browser. - The customer clicks the paypal button which calls your createOrder function, which calls actions.order.create(...) to communicate with paypal and create and return an orderID (which is basically like an invoice describing how much the customer has to pay). This all happens between the client's browser and paypal, no involvement with your server. - The paypal button code takes the returned orderID and pops up a checkout screen where the customer can complete a checkout for that order. - Once they complete the checkout then that order will now be "approved" and your onApprove function will be called. The next step is to call actions.order.capture() which will accept the money from the client and put it into your account. - Now is where your server comes into play: After the capture completes successfully, you send an ajax request to your own server (the paypal-transaction-complete.php page) which contains the orderID. Then, PHP code in the paypal-transaction-complete.php page uses the PHP SDK to communicate directly between the server and paypal to get the money paid for that orderID and verify it against what you expected the client to pay. If it matches, then you save in your database that the client made a successful order and should receive the product. This all happens in paypal-transaction-complete.php - Finally once paypal-transaction-complete.php is finished executing, the ajax request will finish and control will be returned to the javascript code running on the client's browser. The server-side portion of the work is finished. Now you redirect to the success page (or whatever) with javascript. You might do something like window.location = "/success.php" or something which is how you would do a redirect with javascript. 3) Checkout.php is not where you do the database work as I describe above. So the response to the fetch will be either successful or not successful and that's all you'll care about, which you can check with res.ok as I will describe in a moment. Here is an example of how your checkout.php file might look: https://pastebin.com/EYkhWaw2 . I am not sure if this is totally accurate but maybe it can serve as a starting point. Part B. For starters, I think there is some confusion here about which SDK is which, so let me go over what's available (to my knowledge -- I'm not totally sure about all this myself.) Note that I have actually been working with the Java SDK myself, but it seems like the situation with the PHP SDK is basically the same. - First of all, there is the Checkout-PHP-SDK. This is the latest and greatest product and it's what allows you to access the Orders V2 and Payments V2 REST API. So far it is all you will need with this integration (although it could get complicated if you need any more advanced features, see below). Here is the homepage for that product: https://github.com/paypal/Checkout-PHP-SDK - Next there is the PayPal-PHP-SDK, which is actually an older product for the previous REST v1 APIs. From what I can tell, this SDK is deprecated for orders and payments usages, but some functionality like webhooks and dispute handling is only available in this older SDK. So there are some more advanced cases where you might need to use BOTH SDKs. But I don't think you will face that situation yet. This older SDK has a significantly different design from the newer one. Here is the homepage for this older SDK: https://github.com/paypal/PayPal-PHP-SDK - Then there is "PayPal-PHP-SDK 2.0-beta" which has the features of the older SDK, but with a design more like the newer SDK. However it looks like it is no longer maintained so I have avoided this one. I will not be referring to this one in my post, but be aware that it exists. See: https://github.com/paypal/PayPal-PHP-SDK/tree/2.0-beta OK. Now I will try to answer your part B questions. 1) I think it would be best if we just forget about composer for your situation. But if you did want to pursue the composer option, then you would type that in your server's shell or your computer's terminal depending on where you have composer installed. 2) That's right, as you can see you need PHP installed to be able to install Composer. Sorry, I didn't really think about that requirement at first. You could install PHP for windows but that might get complicated. If you do use that approach then you could run the "composer" command from the windows terminal. However again I think it will be easier if we just go with the zip file approach for now. 2 again) So as I explained above the page you linked here is actually the old PayPal-PHP-SDK, not the new Checkout-PHP-SDK which we want. This may be why the files you were seeing disagreed with what you saw in the examples. But to answer your question, you can run those commands on your own computer (in the terminal). Or you can just make the directory in filezilla by clicking "new directory", you don't have to use the mkdir command to do it like it suggests. And the directory does not have to be called "project". 3) Forget about PuTTY for now, if you do not have shell access to your web server then it will not be useful for you. Uncertainty about folder structure: This is partly due to you having the wrong SDK here again. There is also another detail here which is that "vendor/autoload.php" is a Composer specific file and you won't be using that if you aren't using Composer. Just make sure that the PayPalCheckoutSdk\Orders folder is in the right place and get rid of that autoload.php line. I know I didn't cover everything here but hopefully this lets you make some progress. Let me know if that helps any more Shawn
... View more