stanley-king 4 rokov pred
rodič
commit
b4539061a3
35 zmenil súbory, kde vykonal 731 pridanie a 78 odobranie
  1. 58 5
      admin/control/merchant.php
  2. 2 0
      data/config/win/refill.ini.php
  3. 40 2
      data/config/xyztest/refill.ini.php
  4. 2 2
      helper/fcgi_server.php
  5. 56 0
      helper/refill/afandnew/RefillCallBack.php
  6. 11 20
      helper/refill/api/xyz/tianx/RefillPhone.php
  7. 16 0
      helper/refill/afandnew/config.php
  8. 4 6
      helper/refill/api/xyz/afand/RefillPhone.php
  9. 1 1
      helper/refill/api/xyz/afand/config.php
  10. 2 2
      helper/refill/api/xyz/afandeng/RefillPhone.php
  11. 4 4
      helper/refill/api/xyz/tianx/RefillCallBack.php
  12. 91 0
      helper/refill/api/xyz/afandnew/RefillPhone.php
  13. 0 0
      helper/refill/api/xyz/afandnew/config.php
  14. 2 2
      helper/refill/api/xyz/bjb/RefillPhone.php
  15. 2 2
      helper/refill/api/xyz/bjbnew/RefillPhone.php
  16. 2 2
      helper/refill/api/xyz/bjbyd/RefillPhone.php
  17. 52 0
      helper/refill/api/xyz/lingzh/RefillCallBack.php
  18. 118 0
      helper/refill/api/xyz/lingzh/RefillPhone.php
  19. 15 0
      helper/refill/api/xyz/lingzh/config.php
  20. 52 0
      helper/refill/api/xyz/lingzhdl/RefillCallBack.php
  21. 118 0
      helper/refill/api/xyz/lingzhdl/RefillPhone.php
  22. 15 0
      helper/refill/api/xyz/lingzhdl/config.php
  23. 2 2
      helper/refill/api/xyz/saihu/RefillOil.php
  24. 2 2
      helper/refill/api/xyz/suhcpdd/RefillOil.php
  25. 2 2
      helper/refill/api/xyz/suhctm/RefillOil.php
  26. 2 2
      helper/refill/api/xyz/tianjt/RefillOil.php
  27. 2 1
      helper/refill/api/xyz/weit/RefillPhone.php
  28. 2 2
      helper/refill/api/xyz/xc/RefillPhone.php
  29. 2 2
      helper/refill/api/xyz/zzx/RefillOil.php
  30. 6 0
      mobile/refill_afandnew.php
  31. 7 0
      mobile/refill_lingzh.php
  32. 7 0
      mobile/refill_lingzhdl.php
  33. 0 6
      mobile/refill_tianx.php
  34. 2 1
      mobile/signature.php
  35. 32 10
      test/TestRefill.php

+ 58 - 5
admin/control/merchant.php

@@ -31,7 +31,7 @@ class merchantControl extends SystemControl
             Tpl::output('merchant_name', $_GET['merchant_name']);
         }
 
-        $merchant_list = $model_merchant->getMerchantList($condition, 25, 'mchid desc');
+        $merchant_list = $model_merchant->getMerchantList($condition, 25, 'available_predeposit desc');
 
         $merchant_state_text = ['使用中', '已禁用'];
         Tpl::output('merchant_state_text', $merchant_state_text);
