...
|
...
|
@@ -10,6 +10,7 @@ use Plugin\Pay\weixin\lib\WxPayApi; |
|
|
use Plugin\Pay\weixin\lib\WxPayConfig;
|
|
|
use Plugin\Pay\aliwap\AliwapReqparams;
|
|
|
use Plugin\Pay\aliwap\AliwapService;
|
|
|
use Plugin\UdpLog;
|
|
|
|
|
|
/**
|
|
|
* 支付相关的控制器
|
...
|
...
|
@@ -33,12 +34,14 @@ class PayController extends AbstractAction |
|
|
/* 判断是否有订单号参数 */
|
|
|
$orderCode = $this->get('order_code');
|
|
|
if (empty($orderCode)) {
|
|
|
UdpLog::info('【支付宝支付】参数校验', 'orderCode为空');
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 判断用户是否登录 */
|
|
|
$uid = $this->getUid(true);
|
|
|
if (!$uid) {
|
|
|
UdpLog::info('【支付宝支付】参数校验', 'uid为空');
|
|
|
$this->go( Helpers::url('/signin.html', array('refer' => $this->_request->server('HTTP_REFERER'))) );
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -46,6 +49,7 @@ class PayController extends AbstractAction |
|
|
/* 判断订单信息是否存在 */
|
|
|
$orderDetail = OrderData::viewOrderData($orderCode, $uid, $this->_usession);
|
|
|
if (empty($orderDetail['data'])) {
|
|
|
UdpLog::info('【支付宝支付】校验订单信息', 'orderCode:'.$orderCode.'uid:'.$uid.'返回:'.json_encode($orderDetail));
|
|
|
$this->helpJsRedirect('没有找到该订单');
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -61,6 +65,7 @@ class PayController extends AbstractAction |
|
|
$aliwapService = new AliwapService();
|
|
|
$payRequestPars = $aliwapService->getPayRequestPars($reqParams);
|
|
|
if (empty($payRequestPars)) {
|
|
|
UdpLog::info('【支付宝支付】提交支付宝端口无响应', 'orderCode:'.$orderCode.'totalFee:'.$totalFee.'createTime:'.$orderDetail['data']['create_time']);
|
|
|
$this->helpJsRedirect('支付系统繁忙,请稍后再试');
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -93,23 +98,27 @@ class PayController extends AbstractAction |
|
|
|
|
|
$uid = $this->getUid(true);
|
|
|
if (!$uid) {
|
|
|
UdpLog::info('【wechat支付】参数校验', 'uid为空');
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$orderCode = $this->get('order_code');
|
|
|
if (empty($orderCode)) {
|
|
|
UdpLog::info('【wechat支付】参数校验', 'orderCode为空');
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 判断订单信息不存在 */
|
|
|
$orderDetail = OrderData::viewOrderData($orderCode, $uid, $this->_usession);
|
|
|
if (empty($orderDetail['data'])) {
|
|
|
UdpLog::info('【wechat支付】校验订单信息', 'orderCode:'.$orderCode.'uid:'.$uid.'返回:'.json_encode($orderDetail));
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$totalFee = strval($orderDetail['data']['payment_amount'] * 100);
|
|
|
$openId = $this->getSession('weixinOpenId');
|
|
|
if (empty($openId)) {
|
|
|
UdpLog::info('【wechat支付】获取wechat标识为空', 'orderCode:'.$orderCode.'uid:'.$uid.'返回openId:'.$openId);
|
|
|
break;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -149,6 +158,7 @@ class PayController extends AbstractAction |
|
|
$payment = $this->get('payment',0);
|
|
|
|
|
|
if (!$uid || !$orderCode || !$payment) {
|
|
|
UdpLog::info('【支付时间校验】参数校验', 'orderCode:'.$orderCode.'uid:'.$uid.'payment:'.$payment);
|
|
|
break;
|
|
|
}
|
|
|
|
...
|
...
|
|