Skip to content
New issue

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

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

Already on GitHub? # to your account

alipay支付,当subject为中文时候,下单失败。 #9

Closed
shizhice opened this issue Sep 6, 2017 · 6 comments
Closed

alipay支付,当subject为中文时候,下单失败。 #9

shizhice opened this issue Sep 6, 2017 · 6 comments

Comments

@shizhice
Copy link

shizhice commented Sep 6, 2017

Yansongda\Pay\Gateways\Alipay\Alipay文件219行,当subject为中文时,会导致下单失败。去掉JSON_UNESCAPED_UNICODE参数后,问题解决。

image

@yansongda
Copy link
Owner

只有使用 刷卡和扫码 两种支付方法时才会调用这个函数,请问您是在这两种支付方式中下单失败吗?还有请问下报错信息是什么呢?

@shizhice
Copy link
Author

shizhice commented Sep 6, 2017

我刚完成扫码功能,发现这个问题。刷卡,目前没有需求。这个是报错信息

Yansongda\Pay\Exceptions\GatewayException: get result error: - 

我测试了您的代码,阿里返回的错误代码如下

{"code":"40002","msg":"Invalid Arguments","sub_code":"isv.invalid-signature",...}

具体内容,不方便截图,请见谅

@yansongda
Copy link
Owner

好的,感谢您的支持,我晚些时候重现下,确定将进行修复。

目测应该是因为支付宝不支持中文,不过我看文档,上面是支持中文的,奇怪。

@shizhice
Copy link
Author

shizhice commented Sep 6, 2017

恩恩,好的。

@yansongda
Copy link
Owner

已经修复。我想是因为支付宝需要支持 gb2312 和 utf8 两种格式,所以不支持解码时使用 utf8 的中文造成的这个问题。

同时,还发现支付宝服务器返回编码居然是 gb2312 格式。也修复了这个问题。

感谢您的支持!

@shizhice
Copy link
Author

shizhice commented Sep 7, 2017

👍

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

No branches or pull requests

2 participants