I've written about the PayPal SDK in the past, there's an article about a quick start with the PayPal PHP SDK. Check that out if you need help getting started with creating your PayPal App, getting your App ID and App Secret, etc.
For the most part you use the PayPal SDK as is. The only change required is when creating the API Context.
First make sure you are using the required classes from the SDK...
PHP
use PayPal\Rest\ApiContext;
use PayPal\Auth\OAuthTokenCredential;
Next some variables are required to hold your App's data, fill these in as appropriate to your App and set whether you're using the 'live' or 'sandbox' environments.
PHP
$paypalId = 'YOUR_APP_ID_HERE';
$paypalSecret = 'YOUR_APP_SECRET_HERE'
$paypalMode = 'sandbox'; /* set to 'live' to use the live environment */
Next the API Context can be created like so:
PHP
$apiContext = new ApiContext(new OAuthTokenCredential($paypalId, $paypalSecret));
$apiContext->setConfig([
'mode' => $paypalMode,
'log.LogEnabled' => false,
'validation.level' => 'log',
'cache.enabled' => true,
'cache.FileName' => 'gs://#default#/PayPal.cache'
]);
The two notable settings here are - 1) logging is disabled 2) cache file name is set to write to the default bucket in the Cloud DataStore.
I could not get logging to work with the Cloud DataStore even though there is a way to specify the log file name. However it is possible to create your own custom logger. I've not tried doing that and once I do I'll write another article on how to do it with App Engine.
After creating the API Context as above, use the SDK as you would normally.
-i