wx pay debug
parent
135066d517
commit
a3fc4f3360
|
|
@ -0,0 +1 @@
|
|||
pay
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\weixinwebauthorization\index;
|
||||
|
||||
use think\Controller;
|
||||
|
||||
/**
|
||||
* 微信登录 - 支付
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Auth extends Controller
|
||||
{
|
||||
/**
|
||||
* 授权
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Index($params = [])
|
||||
{
|
||||
if(empty($params['pay_data']))
|
||||
{
|
||||
$pay_data = json_decode(urldecode($params['pay_data']), true);
|
||||
print_r($pay_data);die;
|
||||
|
||||
return $this->fetch('../../../plugins/view/weixinwebauthorization/index/pay/index');
|
||||
} else {
|
||||
$this->assign('msg', '支付参数错误');
|
||||
return $this->fetch('public/tips_error');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -205,6 +205,13 @@ class Weixin
|
|||
'timeStamp' => (string) time(),
|
||||
);
|
||||
$pay_data['paySign'] = $this->GetSign($pay_data);
|
||||
|
||||
// 微信中
|
||||
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))]);
|
||||
$result = DataReturn('success', 0, $url);
|
||||
}
|
||||
$result = DataReturn('success', 0, $pay_data);
|
||||
break;
|
||||
|
||||
|
|
@ -213,7 +220,6 @@ class Weixin
|
|||
$result = DataReturn('APP支付暂未开放', -1);
|
||||
break;
|
||||
}
|
||||
print_r($result);die;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue