Authored by whb

Merge branch 'hotfix/log' of http://git.dev.yoho.cn/web/yohobuy.git into hotfix/log

... ... @@ -20,6 +20,7 @@ use Hood\Session;
use WebPlugin\Mobile;
use Api\Yohobuy;
use LibModels\Web\Passport\LoginData;
use WebPlugin\UdpLog;
class WebAction extends Controller_Abstract
{
... ... @@ -383,6 +384,7 @@ class WebAction extends Controller_Abstract
$token = Helpers::makeToken($uid);
$uidCookie = $userInfo['data']['profile_name'] . '::' . $userInfo['data']['uid'] . '::' . $userInfo['data']['vip_info']['title'] . '::' . $token;
$this->setCookie('_UID',$uidCookie,time() + 86400 * 360);
UdpLog::info('【登录】同步登陆cookie生成',$uidCookie);
}
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $uid);
... ...
... ... @@ -12,6 +12,8 @@
namespace Api;
use Plugin\Cache;
use WebPlugin\UdpLog;
class Yohobuy
{
/* 正式环境 */
... ... @@ -190,6 +192,8 @@ class Yohobuy
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
}
$result = curl_exec($ch);
//log打印
UdpLog::info('get调用接口入参url/出参:', 'in:'.$url.' out:'.$result);
if (!$returnJson && !empty($result)) {
$result = json_decode($result, true);
}
... ... @@ -254,6 +258,8 @@ class Yohobuy
curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
}
$result = curl_exec($ch);
//log打印
UdpLog::info('post调用接口入参url/出参:', 'in:'.$url.'?'.$str.' out:'.$result);
if (!$returnJson && !empty($result)) {
$result = json_decode($result, true);
}
... ...
... ... @@ -14,7 +14,7 @@ use WebPlugin\Pay\weixin\lib\WxPayConfig;
use WebPlugin\Pay\weixin\lib\WxPayNativePay;
use WebPlugin\Pay\weixin\lib\WxPayOrderQuery;
use WebPlugin\Pay\weixin\lib\WxPayUnifiedOrder;
use WebPlugin\PhpLog;
use WebPlugin\UdpLog;
/**
* 支付有关方法
... ... @@ -26,18 +26,6 @@ use WebPlugin\PhpLog;
*/
class PayModel
{
// 日志等级,2表示记录信息等级的日志
const LOG_LEVEL = 2;
// 支付方式有关接口调用日志
const PAYMENT_LIST_LOG = '/Data/logs/pc_pay/payment_list';
// 向ERP提交订单状态有关接口调用日志和更新订单状态有关接口调用日志
const ORDER_STATUS_LOG = '/Data/logs/pc_pay/order_status';
// 获取或者更新订单支付银行的接口调用日志
const ORDER_BANK_LOG = '/Data/logs/pc_pay/order_bank';
// 根据用户UID获取订单数有关接口调用日志
const ORDER_COUNT_LOG = '/Data/logs/pc_pay/order_count';
// 发送短信有关接口调用日志
const SEND_MESSAGE_LOG = '/Data/logs/pc_pay/send_message';
// 是否老用户订单数判断值
const OLD_USER_LIMIT = 1;
... ... @@ -86,8 +74,8 @@ class PayModel
break;
}
$result['deliveryType'] =isset($order['delivery_time']) ? $order['delivery_time'] : '';
$result['deliveryType'] = isset($order['delivery_time']) ? $order['delivery_time'] : '';
//统计成交的skn
$sknList = array();
$skuList = array();
... ... @@ -111,13 +99,7 @@ class PayModel
// 用户ID
$result['uid'] = $uid;
// 初始化日志
$log = new PhpLog(self::PAYMENT_LIST_LOG, 'PRC', self::LOG_LEVEL);
// 获取支付途径列表
$log->LogInfo('===开始调用支付方式列表接口,接口方法为web.SpaceOrders.getPaymentList===');
$payTypes = PayData::getPaymentList();
$log->LogInfo('===结束调用支付方式列表接口,返回结果为===');
$log->LogInfo(var_export($payTypes, true));
$defaultPayType = 0;
$types = array();
... ... @@ -148,45 +130,23 @@ class PayModel
// 无需付款
if (isset($order["payment_amount"]) && $order["payment_amount"] == 0) {
// 初始化日志
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('===[' . $orderCode . ']===');
// ERP提交订单状态
$log->LogInfo('===开始调用ERP提交订单状态接口,接口方法为web.SpaceOrders.submitOrderStatus===');
$log->LogInfo('===请求参数为orderCode=' . $orderCode . '===');
$erpReturn = PayData::submitOrderStatus($orderCode, 0, '', '', 0, '', '', '');
$log->LogInfo('===结束调用ERP提交订单状态接口,返回结果为===');
$log->LogInfo(var_export($erpReturn, true));
// 更新订单的状态
$log->LogInfo('===开始调用更新订单状态接口,接口方法为web.SpaceOrders.updatePaymentStatus===');
$log->LogInfo('===请求参数为orderId=' . $order['order_id'] . 'uid=' . $uid . '===');
$updateOrderStatus = PayData::updateOrderStatus($order['order_id'], $uid, 0, 'Y', '');
$log->LogInfo('===结束调用更新订单状态接口,返回结果为===');
$log->LogInfo(var_export($updateOrderStatus, true));
PayData::submitOrderStatus($orderCode, 0, '', '', 0, '', '', '');
PayData::updateOrderStatus($order['order_id'], $uid, 0, 'Y', '');
$result['notNeedPay'] = true;
break;
}
// 记录支付方式
// 初始化日志
$log = new PhpLog(self::ORDER_BANK_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('===开始调用记录支付方式接口,接口方法为web.SpaceOrders.getOrderPayBank===');
$log->LogInfo('===请求参数为orderCode=' . $orderCode . '===');
$bankRecord = PayData::getBankByOrder($orderCode);
$log->LogInfo('===结束调用记录支付方式接口,返回结果为===');
$log->LogInfo(var_export($bankRecord, true));
if (isset($bankRecord['data']['bankCode']) && !empty($bankRecord['data']['bankCode'])) {
$payRecord = $bankRecord['data']['bankCode'];
} else {
$payCode = $order['payment'] ?: $defaultPayType;
}
else {
$payCode = $order['payment'] ? : $defaultPayType;
//记录app上的支付方式
$changeCodes = array(
19 => 21,// app上微信支付
22 => 21,// h5微信支付
19 => 21, // app上微信支付
22 => 21, // h5微信支付
18 => $defaultPayType// h5支付宝支付
);
$platformCode = isset($changeCodes[$payCode]) && $changeCodes[$payCode] ? $changeCodes[$payCode] : $payCode;
... ... @@ -202,12 +162,7 @@ class PayModel
// 是否是老用户(用于订单统计)
$orderCount = 0;
// 初始化日志
$log = new PhpLog(self::ORDER_COUNT_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('===开始调用查询用户订单数接口,接口方法为web.SpaceOrders.getOrderCountByUid===');
$orders = PayData::getOrderCountByUid($uid);
$log->LogInfo('===结束调用查询用户订单数接口,返回结果为===');
$log->LogInfo(var_export($orders, true));
if (isset($orders['data']) && !empty($orders['data'])) {
$orderCount = $orders['data']['total'];
... ... @@ -220,8 +175,8 @@ class PayModel
$result['orderGoods'] = $order['order_goods'];
// 订单商品数(用于订单统计)
$result['ordersGoodsNums'] = count($order['order_goods']);
} while (false);
}
while (false);
return $result;
}
... ... @@ -253,7 +208,6 @@ class PayModel
return $result;
}
/**
* 获取支付有关信息
*
... ... @@ -344,7 +298,8 @@ class PayModel
$bankCode = ($paymentParameter != 'platform' ? $paymentParameter : '');
if (isset($bankRecord['data']['bankCode']) && !empty($bankRecord['data']['bankCode'])) {
$bankPayRecord = PayData::updateOrderPayBank($orderCode, $payId, $bankCode);
} else {
}
else {
$bankPayRecord = PayData::setOrderPayBank($orderCode, $payId, $bankCode);
}
if (!isset($bankPayRecord['code']) || $bankPayRecord['code'] != 200) {
... ... @@ -357,11 +312,13 @@ class PayModel
//直接跳转到支付界面
$result['go'] = true;
$result['payUrl'] = $reqPars['pay_url'] . '?' . $reqPars['pars'];
} else {
}
else {
//如果是post,去form提交
$result = array('reqPars' => $reqPars);
}
} while (false);
}
while (false);
return $result;
}
... ... @@ -388,7 +345,6 @@ class PayModel
return $result;
}
/**
* 处理微信支付
*
... ... @@ -402,11 +358,10 @@ class PayModel
do {
// 初始化日志
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('=====[' . $orderCode . ']===开始生成微信支付二维码========');
UdpLog::info('【支付】开始生成微信支付二维码', 'orderCode:' . $orderCode);
if (empty($orderCode)) {
$log->LogInfo('=====[' . $orderCode . ']===微信支付时,订单号为空========');
UdpLog::info('【支付】微信支付时,订单号为空', 'orderCode:' . $orderCode);
$result['error'] = true;
$result['message'] = '订单号不能为空';
break;
... ... @@ -415,19 +370,19 @@ class PayModel
/* 判断订单信息是否存在 */
$orderDetail = OrderData::getOrderDetail($uid, $orderCode);
if (!isset($orderDetail['data']) || empty($orderDetail['data'])) {
$log->LogInfo('=====[' . $orderCode . ']===微信支付时,订单信息未查到========');
UdpLog::info('【支付】微信支付时,订单信息未查到', 'orderInfo:' . json_encode($orderDetail));
$result['error'] = true;
$result['message'] = '没有找到该订单';
break;
}
/*$wechatqrcode = new Service(array('id' => $paymentCode));
$reqPars = $wechatqrcode->pay(array('order_code'=>$orderCode));
if (empty($reqPars)) {
$result['error'] = true;
$result['message'] = '支付系统繁忙,请稍后再试';
break;
}*/
/* $wechatqrcode = new Service(array('id' => $paymentCode));
$reqPars = $wechatqrcode->pay(array('order_code'=>$orderCode));
if (empty($reqPars)) {
$result['error'] = true;
$result['message'] = '支付系统繁忙,请稍后再试';
break;
} */
//统一下单
$totalFee = strval($orderDetail['data']['payment_amount'] * 100);
... ... @@ -442,8 +397,7 @@ class PayModel
$input->SetProduct_id($orderCode);
$notify = new WxPayNativePay();
$payResult = $notify->GetPayUrl($input);
$log->LogInfo('=====[' . $orderCode . ']===微信支付时,微信统一下单的返回结果为:========');
$log->LogInfo(var_export($payResult, true));
UdpLog::info('【支付】微信支付时,微信统一下单的返回结果为', 'orderCode:' . $orderCode . 'result:' . var_export($payResult, true));
$orderData = $orderDetail['data'];
$firstGoods = current($orderData['order_goods']);
... ... @@ -457,10 +411,9 @@ class PayModel
'choosePayUrl' => Helpers::url('/shopping/pay', array('order_code' => $orderData['order_code'])),
'qrcodeUrl' => $payResult['code_url'] // 'http://paysdk.weixin.qq.com/example/qrcode.php?data=' . $result['code_url']
);
} while (false);
$log->LogInfo('=====[' . $orderCode . ']===微信支付时,处理微信支付的结果为:========');
$log->LogInfo(var_export($result, true));
}
while (false);
UdpLog::info('【支付】微信支付结果', var_export($result, true));
return $result;
}
... ... @@ -485,26 +438,26 @@ class PayModel
}
// 初始化日志
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('=====[' . $orderCode . ']===开始查询微信扫码支付状态========');
UdpLog::info('【支付】开始查询微信扫码支付状态', 'orderCode:' . $orderCode);
// 组装微信支付的订单号
$tradeNo = 'YOHOBuy_' . $orderCode;
$input = new WxPayOrderQuery();
$input->SetOut_trade_no($tradeNo);
$payResult = WxPayApi::orderQuery($input);
$log->LogInfo(var_export($payResult, true));
UdpLog::info('【支付】微信扫码支付返回', 'payResult:' . var_export($payResult, true));
if (isset($payResult['trade_state']) && $payResult['trade_state'] === 'SUCCESS') {
$log->LogInfo('====[' . $orderCode . ']====微信扫码支付成功========');
UdpLog::info('【支付】微信扫码支付成功');
$result = array(
'code' => '200',
'message' => 'success'
);
}
$log->LogInfo('====[' . $orderCode . ']====微信扫码支付失败========');
} while (false);
UdpLog::info('【支付】微信扫码支付失败');
}
while (false);
return $result;
}
... ... @@ -526,17 +479,12 @@ class PayModel
do {
// 初始化日志
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('========[' . $payResult->orderCode . ']========');
$log->LogInfo(var_export($payResult, true));
UdpLog::info('【支付】订单支付后续处理','orderCode:'.$payResult->orderCode.'payResult:'.var_export($payResult, true));
$log->LogInfo('==[' . $payResult->orderCode . ']=开始调用获取订单详情方式接口,接口方法为app.SpaceOrders.detail===');
$orderInfo = OrderData::getOrderDetail($uid, $payResult->orderCode);
$log->LogInfo('==[' . $payResult->orderCode . ']=结束调用获取订单详情方式接口,返回结果为===');
$log->LogInfo(var_export($orderInfo, true));
if (!isset($orderInfo['data']) || empty($orderInfo['data'])) {
$log->LogInfo('==[' . $payResult->orderCode . ']=订单支付失败,未获取到订单详情信息===');
UdpLog::info('【支付】订单支付后续处理,未查询到订单信息','orderCode:'.$payResult->orderCode);
break;
}
... ... @@ -549,12 +497,7 @@ class PayModel
if ($orderData['is_cancel'] === 'Y' && $paymentStatus === 'N') {
// 给用户发送短信
// 初始化日志
$log = new PhpLog(self::SEND_MESSAGE_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('===[' . $orderCode . ']===');
$log->LogInfo('==[' . $orderCode . ']=开始调用订单取消时给用户发短信接口,接口方法为app.message.sendMsg===');
$messageReturn = PayData::sendMessage($orderData['mobile'], 'error_sms', '支付成功,但订单已取消,订单号为' . $orderCode);
$log->LogInfo('==[' . $orderCode . ']=结束调用给用户发短信接口,返回结果为===');
$log->LogInfo(var_export($messageReturn, true));
PayData::sendMessage($orderData['mobile'], 'error_sms', '支付成功,但订单已取消,订单号为' . $orderCode);
$result['code'] = 417;
$result['message'] = '支付成功,但订单已取消,需联系客服';
... ... @@ -563,8 +506,7 @@ class PayModel
// 支付金额与订单金额不一致
if (round($amount, 2) != round($payResult->totalFee, 2)) {
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('==[' . $orderCode . ']=订单支付失败,支付金额与订单金额不一致===');
UdpLog::info('【支付】订单支付后续处理,订单支付金额不一致','orderCode:'.$orderCode.'account:'.round($amount, 2).'payfee:'.round($payResult->totalFee, 2));
$result['code'] = 415;
$result['message'] = '支付金额与订单金额不一致';
break;
... ... @@ -577,24 +519,11 @@ class PayModel
$bankName = $payResult->bankName;
$bankCode = $payResult->bankCode;
// 初始化日志
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('===[' . $orderCode . ']===');
$log->LogInfo('==[' . $orderCode . ']=开始调用ERP提交订单状态接口,接口方法为web.SpaceOrders.submitOrderStatus===');
$log->LogInfo('==[' . $orderCode . ']=请求参数为orderCode=' . $orderCode . '===');
// ERP提交订单状态
$erpReturn = PayData::submitOrderStatus($orderCode, $payment, $bankName, $bankCode, $amount, $payOrderCode, $tradeNo, $bankBillNo);
$log->LogInfo('==[' . $orderCode . ']=结束调用ERP提交订单状态接口,返回结果为===');
$log->LogInfo(var_export($erpReturn, true));
PayData::submitOrderStatus($orderCode, $payment, $bankName, $bankCode, $amount, $payOrderCode, $tradeNo, $bankBillNo);
$log->LogInfo('==[' . $orderCode . ']=开始调用更新订单状态接口,接口方法为web.SpaceOrders.updatePaymentStatus===');
$log->LogInfo('==[' . $orderCode . ']=请求参数为orderId=' . $orderData['order_id'] . 'uid=' . $uid . '===');
// 更新订单的状态
$updateOrderStatus = PayData::updateOrderStatus($orderData['order_id'], $uid, $payment, 'Y', $bankCode);
$log->LogInfo('==[' . $orderCode . ']=结束调用更新订单状态接口,返回结果为===');
$log->LogInfo(var_export($updateOrderStatus, true));
$log->LogInfo('==[' . $orderCode . ']=订单支付成功,请等待发货===');
$result['code'] = 200;
$result['message'] = '支付成功,请等待发货';
... ... @@ -611,8 +540,10 @@ class PayModel
'vipUrl' => Helpers::url('/help', array('category_id' => 91)),
'returnHomeUrl' => Helpers::url('/')
);
} while (false);
}
while (false);
return $result;
}
}
\ No newline at end of file
}
... ...
... ... @@ -7,6 +7,7 @@ use Passport\PassportModel;
use Configs\ChannelConfig;
use WebPlugin\Helpers;
use WebPlugin\Cache;
use WebPlugin\UdpLog;
/**
* 登录
... ... @@ -113,6 +114,7 @@ class LoginController extends WebAction
$verifyCode = trim($this->post('captcha'));
$isRemember = $this->post('isRemember');
if (!is_numeric($area) || empty($account) || empty($password)) {
UdpLog::info('【登录】校验参数传递auth','area:'.$area.'account:'.$account.'password:'.$password);
break;
}
... ... @@ -120,6 +122,7 @@ class LoginController extends WebAction
$verifyEmail = Helpers::verifyEmail($account);
$verifyMobile = Helpers::verifyAreaMobile(Helpers::makeMobile($area, $account));
if (!$verifyEmail && !$verifyMobile) {
UdpLog::info('【登录】校验账号是否有效auth','email:'.$verifyEmail.'mobile:'.$verifyMobile);
break;
}
... ... @@ -161,6 +164,7 @@ class LoginController extends WebAction
if ($verifyCode) {
$picFlag = PassportModel::verifyCode($verifyCode);
if (!$picFlag) {
UdpLog::info('【登录】登录验证码','area:'.$area.'account:'.$account.'verifyCode:'.$verifyCode);
$data = array('code' => 400, 'message' => '验证码不正确或验证码已过期', 'data' => array('needCaptcha' => true, 'errorType' => 'captcha'));
break;
}
... ...
... ... @@ -6,6 +6,7 @@ use WebPlugin\Helpers;
use WebPlugin\Cache;
use Passport\PassportModel;
use LibModels\Web\Passport\BindData;
use WebPlugin\UdpLog;
/**
* 注册
... ... @@ -265,6 +266,7 @@ class RegisterController extends WebAction
$mobile = trim($this->post('mobile'));
$area = trim($this->post('area'));
if (!is_numeric($mobile) || !is_numeric($area)) {
UdpLog::info('【注册】参数校验', 'mobile:'.$mobile.'area:'.$area);
$data['message'] = '手机号码格式不正确';
break;
}
... ... @@ -272,6 +274,7 @@ class RegisterController extends WebAction
/* 判断是否是有效的注册方式,防注册机刷 */
$effectiveTime = $this->getSession('effective_time');
if ($effectiveTime < time() || empty($effectiveTime)) {
UdpLog::info('【注册】超时', 'mobile:'.$mobile.'area:'.$area);
$data['message'] = '注册超时';
break;
}
... ... @@ -279,6 +282,7 @@ class RegisterController extends WebAction
//检测验证码不正确
$verifyCode = strtolower(trim($this->post('verifyCode'))); //图形验证码
if (!PassportModel::verifyCode($verifyCode)) {
UdpLog::info('【注册】验证码不正确', 'mobile:'.$mobile.'area:'.$area.'verifyCode:'.$verifyCode);
$data['message'] = '验证码不正确';
break;
}
... ... @@ -287,6 +291,7 @@ class RegisterController extends WebAction
$code = trim($this->post('code')); //手机验证码
$password = $this->post('password');
if (!Helpers::verifyPassword($password)) {
UdpLog::info('【注册】密码格式问题', 'mobile:'.$mobile.'area:'.$area.'password:'.$password);
$data['message'] = '密码不正确';
break;
}
... ... @@ -302,6 +307,7 @@ class RegisterController extends WebAction
$ipTimes = intval($ipTimes);
}
if ($ipTimes >= 500) {
UdpLog::info('【注册】ip限制', 'mobile:'.$mobile.'area:'.$area.'ip:'.$ip.'ipTimes:'.$ipTimes);
$data['message'] = '由于你IP受限无法注册';
break;
}
... ... @@ -309,6 +315,7 @@ class RegisterController extends WebAction
/* 验证注册的标识码是否有效 */
$data = RegData::validMobileCode($area, $mobile, $code);
if (!isset($data['code']) || $data['code'] != 200) {
UdpLog::info('【注册】短信验证码校验', 'mobile:'.$mobile.'area:'.$area.'code:'.$code);
$data['message'] = '验证码错误';
break;
}
... ...
... ... @@ -5,7 +5,7 @@ use Shopping\PayModel;
use WebPlugin\Pay\PayFactory;
use WebPlugin\Pay\Rspparams;
use WebPlugin\Pay\weixin\PayNotifyCallBack;
use WebPlugin\PhpLog;
use WebPlugin\UdpLog;
/**
* 支付Notice
... ... @@ -13,18 +13,11 @@ use WebPlugin\PhpLog;
class NoticeController extends WebAction
{
// 日志等级,2表示记录信息等级的日志
const LOG_LEVEL = 2;
// 向回调通知有关调用日志
const ORDER_STATUS_LOG = '/Data/logs/pc_pay/order_status';
// 存储的UID键名
const SESSION_UID_KEY = 'payUserid';
private $log = null;
public function init() {
parent::init();
$this->log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
}
/**
... ... @@ -35,7 +28,7 @@ class NoticeController extends WebAction
$payment = PayModel::getPaymentById(2);
$payService = PayFactory::factory($payment);
$this->log->LogInfo("begin alipaynoticeAction");
UdpLog::info('begin alipaynoticeAction');
$res = $payService->parseResponse($_POST); //支付宝通知使用的
if ($res->payResult != -1) {
... ... @@ -50,7 +43,7 @@ class NoticeController extends WebAction
*/
public function alipayreturnAction()
{
$this->log->LogInfo("begin alipayreturnAction");
UdpLog::info('begin alipayreturnAction');
$payment = PayModel::getPaymentById(2);
$payService = PayFactory::factory($payment);
... ... @@ -65,7 +58,7 @@ class NoticeController extends WebAction
*/
public function alibarcodenoticeAction()
{
$this->log->LogInfo("begin alibarcodenoticeAction");
UdpLog::info('begin alibarcodenoticeAction');
$payment = PayModel::getPaymentById(17);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST); //支付宝通知使用的
... ... @@ -81,7 +74,7 @@ class NoticeController extends WebAction
*/
public function alibarcodereturnAction()
{
$this->log->LogInfo("begin alibarcodereturnAction");
UdpLog::info('begin alibarcodereturnAction');
$payment = PayModel::getPaymentById(17);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_GET);
... ... @@ -95,7 +88,7 @@ class NoticeController extends WebAction
*/
public function allinpaynoticeAction()
{
$this->log->LogInfo("begin allinpaynoticeAction");
UdpLog::info('begin allinpaynoticeAction');
$payment = PayModel::getPaymentById(16);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST);
... ... @@ -111,7 +104,7 @@ class NoticeController extends WebAction
*/
public function allinpayreturnAction()
{
$this->log->LogInfo("begin allinpayreturnAction");
UdpLog::info('begin allinpayreturnAction');
$payment = PayModel::getPaymentById(16);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST);
... ... @@ -125,7 +118,7 @@ class NoticeController extends WebAction
*/
public function aliexpressgatewayreturnAction()
{
$this->log->LogInfo("begin aliexpressgatewayreturnAction");
UdpLog::info('begin aliexpressgatewayreturnAction');
$payment = PayModel::getPaymentById(13);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_GET);
... ... @@ -139,7 +132,7 @@ class NoticeController extends WebAction
*/
public function aliexpressgatewaynoticeAction()
{
$this->log->LogInfo("begin aliexpressgatewaynoticeAction");
UdpLog::info('begin aliexpressgatewaynoticeAction');
$payment = PayModel::getPaymentById(13);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST); //支付宝通知使用的
... ... @@ -155,7 +148,7 @@ class NoticeController extends WebAction
*/
public function alibanknoticeAction()
{
$this->log->LogInfo("begin alibanknoticeAction");
UdpLog::info('begin alibanknoticeAction');
$payment = PayModel::getPaymentById(12);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST);
... ... @@ -173,7 +166,7 @@ class NoticeController extends WebAction
*/
public function alibankreturnAction()
{
$this->log->LogInfo("begin alibanknoticeAction");
UdpLog::info('begin alibanknoticeAction');
$payment = PayModel::getPaymentById(12);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_GET);
... ... @@ -187,7 +180,7 @@ class NoticeController extends WebAction
*/
public function chinabankAction()
{
$this->log->LogInfo("begin chinabankAction");
UdpLog::info("begin chinabankAction");
$payment = PayModel::getPaymentById(4);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST);
... ... @@ -201,7 +194,7 @@ class NoticeController extends WebAction
*/
public function chinabankautorevAction()
{
$this->log->LogInfo("begin chinabankautorevAction");
UdpLog::info("begin chinabankautorevAction");
$payment = PayModel::getPaymentById(4);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST);
... ... @@ -219,7 +212,7 @@ class NoticeController extends WebAction
*/
public function tenpayAction()
{
$this->log->LogInfo("begin tenpayAction");
UdpLog::info("begin tenpayAction");
$payment = PayModel::getPaymentById(1);
$payService = PayFactory::factory($payment);
$rspParams = $payService->parseResponse($_GET); //财付通是以get方式回复的。
... ... @@ -232,7 +225,7 @@ class NoticeController extends WebAction
*/
public function shengpayreturnAction()
{
$this->log->LogInfo("begin shengpayreturnAction");
UdpLog::info("begin shengpayreturnAction");
$payment = PayModel::getPaymentById(11);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST);
... ... @@ -246,7 +239,7 @@ class NoticeController extends WebAction
*/
public function shengpaynoticeAction()
{
$this->log->LogInfo("begin shengpaynoticeAction");
UdpLog::info("begin shengpaynoticeAction");
$payment = PayModel::getPaymentById(11);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST);
... ... @@ -262,7 +255,7 @@ class NoticeController extends WebAction
*/
public function wechatcallbackAction()
{
$this->log->LogInfo("begin wechatcallbackAction");
UdpLog::info("begin wechatcallbackAction");
$callback = $this->get('callback');
$orderCode = $this->get('ordercode');
... ... @@ -277,14 +270,14 @@ class NoticeController extends WebAction
*/
public function wechatqrcodenotifyAction()
{
$this->log->LogInfo("begin wechatqrcodenotifyAction");
UdpLog::info("begin wechatqrcodenotifyAction");
$uid = $this->getUid();
if (empty($uid)) { // cookie中获取为空时再从之前保存的session中获取
$uid = $this->getSession(self::SESSION_UID_KEY);
$this->setSession(self::SESSION_UID_KEY, null);
}
$this->log->LogInfo($uid);
UdpLog::info($uid);
$notify = new PayNotifyCallBack($uid);
$notify->handle(false);
}
... ... @@ -294,7 +287,7 @@ class NoticeController extends WebAction
*/
public function wechatqrcodereturnAction()
{
$this->log->LogInfo("begin wechatqrcodereturnAction");
UdpLog::info("begin wechatqrcodereturnAction");
$dealResult = array(
'code' => 500,
'message' => '支付失败'
... ... @@ -321,7 +314,7 @@ class NoticeController extends WebAction
*/
public function unionpaywebreturnAction()
{
$this->log->LogInfo("begin unionpaywebreturnAction");
UdpLog::info("begin unionpaywebreturnAction");
$payment = PayModel::getPaymentById(25);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_REQUEST);
... ... @@ -335,7 +328,7 @@ class NoticeController extends WebAction
*/
public function unionpaywebnoticeAction()
{
$this->log->LogInfo("begin unionpaywebnoticeAction");
UdpLog::info("begin unionpaywebnoticeAction");
$payment = PayModel::getPaymentById(25);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_REQUEST);
... ... @@ -352,7 +345,7 @@ class NoticeController extends WebAction
*/
public function alimobilenoticeminiAction()
{
$this->log->LogInfo("begin alimobilenoticeminiAction");
UdpLog::info("begin alimobilenoticeminiAction");
$payment = PayModel::getPaymentById(20);
$payService = PayFactory::factory($payment);
$res = $payService->parseResponse($_POST); //支付宝通知使用的
... ... @@ -400,19 +393,17 @@ class NoticeController extends WebAction
private function payResultProc($payResult, $payment)
{
// 初始化日志
$log = $this->log;
$log->LogInfo('================开始验证登录状态============');
$log->LogInfo('================支付结果数据为============');
$log->LogInfo(var_export($payResult, true));
UdpLog::info('【支付】支付结果数据',var_export($payResult, true));
//判断是否登录
$uid = $this->getUid();
if (empty($uid)) { // cookie中获取为空时再从之前保存的session中获取
UdpLog::info('【支付】未获取到uid信息');
$uid = $this->getSession(self::SESSION_UID_KEY);
$this->setSession(self::SESSION_UID_KEY, null);
}
$log->LogInfo('================已登录,获取到用户ID============');
UdpLog::info('【支付】已获取UID信息',$uid);
$result = array(
'code' => 500,
... ... @@ -424,8 +415,7 @@ class NoticeController extends WebAction
$result = PayModel::procOrderData($uid, $payResult, $payment);
}
$log->LogInfo('================支付结果为============');
$log->LogInfo(var_export($result, true));
UdpLog::info('【支付】支付回调java接口返回结果', json_encode($result));
return $result;
}
... ...