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

沙箱验证失败的问题 #19

Open
zyssyz123 opened this issue Nov 17, 2019 · 1 comment
Open

沙箱验证失败的问题 #19

zyssyz123 opened this issue Nov 17, 2019 · 1 comment

Comments

@zyssyz123
Copy link

zyssyz123 commented Nov 17, 2019

在调用client类函数Refund()退款时会报错

return_code value is invalid in XML

查看微信的回复内容为

<xml> <return_code><![CDATA[FAIL]]></return_code> <return_msg><![CDATA[沙箱验证签名失败,请确认沙箱签名key是否正确(通过getsignkey调用生成)]]></return_msg> </xml>

麻烦问一下为什么会出现沙箱验证失败

@ColeZia
Copy link

ColeZia commented Nov 29, 2019

在调用client类函数Refund()退款时会报错

return_code value is invalid in XML

查看微信的回复内容为

<xml> <return_code><![CDATA[FAIL]]></return_code> <return_msg><![CDATA[沙箱验证签名失败,请确认沙箱签名key是否正确(通过getsignkey调用生成)]]></return_msg> </xml>

麻烦问一下为什么会出现沙箱验证失败

发现获取的return_code值不对, 在出现错误的结果中 xml标签后的换行符 \n ``后面会多出一个空格,导致 if value != "\n" { params.SetString(key, value) }
判断错误
不过你说的沙箱验证失败是因为你没有拿正确的key,确认一下是否通过getsignkey生成了沙箱app key,替换正式的app key. https://www.hehuapei.com/index.php/archives/4/

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