wx pay debug

This commit is contained in:
devil_gong 2019-05-24 18:59:45 +08:00
parent da93a419cb
commit 95c3a064ae
3 changed files with 12 additions and 11 deletions

View File

@ -33,7 +33,7 @@ class Pay extends Controller
{
if(!empty($params['pay_data']))
{
$pay_data = json_decode(urldecode($params['pay_data']), true);
$pay_data = json_decode(base64_decode(urldecode($params['pay_data'])), true);
$redirect_url = empty($params['redirect_url']) ? '' : urldecode($params['redirect_url']);
$this->assign('pay_data', $pay_data);
$this->assign('redirect_url', $redirect_url);

File diff suppressed because one or more lines are too long

View File

@ -210,7 +210,7 @@ class Weixin
// 微信中
if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false)
{
$url = PluginsHomeUrl('weixinwebauthorization', 'pay', 'index', ['pay_data'=>urlencode(json_encode($pay_data)), 'redirect_url'=>$redirect_url]);
$url = PluginsHomeUrl('weixinwebauthorization', 'pay', 'index', ['pay_data'=>urlencode(base64_encode(json_encode($pay_data))), 'redirect_url'=>$redirect_url]);
$result = DataReturn('success', 0, $url);
} else {
$result = DataReturn('success', 0, $pay_data);