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

返回支付页面时报错:"access_token" could not be empty #367

Closed
alwaystrong opened this issue Mar 29, 2016 · 3 comments
Closed

返回支付页面时报错:"access_token" could not be empty #367

alwaystrong opened this issue Mar 29, 2016 · 3 comments

Comments

@alwaystrong
Copy link

我用的环境

laravel 5.2
微信iOS版本

PHP 版本:5.6
overtrue/wechat 版本:3.0

问题及现象

pay页面:授权后,获取地址,支付参数,调用支付。
支付完成后,进入一个新的页面。
这时,点击返回,会有一个错误:
InvalidArgumentException in AccessToken.php line 44:
The key "access_token" could not be empty。

从支付之后的新的页面返回支付页面是,会先返回到授权页面,如:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxe330df283d0d22bd&redirect_uri=http%3A%2F%2Fzaihu.me%2Fwechat%2Forders%2Fpay%2F150&response_type=code&scope=snsapi_base&state=56f9edca19082&connect_redirect=1#wechat_redirect

@overtrue
Copy link
Collaborator

不能点击返回啊,返回又请求了一次,而且这次请求使用的上一次的code,拿不到access_token,当然报错了。

@overtrue
Copy link
Collaborator

@alwaystrong 通常的做法是授权完事后应该是redirect到你的业务页面,而不是在授权完事的页面就显示业务界面。

@alwaystrong
Copy link
Author

好。谢谢。多谢指点。

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