Răsfoiți Sursa

混合支付调试

moonsflyer 5 luni în urmă
părinte
comite
0009d56902

+ 2 - 1
app/common/logic/PaymentLogic.php

@@ -72,7 +72,7 @@ class PaymentLogic extends BaseLogic
                 IntegralOrder::update(['pay_way' => $payWay], ['id' => $order['id']]);
                 break;
         }
-
+        outFileLog($payWay,'prepay','$payWay');
         if($order['order_amount'] == 0) {
             PayNotifyLogic::handle($from, $order['sn']);
             return ['pay_way'=>PayEnum::BALANCE_PAY];
@@ -113,6 +113,7 @@ class PaymentLogic extends BaseLogic
                 $result = [ 'pay_way' => PayEnum::OFFLINE_PAY ];
                 break;
             case PayEnum::MIXED_PAY:
+                outFileLog('混合支付进入','prepay','$payWay');
                 // 混合支付(余额+微信)
                 $payService = (new MixedPayService($terminal, $order['user_id'] ?? null));
                 $result = $payService->pay($from, $order);

+ 3 - 3
app/common/service/pay/MixedPayService.php

@@ -67,7 +67,7 @@ class MixedPayService extends BasePayService
             if ($user->isEmpty()) {
                 throw new \Exception('用户不存在');
             }
-
+            outFileLog($user,'prepay','$user');
             $userBalance = $user['user_money']; // 用户余额
             $orderAmount = $order['order_amount']; // 订单金额
 
@@ -101,12 +101,12 @@ class MixedPayService extends BasePayService
                     '混合支付-余额部分'
                 );
             }
-
+            outFileLog(2,'prepay','2');
             // 创建微信支付订单(金额为剩余需要支付的金额)
             $wechatOrder = $order;
             $wechatOrder['order_amount'] = $wechatAmount;
             $wechatOrder['balance_amount'] = $balanceAmount; // 记录已使用的余额金额
-
+            outFileLog($wechatOrder,'prepay','$wechatOrder');
             $result = $this->wechatPayService->pay($from, $wechatOrder);
             if ($result === false) {
                 throw new \Exception('微信支付创建失败');