Przeglądaj źródła

退款金额超过在线支付金额

shish 4 lat temu
rodzic
commit
b2eeda37b2
1 zmienionych plików z 3 dodań i 5 usunięć
  1. 3 5
      biz-hd/refund/services/HdRefundService.php

+ 3 - 5
biz-hd/refund/services/HdRefundService.php

@@ -38,19 +38,17 @@ class HdRefundService extends BaseService
         //记录总的退款金额
         $order->refundPrice = $refundPrice;
         $currentTkPrice = bcadd($order->tkPrice, $refundPrice, 2);
+        if ($currentTkPrice > $order->mainPay) {
+            util::fail('退款金额超过在线支付金额');
+        }
         $order->tkPrice = $currentTkPrice;
         $order->refund = OrderClass::REFUND_YES;
         $currentActPrice = bcsub($order->actPrice, $refundPrice, 2);
-        $currentMainPay = bcsub($order->mainPay, $refundPrice, 2);
         if ($currentActPrice < 0) {
             util::fail('退款金额有问题!');
         }
-        if ($currentMainPay < 0) {
-            util::fail('退款金额有问题哦');
-        }
         $order->actPrice = $currentActPrice;
         $order->realPrice = $currentActPrice;
-        $order->mainPay = $currentMainPay;
         $order->save();
 
         $transaction_id = $order->thirdNo ?? '';