微信支付回调处理分为1.同步2.异步这里微信官方推荐使用微信回调的第二种php异步处理//获取返回的xml$testxml=file_get_contents("php://input");//将xml转换成json格式$jsonxml=json_encode(simplexml_load_string($testxml,'SimpleXMLElement',LIBXML_NOCDATA));//转换成数组$result=json_decode($jsonxml,true);if($result){//如果返回成功if($result['return_code']=='SUCCESS'&&$result['result_code']=='SUCCESS'){//执行更改订单状态等操作。...}}本次微信支付返回的xml转换成json格式如下:{"appid":"12345","attach":"pay","bank_type":"CFT","cash_fee":"1","fee_type":"CNY","is_subscribe":"Y","mch_id":"12345","nonce_str":"dZYFpaDYRpF5rwhv","openid":"onhwF1hiutUySKCsrV21A6MCtT5Q","out_trade_no":"SH201808222055598628","result_code"SUCCESS","return_code":"SUCCESS","sign":"5A019F52BEF1C3A98AE0F1FF29D01574","time_end":"20180822205606","total_fee":"1","trade_type":"MWEB","transaction_id":"410025120855"}其中"result_code":"SUCCESS","re??turn_code":"SUCCESS"是判断用户是否付费的依据,如果这篇文章对你有用,可以点赞或收藏,即给作者一个鼓励~另附上小弟的网站。。。www.entercode.cn推广一波。。。