@@ -776,9 +776,15 @@ class merchantControl extends SystemControl
 
     public function OrderQueryOp()
     {
+<<<<<<< HEAD
         $model_vr_order = Model('vr_order');
         $condition['order_state'] = ORDER_STATE_SEND;
         $orders = $model_vr_order->getOrderList($condition);
+=======
+        $model_refill_order = Model('vr_order');
+        $condition['order_state'] = ORDER_STATE_SEND;
+        $orders = $model_refill_order->getOrderList($condition);
+>>>>>>> a6ba406cb16e9d0e3722be24363c0a95891f5fd5
         if(!empty($orders)) {
             foreach ($orders as $order) {
                 $order_id = $order['order_id'];
@@ -788,6 +794,7 @@ class merchantControl extends SystemControl
         showMessage('操作成功', 'index.php?act=merchant&op=refill_order');
     }
 
+<<<<<<< HEAD
     public function mch_notifyOp()
     {
         $model_refill_order = Model('refill_order');
@@ -813,6 +820,12 @@ class merchantControl extends SystemControl
         $model_refill_order = Model('refill_order');
         $condition['refill_order.inner_status'] = 0;
 
+=======
+    public function refill_orderOp()
+    {
+        $model_refill_order = Model('refill_order');
+        $condition = [];
+>>>>>>> a6ba406cb16e9d0e3722be24363c0a95891f5fd5
         if (!empty($_GET['order_sn'])) {
             $condition['refill_order.order_sn'] = $_GET['order_sn'];
         }
@@ -825,11 +838,23 @@ class merchantControl extends SystemControl
         if (!empty($_GET['channel_name'])) {
             $condition['refill_order.channel_name'] = $_GET['channel_name'];
         }
+<<<<<<< HEAD
         if (!empty($_GET['store_id'])) {
             $condition['vr_order.store_id'] = $_GET['store_id'];
         }
         if (!empty($_GET['card_type']))
         {
+=======
+        if (!empty($_GET['ch_trade_no'])) {
+            $condition['refill_order.ch_trade_no'] = $_GET['ch_trade_no'];
+        }
+        if (!empty($_GET['card_no'])) {
+            $condition['refill_order.card_no'] = $_GET['card_no'];
+        }
+        $condition['refill_order.order_time'] = ['time', [strtotime(date("Y-m-d")), strtotime(date("Y-m-d"))]];
+        $condition['refill_order.inner_status'] = 0;
+        if (!empty($_GET['card_type'])) {
+>>>>>>> a6ba406cb16e9d0e3722be24363c0a95891f5fd5
             if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
                 $condition['refill_order.card_type'] = $_GET['card_type'];
             }
@@ -840,16 +865,20 @@ class merchantControl extends SystemControl
                 $condition['refill_order.card_type'] = ['in' , ['4' , '5' , '6']];
             }
         }
+<<<<<<< HEAD
         if (!empty($_GET['ch_trade_no'])) {
             $condition['refill_order.ch_trade_no'] = $_GET['ch_trade_no'];
         }
         if (!empty($_GET['card_no'])) {
             $condition['refill_order.card_no'] = $_GET['card_no'];
         }
+=======
+>>>>>>> a6ba406cb16e9d0e3722be24363c0a95891f5fd5
         if (in_array($_GET['refill_amount'], ['10', '20', '30', '50' , '100', '200', '300', '500' , '1000', '20000'])) {
             $condition['refill_order.refill_amount'] = $_GET['refill_amount'];
         }
 
+<<<<<<< HEAD
         $start_unixtime = strtotime($_GET['query_start_time']);
         $end_unixtime   = strtotime($_GET['query_end_time']);
         if ($start_unixtime >0) {
@@ -857,6 +886,14 @@ class merchantControl extends SystemControl
                 $end_unixtime = time();
             }
             $condition['refill_order.order_time'] = [ ['egt', $start_unixtime] , ['lt', $end_unixtime] , 'and'];
+=======
+        $if_start_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $_GET['query_start_time']);
+        $if_end_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $_GET['query_end_time']);
+        $start_unixtime = $if_start_time ? strtotime($_GET['query_start_time']) : null;
+        $end_unixtime = $if_end_time ? strtotime($_GET['query_end_time']) : null;
+        if ($start_unixtime || $end_unixtime) {
+            $condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
+>>>>>>> a6ba406cb16e9d0e3722be24363c0a95891f5fd5
         }
 
         if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40']))
@@ -886,14 +923,14 @@ class merchantControl extends SystemControl
             $order_list[$order_id]['mch_name'] = $merchants[$order_info['mchid']]['company_name'];
             if($order_info['notify_time'] > 0)
             {
-                $order_list[$order_id]['diff_time_text'] = $this->elapse_time($order_info['notify_time'] - $order_info['order_time']);
-                $order_list[$order_id]['diff_time'] = $order_info['notify_time'] - $order_info['order_time'];
+                $diff_time = $order_info['notify_time'] - $order_info['order_time'];
             }
             else
             {
-                $order_list[$order_id]['diff_time_text'] = $this->elapse_time(time() - $order_info['order_time']);
-                $order_list[$order_id]['diff_time'] = time() - $order_info['order_time'];
+                $diff_time = time() - $order_info['order_time'];
             }
+            $order_list[$order_id]['diff_time_text'] = $this->elapse_time($diff_time);
+            $order_list[$order_id]['diff_time'] = $diff_time;
         }
         $provider_list = Model('')->table('refill_provider,store')->field('refill_provider.*,store.store_name')->join('inner')->on('store.store_id=refill_provider.store_id')->limit(100)->select();
 
@@ -1340,6 +1377,7 @@ class merchantControl extends SystemControl
 
     private function refill_stat($condition)
     {
+<<<<<<< HEAD
         $stat_order = function ($condition) {
             $stat = Model('')->table('refill_order,vr_order')->join('inner')
                 ->on('refill_order.order_id=vr_order.order_id')
@@ -1409,5 +1447,20 @@ class merchantControl extends SystemControl
         Tpl::output('provider_list', $provider_list);
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::showpage('refill.order.send.index');
+=======
+        $condition['order_state'] = ORDER_STATE_SEND;
+
+        $condition['refill_order.order_time'] = ['between', [(time() - 3600) , (time() - 1800)]];
+        $half_stats = Model('')->table('refill_order,vr_order')->join('inner')
+            ->on('refill_order.order_id=vr_order.order_id')
+            ->field('count(*) as order_count ')
+            ->where($condition)->find();
+        $condition['refill_order.order_time'] = ['lt', (time() - 3600)];
+        $hour_stats = Model('')->table('refill_order,vr_order')->join('inner')
+            ->on('refill_order.order_id=vr_order.order_id')
+            ->field('count(*) as order_count ')
+            ->where($condition)->find();
+        return ['half_count' => $half_stats['order_count'] , 'hour_count' => $hour_stats['order_count']];
+>>>>>>> a6ba406cb16e9d0e3722be24363c0a95891f5fd5
     }
 }

+ 2 - 0
data/config/win/refill.ini.php

@@ -1,4 +1,5 @@
 <?php
+global $config;
 
 $config['refill_oil_specs'] = [100 , 200 , 500 , 1000 , 2000];
 $config['refill_phone_specs'] = [10 , 20 , 30 , 50 , 100 , 200 , 300 , 500];
