微信小程序支付回调notify_url问题 yii框架

在做小程序支付回调时,先调用【统一下单】接口,notify_url可以是http,也可以是https。

然后出现支付成功没有自动执行notify_url里的方法这个问题:

解决方法:首先测试

      $test=fopen('/data/wx/modules/xcx/controllers/test.txt','w') or die("Unable to open file!");
     if(file_exists('/data/wx/modules/xcx/controllers/test.txt')){
           fwrite($test, $GLOBALS["HTTP_RAW_POST_DATA"]);

      }        

       fclose($test);

手动访问,看是否能新建文件,不能的话检查权限。

最后问题原因是yii框架的csfr验证卡住的,这个框架自带post验证,所有禁止了微信那边传递支付成功信息!

在controller里加public $enableCsrfValidation = false;来禁止这个验证就好了

猜你喜欢

转载自blog.csdn.net/jjk_2333/article/details/79986360
今日推荐