$mchid = 'xxxxx'; //微信支付商户号 $appid = 'xxxxx'; //公众号APPID $apiKey = 'xxxxx'; //API密钥 $wxPay = new Wxpay($mchid, $appid, $apiKey); $result = $wxPay->notify(); if($result){ //逻辑处理 //金额$result['cash_fee'] //订单号$result['out_trade_no'] }else{ echo '支付失败'; } 如果回调失败,打开文件第34行 将 $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; 改为 $postStr = file_get_contents('php://input');