转载:http://blog.csdn.net/aa3115386/article/details/50740443
ajax轮询:http://www.cnblogs.com/itxiongwei/p/5531053.html
修改微信sdk的错误:http://www.cnblogs.com/xxoome/p/5705583.html
微信sdk需要修改的地方:
在lib/WxPay.Api.php的414行,
改成这个:

$xml = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : file_get_contents("php://input");

回传的原始文本:

格式化后:


如果414行的代码不修改,只能在日志里收到这样的结果:

jquery.min.js:4 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

答案来源:https://q.cnblogs.com/q/70126/

详细解释:http://blog.csdn.net/xllily_11/article/details/51879420
要删除微信sdk中example/orderquery.php中的<html>部分的代码,是为了不在前台ajax请求回来的数据中输出画蛇添足的数据。
在orderquery.php里关键是这一行:

前台ajax轮询出来的是这样的结果:(在还没扫码支付时)
【轮询出来的是1-9行的内容,第12行是上边14行的内容】
