Showing
1 changed file
with
11 additions
and
1 deletions
@@ -401,7 +401,12 @@ class PayModel | @@ -401,7 +401,12 @@ class PayModel | ||
401 | $result = array(); | 401 | $result = array(); |
402 | 402 | ||
403 | do { | 403 | do { |
404 | + // 初始化日志 | ||
405 | + $log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL); | ||
406 | + $log->LogInfo('=====[' . $orderCode . ']===开始生成微信支付二维码========'); | ||
407 | + | ||
404 | if (empty($orderCode)) { | 408 | if (empty($orderCode)) { |
409 | + $log->LogInfo('=====[' . $orderCode . ']===微信支付时,订单号为空========'); | ||
405 | $result['error'] = true; | 410 | $result['error'] = true; |
406 | $result['message'] = '订单号不能为空'; | 411 | $result['message'] = '订单号不能为空'; |
407 | break; | 412 | break; |
@@ -410,6 +415,7 @@ class PayModel | @@ -410,6 +415,7 @@ class PayModel | ||
410 | /* 判断订单信息是否存在 */ | 415 | /* 判断订单信息是否存在 */ |
411 | $orderDetail = OrderData::getOrderDetail($uid, $orderCode); | 416 | $orderDetail = OrderData::getOrderDetail($uid, $orderCode); |
412 | if (!isset($orderDetail['data']) || empty($orderDetail['data'])) { | 417 | if (!isset($orderDetail['data']) || empty($orderDetail['data'])) { |
418 | + $log->LogInfo('=====[' . $orderCode . ']===微信支付时,订单信息未查到========'); | ||
413 | $result['error'] = true; | 419 | $result['error'] = true; |
414 | $result['message'] = '没有找到该订单'; | 420 | $result['message'] = '没有找到该订单'; |
415 | break; | 421 | break; |
@@ -436,6 +442,8 @@ class PayModel | @@ -436,6 +442,8 @@ class PayModel | ||
436 | $input->SetProduct_id($orderCode); | 442 | $input->SetProduct_id($orderCode); |
437 | $notify = new WxPayNativePay(); | 443 | $notify = new WxPayNativePay(); |
438 | $payResult = $notify->GetPayUrl($input); | 444 | $payResult = $notify->GetPayUrl($input); |
445 | + $log->LogInfo('=====[' . $orderCode . ']===微信支付时,微信统一下单的返回结果为:========'); | ||
446 | + $log->LogInfo(var_export($payResult, true)); | ||
439 | 447 | ||
440 | $orderData = $orderDetail['data']; | 448 | $orderData = $orderDetail['data']; |
441 | $firstGoods = current($orderData['order_goods']); | 449 | $firstGoods = current($orderData['order_goods']); |
@@ -447,10 +455,12 @@ class PayModel | @@ -447,10 +455,12 @@ class PayModel | ||
447 | 'tellphoneNum' => $orderData['mobile'], | 455 | 'tellphoneNum' => $orderData['mobile'], |
448 | 'tradeName' => $firstGoods['product_name'], | 456 | 'tradeName' => $firstGoods['product_name'], |
449 | 'choosePayUrl' => Helpers::url('/shopping/pay', array('order_code' => $orderData['order_code'])), | 457 | 'choosePayUrl' => Helpers::url('/shopping/pay', array('order_code' => $orderData['order_code'])), |
450 | - 'qrcodeUrl' => $payResult['code_url']//$reqPars['pay_url'] // 'http://paysdk.weixin.qq.com/example/qrcode.php?data=' . $result['code_url'] | 458 | + 'qrcodeUrl' => $payResult['code_url'] // 'http://paysdk.weixin.qq.com/example/qrcode.php?data=' . $result['code_url'] |
451 | ); | 459 | ); |
452 | 460 | ||
453 | } while (false); | 461 | } while (false); |
462 | + $log->LogInfo('=====[' . $orderCode . ']===微信支付时,处理微信支付的结果为:========'); | ||
463 | + $log->LogInfo(var_export($result, true)); | ||
454 | 464 | ||
455 | return $result; | 465 | return $result; |
456 | } | 466 | } |
-
Please register or login to post a comment