Replies: 1 comment
-
微信支付APIv2通知的body是XML,APIv3是JSON,探测请求头例如: [$mime] = $request->hasHeader('content-type') ? $request->getHeader('content-type') : ['noop'];
if (stripos($mime, 'xml') > 0) {
//do something
}
if (stripos($mime, 'json') > 0) {
//do something
}
if (stripos($mime, 'noop') > 0) {
// do something
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
源文件路径easywechat\src\Pay\Server.php
支付成功后,使用回调通知接口无法获取消息body内的json
$server = $app->getServer();
$server->handlePaid(function (Message $message, \Closure $next) {
print_r($message);
});
Beta Was this translation helpful? Give feedback.
All reactions