浏览代码

Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into rstanley

stanley-king 1 年之前
父节点
当前提交
bbe7be9005

+ 3 - 0
admin/control/refill_third.php

@@ -15,6 +15,9 @@ class refill_thirdControl extends SystemControl
         if (trim($_GET['product_name']) != '') {
             $condition['product_name'] = ['like', '%' . $_GET['product_name'] . '%'];
         }
+        if (trim($_GET['system_code']) != '') {
+            $condition['system_code'] = $_GET['system_code'];
+        }
         if (!empty($_GET['product_type'])) {
             $condition['product_type'] = $_GET['product_type'];
         }

+ 2 - 0
admin/templates/default/third.product.list.php

@@ -18,6 +18,8 @@
         <table class="tb-type1 noborder search">
             <tbody>
             <tr>
+                <th><label for="system_code">产品编码</label></th>
+                <td><input type="text" name="system_code" id="system_code" class="txt"  value="<?php echo $_GET['system_code']; ?>"></td>
                 <th><label for="product_name">产品名称</label></th>
                 <td><input type="text" name="product_name" id="product_name" class="txt"  value="<?php echo $_GET['product_name']; ?>"></td>
                 <th><label for="product_type">产品类型</label></th>

+ 14 - 0
data/config/xyz/refill.ini.php

@@ -9058,6 +9058,19 @@ $quanzhen_hf_man_phone = ['name' => 'quanzhen_hf_man', 'store_id' => 332, 'quali
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$meixu_sec_phone = ['name' => 'meixu_sec', 'store_id' => 336, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 8719, 'price' => 9.96, 'quality' => 2, 'card_type' => 'chinatelecom']],
+//        20 => [['goods_id' => 8720, 'price' => 19.92, 'quality' => 2, 'card_type' => 'chinatelecom']],
+//        30 => [['goods_id' => 8721, 'price' => 29.88, 'quality' => 2, 'card_type' => 'chinatelecom']],
+//        50 => [['goods_id' => 8722, 'price' => 49, 'quality' => 2, 'card_type' => 'chinatelecom']],
+        100 => [['goods_id' => 8723, 'price' => 100.6, 'quality' => 2, 'card_type' => 'chinatelecom']],
+        200 => [['goods_id' => 8724, 'price' => 200.8, 'quality' => 2, 'card_type' => 'chinatelecom']],
+        300 => [['goods_id' => 8725, 'price' => 301.2, 'quality' => 2, 'card_type' => 'chinatelecom']],
+        500 => [['goods_id' => 8726, 'price' => 502, 'quality' => 2, 'card_type' => 'chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -9337,6 +9350,7 @@ $phone_providers = [
     ['name' => 'tianchen_sec', 'cfg' => $tianchen_sec_phone],
     ['name' => 'quanzhen_hf', 'cfg' => $quanzhen_hf_phone],
     ['name' => 'quanzhen_hf_man', 'cfg' => $quanzhen_hf_man_phone],
+    ['name' => 'meixu_sec', 'cfg' => $meixu_sec_phone],
 ];
 $config['phone_providers'] = $phone_providers;
 

二进制
helper/refill/api/xyz/guochuang/20230605福建移动调价函.png


二进制
helper/refill/api/xyz/guochuang/20230605辽宁移动调价函.jpg


+ 2 - 2
helper/refill/api/xyz/guochuang/config.php

@@ -64,12 +64,12 @@ class config
     const Price = [
         //移动
         "4-10-2" => 10.18, "4-20-2" => 20.36, "4-30-2" => 30.18, "4-50-2" => 50.3, "4-100-2" => 100.3, "4-200-2" => 200.6, "4-300-2" => 300.9, "4-500-2" => 501.5,//天津 2
-        "4-10-6" => 9.725, "4-20-6" => 19.45, "4-30-6" => 29.175, "4-50-6" => 48.625, "4-100-6" => 97.25, "4-200-6" => 194.5, "4-300-6" => 291.75, "4-500-6" => 486.25,//辽宁 6
+        "4-10-6" => 9.72, "4-20-6" => 19.44, "4-30-6" => 29.16, "4-50-6" => 48.6, "4-100-6" => 97.2, "4-200-6" => 194.4, "4-300-6" => 291.6, "4-500-6" => 486,//辽宁 6
         "4-10-9" => 9.94, "4-20-9" => 19.88, "4-30-9" => 29.82, "4-50-9" => 49.7, "4-100-9" => 99.4,//上海 9
         "4-10-8" => 9.98, "4-20-8" => 19.96, "4-30-8" => 29.94, "4-50-8" => 49.9, "4-100-8" => 99.8, "4-200-8" => 199.6, "4-300-8" => 299.4, "4-500-8" => 499,//黑龙江 8
         "4-10-29" => 9.88, "4-20-29" => 19.76, "4-30-29" => 29.64, "4-50-29" => 49.4, "4-100-29" => 98.8, "4-200-29" => 197.6, "4-300-29" => 296.4, "4-500-29" => 494,//青海 29
         "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
-        "4-10-13" => 10, "4-20-13" => 20, "4-30-13" => 30, "4-50-13" => 50, "4-100-13" => 100, "4-200-13" => 200, "4-300-13" => 300, "4-500-13" => 500,//福建 13
+        "4-10-13" => 10.01, "4-20-13" => 20.02, "4-30-13" => 30.03, "4-50-13" => 50.05, "4-100-13" => 100.1, "4-200-13" => 200.2, "4-300-13" => 300.3, "4-500-13" => 500.5,//福建 13
         "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
         "4-10-19" => 10.005, "4-20-19" => 20.1, "4-30-19" => 30.03, "4-50-19" => 50.05, "4-100-19" => 100.1, "4-200-19" => 200.2, "4-300-19" => 300.3, "4-500-19" => 500.5,//广东 19

+ 50 - 0
helper/refill/api/xyz/meixu_sec/RefillCallBack.php

@@ -0,0 +1,50 @@
+<?php
+namespace refill\meixu_sec;
+
+require_once(BASE_HELPER_RAPI_PATH . '/meixu_sec/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$userid}&orderid={$params['orderid']}&sporderid={$params['sporderid']}&merchantsubmittime={$params['merchantsubmittime']}";
+        $content .= "&resultno={$params['resultno']}&key={$key}";
+        return strtoupper(md5($content));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['resultno']);
+        $order_sn = $params['sporderid'];
+
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false, false, ''];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === 1) {
+            $data['official_sn'] = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $official_sn = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        } elseif ($status === 9) {
+            return [$order_id, false, true, true, ''];
+        } else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 154 - 0
helper/refill/api/xyz/meixu_sec/RefillPhone.php

