Authored by Rock Zhang

添加更多的微信支付有关的日志

... ... @@ -401,7 +401,12 @@ class PayModel
$result = array();
do {
// 初始化日志
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
$log->LogInfo('=====[' . $orderCode . ']===开始生成微信支付二维码========');
if (empty($orderCode)) {
$log->LogInfo('=====[' . $orderCode . ']===微信支付时,订单号为空========');
$result['error'] = true;
$result['message'] = '订单号不能为空';
break;
... ... @@ -410,6 +415,7 @@ class PayModel
/* 判断订单信息是否存在 */
$orderDetail = OrderData::getOrderDetail($uid, $orderCode);
if (!isset($orderDetail['data']) || empty($orderDetail['data'])) {
$log->LogInfo('=====[' . $orderCode . ']===微信支付时,订单信息未查到========');
$result['error'] = true;
$result['message'] = '没有找到该订单';
break;
... ... @@ -436,6 +442,8 @@ class PayModel
$input->SetProduct_id($orderCode);
$notify = new WxPayNativePay();
$payResult = $notify->GetPayUrl($input);
$log->LogInfo('=====[' . $orderCode . ']===微信支付时,微信统一下单的返回结果为:========');
$log->LogInfo(var_export($payResult, true));
$orderData = $orderDetail['data'];
$firstGoods = current($orderData['order_goods']);
... ... @@ -447,10 +455,12 @@ class PayModel
'tellphoneNum' => $orderData['mobile'],
'tradeName' => $firstGoods['product_name'],
'choosePayUrl' => Helpers::url('/shopping/pay', array('order_code' => $orderData['order_code'])),
'qrcodeUrl' => $payResult['code_url']//$reqPars['pay_url'] // 'http://paysdk.weixin.qq.com/example/qrcode.php?data=' . $result['code_url']
'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));
return $result;
}
... ...