Downloaded the official DEMO of WeChat Pay and paid using Mode 2. There is no problem with the payment now and the payment can be successful. However, the XML data sent by WeChat cannot be received in the callback notify.php;
$input = $GLOBALS['HTTP_RAW_POST_DATA'];
$xml = simplexml_load_string($input, 'SimpleXMLElement', LIBXML_NOCDATA);
var_dump($xml);
The WeChat official account payment authorization directory is as follows:
世界只因有你2017-05-16 13:08:38
If yesPHP7
Use the following method to obtain the WeChat asynchronous notification parameters
file_get_contents("php://input");
PHPz2017-05-16 13:08:38
$GLOBALS['HTTP_RAW_POST_DATA']; It seems that the entire function has been deleted in php7, use file_get_contents('php://input')
滿天的星座2017-05-16 13:08:38
1. First check the log in nginx or apache to check whether the WeChat client requested a callback connection after the payment was successful.
2. If a link is requested, check the function logic issues in the callback
曾经蜡笔没有小新2017-05-16 13:08:38
Higher versions of PHP are not availableHTTP_RAW_POST_DATA
Please use them consistently
file_get_contents('php://input');