坑一:
微信支付 Api.class.php 或 微信 API :WxPay.Api.php
的 notify() 方法 支付结果通用通知
- // 获取通知的数据
- // $xml = $GLOBALS['HTTP_RAW_POST_DATA'];
- $xml = file_get_contents("php://input"); // 开启 openssl.dll 扩展
升级完 php7 发现微信支付回调失败.
坑二:
返回回事件消息失败和返回文本消息失败问题 public function __construct
微信示例代码 wxBizMsgCrypt.php 里面的构造函数是用的类名, 但 php7 不再支持类名作为构造函数, 需要使用__construct, 修改构造函数为__construct.
public function Prpcrypt 修改为 public function __construct
public function WXBizMsgCrypt 修改为 public function __construct
坑三:
- // 获取微信推送过来的 post 数据 (xml 格式)
- // $postArr = $GLOBALS['HTTP_RAW_POST_DATA']; // 接受 post 数据, PHP7 废弃的全局变量
- $postArr = file_get_contents("php://input");
目前遇到过的
来源: http://www.bubuko.com/infodetail-2552728.html