Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法通知微信支付完成 #412

Closed
zyj007 opened this issue May 11, 2016 · 5 comments
Closed

无法通知微信支付完成 #412

zyj007 opened this issue May 11, 2016 · 5 comments

Comments

@zyj007
Copy link

zyj007 commented May 11, 2016

我用的环境

PHP 版本:5.6.20
overtrue/wechat 版本:3.0.16

问题及现象

使用扫描支付成功后,微信发送通知到本地,本地服务器可以通过handleNotify正确接收通知,但是使用
本地服务器通知微信支付完成时(return true,return $response),微信均无法正确收到通知。
调试$response,json_encode后出来的数据是{"headers":{}}

$app = new \EasyWeChat\Foundation\Application($this->options);
$response = $app->payment->handleNotify(function($notify, $successful){
$ticketid=$notify->out_trade_no;
//处理业务
return true;
});
return $response;
//M('ordernotice')->add(array('orderinfo'=>json_encode($response)));//调试用

@zyj007 zyj007 closed this as completed May 15, 2016
@overtrue
Copy link
Collaborator

@zyj007 建议把弄错的原因贴上,便于帮忙其它人,谢谢!

@zyj007
Copy link
Author

zyj007 commented May 16, 2016

因为$response的信息不是很方便调试,所以一直找不到错误原因。后来在chrome上装了个simple-rest-client的扩展,通过easywechat日志中的微信返回的内容,再放到simple-rest-client中模拟微信返回,找到错误,解决问题

@koiding
Copy link

koiding commented Feb 24, 2017

我也遇到了同样的问题, 请问你后来找到的错误是什么 @zyj007

@imbiss
Copy link

imbiss commented Dec 5, 2017

请问你@zyj007如何解决的,我也遇到同样的问题. 

@imbiss
Copy link

imbiss commented Dec 5, 2017

我通过$reponse->__toString(),把内容记录到log后看,内容是正确的
HTTP/1.0 200 OK Cache-Control: no-cache, private Date: Tue, 05 Dec 2017 16:01:03 GMT <xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>
是符合微信文档要求的. 文档 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants