dougui5419 2015-04-10 08:49
浏览 57

推荐的paypal php sdk版本提供了poodle sslv3 bug并且实际上工作

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.

  • 写回答

2条回答 默认 最新

  • dongyinpan9284 2015-04-10 10:13
    关注

    I would take a look at this one instead. It's a lot easier to work with than PayPal's SDK, and much of the PayPal integration team actually prefer it themselves.

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?