@@ -0,0 +1,154 @@
+<?php
+
+namespace refill\meixu_sec;
+
+require_once(BASE_HELPER_RAPI_PATH . '/meixu_sec/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, $card_type, string $order_sn)
+    {
+        $params['userid'] = config::USER_ID;
+        $params['productid'] = config::ProductId[$card_type][$amount];
+        $params['price'] = $amount;
+        $params['num'] = 1;
+        $params['mobile'] = $phone;
+        $params['spordertime'] = date("YmdHis");
+        $params['sporderid'] = $order_sn;
+        $params['back_url'] = config::NOTIFY_URL;
+        $params['paytype'] = config::operator[$card_type];
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            }
+
+            $resultno = $resp['resultno'];
+            if (in_array($resultno, ['0', '1', '2'], true)) {
+                return [true, $resp['orderid'], false];
+            } elseif (in_array($resultno, config::ERR_NOS, true)) {
+                return [false, $resultno, false];
+            } elseif (in_array($resultno, ['9999', '5006'], true)) {
+                $net_errno = "HTTP-{$resultno}";
+                return [false, $resultno, true];
+            } else {
+                //未知结果码
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resultno, true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['userid'] = config::USER_ID;
+        $params['sporderid'] = $refill_info['order_sn'];
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST');
+
+        if (empty($resp)) {
+            return [false, '网络错误',''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp))
+            {
+                return [false, '网络错误',''];
+            }
+            else
+            {
+                $offical_sn = '';
+                $resultno = $resp['resultno'];
+                if ($resultno === '1') {
+                    $offical_sn = $resp['remark1'];
+                    $updata['official_sn'] = $offical_sn;
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($resultno === '9') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($resultno, ['0','2'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($resultno === '5007' && (time() - $refill_info['commit_time'] > 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $resultno, $offical_sn];
+                }
+
+                return [true, $order_state, $offical_sn];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['userid'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$params['userid']}&key={$key}";
+        $params['sign'] = md5($content);
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST');
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['resultno'] === '1') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['resultno']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$userid}&productid={$params['productid']}&price={$params['price']}&num={$params['num']}&mobile={$params['mobile']}&spordertime={$params['spordertime']}";
+        $content .= "&sporderid={$params['sporderid']}&key={$key}";
+        return md5($content);
+    }
+
+    public function xmlToArray($xml)
+    {
+        $replace_str = str_replace(' ','','encoding="gb2312"');
+        $xml = mb_convert_encoding($xml,"UTF-8","gb2312");
+        $xml = str_replace($replace_str, "encoding='utf-8'", $xml);
+        return refill\util::xmlToArray($xml);
+    }
+}

+ 39 - 0
helper/refill/api/xyz/meixu_sec/config.php

@@ -0,0 +1,39 @@
+<?php
+
+
+namespace refill\meixu_sec;
+
+use mtopcard;
+class config
+{
+    //https://docs.qq.com/doc/DR2lpVUdGY3JEU25k
+    const ORDER_URL = 'http://123.57.216.254:9086/onlinepay.do';
+    const QUERY_URL= 'http://123.57.216.254:9086/searchpay.do';
+    const BALANCE_URL = 'http://123.57.216.254:9086/searchbalance.do';
+
+    const USER_ID= '10007644';
+    const KEY = 'Bme6aKfAe8FMQBsEz8E5rDsNKRKPjDK5';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_meixu_sec.php";
+    const operator = [
+        mtopcard\ChinaMobileCard  => 'yd',
+        mtopcard\ChinaUnicomCard  => 'lt',
+        mtopcard\ChinaTelecomCard => 'dx'
+    ];
+    const ERR_NOS = [
+        '5001','5002','5003','5004','5005','5008','5009','5010','5011','5012'
+    ];
+    const ProductId = [
+        mtopcard\ChinaMobileCard => [
+
+        ],
+        mtopcard\ChinaUnicomCard => [
+
+        ],
+        mtopcard\ChinaTelecomCard => [
+            100 => 30000003446,
+            200 => 30000003447,
+            300 => 30000003448,
+            500 => 30000003449,
+        ],
+    ];
+}

+ 17 - 0
helper/refill/api/xyz/meixu_sec/对接文档-yezi.txt

@@ -0,0 +1,17 @@
+在线对接文档:https://www.showdoc.cc/2162749258805924
+后台登录地址:http://123.56.114.109:7080/
+登录名:GYXDQHF
+初始密码:sup123456
+
+用户编号:10007644
+密钥:Bme6aKfAe8FMQBsEz8E5rDsNKRKPjDK5
+充值地址:http://123.57.216.254:9086/onlinepay.do
+查询地址:http://123.57.216.254:9086/searchpay.do
+余额地址:http://123.57.216.254:9086/searchbalance.do
+
+对接后麻烦提供下ip白名单
+
+30000003446	全国电信电渠话费100元
+30000003447	全国电信电渠话费200元
+30000003448	全国电信电渠话费300元
+30000003449	全国电信电渠话费500元

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

@@ -35,6 +35,7 @@ class config
         "4-50-13" => 46.85, "4-100-13" => 93.7, "4-200-13" => 187.4,//福建 13
         "4-50-3" => 46.9, "4-100-3" => 93.8, "4-200-3" => 187.6,//河北 3
         "4-50-20" => 47.45, "4-100-20" => 94.9, "4-200-20" => 189.8,//广西 20
+        "4-30-31" => 28.29, "4-50-31" => 47.15, "4-100-31" => 94.3, "4-200-31" => 188.6,//新疆 31
 
         //电信
         "6-30-23" => 28.02, "6-50-23" => 46.7, "6-100-23" => 93.4, "6-200-23" => 186.8,//四川 23

+ 2 - 2
helper/refill/api/yl/guochuang/config.php

@@ -64,12 +64,12 @@ class config
     const Price = [
         //移动
         "4-10-2" => 10.18, "4-20-2" => 20.36, "4-30-2" => 30.18, "4-50-2" => 50.3, "4-100-2" => 100.3, "4-200-2" => 200.6, "4-300-2" => 300.9, "4-500-2" => 501.5,//天津 2
-        "4-10-6" => 9.725, "4-20-6" => 19.45, "4-30-6" => 29.175, "4-50-6" => 48.625, "4-100-6" => 97.25, "4-200-6" => 194.5, "4-300-6" => 291.75, "4-500-6" => 486.25,//辽宁 6
+        "4-10-6" => 9.72, "4-20-6" => 19.44, "4-30-6" => 29.16, "4-50-6" => 48.6, "4-100-6" => 97.2, "4-200-6" => 194.4, "4-300-6" => 291.6, "4-500-6" => 486,//辽宁 6
         "4-10-9" => 9.94, "4-20-9" => 19.88, "4-30-9" => 29.82, "4-50-9" => 49.7, "4-100-9" => 99.4,//上海 9
         "4-10-8" => 9.98, "4-20-8" => 19.96, "4-30-8" => 29.94, "4-50-8" => 49.9, "4-100-8" => 99.8, "4-200-8" => 199.6, "4-300-8" => 299.4, "4-500-8" => 499,//黑龙江 8
         "4-10-29" => 9.88, "4-20-29" => 19.76, "4-30-29" => 29.64, "4-50-29" => 49.4, "4-100-29" => 98.8, "4-200-29" => 197.6, "4-300-29" => 296.4, "4-500-29" => 494,//青海 29
         "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
-        "4-10-13" => 10, "4-20-13" => 20, "4-30-13" => 30, "4-50-13" => 50, "4-100-13" => 100, "4-200-13" => 200, "4-300-13" => 300, "4-500-13" => 500,//福建 13
+        "4-10-13" => 10.01, "4-20-13" => 20.02, "4-30-13" => 30.03, "4-50-13" => 50.05, "4-100-13" => 100.1, "4-200-13" => 200.2, "4-300-13" => 300.3, "4-500-13" => 500.5,//福建 13
         "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
         "4-10-19" => 10.005, "4-20-19" => 20.1, "4-30-19" => 30.03, "4-50-19" => 50.05, "4-100-19" => 100.1, "4-200-19" => 200.2, "4-300-19" => 300.3, "4-500-19" => 500.5,//广东 19

+ 1 - 0
helper/refill/api/yl/xinhengyang_fs/config.php

@@ -35,6 +35,7 @@ class config
         "4-50-13" => 46.85, "4-100-13" => 93.7, "4-200-13" => 187.4,//福建 13
         "4-50-3" => 46.9, "4-100-3" => 93.8, "4-200-3" => 187.6,//河北 3
         "4-50-20" => 47.45, "4-100-20" => 94.9, "4-200-20" => 189.8,//广西 20
+        "4-30-31" => 28.29, "4-50-31" => 47.15, "4-100-31" => 94.3, "4-200-31" => 188.6,//新疆 31
 
         //电信
         "6-30-23" => 28.02, "6-50-23" => 46.7, "6-100-23" => 93.4, "6-200-23" => 186.8,//四川 23

+ 4 - 0
mobile/callback/refill_meixu_sec.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('meixu_sec',$_POST);
+echo ('OK');

+ 5 - 0
test/TestRefill.php

@@ -3466,6 +3466,11 @@ class TestRefill extends TestCase
         $resp = $provider->balance();
     }
 
+    public function testMeixu_sec()
+    {
+        $provider = $this->getProvider('meixu_sec');
+        $resp = $provider->balance();
+    }
 
     public function testAmingjd()
     {