dou31797719 2013-01-27 07:49
浏览 66
已采纳

PayPal_Adaptive :: CURLRequest()的声明应该与PayPal :: CURLRequest()的声明兼容

I am getting the above error when I tried to create invoice.Invoice is creating successfully but the above error is not going.

I found this but it's not working- Declaration of Methods should be Compatible with Parent Methods in PHP Here are the functions-

class PayPal
{
    .
    .
    .
    /**
     * Send the API request to PayPal using CURL
     *
     * @access  public
     * @param   string  NVP string
     * @return  string
     */
    function CURLRequest($Request)
    {
        $curl = curl_init();
                // curl_setopt($curl, CURLOPT_HEADER,TRUE);
                curl_setopt($curl, CURLOPT_VERBOSE, 1);
                curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
                curl_setopt($curl, CURLOPT_TIMEOUT, 30);
                curl_setopt($curl, CURLOPT_URL, $this->EndPointURL);
                curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($curl, CURLOPT_POSTFIELDS, $Request);

        if($this->APIMode == 'Certificate')
        {
            curl_setopt($curl, CURLOPT_SSLCERT, $this->PathToCertKeyPEM);
        }

        $Response = curl_exec($curl);       
        curl_close($curl);
        return $Response;   
    }

    .
    .
}

class PayPal_Adaptive extends PayPal
    {
        .
        .
        .   
        /**
         * Send the API request to PayPal using CURL
         *
         * @access  public
         * @param   string $Request
         * @param   string $APIName
         * @param   string $APIOperation
         * @return  string
         */
        function CURLRequest($Request, $APIName, $APIOperation)
        {
            $curl = curl_init();
                    curl_setopt($curl, CURLOPT_VERBOSE, 1);
                    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
                    curl_setopt($curl, CURLOPT_TIMEOUT, 30);
                    curl_setopt($curl, CURLOPT_URL, $this -> EndPointURL . $APIName . '/' . $APIOperation);
                    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                    curl_setopt($curl, CURLOPT_POSTFIELDS, $Request);
                    curl_setopt($curl, CURLOPT_HTTPHEADER, $this -> BuildHeaders(false));

            if($this -> APIMode == 'Certificate')
            {
                curl_setopt($curl, CURLOPT_SSLCERT, $this -> PathToCertKeyPEM);
            }

            $Response = curl_exec($curl);       
            curl_close($curl);
            return $Response;
        }
        .
        .
    } // End Class PayPal_Adaptive

I have changed all the parameters to same number as well as same default values but does not seem to work. System is using custom error handler. I also tried this - error_reporting(E_ALL & ~(E_NOTICE | E_DEPRECATED | E_STRICT));

I have downloaded this library from here.

Thanks.

  • 写回答

1条回答 默认 最新

  • doujue1246 2013-01-28 02:28
    关注

    It looks like you must be using my PHP class library for PayPal..??

    I've got this issue fixed in my current local version, but I have a few other things to update before I release the official update.

    To fix this problem, set the opening line for that function to the following...

    function CURLRequest($Request = '', $APIName = '', $APIOperation = '')
    {
    
    }
    

    Depending on which version of my library you're using there may be other extended classes for PayPal Here, PayFlow, and PayPal Access. If you have these, just make the same change to the CURLRequest function in those extended classes so it matches everywhere.

    This will eliminate the notice.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试