@@ -139,4 +140,5 @@ $phone_providers = [
     ['name' => 'wuchen', 'cfg' => $wuchen_phone, 'opened' => true, 'sort' => 1],
     ['name' => 'yibao', 'cfg' => $yibaoyd, 'opened' => true, 'sort' => 1],
 ];
+
 $config['phone_providers'] = $phone_providers;

+ 40 - 2
data/config/xyztest/refill.ini.php

@@ -134,6 +134,31 @@ $bjb_phone = ['name' => 'bjb', 'store_id' => 12,
         500 => [['goods_id' => 6328, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
         ],
     'official_sn' => true, 'refill_type' => 'api'];
+$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,
+    'amount' => [
+        10 => [['goods_id' => 6389, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 6391, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 6392, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 6393, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 6394, 'price' => 190.60, 'quality' => 1, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 6395, 'price' => 285.90, 'quality' => 1, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 6396, 'price' => 476.50, 'quality' => 1, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$lingzhdl_phone = ['name' => 'lingzhdl', 'store_id' => 29, 'card_type' => ['chinaunicom', 'chinatelecom'],
+    'amount' => [
+        10 => [['goods_id' => 6397, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6398, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6399, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6400, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6401, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6402, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6403, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6404, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
 
 $bjbyd_phone = ['name' => 'bjbyd', 'store_id' => 24,
     'amount' => [
@@ -144,6 +169,17 @@ $bjbyd_phone = ['name' => 'bjbyd', 'store_id' => 24,
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$afandnew_phone = ['name' => 'afandnew', 'store_id' => 25,
+    'amount' => [
+        30 => [['goods_id' => 6386, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 6371, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 6372, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 6373, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 6387, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 6388, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile']]
+    ],
+    'refill_type' => 'api'];
+
 $tianx_phone = ['name' => 'tianx', 'store_id' => 25,
     'amount' => [
         50 => [['goods_id' => 6371, 'price' => 46.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
@@ -212,11 +248,13 @@ $phone_providers = [
     ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
     ['name' => 'bjb', 'cfg' => $bjb_phone],
     ['name' => 'bjbyd', 'cfg' => $bjbyd_phone],
-    ['name' => 'tianx', 'cfg' => $tianx_phone],
     ['name' => 'yifa', 'cfg' => $yifa_phone],
     ['name' => 'jiec', 'cfg' => $jiec_phone],
     ['name' => 'weit', 'cfg' => $weit_phone],
     ['name' => 'afand', 'cfg' => $afand_phone],
-    ['name' => 'afandeng', 'cfg' => $afandeng_phone]
+    ['name' => 'afandeng', 'cfg' => $afandeng_phone],
+    ['name' => 'afandnew', 'cfg' => $afandnew_phone],
+    ['name' => 'lingzh', 'cfg' => $lingzh_phone],
+    ['name' => 'lingzhdl', 'cfg' => $lingzhdl_phone]
 ];
 $config['phone_providers'] = $phone_providers;

+ 2 - 2
helper/fcgi_server.php

@@ -31,8 +31,8 @@ class fcgi_server
             'refill_tianjt.php','refill_suhctm.php','refill_suhcpdd.php','refill_gftd.php',
             'refill_beixt.php','refill_bxtwt.php','refill_bjb.php','refill_xyz.php',
             'refill_zzx.php','refill_inner.php','refill_jiec.php','refill_yifa.php',
-            'bridge_shr.php','refill_weit.php','refill_tianx.php','refill_afand.php',
-            'refill_afandeng.php'
+            'bridge_shr.php','refill_weit.php','refill_afand.php','refill_afandeng.php',
+            'refill_afandnew.php','refill_lingzh.php','refill_lingzhdl.php'
         ];
         $path = BASE_ROOT_PATH . '/mobile/';
         $file = str_replace($path,'',$file);

+ 56 - 0
helper/refill/afandnew/RefillCallBack.php

@@ -0,0 +1,56 @@
+<?php
+
+
+namespace refill\afandnew;
+
+<<<<<<< HEAD:helper/refill/api/xyz/tianx/RefillCallBack.php
+require_once(BASE_HELPER_RAPI_PATH . '/tianx/config.php');
+=======
+require_once(BASE_HELPER_PATH . '/refill/afandnew/config.php');
+>>>>>>> a6ba406cb16e9d0e3722be24363c0a95891f5fd5:helper/refill/afandnew/RefillCallBack.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)
+    {
+        $content = $params['order_id'] . $params['out_order_id'] . config::MCHID . $params['tel'] . $params['price'] . $params['status'] . config::KEY;
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['status']);
+        $order_sn = $params['order_id'];
+        $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'];
+        
+        $data['official_sn'] = strtolower($params['out_order_id']) == 'null' ? '' : $params['out_order_id'];
+
+        if ($status === 1) {
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 0) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 11 - 20
helper/refill/api/xyz/tianx/RefillPhone.php

@@ -1,8 +1,12 @@
 <?php
 
-namespace refill\tianx;
+namespace refill\afandnew;
 
+<<<<<<< HEAD:helper/refill/api/xyz/tianx/RefillPhone.php
 require_once(BASE_HELPER_RAPI_PATH . '/tianx/config.php');
+=======
+require_once(BASE_HELPER_PATH . '/refill/afandnew/config.php');
+>>>>>>> a6ba406cb16e9d0e3722be24363c0a95891f5fd5:helper/refill/afandnew/RefillPhone.php
 
 use refill;
 use Log;
@@ -18,12 +22,12 @@ class RefillPhone extends refill\IRefillPhone
     private function req_params(int $phone, int $amount, string $order_sn)
     {
         $params['tel'] = $phone;
-        $params['price'] = $order_sn;
+        $params['price'] = intval($amount);
         $params['mchid'] = config::MCHID;
-        $params['orderid'] = $amount;
+        $params['orderid'] = $order_sn;
         $params['notify'] = config::NOTIFY_URL;
-        $params['teltype'] = $this->phone_type($phone);
-        $params['timeout'] = 180;
+        $params['teltype'] = 0;
+        $params['timeout'] = 300;
         $params['time'] = time();
         $params['rand'] = rand(100000,999999);
 
@@ -63,7 +67,7 @@ class RefillPhone extends refill\IRefillPhone
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
             if ($resp['code'] == 100) {
-                $order_state = '';
+                $order_state = -1;
                 if ($resp['status'] == 3) {
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resp['status'] == 4) {
@@ -71,7 +75,7 @@ class RefillPhone extends refill\IRefillPhone
                 } elseif ($resp['status'] == 2){
                     $order_state = ORDER_STATE_SEND;
                 }
-                if (empty($order_state)) {
+                if ($order_state == -1) {
                     return [false, $resp['data']];
                 }
                 return [true, $order_state];
@@ -88,17 +92,4 @@ class RefillPhone extends refill\IRefillPhone
         $content .= $params['time'] . $params['rand'] . $key;
         return md5($content);
     }
-
-    private function phone_type($phone)
-    {
-        $card_type = mtopcard\card_type($phone);
-
-        if ($card_type == mtopcard\ChinaMobileCard) {
-            return 0;
-        } elseif ($card_type == mtopcard\ChinaUnicomCard) {
-            return 1;
-        } elseif ($card_type == mtopcard\ChinaTelecomCard) {
-            return 2;
-        }
-    }
 }

+ 16 - 0
helper/refill/afandnew/config.php

@@ -0,0 +1,16 @@
+<?php
+
+
+namespace refill\afandnew;
+
+
+class config
+{
+    const ORDER_URL = 'http://121.43.132.103/api/telpay';
+    const QUERY_URL = 'http://121.43.132.103/api/telpay/query';
+
+    const MCHID = 10002;
+    const KEY = '95efedd2b18ecae8eec34284df0082da';
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/refill_afandnew.php";
+    const ExtHeaders = ['Content-Type: application/x-www-form-urlencoded'];
+}

+ 4 - 6
helper/refill/api/xyz/afand/RefillPhone.php

@@ -69,15 +69,13 @@ class RefillPhone extends refill\IRefillPhone
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
             if ($resp['code'] == 0) {
-                $order_state = '';
-                if ($resp['status'] == 3) {
+                $order_state = -1;
+                if ($resp['data']['status'] == '已支付') {
                     $order_state = ORDER_STATE_SUCCESS;
-                } elseif ($resp['status'] == 4) {
+                } elseif ($resp['data']['status'] == '支付失败') {
                     $order_state = ORDER_STATE_CANCEL;
-                } elseif ($resp['status'] == 2){
-                    $order_state = ORDER_STATE_SEND;
                 }
-                if (empty($order_state)) {
+                if ($order_state == -1) {
                     return [false, $resp['data']];
                 }
                 return [true, $order_state];

+ 1 - 1
helper/refill/api/xyz/afand/config.php

@@ -11,5 +11,5 @@ class config
 
     const MCHID = 10019;
     const KEY = '953b8e10a70ef4e85b77f09448c0e316';
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/refill_afand.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_afand.php";
 }

+ 2 - 2
helper/refill/api/xyz/afandeng/RefillPhone.php

@@ -59,7 +59,7 @@ class RefillPhone extends refill\IRefillPhone
         } else {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
-            $order_state = '';
+            $order_state = -1;
             if ($resp['code'] == 200) {
                 $order_state = ORDER_STATE_SUCCESS;
             } elseif ($resp['code'] == 604) {
@@ -67,7 +67,7 @@ class RefillPhone extends refill\IRefillPhone
             } elseif ($resp['code'] == 603){
                 $order_state = ORDER_STATE_SEND;
             }
-            if (empty($order_state)) {
+            if ($order_state == -1) {
                 return [false, $resp['msg']];
             }
             return [true, $order_state];

+ 4 - 4
helper/refill/api/xyz/tianx/RefillCallBack.php

@@ -1,9 +1,9 @@
 <?php
 
 
-namespace refill\tianx;
+namespace refill\afandnew;
 
-require_once(BASE_HELPER_RAPI_PATH . '/tianx/config.php');
+require_once(BASE_HELPER_RAPI_PATH . '/afandnew/config.php');
 
 
 use refill;
@@ -22,7 +22,7 @@ class RefillCallBack implements refill\IRefillCallBack
 
     private function sign($params)
     {
-        $content = $params['order_id'] . $params['out_order_id'] . config::MCHID . $params['tel'] . $params['price'] . $params['pay_type'] . $params['status'] . config::KEY;
+        $content = $params['order_id'] . $params['out_order_id'] . config::MCHID . $params['tel'] . $params['price'] . $params['status'] . config::KEY;
         return md5($content);
     }
 
@@ -37,9 +37,9 @@ class RefillCallBack implements refill\IRefillCallBack
         $order_id = $order_info['order_id'];
         
         $data['official_sn'] = strtolower($params['out_order_id']) == 'null' ? '' : $params['out_order_id'];
-        Model('refill_order')->edit($order_id, $data);
 
         if ($status === 1) {
+            Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false,true];
         }
         elseif ($status === 0) {

+ 91 - 0
helper/refill/api/xyz/afandnew/RefillPhone.php

@@ -0,0 +1,91 @@
+<?php
+
+namespace refill\afandnew;
+
+require_once(BASE_HELPER_RAPI_PATH . '/afandnew/config.php');
+
+use refill;
+use Log;
+use mtopcard;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['tel'] = $phone;
+        $params['price'] = intval($amount);
+        $params['mchid'] = config::MCHID;
+        $params['orderid'] = $order_sn;
+        $params['notify'] = config::NOTIFY_URL;
+        $params['teltype'] = 0;
+        $params['timeout'] = 300;
+        $params['time'] = time();
+        $params['rand'] = rand(100000,999999);
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params)
+    {
+        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST' , false , config::ExtHeaders);
+        if ($resp === false) {
+            return [false, '系统错误'];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if ($resp['code'] == 0) {
+                return [true, $resp['order_id']];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['orderid'] = $refill_info['order_sn'];
+        $params['mchid'] = config::MCHID;
+        $content = $params['mchid'] . $params['orderid'] . config::KEY;
+        $params['sign'] = md5($content);
+        $resp = http_request(config::QUERY_URL, $params , 'POST' , false , config::ExtHeaders);
+        if ($resp === false) {
+            return [false, '系统错误'];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if ($resp['code'] == 100) {
+                $order_state = -1;
+                if ($resp['status'] == 3) {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($resp['status'] == 4) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($resp['status'] == 2){
+                    $order_state = ORDER_STATE_SEND;
+                }
+                if ($order_state == -1) {
+                    return [false, $resp['data']];
+                }
+                return [true, $order_state];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content  = $params['mchid'] . $params['tel'] . $params['price'] . $params['orderid'] . $params['teltype'] . $params['timeout'] . $params['notify'];
+        $content .= $params['time'] . $params['rand'] . $key;
+        return md5($content);
+    }
+}

helper/refill/api/xyz/tianx/config.php → helper/refill/api/xyz/afandnew/config.php


+ 2 - 2
helper/refill/api/xyz/bjb/RefillPhone.php

@@ -70,7 +70,7 @@ class RefillPhone extends refill\IRefillPhone
             if(count($resp) != 3) {
                 return [false,'返回值错误'];
             }
-            $order_state = '';
+            $order_state = -1;
             if ($resp[0] == 1) {
                 $order_state = ORDER_STATE_SUCCESS;
             } elseif ($resp[0] == 2) {
@@ -78,7 +78,7 @@ class RefillPhone extends refill\IRefillPhone
             } elseif ($resp[0] == 0){
                 $order_state = ORDER_STATE_SEND;
             }
-            if (empty($order_state)) {
+            if ($order_state == -1) {
                 return [false, $resp[0]];
             }
             return [true, $order_state];

+ 2 - 2
helper/refill/api/xyz/bjbnew/RefillPhone.php

@@ -63,7 +63,7 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp,Log::DEBUG);
             $resp = $this->xmlToArray($resp);
-            $order_state = '';
+            $order_state = -1;
             if ($resp['resultno'] == 0014) {
                 $order_state = ORDER_STATE_SUCCESS;
             } elseif ($resp['resultno'] == 0015) {
@@ -71,7 +71,7 @@ class RefillPhone extends refill\IRefillPhone
             } elseif ($resp['resultno'] == 0016){
                 $order_state = ORDER_STATE_SEND;
             }
-            if (empty($order_state)) {
+            if ($order_state == -1) {
                 return [false, $resp['resultmessage']];
             }
             return [true, $order_state];

+ 2 - 2
helper/refill/api/xyz/bjbyd/RefillPhone.php

@@ -70,7 +70,7 @@ class RefillPhone extends refill\IRefillPhone
             if(count($resp) != 3) {
                 return [false,'返回值错误'];
             }
-            $order_state = '';
+            $order_state = -1;
             if ($resp[0] == 1) {
                 $order_state = ORDER_STATE_SUCCESS;
             } elseif ($resp[0] == 2) {
@@ -78,7 +78,7 @@ class RefillPhone extends refill\IRefillPhone
             } elseif ($resp[0] == 0){
                 $order_state = ORDER_STATE_SEND;
             }
-            if (empty($order_state)) {
+            if ($order_state == -1) {
                 return [false, $resp[0]];
             }
             return [true, $order_state];

+ 52 - 0
helper/refill/api/xyz/lingzh/RefillCallBack.php

@@ -0,0 +1,52 @@
+<?php
+
+
+namespace refill\lingzh;
+
+require_once(BASE_HELPER_PATH . '/refill/lingzh/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sgn'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = $params['ord'] . $params['state'] . config::KEY;
+        return strtoupper(md5($content));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['state']);
+        $order_sn = $params['ord'];
+        $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'];
+        $data['official_sn'] = $params['bz'];
+
+
+        if ($status === 1) {
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 2) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 118 - 0
helper/refill/api/xyz/lingzh/RefillPhone.php

@@ -0,0 +1,118 @@
+<?php
+namespace refill\lingzh;
+
+require_once(BASE_HELPER_PATH . '/refill/lingzh/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 ,string $order_sn)
+    {
+        $params['act'] = 'lzrefill';
+        $params['op'] = 'add_mob';
+        $params['notifyurl'] = config::NOTIFY_URL;
+        $params['usr'] = config::USR;
+        $params['mob'] = $phone;
+        $params['amt'] = $amount;
+        $params['ord'] = $order_sn;
+        $params['tim'] = date("YmdHis");
+        $params['yysid'] = 0;
+        $params['hmlx'] = 0;
+        return $params;
+    }
+
+    public function add($card_no, $card_type,$amount,$params)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no,$amount,$order_sn);
+        $sign = $this->sign($params);
+        $params['sgn'] = $sign;
+        $resp = http_request(config::PAY_PHONE_URL,$params,'GET');
+        if($resp === false) {
+            return [false,'系统错误'];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = ltrim($resp , '|');
+
+            $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
+            elseif($resp[0] == 0) {
+                return [true,''];
+            }
+            else {
+                return [false,$resp[1]];
+            }
+        }
+    }
+    public function query($refill_info)
+    {
+        $params['act'] = 'lzrefill';
+        $params['op'] = 'query';
+        $params['ord'] = $refill_info['order_sn'];
+        $params['usr'] = config::USR;
+        $content = $params['usr'] . $params['ord'] . config::KEY;
+        $params['sgn'] = strtoupper(md5($content));
+        $resp = http_request(config::QUERY_URL,$params);
+        if($resp === false) {
+            return [false,'系统错误'];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = ltrim($resp , '|');
+            $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
+            $order_state = -1;
+            if ($resp[0] == 1) {
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($resp[0] == 2) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif ($resp[0] == 0){
+                $order_state = ORDER_STATE_SEND;
+            }
+            if ($order_state == -1) {
+                return [false, $resp[0]];
+            }
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['act'] = 'lzrefill';
+        $params['op'] = 'balance';
+        $params['usr'] = config::USR;
+        $content = $params['usr'] . config::KEY;
+        $params['sgn'] = strtoupper(md5($content));
+        $resp = http_request(config::QUERY_URL,$params);
+        if($resp === false) {
+            return [false,'系统错误'];
+        }else{
+            $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
+            return [true,$resp[1]];
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content = $params['usr'] . $params['ord'] . $params['mob'] . $params['amt'] . $params['tim'] . $key;
+        return strtoupper(md5($content));
+    }
+}

+ 15 - 0
helper/refill/api/xyz/lingzh/config.php

@@ -0,0 +1,15 @@
+<?php
+
+
+namespace refill\lingzh;
+
+
+class config
+{
+    const PAY_PHONE_URL = 'http://121.89.212.167/racc/index.php';
+    const QUERY_URL= 'http://121.89.212.167/racc/index.php';
+    const USR= 9618;
+    const KEY = 'fa0a841bdb424b6e1ac76148e9fdc7a8';
+    const API_IP = NET_IP;
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/refill_lingzh.php";
+}

+ 52 - 0
helper/refill/api/xyz/lingzhdl/RefillCallBack.php

@@ -0,0 +1,52 @@
+<?php
+
+
+namespace refill\lingzhdl;
+
+require_once(BASE_HELPER_PATH . '/refill/lingzhdl/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sgn'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = $params['ord'] . $params['state'] . config::KEY;
+        return strtoupper(md5($content));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['state']);
+        $order_sn = $params['ord'];
+        $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'];
+        $data['official_sn'] = $params['bz'];
+
+
+        if ($status === 1) {
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 2) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 118 - 0
helper/refill/api/xyz/lingzhdl/RefillPhone.php

@@ -0,0 +1,118 @@
+<?php
+namespace refill\lingzhdl;
+
+require_once(BASE_HELPER_PATH . '/refill/lingzhdl/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 ,string $order_sn)
+    {
+        $params['act'] = 'lzrefill';
+        $params['op'] = 'add_mob';
+        $params['notifyurl'] = config::NOTIFY_URL;
+        $params['usr'] = config::USR;
+        $params['mob'] = $phone;
+        $params['amt'] = $amount;
+        $params['ord'] = $order_sn;
+        $params['tim'] = date("YmdHis");
+        $params['yysid'] = 0;
+        $params['hmlx'] = 0;
+        return $params;
+    }
+
+    public function add($card_no, $card_type,$amount,$params)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no,$amount,$order_sn);
+        $sign = $this->sign($params);
+        $params['sgn'] = $sign;
+        $resp = http_request(config::PAY_PHONE_URL,$params,'GET');
+        if($resp === false) {
+            return [false,'系统错误'];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = ltrim($resp , '|');
+
+            $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
+            elseif($resp[0] == 0) {
+                return [true,''];
+            }
+            else {
+                return [false,$resp[1]];
+            }
+        }
+    }
+    public function query($refill_info)
+    {
+        $params['act'] = 'lzrefill';
+        $params['op'] = 'query';
+        $params['ord'] = $refill_info['order_sn'];
+        $params['usr'] = config::USR;
+        $content = $params['usr'] . $params['ord'] . config::KEY;
+        $params['sgn'] = strtoupper(md5($content));
+        $resp = http_request(config::QUERY_URL,$params);
+        if($resp === false) {
+            return [false,'系统错误'];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = ltrim($resp , '|');
+            $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
+            $order_state = -1;
+            if ($resp[0] == 1) {
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($resp[0] == 2) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif ($resp[0] == 0){
+                $order_state = ORDER_STATE_SEND;
+            }
+            if ($order_state == -1) {
+                return [false, $resp[0]];
+            }
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['act'] = 'lzrefill';
+        $params['op'] = 'balance';
+        $params['usr'] = config::USR;
+        $content = $params['usr'] . config::KEY;
+        $params['sgn'] = strtoupper(md5($content));
+        $resp = http_request(config::QUERY_URL,$params);
+        if($resp === false) {
+            return [false,'系统错误'];
+        }else{
+            $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
+            return [true,$resp[1]];
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content = $params['usr'] . $params['ord'] . $params['mob'] . $params['amt'] . $params['tim'] . $key;
+        return strtoupper(md5($content));
+    }
+}

+ 15 - 0
helper/refill/api/xyz/lingzhdl/config.php

@@ -0,0 +1,15 @@
+<?php
+
+
+namespace refill\lingzhdl;
+
+
+class config
+{
+    const PAY_PHONE_URL = 'http://121.89.212.167/racc/index.php';
+    const QUERY_URL= 'http://121.89.212.167/racc/index.php';
+    const USR= 9618;
+    const KEY = 'fa0a841bdb424b6e1ac76148e9fdc7a8';
+    const API_IP = NET_IP;
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/refill_lingzhdl.php";
+}

+ 2 - 2
helper/refill/api/xyz/saihu/RefillOil.php

@@ -71,7 +71,7 @@ class RefillOil extends refill\IRefillOil
             $resp = json_decode($resp, true);
             if ($resp['code'] == 0)
             {
-                $order_state = '';
+                $order_state = -1;
                 if ($resp['result']['order_state'] == 1) {
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resp['result']['order_state'] == 9) {
@@ -80,7 +80,7 @@ class RefillOil extends refill\IRefillOil
                     $order_state = ORDER_STATE_SEND;
                 }
 
-                if (empty($order_state)) {
+                if ($order_state == -1) {
                     return [false, $resp['result']];
                 }
 

+ 2 - 2
helper/refill/api/xyz/suhcpdd/RefillOil.php

@@ -92,7 +92,7 @@ class RefillOil extends refill\IRefillOil
             Log::record($resp,Log::DEBUG);
             $resp = json_decode($resp,true);
             if($resp['state'] == 0) {
-                $order_state = '';
+                $order_state = -1;
                 if ($resp['status'] == 2) {
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resp['status'] == 3) {
@@ -100,7 +100,7 @@ class RefillOil extends refill\IRefillOil
                 } elseif ($resp['status'] == 0){
                     $order_state = ORDER_STATE_SEND;
                 }
-                if (empty($order_state)) {
+                if ($order_state == -1) {
                     return [false, $resp['data']];
                 }
                 return [true, $order_state];

+ 2 - 2
helper/refill/api/xyz/suhctm/RefillOil.php

@@ -92,7 +92,7 @@ class RefillOil extends refill\IRefillOil
             Log::record($resp,Log::DEBUG);
             $resp = json_decode($resp,true);
             if($resp['state'] == 0) {
-                $order_state = '';
+                $order_state = -1;
                 if ($resp['status'] == 2) {
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resp['status'] == 3) {
@@ -100,7 +100,7 @@ class RefillOil extends refill\IRefillOil
                 } elseif ($resp['status'] == 0){
                     $order_state = ORDER_STATE_SEND;
                 }
-                if (empty($order_state)) {
+                if ($order_state == -1) {
                     return [false, $resp['data']];
                 }
                 return [true, $order_state];

+ 2 - 2
helper/refill/api/xyz/tianjt/RefillOil.php

@@ -92,7 +92,7 @@ class RefillOil extends refill\IRefillOil
             Log::record($resp,Log::DEBUG);
             $resp = json_decode($resp,true);
             if($resp['state'] == 0) {
-                $order_state = '';
+                $order_state = -1;
                 if ($resp['data']['status'] == 2) {
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resp['data']['status'] == 3) {
@@ -100,7 +100,7 @@ class RefillOil extends refill\IRefillOil
                 } elseif ($resp['data']['status'] == 0){
                     $order_state = ORDER_STATE_SEND;
                 }
-                if (empty($order_state)) {
+                if ($order_state == -1) {
                     return [false, $resp['data']];
                 }
                 return [true, $order_state];

+ 2 - 1
helper/refill/api/xyz/weit/RefillPhone.php

@@ -70,6 +70,7 @@ class RefillPhone extends refill\IRefillPhone
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
             if ($resp['code'] == 0) {
+                $order_state = -1;
                 if ($resp['data']['status'] == 1) {
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resp['data']['status'] == 0) {
@@ -77,7 +78,7 @@ class RefillPhone extends refill\IRefillPhone
                 } elseif ($resp['data']['status'] == 2){
                     $order_state = ORDER_STATE_SEND;
                 }
-                if (empty($order_state)) {
+                if ($order_state == -1) {
                     return [false, $resp['data']];
                 }
                 return [true, $order_state];

+ 2 - 2
helper/refill/api/xyz/xc/RefillPhone.php

@@ -60,7 +60,7 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp,Log::DEBUG);
             $resp = json_decode($resp,true);
-            $order_state = '';
+            $order_state = -1;
             if ($resp['status'] == 1) {
                 $order_state = ORDER_STATE_SUCCESS;
             } elseif ($resp['status'] == 2) {
@@ -68,7 +68,7 @@ class RefillPhone extends refill\IRefillPhone
             } elseif ($resp['status'] == 6){
                 $order_state = ORDER_STATE_SEND;
             }
-            if (empty($order_state)) {
+            if ($order_state == -1) {
                 return [false, $resp['data']];
             }
             return [true, $order_state];

+ 2 - 2
helper/refill/api/xyz/zzx/RefillOil.php

@@ -81,7 +81,7 @@ class RefillOil extends refill\IRefillOil
         else {
             Log::record($resp,Log::DEBUG);
             $resp = json_decode($resp,true);
-            $order_state = '';
+            $order_state = -1;
             if ($resp['code'] == 0000) {
                 $order_state = ORDER_STATE_SUCCESS;
             } elseif ($resp['code'] == 0004) {
@@ -89,7 +89,7 @@ class RefillOil extends refill\IRefillOil
             } elseif ($resp['code'] == 0005){
                 $order_state = ORDER_STATE_SEND;
             }
-            if (empty($order_state)) {
+            if ($order_state == -1) {
                 return [false, $resp['msg']];
             }
             return [true, $order_state];

+ 6 - 0
mobile/refill_afandnew.php

@@ -0,0 +1,6 @@
+<?php
+
+refill\util::push_notify('afandnew',$_POST);
+
+echo ('success');
+

+ 7 - 0
mobile/refill_lingzh.php

@@ -0,0 +1,7 @@
+<?php
+
+require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+
+refill\RefillFactory::instance()->notify('lingzh',$_POST);
+
+echo ('ok');

+ 7 - 0
mobile/refill_lingzhdl.php

@@ -0,0 +1,7 @@
+<?php
+
+require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+
+refill\RefillFactory::instance()->notify('lingzhdl',$_POST);
+
+echo ('ok');

+ 0 - 6
mobile/refill_tianx.php

@@ -1,6 +0,0 @@
-<?php
-
-refill\util::push_notify('tianx',$_POST);
-
-echo ('success');
-

+ 2 - 1
mobile/signature.php

@@ -6,7 +6,8 @@
 //$timestamp = $_GET["timestamp"];
 //$nonce = $_GET["nonce"];
 //$echostr = $_GET["echostr"];
-
+$data = json_encode($_POST);
+Log::record("signature data : {$data}",Log::DEBUG);
 echo ('SUCCESS');
 
 //echo("{$echostr}");

+ 32 - 10
test/TestRefill.php

@@ -248,9 +248,9 @@ class TestRefill extends TestCase
     public function testAfandPhone()
     {
         $providers = new refill\afand\RefillPhone([]);
-        for ($i = 3; $i > 0; --$i) {
-            $resp = $providers->add(18518267398, 4, 30, ['order_sn' => $this->make_sn()]);
-        }
+//        for ($i = 3; $i > 0; --$i) {
+            $resp = $providers->query(['order_sn' => '540668612768904780']);
+//        }
     }
 
     public function testAfandengPhone()
@@ -259,6 +259,35 @@ class TestRefill extends TestCase
         $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
     }
 
+
+    public function testLingzhPhone()
+    {
+        $providers = new refill\lingzh\RefillPhone([]);
+//        $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '59911615124025101286']);
+        $resp = $providers->balance();
+//        $input['usr'] = 1;
+//        $input['ord'] = '52741615119546453690';
+//        $input['bz'] = '';
+//        $input['state'] = 2;
+//        $input['sgn'] = 'FFCBB75C307154DD306F4EC75BB69A6D';
+//        refill\RefillFactory::instance()->notify('lingzh',$input);
+    }
+
+    public function testAfandnewPhone()
+    {
+        $providers = new refill\afandnew\RefillPhone([]);
+        $resp = $providers->query(['order_sn' => '54481615109732967195']);
+//        $input['order_id'] = '54481615109732967195';
+//        $input['mchid'] = 10002;
+//        $input['tel'] = 13699279618;
+//        $input['price'] = '30.00';
+//        $input['status'] = 0;
+//        $input['out_order_id'] = '0';
+//        $input['sign'] = '26b0baef38daba7f423da23bfe56e3e0';
+//        refill\RefillFactory::instance()->notify('afandnew',$input);
+    }
+
     public function testYifaPhone()
     {
         $providers = new refill\yifa\RefillPhone([]);
@@ -272,13 +301,6 @@ class TestRefill extends TestCase
         $resp = $providers->add($cardno, 2, 500, ['order_sn' => $this->make_sn()]);
     }
 
-    public function testTianxPhone()
-    {
-        $cardno = 13699279618;
-        $providers = new refill\tianx\RefillPhone([]);
-        $resp = $providers->add($cardno, 4, 50, ['order_sn' => $this->make_sn()]);
-    }
-
     public function testWeitPhone()
     {
         $providers = new refill\weit\RefillPhone([]);