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

关于验证微信通信标识的疑问 #25

Closed
koulerz opened this issue Nov 6, 2017 · 2 comments
Closed

关于验证微信通信标识的疑问 #25

koulerz opened this issue Nov 6, 2017 · 2 comments

Comments

@koulerz
Copy link

koulerz commented Nov 6, 2017

微信支付结果通知 API 文档中说只有当 return_code (通信标识) 为 SUCCESS 时,返回信息中才有 sign 等字段,所以当 return_code (通信标识) 为 FAIL 时,下面这段代码会因为找不到 $data['sign'] 报错吧?

public function verify($data, $sign = null, $sync = false)
{
    $data = $this->fromXml($data);
    $sign = is_null($sign) ? $data['sign'] : $sign;
    return $this->getSign($data) === $sign ? $data : false;
}

微信文档链接
代码链接

@yansongda
Copy link
Owner

敢问通讯表示为 false 的话,连腾讯的没管这种处理,这里需要管么?

PS:您的业务中有遇到这种情况?

@koulerz
Copy link
Author

koulerz commented Nov 6, 2017

并没有遇到过这种情况,多谢回复。

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

2 participants