Explorar o código

xyz yl ningying_normal update api

xiaoyu %!s(int64=2) %!d(string=hai) anos
pai
achega
ec3ed8b1e1

+ 10 - 29
helper/refill/api/xyz/ningying_normal/RefillCallBack.php

@@ -8,10 +8,8 @@ class RefillCallBack implements refill\IRefillCallBack
 {
     public function verify($params): bool
     {
-        $input = $params;
-        unset($input['sign']);
-        $sign = $this->sign($input);
-        if ($params['sign'] == $sign) {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
             return true;
         } else {
             return false;
@@ -20,42 +18,25 @@ class RefillCallBack implements refill\IRefillCallBack
 
     private function sign($params)
     {
-        $params['appSecret'] = config::APP_SECRET;
-        ksort($params);
-        $content = '';
-        foreach ($params as $key => $value) {
-            if($this->check_empty($value) === false) {
-                $content .= "{$key}={$value}&";
-            }
-        }
-        $content = rtrim($content, '&');
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
         return md5($content);
     }
 
-    private function check_empty($value)
-    {
-        if (!isset($value))
-            return true;
-        if ($value === null)
-            return true;
-        if (trim($value) === "")
-            return true;
-
-        return false;
-    }
-
     public function notify($params)
     {
-        $status = intval($params['orderStatus']);
-        $order_sn = $params['outOrderId'];
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
         $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'];
+
         if ($status === 2) {
-            $data['official_sn'] = strtolower($params['ext1']) == 'null' ? '' : $params['ext1'];
+            $data['official_sn'] = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false, true];
         } elseif ($status === 3) {

+ 55 - 69
helper/refill/api/xyz/ningying_normal/RefillPhone.php

@@ -16,13 +16,15 @@ class RefillPhone extends refill\IRefillPhone
 
     private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
     {
-        $params['appId'] = config::APP_ID;
-        $params['outOrderId'] = $order_sn;
-        $params['uuid'] = $phone;
-        $params['itemId'] = config::PRODUCT[$card_type][$amount];
-        $params['itemFace'] = $amount;
-        $params['callbackUrl'] = config::NOTIFY_URL;
-        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
         return $params;
     }
 
@@ -30,11 +32,9 @@ class RefillPhone extends refill\IRefillPhone
     {
         $order_sn = $params['order_sn'];
         $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
-        if(empty($params['itemId'])) {
-            return [false, '商品编号错误', false];
-        }
+
         $sign = $this->sign($params);
-        $params['sign'] = $sign;
+        $params['szVerifyString'] = $sign;
 
         $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
 
@@ -45,28 +45,32 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+
+            $nRtn = $resp['nRtn'];
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['code'] === '00') {
-                return [true, $resp['orderId'], false];
-            } elseif (in_array($resp['code'], config::ERRCODES, true)) {
-                return [false, $resp['msg'], false];
-            } elseif (in_array($resp['code'], ['-22', '-23', '-99'], true)) {
-                $net_errno = "HTTP-{$resp['code']}";
-                return [false, $resp['msg'], true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
             } else {
-                $net_errno = "HTTP-998";
-                return [false, $resp['msg'], true];
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
             }
         }
     }
 
     public function query($refill_info)
     {
-        $params['appId'] = config::APP_ID;
-        $params['outOrderId'] = $refill_info['order_sn'];
-        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
-        $params['sign'] = $this->sign($params);
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
 
         $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
 
@@ -80,36 +84,32 @@ class RefillPhone extends refill\IRefillPhone
             if (empty($resp)) {
                 return [false, '网络错误'];
             }
-            elseif ($resp['code'] === '00')
-            {
-                $status = $resp['orderStatus'];
-                if ($status === '2') {
-                    $updata['official_sn'] = $resp['ext1'];
-                    Model('refill_order')->edit($refill_info['order_id'], $updata);
-                    $order_state = ORDER_STATE_SUCCESS;
-                } elseif ($status === '3') {
-                    $order_state = ORDER_STATE_CANCEL;
-                } elseif ($status === '1') {
-                    $order_state = ORDER_STATE_SEND;
-                } elseif ($status === '4' && (time() - $refill_info['commit_time'] >= 600)) {
-                    $order_state = ORDER_STATE_NOEXIST;
-                } else {
-                    return [false, $resp['msg']];
-                }
-                return [true, $order_state];
-            }
-            else
-            {
-                return [false, $resp['msg']];
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $updata['official_sn'] = $resp['szRtnMsg'];
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg']];
             }
+
+            return [true, $order_state];
         }
     }
 
     public function balance()
     {
-        $params['appId'] = config::APP_ID;
-        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
-        $params['sign'] = $this->sign($params);
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
 
         $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
 
@@ -122,34 +122,20 @@ class RefillPhone extends refill\IRefillPhone
             $resp = json_decode($resp, true);
             if (empty($resp)) {
                 return [false, '网络错误'];
-            } elseif ($resp['code'] === '00') {
-                return [true, $resp['balance']];
+            } elseif ($resp['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
             } else {
-                return [false, $resp['msg']];
+                return [false, $resp['szRtnCode']];
             }
         }
     }
 
-    /**
-     * 获取毫秒级别的时间戳
-     */
-    private function get_millisecond()
-    {
-        list($usec, $sec) = explode(" ", microtime());
-        return round($usec*1000);
-    }
-
     private function sign($params)
     {
-        $params['appSecret'] = config::APP_SECRET;
-        ksort($params);
-        $content = '';
-        foreach ($params as $key => $value) {
-            if($this->check_empty($value) === false) {
-                $content .= "{$key}={$value}&";
-            }
-        }
-        $content = rtrim($content, '&');
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
         return md5($content);
     }
 }

+ 13 - 0
helper/refill/api/xyz/ningying_normal/api.txt

@@ -0,0 +1,13 @@
+正式环境:
+话费下单地址:http://39.106.91.7:10186/plat/api/old/submitorder
+查询地址:http://39.106.91.7:10186/plat/api/old/queryorder
+查询余额地址:http://39.106.91.7:10186/plat/api/old/queryBalance
+
+后台地址:http://39.106.91.7:10186/plat/index
+登陆账号:椰子
+登陆密码:123456
+
+正式ID:200006
+秘钥:78b2753d545f47f2b1f66def06dac690
+
+对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ

+ 16 - 32
helper/refill/api/xyz/ningying_normal/config.php

@@ -6,39 +6,23 @@ namespace refill\ningying_normal;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://47.97.218.21:8911/api/hf/order/submit';
-    const QUERY_URL = 'http://47.97.218.21:8911/api/order/query';
-    const BALANCE_URL = 'http://47.97.218.21:8911/api/account/balance';
+    const ORDER_URL = 'http://39.106.91.7:10186/plat/api/old/submitorder';
+    const QUERY_URL= 'http://39.106.91.7:10186/plat/api/old/queryorder';
+    const BALANCE_URL = 'http://39.106.91.7:10186/plat/api/old/queryBalance';
 
-    const APP_ID = 'wxhhe5zZhM';
-    const APP_SECRET = 'WoGltJxxUHPCEzom';
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_ningying_normal.php";
-    const PRODUCT = [
-        mtopcard\ChinaMobileCard => [
-            30  => 100001,
-            50  => 100002,
-            100 => 100003,
-            200 => 100004,
-            300 => 100005,
-            500 => 100006
-        ],
-        mtopcard\ChinaUnicomCard => [
-            30  => 100007,
-            50  => 100008,
-            100 => 100009,
-            200 => 100010,
-            300 => 100011,
-            500 => 100012
-        ],
-        mtopcard\ChinaTelecomCard => [
-            30  => 100013,
-            50  => 100014,
-            100 => 100015,
-            200 => 100016,
-            300 => 100017,
-            500 => 100018
-        ],
+    const USER_ID= '200006';
+    const KEY = '78b2753d545f47f2b1f66def06dac690';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_guitong.php";
+
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
-    const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 0 - 40
helper/refill/api/xyz/ningying_normal/开户信息.txt

@@ -1,40 +0,0 @@
-后台地址:http://47.97.218.21:8888
-帐号:低价椰子
-密码:224892
-二级密码:YNlf8961
-appId:wxhhe5zZhM
-appSecret:WoGltJxxUHPCEzom
-后台-商品列表,可查看已配置商品信息
-后台-安全中心,可配置IP白名单
-接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
-话费直充接口:http://47.97.218.21:8911/api/hf/order/submit
-通用直充接口:http://47.97.218.21:8911/api/order/submit
-卡密提取接口:http://47.97.218.21:8911/api/card/get
-查单接口接口:http://47.97.218.21:8911/api/order/query
-余额接口接口:http://47.97.218.21:8911/api/account/balance
-
-
-
-
-100001 全国移动30
-100002 全国移动50
-100003 全国移动100
-100004 全国移动200
-100005 全国移动300
-100006 全国移动500
-
-
-100007 全国联通30
-100008 全国联通50
-100009 全国联通100
-100010 全国联通200
-100011 全国联通300
-100012 全国联通500
-
-
-100013 全国电信30
-100014 全国电信50
-100015 全国电信100
-100016 全国电信200
-100017 全国电信300
-100018 全国电信500

+ 10 - 29
helper/refill/api/yl/ningying_normal/RefillCallBack.php

@@ -8,10 +8,8 @@ class RefillCallBack implements refill\IRefillCallBack
 {
     public function verify($params): bool
     {
-        $input = $params;
-        unset($input['sign']);
-        $sign = $this->sign($input);
-        if ($params['sign'] == $sign) {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
             return true;
         } else {
             return false;
@@ -20,42 +18,25 @@ class RefillCallBack implements refill\IRefillCallBack
 
     private function sign($params)
     {
-        $params['appSecret'] = config::APP_SECRET;
-        ksort($params);
-        $content = '';
-        foreach ($params as $key => $value) {
-            if($this->check_empty($value) === false) {
-                $content .= "{$key}={$value}&";
-            }
-        }
-        $content = rtrim($content, '&');
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
         return md5($content);
     }
 
-    private function check_empty($value)
-    {
-        if (!isset($value))
-            return true;
-        if ($value === null)
-            return true;
-        if (trim($value) === "")
-            return true;
-
-        return false;
-    }
-
     public function notify($params)
     {
-        $status = intval($params['orderStatus']);
-        $order_sn = $params['outOrderId'];
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
         $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'];
+
         if ($status === 2) {
-            $data['official_sn'] = strtolower($params['ext1']) == 'null' ? '' : $params['ext1'];
+            $data['official_sn'] = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false, true];
         } elseif ($status === 3) {

+ 55 - 69
helper/refill/api/yl/ningying_normal/RefillPhone.php

@@ -16,13 +16,15 @@ class RefillPhone extends refill\IRefillPhone
 
     private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
     {
-        $params['appId'] = config::APP_ID;
-        $params['outOrderId'] = $order_sn;
-        $params['uuid'] = $phone;
-        $params['itemId'] = config::PRODUCT[$card_type][$amount];
-        $params['itemFace'] = $amount;
-        $params['callbackUrl'] = config::NOTIFY_URL;
-        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
         return $params;
     }
 
@@ -30,11 +32,9 @@ class RefillPhone extends refill\IRefillPhone
     {
         $order_sn = $params['order_sn'];
         $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
-        if(empty($params['itemId'])) {
-            return [false, '商品编号错误', false];
-        }
+
         $sign = $this->sign($params);
-        $params['sign'] = $sign;
+        $params['szVerifyString'] = $sign;
 
         $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
 
@@ -45,28 +45,32 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+
+            $nRtn = $resp['nRtn'];
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['code'] === '00') {
-                return [true, $resp['orderId'], false];
-            } elseif (in_array($resp['code'], config::ERRCODES, true)) {
-                return [false, $resp['msg'], false];
-            } elseif (in_array($resp['code'], ['-22', '-23', '-99'], true)) {
-                $net_errno = "HTTP-{$resp['code']}";
-                return [false, $resp['msg'], true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
             } else {
-                $net_errno = "HTTP-998";
-                return [false, $resp['msg'], true];
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
             }
         }
     }
 
     public function query($refill_info)
     {
-        $params['appId'] = config::APP_ID;
-        $params['outOrderId'] = $refill_info['order_sn'];
-        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
-        $params['sign'] = $this->sign($params);
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
 
         $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
 
@@ -80,36 +84,32 @@ class RefillPhone extends refill\IRefillPhone
             if (empty($resp)) {
                 return [false, '网络错误'];
             }
-            elseif ($resp['code'] === '00')
-            {
-                $status = $resp['orderStatus'];
-                if ($status === '2') {
-                    $updata['official_sn'] = $resp['ext1'];
-                    Model('refill_order')->edit($refill_info['order_id'], $updata);
-                    $order_state = ORDER_STATE_SUCCESS;
-                } elseif ($status === '3') {
-                    $order_state = ORDER_STATE_CANCEL;
-                } elseif ($status === '1') {
-                    $order_state = ORDER_STATE_SEND;
-                } elseif ($status === '4' && (time() - $refill_info['commit_time'] >= 600)) {
-                    $order_state = ORDER_STATE_NOEXIST;
-                } else {
-                    return [false, $resp['msg']];
-                }
-                return [true, $order_state];
-            }
-            else
-            {
-                return [false, $resp['msg']];
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $updata['official_sn'] = $resp['szRtnMsg'];
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg']];
             }
+
+            return [true, $order_state];
         }
     }
 
     public function balance()
     {
-        $params['appId'] = config::APP_ID;
-        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
-        $params['sign'] = $this->sign($params);
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
 
         $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
 
@@ -122,34 +122,20 @@ class RefillPhone extends refill\IRefillPhone
             $resp = json_decode($resp, true);
             if (empty($resp)) {
                 return [false, '网络错误'];
-            } elseif ($resp['code'] === '00') {
-                return [true, $resp['balance']];
+            } elseif ($resp['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
             } else {
-                return [false, $resp['msg']];
+                return [false, $resp['szRtnCode']];
             }
         }
     }
 
-    /**
-     * 获取毫秒级别的时间戳
-     */
-    private function get_millisecond()
-    {
-        list($usec, $sec) = explode(" ", microtime());
-        return round($usec*1000);
-    }
-
     private function sign($params)
     {
-        $params['appSecret'] = config::APP_SECRET;
-        ksort($params);
-        $content = '';
-        foreach ($params as $key => $value) {
-            if($this->check_empty($value) === false) {
-                $content .= "{$key}={$value}&";
-            }
-        }
-        $content = rtrim($content, '&');
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
         return md5($content);
     }
 }

+ 13 - 0
helper/refill/api/yl/ningying_normal/api.txt

@@ -0,0 +1,13 @@
+正式环境:
+话费下单地址:http://39.106.91.7:10186/plat/api/old/submitorder
+查询地址:http://39.106.91.7:10186/plat/api/old/queryorder
+查询余额地址:http://39.106.91.7:10186/plat/api/old/queryBalance
+
+后台地址:http://39.106.91.7:10186/plat/index
+登陆账号:椰林
+登陆密码:123456
+
+正式ID:200007
+秘钥:a9840d38d2df4f848f586f47ee232948
+
+对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ

+ 16 - 32
helper/refill/api/yl/ningying_normal/config.php

@@ -6,39 +6,23 @@ namespace refill\ningying_normal;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://47.97.218.21:8911/api/hf/order/submit';
-    const QUERY_URL = 'http://47.97.218.21:8911/api/order/query';
-    const BALANCE_URL = 'http://47.97.218.21:8911/api/account/balance';
+    const ORDER_URL = 'http://39.106.91.7:10186/plat/api/old/submitorder';
+    const QUERY_URL= 'http://39.106.91.7:10186/plat/api/old/queryorder';
+    const BALANCE_URL = 'http://39.106.91.7:10186/plat/api/old/queryBalance';
 
-    const APP_ID = 'DFwefjmtge';
-    const APP_SECRET = 'QbXslELhRFgmwVgl';
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_ningying_normal.php";
-    const PRODUCT = [
-        mtopcard\ChinaMobileCard => [
-            30  => 100001,
-            50  => 100002,
-            100 => 100003,
-            200 => 100004,
-            300 => 100005,
-            500 => 100006
-        ],
-        mtopcard\ChinaUnicomCard => [
-            30  => 100007,
-            50  => 100008,
-            100 => 100009,
-            200 => 100010,
-            300 => 100011,
-            500 => 100012
-        ],
-        mtopcard\ChinaTelecomCard => [
-            30  => 100013,
-            50  => 100014,
-            100 => 100015,
-            200 => 100016,
-            300 => 100017,
-            500 => 100018
-        ],
+    const USER_ID= '200007';
+    const KEY = 'a9840d38d2df4f848f586f47ee232948';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_guitong.php";
+
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
-    const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 0 - 40
helper/refill/api/yl/ningying_normal/开户信息.txt

@@ -1,40 +0,0 @@
-后台地址:http://47.97.218.21:8888
-帐号:低价椰林
-密码:806254
-二级密码:jLvp4018
-appId:DFwefjmtge
-appSecret:QbXslELhRFgmwVgl
-后台-商品列表,可查看已配置商品信息
-后台-安全中心,可配置IP白名单
-接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
-话费直充接口:http://47.97.218.21:8911/api/hf/order/submit
-通用直充接口:http://47.97.218.21:8911/api/order/submit
-卡密提取接口:http://47.97.218.21:8911/api/card/get
-查单接口接口:http://47.97.218.21:8911/api/order/query
-余额接口接口:http://47.97.218.21:8911/api/account/balance
-
-
-
-
-100001 全国移动30
-100002 全国移动50
-100003 全国移动100
-100004 全国移动200
-100005 全国移动300
-100006 全国移动500
-
-
-100007 全国联通30
-100008 全国联通50
-100009 全国联通100
-100010 全国联通200
-100011 全国联通300
-100012 全国联通500
-
-
-100013 全国电信30
-100014 全国电信50
-100015 全国电信100
-100016 全国电信200
-100017 全国电信300
-100018 全国电信500

+ 4 - 4
test/TestRefill.php

@@ -1916,12 +1916,12 @@ class TestRefill extends TestCase
 
     public function testNingying_normal()
     {
-//        $provider = $this->getProvider('ningying_normal');
+        $provider = $this->getProvider('ningying_normal');
 //        $resp = $provider->balance();
-//        $resp = $provider->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
-//        $resp = $provider->query(['order_sn' => '20731646376051289638']);
+//        $resp = $provider->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
+//        $resp = $provider->query(['order_sn' => '83651658900120901860']);
 
-        $body = '{"orderId":"220304144055089955","appId":"wxhhe5zZhM","outOrderId":"20731646376051289638","sign":"c1f3622f9320c127ded0470246370bc9","orderStatus":"3","completeTime":"20220304144328","orderDesc":"\u5904\u7406\u8d85\u65f6"}';
+        $body = '{"szOrderId":"83651658900120901860","fSalePrice":"94.2","szAgentId":"200006","nFlag":"3","szVerifyString":"44fff983651dd01946c400085b9efd32","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"100"}';
         $params = json_decode($body, true);
         $provider = $this->getProvider('ningying_normal','RefillCallBack');
         $ret = $provider->verify($params);