Authored by Rock Zhang

细化一些支付的日志记录

... ... @@ -113,8 +113,8 @@ class Service extends PayAbstract
* http://www.yohobuy.com/pay/notice/alipayreturn?buyer_email=tds%40smartunite.com&buyer_id=2088302294447308&exterface=create_direct_pay_by_user&is_success=T&notify_id=RqPnCoPT3K9%252Fvwbh3I7xtEV5W65QRToFQ5fPrXsVxt12e%252FExCtC1XNiKnuRwupLaVLAR&notify_time=2011-06-11+07%3A48%3A10&notify_type=trade_status_sync&out_trade_no=1061003000&payment_type=1&seller_email=shop%40yoho.cn&seller_id=2088001550230585&subject=YOHO%E5%95%86%E5%93%81&total_fee=0.01&trade_no=2011061199833830&trade_status=TRADE_SUCCESS&sign=ca1c49f58d17eaa57aac308d0ac64434&sign_type=MD5
*/
$this->log->LogInfo("===开始解析支付宝银行的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse), true);
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
if (isset($arrResponse['q'])) {
unset($arrResponse['q']);
... ...
... ... @@ -63,13 +63,13 @@ class Service extends PayAbstract
$rsp->tradeNo = $arrResponse['trade_no'];
$rsp->bankBillNo = "";
$this->log->logInfo(var_export($arrResponse, true));
$this->log->logInfo('======alimobilemini成功===');
$this->log->LogInfo(var_export($arrResponse, true));
$this->log->LogInfo('======alimobilemini成功===');
} else {
//不成功
$rsp->payResult = -1;
$this->log->logInfo(var_export($arrResponse, true));
$this->log->logInfo('======alimobilemini失败===订单号----->' . $arrResponse['out_trade_no']);
$this->log->LogInfo(var_export($arrResponse, true));
$this->log->LogInfo('======alimobilemini失败===订单号----->' . $arrResponse['out_trade_no']);
}
return $rsp;
... ...
... ... @@ -47,8 +47,8 @@ class Service extends PayAbstract
public function getPayRequestPars(Reqparams $params)
{
$this->log->LogInfo("===开始处理支付宝的请求参数===");
$this->log->logInfo("-----请求参数为---");
$this->log->logInfo(var_export($params, true));
$this->log->LogInfo("-----请求参数为---");
$this->log->LogInfo(var_export($params, true));
$baseUrl = $this->getBaseNoticeUrl($params->isTest);
// $loseTime = intval(($params->orderTime + 7200 -time())/60);
... ... @@ -101,7 +101,7 @@ class Service extends PayAbstract
'reqType' => 'get'
);
$this->log->LogInfo('----支付宝回调处理结果为----');
$this->log->LogInfo('----支付宝请求处理结果为----');
$this->log->LogInfo(var_export($result, true));
return $result;
... ... @@ -113,19 +113,19 @@ class Service extends PayAbstract
* http://www.yohobuy.com/pay/notice/alipayreturn?buyer_email=tds%40smartunite.com&buyer_id=2088302294447308&exterface=create_direct_pay_by_user&is_success=T&notify_id=RqPnCoPT3K9%252Fvwbh3I7xtEV5W65QRToFQ5fPrXsVxt12e%252FExCtC1XNiKnuRwupLaVLAR&notify_time=2011-06-11+07%3A48%3A10&notify_type=trade_status_sync&out_trade_no=1061003000&payment_type=1&seller_email=shop%40yoho.cn&seller_id=2088001550230585&subject=YOHO%E5%95%86%E5%93%81&total_fee=0.01&trade_no=2011061199833830&trade_status=TRADE_SUCCESS&sign=ca1c49f58d17eaa57aac308d0ac64434&sign_type=MD5
*/
$this->log->LogInfo("===开始解析支付宝的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse, true));
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
if (isset($arrResponse['q'])) {
unset($arrResponse['q']);
}
$rsp = new Rspparams();
if (!$this->checkResponse($arrResponse)) {
$this->log->logInfo("-----支付宝回调参数验证签名失败---");
$this->log->LogInfo("-----支付宝回调参数验证签名失败---");
//验证不成功
$rsp->payResult = -1;
} else {
$this->log->logInfo("-----支付宝回调参数验证签名成功---");
$this->log->LogInfo("-----支付宝回调参数验证签名成功---");
$rsp->bankName = "";
$outTradeNo = $arrResponse["out_trade_no"];
$rsp->orderCode = $outTradeNo;
... ... @@ -138,6 +138,10 @@ class Service extends PayAbstract
$rsp->tradeNo = $arrResponse['trade_no'];
$rsp->bankBillNo = "";
}
$this->log->LogInfo("-----解析支付宝回调参数的结果为---");
$this->log->LogInfo(var_export($rsp, true));
return $rsp;
}
... ...
... ... @@ -68,16 +68,16 @@ class Service extends PayAbstract
public function parseResponse(array $arrResponse)
{
$this->log->LogInfo("===开始处理通联支付的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse, true));
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
$rsp = new Rspparams();
if (!$this->checkResponse($arrResponse)) {
$this->log->logInfo("-----验证通联支付回调参数失败---");
$this->log->LogInfo("-----验证通联支付回调参数失败---");
$rsp->payResult = -1;
} else {
$this->log->logInfo("-----验证通联支付回调参数成功---");
$this->log->LogInfo("-----验证通联支付回调参数成功---");
$rsp->bankName = "";
$rsp->orderCode = $arrResponse["orderNo"];
... ...
... ... @@ -32,8 +32,8 @@ class Service extends PayAbstract
{
$this->log->LogInfo("===开始处理盛付通的请求参数===");
$this->log->logInfo("-----请求参数为---");
$this->log->logInfo(var_export($params, true));
$this->log->LogInfo("-----请求参数为---");
$this->log->LogInfo(var_export($params, true));
$bankCode = $params->paymentParameter == 'platform' ? '' : $params->paymentParameter;
$baseUrl = $this->getBaseNoticeUrl($params->isTest);
... ... @@ -109,17 +109,17 @@ class Service extends PayAbstract
function parseResponse(Array $arrResponse)
{
$this->log->LogInfo("===开始处理盛付通的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse, true));
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
$rsp = new Rspparams();
if (!$this->checkResponse($arrResponse)) {
$this->log->logInfo("-----验证盛付通回调参数失败---");
$this->log->LogInfo("-----验证盛付通回调参数失败---");
//验证不成功
$rsp->payResult = -1;
} else {
$this->log->logInfo("-----验证盛付通回调参数成功---");
$this->log->LogInfo("-----验证盛付通回调参数成功---");
$rsp->bankName = "";
$rsp->orderCode = $arrResponse["OrderNo"];
... ...
... ... @@ -35,8 +35,8 @@ class Service extends PayAbstract
public function getPayRequestPars(Reqparams $params)
{
$this->log->LogInfo("===开始处理财付通的请求参数===");
$this->log->logInfo("-----请求参数为---");
$this->log->logInfo(var_export($params, true));
$this->log->LogInfo("-----请求参数为---");
$this->log->LogInfo(var_export($params, true));
parent::getPayRequestPars($params);
$baseUrl = $this->getBaseNoticeUrl($params->isTest);
... ... @@ -77,8 +77,8 @@ class Service extends PayAbstract
public function parseResponse(array $arrResponse)
{
$this->log->LogInfo("===开始处理财付通的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse, true));
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
$rsp = new Rspparams();
if (!$this->checkResponse($arrResponse)) {
... ...
... ... @@ -24,7 +24,7 @@ function sign(&$params)
$log->LogInfo("摘要sha1x16 >" . $params_sha1x16);
// 签名证书路径
$cert_path = dirname(__FILE__) . '/../' . SDK_SIGN_CERT_PATH;
$log->logInfo($cert_path);
$log->LogInfo($cert_path);
$private_key = getPrivateKey($cert_path);
// 签名
$sign_falg = openssl_sign($params_sha1x16, $signature, $private_key, OPENSSL_ALGO_SHA1);
... ...
... ... @@ -35,8 +35,8 @@ class Service extends PayAbstract
*/
public function parseResponse(array $package)
{
$this->log->logInfo("===开始解析银联支付的回调参数===");
$this->log->logInfo("===回调参数为===");
$this->log->LogInfo("===开始解析银联支付的回调参数===");
$this->log->LogInfo("===回调参数为===");
$this->log->LogInfo(var_export($package, true));
$verify = false;
... ... @@ -69,7 +69,7 @@ class Service extends PayAbstract
$responseData->payResult = -1;
}
$this->log->logInfo("===银联支付的回调参数处理结果为===");
$this->log->LogInfo("===银联支付的回调参数处理结果为===");
$this->log->LogInfo(var_export($responseData, true));
return $responseData;
... ...
... ... @@ -54,8 +54,8 @@ class Service extends PayAbstract
public function pay(array $orderInfo)
{
$this->log->LogInfo("===开始处理微信扫码支付的请求参数===");
$this->log->logInfo("-----请求参数为---");
$this->log->logInfo(var_export($orderInfo, true));
$this->log->LogInfo("-----请求参数为---");
$this->log->LogInfo(var_export($orderInfo, true));
//生成签名
$this->orderCode = $orderInfo['order_code'];
... ... @@ -85,8 +85,8 @@ class Service extends PayAbstract
);
$this->log->LogInfo("===开始处理微信扫码支付的支付地址===");
$this->log->logInfo("-----支付地址数据为---");
$this->log->logInfo(var_export($payUrlInfo, true));
$this->log->LogInfo("-----支付地址数据为---");
$this->log->LogInfo(var_export($payUrlInfo, true));
$payUrl = $payUrlInfo['pay_url'] . '?' . $payUrlInfo['pars'];
... ... @@ -107,8 +107,8 @@ class Service extends PayAbstract
$input->SetOut_trade_no($tradeNo);
$result = WxPayApi::orderQuery($input);
$this->log->logInfo("===查询微信扫码支付的结果结束,结果为===");
$this->log->logInfo(var_export($result, true));
$this->log->LogInfo("===查询微信扫码支付的结果结束,结果为===");
$this->log->LogInfo(var_export($result, true));
$rsp = new Rspparams();
// 支付成功
... ... @@ -124,10 +124,13 @@ class Service extends PayAbstract
$rsp->tradeNo = $result["out_trade_no"];
$rsp->bankBillNo = $result['bank_type'];
} else {
$this->log->logInfo("===微信扫码支付失败===");
$this->log->LogInfo("===微信扫码支付失败===");
$rsp->payResult = -1;
}
$this->log->LogInfo("===微信扫码支付回调参数解析结果为===");
$this->log->LogInfo(var_export($rsp, true));
return $rsp;
}
... ...
... ... @@ -5,12 +5,19 @@ use Shopping\PayModel;
use WebPlugin\Pay\PayFactory;
use WebPlugin\Pay\Rspparams;
use WebPlugin\Pay\weixin\PayNotifyCallBack;
use WebPlugin\PhpLog;
/**
* 支付Notice
*/
class NoticeController extends WebAction
{
// 日志等级,2表示记录信息等级的日志
const LOG_LEVEL = 2;
// 向回调通知有关调用日志
const ORDER_STATUS_LOG = '/Data/logs/pc_pay/order_status';
/**
* 支付宝后台服务器返回,主要是用于补单
*/
... ... @@ -352,9 +359,17 @@ class NoticeController extends WebAction
*/
private function payResultProc($payResult, $payment)
{
// 初始化日志
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('================开始验证登录状态============');
$log->LogInfo('================支付结果数据为============');
$log->LogInfo(var_export($payResult, true));
//判断是否登录
$uid = $this->auditJumpLogin();
$log->LogInfo('================已登录,获取到用户ID============');
$result = array(
'code' => 500,
'message' => '支付失败'
... ... @@ -365,6 +380,9 @@ class NoticeController extends WebAction
$result = PayModel::procOrderData($uid, $payResult, $payment);
}
$log->LogInfo('================支付结果为============');
$log->LogInfo(var_export($result, true));
return $result;
}
}
... ...