|
@@ -18,14 +18,13 @@ require_once (WXPAY_PATH . '/lib/WxPay.Notify.php');
|
|
|
|
|
|
|
|
|
//初始化日志
|
|
|
-$log_path = BASE_ROOT_PATH . "/logs/wx-".date('Y-m-d').'.log';
|
|
|
-echo($log_path);
|
|
|
-$logHandler= new CLogFileHandler(BASE_ROOT_PATH . "/logs/wx-".date('Y-m-d').'.log');
|
|
|
-$log = wxLog::Init($logHandler, 15);
|
|
|
-
|
|
|
-if(empty($log)) {
|
|
|
- Log::record('open file error',Log::ERR);
|
|
|
-}
|
|
|
+//$log_path = BASE_ROOT_PATH . "/logs/wx-".date('Y-m-d').'.log';
|
|
|
+//$logHandler= new CLogFileHandler(BASE_ROOT_PATH . "/logs/wx-".date('Y-m-d').'.log');
|
|
|
+//$log = wxLog::Init($logHandler, 15);
|
|
|
+//
|
|
|
+//if(empty($log)) {
|
|
|
+// Log::record('open file error',Log::ERR);
|
|
|
+//}
|
|
|
|
|
|
|
|
|
//xml格式
|
|
@@ -51,25 +50,23 @@ if(empty($log)) {
|
|
|
try
|
|
|
{
|
|
|
$content = request_helper::content();
|
|
|
- wxLog::DEBUG($content ."\r\n");
|
|
|
+ //wxLog::DEBUG($content ."\r\n");
|
|
|
$result = WxPayResults::Init($content);
|
|
|
-
|
|
|
$ret_wx = array();
|
|
|
-
|
|
|
$ret_code = $result['result_code'];
|
|
|
Log::record("result_code= {$ret_code}",Log::DEBUG);
|
|
|
if($ret_code == 'SUCCESS')
|
|
|
{
|
|
|
$out_trade_no = $result['out_trade_no'];
|
|
|
$transaction_id=$result['transaction_id'];
|
|
|
- wxLog::DEBUG("out_trade_no=".$out_trade_no . " and transaction_id = " . $transaction_id);
|
|
|
+// wxLog::DEBUG("out_trade_no=".$out_trade_no . " and transaction_id = " . $transaction_id);
|
|
|
Log::record("out_trade_no={$out_trade_no} and transaction_id = {$transaction_id}",Log::DEBUG);
|
|
|
|
|
|
if($cb_info['state'] == false) {
|
|
|
- wxLog::ERROR('wxpay error 1.');
|
|
|
+// wxLog::ERROR('wxpay error 1.');
|
|
|
Log::record('wxpay error.',Log::DEBUG);
|
|
|
} else {
|
|
|
- wxLog::DEBUG('wxpay success.');
|
|
|
+// wxLog::DEBUG('wxpay success.');
|
|
|
Log::record('wxpay success.',Log::DEBUG);
|
|
|
$cb_info = app_payControl::update_order($out_trade_no,$transaction_id,'wxpay');
|
|
|
}
|
|
@@ -90,6 +87,7 @@ try
|
|
|
|
|
|
echo($xml);
|
|
|
} catch (WxPayException $e){
|
|
|
+ Log::record($e->getTraceAsString(),Log::ERR);
|
|
|
$msg = $e->errorMessage();
|
|
|
return false;
|
|
|
}
|