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.

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

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度