Kaynağa Gözat

fix third card refill_amount channel_amount value

stanley-king 3 yıl önce
ebeveyn
işleme
f9eefbe6ab
2 değiştirilmiş dosya ile 13 ekleme ve 2 silme
  1. 3 0
      helper/mtopcard/mtopcard.php
  2. 10 2
      helper/refill/RefillBase.php

+ 3 - 0
helper/mtopcard/mtopcard.php

@@ -131,6 +131,9 @@ function scard_type($card_type)
     elseif($card_type == PhoneCard) { //手机卡
         return 'phone';
     }
+    elseif($card_type == ThirdRefillCard) {
+        return 'third';
+    }
     else {
         return 'unknown';
     }

+ 10 - 2
helper/refill/RefillBase.php

@@ -334,9 +334,17 @@ class RefillBase
                     $mch_order = $order_sn;
                 }
 
+                $thrid_refill = Model('thrid_refill');
+                if($card_type == mtopcard\ThirdRefillCard) {
+                    $product = $thrid_refill->getProduct(['system_code' => $third_params['product_code']]);
+                    $refill_amount = $product['refill_amount'];
+                } else {
+                    $refill_amount = $amount;
+                }
+
                 //虚拟订单表信息扩展
                 $orderext = ['order_id' => $order_id, 'order_sn' => $order_sn, 'mchid' => $mchid,
-                    'refill_amount' => $amount, 'mch_order' => $mch_order,
+                    'refill_amount' => $refill_amount, 'mch_order' => $mch_order,
                     'idcard' => $idcard, 'card_name' => $card_name,
                     'notify_url' => $notify_url, 'channel_name' => $channel_name,
                     'mch_amount' => $mch_amount, 'channel_amount' => $price * $quantity,
@@ -346,7 +354,7 @@ class RefillBase
                 $mod_refill->add_refill($orderext);
 
                 if($card_type == mtopcard\ThirdRefillCard) {
-                    $thrid_refill = Model('thrid_refill');
+
                     $ext = ['order_id' => $order_id,
                         'order_sn' => $order_sn,
                         'account_type' => $third_params['third_card_type'],