I'm using composer to install paypal SDK's for permissions and adaptive payments. My partial composer.json is:
{
"paypal/adaptiveaccounts-sdk-php":"*",
"paypal/permissions-sdk-php":"v2.5.106",
"paypal/adaptivepayments-sdk-php":"2.*"
}
}
Now this works fine however if I try to use it as is it throws the following error:
PHP Fatal error: Access to undeclared static property: PPBaseService::$SDK_NAME in /var/app/current/vendor/paypal/permissions-sdk-php/lib/services/Permissions/PermissionsService.php on line 22
this is because the PPBaseServer class does not have these variables. I found that this was a bug in a recent fix for the POODLE sslv3 issue in sdk.
I found this: https://github.com/paypal/merchant-sdk-php/issues/68, which mentions that a bug was introduced with the POODLE fix so you have to override the sdk-core to sdk-core-php": "v1.4.2. My composer.json changes to:
{
"paypal/adaptiveaccounts-sdk-php":"*",
"paypal/sdk-core-php": "v1.4.2",
"paypal/permissions-sdk-php":"v2.5.106",
"paypal/adaptivepayments-sdk-php":"2.*"
}
this fixes the 'Access to undeclared static property' however it reintroduces the POODLE bug.
It is possible to manually update the class files that handle the SSLv3 issue after composer runs. This works fine, but I use composer to load these files automatically on AWS.
Each time I release a build it will overwrite the changes i make, which would need to be re-made. This is a major issue in a production system.
My question is, what are the recommended sdk versions that handle the POODLE sslv3 issue and actually work without missing variables etc
EDIT Following Suggestion by PayPal_Martin I've modified my componer.json to the following:
{
"require": {
"ext-curl": "*",
"paypal/adaptiveaccounts-sdk-php":"*",
"paypal/permissions-sdk-php":"*",
"paypal/adaptivepayments-sdk-php":"*"
}
}
This is now throwing the following error:
PHP Fatal error: Class 'RequestEnvelope' not found in /var/app/current/paypal/Permissions.class.php on line 198
The responsible code is:
$requestEnvelope = new RequestEnvelope(); //<<<HERE
$requestEnvelope -> errorLanguage = self::$ERROR_LANG;
$request = new GetPermissionsRequest();
$request -> requestEnvelope = $requestEnvelope;
$request -> token = $token;
try {
$service = new PermissionsService(Configuration::getAcctAndConfig());
$this -> parseGetPermissionsResponse($service -> GetPermissions($request));
This code section is unchanged between versions and works with my previous definition.