How to include a paypal integration into a modx site based on the docs

Despite having a good grasp of PHP, I still don’t fully grasp how things like vendor-autoload and such work, especially in MODX

Given the php from this example on the paypal documentation how do I set up the required dependencies so that I can use use?

You might need to update the backend used in the example, it defaults to JS for some reason and there’s no way to set which it should be in the url

Did you already install/require the “PayPal SDK” with Composer?

Right, so this is where I fear my understanding is lacking. Am I creating a folder in core/components/ and running the composer commands to install in there? Is there a folder structure I have to follow?

would love a modx init extra cli tool

I don’t think so.
But using a folder in core/components/<some_name> probably isn’t a bad idea.

The import thing is, that when you use a line like require __DIR__ . "/../vendor/autoload.php"; from the example code, that you adapt the path (to the autoload.php) to the correct location.


You can use GPM.