轉載: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行的內容】