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

当面付 WAIT_BUYER_PAY 可以验签、TRADE_SUCCESS 无法验签的解决方法 #143

Open
babytomas opened this issue Jul 10, 2018 · 3 comments
Labels

Comments

@babytomas
Copy link

在回调出现无法验签时,一般是支付宝公钥有误所导致的。

但今日发现了另外的一种情况,trade_status 是 WAIT_BUYER_PAY 的时候可以验签、是 TRADE_SUCCESS 时则无法验签。

这是由于交易成功的 TRADE_SUCCESS 回调报文中包含 fund_bill_list,这个键的值是 HTML 转义过的、在验签之前需要转回来。

PHP 下可以在验证异步回调之前加一条:

$_POST['fund_bill_list'] AND $_POST['fund_bill_list'] = html_entity_decode($_POST['fund_bill_list']);

这个可以加到这个类中,不过内容较少、所以我没有发 Pull Request,如果作者有时间的话可以加一下。

@ZBrettonYe
Copy link

按照 #175 的搞法
$signer->setIgnores(['fund_bill_list']);

加上这个应该就好了吧

@wwnice-max
Copy link

按照 #175 的搞法
$signer->setIgnores(['fund_bill_list']);

加上这个应该就好了吧

3.1.2版本 亲测无效

@wwnice-max
Copy link

在回调出现无法验签时,一般是支付宝公钥有误所导致的。

但今日发现了另外的一种情况,trade_status 是 WAIT_BUYER_PAY 的时候可以验签、是 TRADE_SUCCESS 时则无法验签。

这是由于交易成功的 TRADE_SUCCESS 回调报文中包含 fund_bill_list,这个键的值是 HTML 转义过的、在验签之前需要转回来。

PHP 下可以在验证异步回调之前加一条:

$_POST['fund_bill_list'] AND $_POST['fund_bill_list'] = html_entity_decode($_POST['fund_bill_list']);

这个可以加到这个类中,不过内容较少、所以我没有发 Pull Request,如果作者有时间的话可以加一下。

亲测无效 3.1.2

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

No branches or pull requests

4 participants