stanley-king пре 4 година
родитељ
комит
9d11834013

+ 1 - 1
helper/refill/api/xyz/wantong/RefillCallBack.php

@@ -36,8 +36,8 @@ class RefillCallBack implements refill\IRefillCallBack
         if (empty($order_info)) {
             return [false, false, false,false];
         }
+
         $order_id = $order_info['order_id'];
-        
         $data['official_sn'] = strtolower($params['out_order_id']) == 'null' ? '' : $params['out_order_id'];
 
         if ($status === 1) {

+ 4 - 2
helper/refill/api/xyz/wantong/RefillPhone.php

@@ -22,7 +22,7 @@ class RefillPhone extends refill\IRefillPhone
         $params['orderid'] = $order_sn;
         $params['price'] = $amount;
         $params['teltype'] = $this->phone_type($phone);
-        $params['timeout'] = 7200;
+        $params['timeout'] = config::NotifyTimeout;
         $params['notify'] = config::NOTIFY_URL;
         $params['time'] = time();
         $params['rand'] = rand(100000, 999999);
@@ -72,6 +72,7 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+
             if (empty($resp)) {
                 return [false, '系统错误'];
             }
@@ -89,6 +90,7 @@ class RefillPhone extends refill\IRefillPhone
                 } else {
                     return [false, $resp['data']];
                 }
+
                 return [true, $order_state];
             }
             else {
@@ -113,7 +115,7 @@ class RefillPhone extends refill\IRefillPhone
             return 0;
         } elseif ($card_type == mtopcard\ChinaUnicomCard) {
             return 1;
-        } elseif ($card_type == mtopcard\ChinaTelecomCard) {
+        } else { // ($card_type == mtopcard\ChinaTelecomCard)
             return 2;
         }
     }

+ 1 - 0
helper/refill/api/xyz/wantong/config.php

@@ -12,4 +12,5 @@ class config
     const MCHID = 10037;
     const KEY = '7ad5f64b90f7f02a30fbd26641195f58';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_wantong.php";
+    const NotifyTimeout = 7200;
 }