stanley-king 4 년 전
부모
커밋
230c700fc7

+ 3 - 4
helper/refill/api/lingzh/feiniao/RefillCallBack.php

@@ -5,7 +5,6 @@ namespace refill\feiniao;
 
 require_once(BASE_HELPER_RAPI_PATH . '/feiniao/config.php');
 
-
 use refill;
 
 class RefillCallBack implements refill\IRefillCallBack
@@ -22,10 +21,10 @@ class RefillCallBack implements refill\IRefillCallBack
 
     private function sign($params)
     {
-        $content  = $params['result'] . $params['msg'];
-        if(is_null($params['order'])) {
+        $content = $params['result'] . $params['msg'];
+        if (is_null($params['order'])) {
             $content .= "null";
-        }else{
+        } else {
             $content .= $params['order'];
         }
         $content .= $params['phone_no'] . $params['amount'] . $params['op_no'] . $params['settle'] . config::KEY;

+ 15 - 6
helper/refill/api/lingzh/feiniao/RefillPhone.php

@@ -34,7 +34,9 @@ class RefillPhone extends refill\IRefillPhone
         $resp = http_request(config::ORDER_URL, $params);
         if ($resp === false) {
             return [false, '系统错误', true];
-        } else {
+        }
+        else
+        {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
             if ($resp['result'] == 'SUCCESS') {
@@ -55,12 +57,14 @@ class RefillPhone extends refill\IRefillPhone
         $resp = http_request(config::QUERY_URL, $params);
         if ($resp === false) {
             return [false, '系统错误'];
-        } else {
+        }
+        else
+        {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
 
-            if ($resp['result'] == 'SUCCESS') {
-                $order_state = -1;
+            if ($resp['result'] == 'SUCCESS')
+            {
                 $status = $resp['msg'];
                 if ($status == '充值成功') {
                     $order_state = ORDER_STATE_SUCCESS;
@@ -70,12 +74,17 @@ class RefillPhone extends refill\IRefillPhone
                     $order_state = ORDER_STATE_CANCEL;
                 } elseif ($status == '充值中') {
                     $order_state = ORDER_STATE_SEND;
+                } else {
+                    $order_state = -1;
                 }
+
                 if ($order_state == -1) {
                     return [false, $resp['msg']];
+                } else {
+                    return [true, $order_state];
                 }
-                return [true, $order_state];
-            } else {
+            }
+            else {
                 return [false, $resp['code']['desc']];
             }
         }

+ 0 - 1
helper/refill/api/lingzh/feiniao/config.php

@@ -6,7 +6,6 @@ namespace refill\feiniao;
 
 class config
 {
-
     const ORDER_URL = 'http://api.ceslfe.com/api/order/invest';
     const QUERY_URL = 'http://api.ceslfe.com/api/order/queryStatus';
 

+ 2 - 1
helper/refill/api/xyz/afandnew/RefillCallBack.php

@@ -52,12 +52,13 @@ class RefillCallBack implements refill\IRefillCallBack
     {
         $status = intval($params['orderStatus']);
         $order_sn = $params['orderNo'];
+
         $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
         if (empty($order_info)) {
             return [false, false, false, false];
         }
-        $order_id = $order_info['order_id'];
 
+        $order_id = $order_info['order_id'];
         $data['official_sn'] = strtolower($params['carrierOrderNo']) == 'null' ? '' : $params['carrierOrderNo'];
 
         if ($status === 2) {

+ 18 - 6
helper/refill/api/xyz/afandnew/RefillPhone.php

@@ -37,7 +37,9 @@ class RefillPhone extends refill\IRefillPhone
         $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders);
         if ($resp === false) {
             return [false, '系统错误', true];
-        } else {
+        }
+        else
+        {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
             if ($resp['code'] == 200) {
@@ -57,14 +59,17 @@ class RefillPhone extends refill\IRefillPhone
         $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
         if ($resp === false) {
             return [false, '系统错误'];
-        } else {
+        }
+        else
+        {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
             if ($resp == false) {
                 return [false, '系统错误'];
             }
-            if ($resp['code'] == 200) {
-                $order_state = -1;
+
+            if ($resp['code'] == 200)
+            {
                 $data = $resp['data'];
                 if ($data['orderStatus'] == 2) {
                     $order_state = ORDER_STATE_SUCCESS;
@@ -75,11 +80,18 @@ class RefillPhone extends refill\IRefillPhone
                 } elseif ($data['orderStatus'] == 1) {
                     $order_state = ORDER_STATE_SEND;
                 }
+                else {
+                    $order_state = -1;
+                }
+
                 if ($order_state == -1) {
                     return [false, $resp['msg']];
                 }
-                return [true, $order_state];
-            } else {
+                else {
+                    return [true, $order_state];
+                }
+            }
+            else {
                 return [false, $resp['msg']];
             }
         }

+ 6 - 4
helper/refill/api/xyz/afandnew/config.php

@@ -2,6 +2,7 @@
 
 
 namespace refill\afandnew;
+use mtopcard;
 
 
 class config
@@ -11,11 +12,12 @@ class config
 
     const APP_ID = 'RC5229f3ef515e4b34adfb9aa251b5e15e';
     const KEY = '9803e5a3e4984ea4b8f847de28f22e2f';
-    const NOTIFY_URL =  BASE_SITE_URL."/mobile/refill_afandnew.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_afandnew.php";
     const ExtHeaders = ['Content-Type: application/x-www-form-urlencoded'];
+
     const ProductIDS = [
-        4 => [50 => '2110000050000', 100 => '21100000100000', 200 => '21100000200101'],
-        5 => [50 => '2310000050101', 100 => '23100000100101', 200 => '23100000200101'],
-        6 => [50 => '2210000050101', 100 => '22100000100101', 200 => '22100000200101'],
+        mtopcard\ChinaMobileCard => [50 => '2110000050000', 100 => '21100000100000', 200 => '21100000200101'],
+        mtopcard\ChinaUnicomCard => [50 => '2310000050101', 100 => '23100000100101', 200 => '23100000200101'],
+        mtopcard\ChinaTelecomCard => [50 => '2210000050101', 100 => '22100000100101', 200 => '22100000200101'],
     ];
 }