Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
paypal库paypal_Lib.php中出错_Php_Codeigniter_Paypal Ipn - Fatal编程技术网

paypal库paypal_Lib.php中出错

paypal库paypal_Lib.php中出错,php,codeigniter,paypal-ipn,Php,Codeigniter,Paypal Ipn,当我在codeigniter中使用Paypal_lib.php时,会产生以下错误。 因此,请提供贝宝ipn的贝宝替代库。我遵循了这一点 集成paypal ipn和codeigniter的教程 A PHP Error was encountered Severity: 8192 Message: Function eregi() is deprecated Filename: libraries/paypal_lib.php Line Number: 208 A PHP Error

当我在codeigniter中使用
Paypal_lib.php
时,会产生以下错误。 因此,请提供贝宝ipn的贝宝替代库。我遵循了这一点

集成paypal ipn和codeigniter的教程

A PHP Error was encountered

Severity: 8192

Message: Function eregi() is deprecated

Filename: libraries/paypal_lib.php

Line Number: 208


A PHP Error was encountered

Severity: Warning

Filename: libraries/paypal_lib.php

Line Number: 243


A PHP Error was encountered

Severity: Warning

Message: fwrite() expects parameter 1 to be resource, boolean given

Filename: libraries/paypal_lib.php

Line Number: 244


     A PHP Error was encountered

    Severity: Warning

    Message: fclose() expects parameter 1 to be resource, boolean given

Filename: libraries/paypal_lib.php

Line Number: 246

此代码已解决此问题

 if (preg_match( "~VERIFIED~i", $this->ipn_response))
    {
        // Valid IPN transaction.
        $this->log_ipn_results(true);
        return true;         
    }
   if (eregi("VERIFIED",$this->ipn_response))
    {
        // Valid IPN transaction.
        $this->log_ipn_results(true);
        return true;         
    }
而不是这个代码

 if (preg_match( "~VERIFIED~i", $this->ipn_response))
    {
        // Valid IPN transaction.
        $this->log_ipn_results(true);
        return true;         
    }
   if (eregi("VERIFIED",$this->ipn_response))
    {
        // Valid IPN transaction.
        $this->log_ipn_results(true);
        return true;         
    }

那篇文章差不多有四年历史了——难怪它已经过时了。去寻找更流行的东西。GitHub中有一个官方的PayPal PHP SDK,我建议您尝试使用它。我在GitHub上找到的最后一个,但从未尝试过。所以请随意使用google错误消息(即“Function eregi()已弃用”)。第一个(或随机)链接将为您提供简洁的解决方案。另外,请听上面的两条评论——它们是正确的。