xiaoyu 1 jaar geleden
bovenliggende
commit
8edb61eda5
57 gewijzigde bestanden met toevoegingen van 1005 en 228 verwijderingen
  1. 5 0
      admin/config/config.ini.php
  2. 30 2
      data/config/xyz/refill.ini.php
  3. 16 16
      data/config/yl/refill.ini.php
  4. 8 8
      data/config/zy/refill.ini.php
  5. 53 0
      data/logic/queue.logic.php
  6. 5 5
      helper/mtopcard/mtopcard.php
  7. 1 0
      helper/mtopcard/open_query.php
  8. BIN
      helper/refill/api/xyz/bier_fs/20230614天津电信调价函.png
  9. 1 1
      helper/refill/api/xyz/bier_fs/config.php
  10. 3 42
      helper/refill/api/xyz/by_online/RefillPhone.php
  11. 13 24
      helper/refill/api/xyz/by_online/hnyd.php
  12. BIN
      helper/refill/api/xyz/dezhi_fs/20230613移动江苏贵州福建云南-电信广东四川新疆江苏调价函.png
  13. BIN
      helper/refill/api/xyz/dezhi_fs/20230614新疆移动调价函.jpg
  14. BIN
      helper/refill/api/xyz/dezhi_fs/20230614江苏电信调价函.jpg
  15. 9 9
      helper/refill/api/xyz/dezhi_fs/config.php
  16. BIN
      helper/refill/api/xyz/feimingyu_fs/20230613四川电信调价函.jpg
  17. 17 1
      helper/refill/api/xyz/feimingyu_fs/config.php
  18. 13 0
      helper/refill/api/xyz/feimingyu_fs/对接文档-yezi.txt
  19. BIN
      helper/refill/api/xyz/guochuang/20230614辽宁移动调价函.jpg
  20. 1 1
      helper/refill/api/xyz/guochuang/config.php
  21. 10 9
      helper/refill/api/xyz/huiyuan/RefillCallBack.php
  22. 3 0
      helper/refill/api/xyz/huiyuan/RefillPhone.php
  23. 3 0
      helper/refill/api/xyz/huiyuan/api.txt
  24. 15 0
      helper/refill/api/xyz/piaoyi_oil/API信息.txt
  25. 69 0
      helper/refill/api/xyz/piaoyi_oil/RefillCallBack.php
  26. 187 0
      helper/refill/api/xyz/piaoyi_oil/RefillPhone.php
  27. 17 0
      helper/refill/api/xyz/piaoyi_oil/config.php
  28. BIN
      helper/refill/api/xyz/piaoyi_oil/产品编码.xlsx
  29. BIN
      helper/refill/api/xyz/qianqian_fs/20230614天津电信调价函.png
  30. 1 1
      helper/refill/api/xyz/qianqian_fs/config.php
  31. 50 0
      helper/refill/api/xyz/qiantu/RefillCallBack.php
  32. 157 0
      helper/refill/api/xyz/qiantu/RefillPhone.php
  33. 24 0
      helper/refill/api/xyz/qiantu/config.php
  34. 6 0
      helper/refill/api/xyz/qiantu/对接文档-yezi.txt
  35. BIN
      helper/refill/api/xyz/qiantu/通信充值接口.doc
  36. 39 0
      helper/refill/api/xyz/tongka_fetch/RefillCallBack.php
  37. 61 0
      helper/refill/api/xyz/tongka_fetch/RefillPhone.php
  38. 20 0
      helper/refill/api/xyz/tongka_fetch/config.php
  39. 32 31
      helper/refill/api/xyz/yanhao/RefillPhone.php
  40. 1 1
      helper/refill/api/yl/bier_fs/config.php
  41. 9 9
      helper/refill/api/yl/dezhi_fs/config.php
  42. 17 1
      helper/refill/api/yl/feimingyu_fs/config.php
  43. 1 1
      helper/refill/api/yl/guochuang/config.php
  44. 1 1
      helper/refill/api/yl/qianqian_fs/config.php
  45. 6 2
      helper/refill/api/zy/by_online_cb/RefillCallBack.php
  46. 1 2
      helper/refill/api/zy/by_online_cb/RefillPhone.php
  47. 13 24
      helper/refill/api/zy/by_online_cb/hnyd.php
  48. 1 1
      helper/refill/api/zy/by_online_kami_cb/RefillCallBack.php
  49. 1 2
      helper/refill/api/zy/by_online_kami_cb/RefillPhone.php
  50. 13 24
      helper/refill/api/zy/by_online_kami_cb/hnyd.php
  51. 1 0
      helper/refill/util.php
  52. 6 0
      mobile/callback/refill_piaoyi_oil.php
  53. 4 0
      mobile/callback/refill_qiantu.php
  54. 1 1
      rdispatcher/proxy.php
  55. 20 3
      test/TestCardNo.php
  56. 30 4
      test/TestRefill.php
  57. 10 2
      test/TestRefund.php

+ 5 - 0
admin/config/config.ini.php

@@ -54,6 +54,11 @@ elseif(defined('COMPANY_NAME') && COMPANY_NAME === 'ZY_COMPANY')
         '飞鸢招行',
         '飞鸢民生银行'
     ];
+
+    $config['test_mchid'] = [
+
+    ];
+
     $config['WEB_COMPANY_NAME'] = '北京榜样在线科技有限公司';
 }
 else

+ 30 - 2
data/config/xyz/refill.ini.php

@@ -9004,8 +9004,8 @@ $guoyyantyd_phone = ['name' => 'guoyyantyd', 'store_id' => 329, 'qualitys' => '3
         50 => [['goods_id' => 8679, 'price' => 50.15, 'quality' => 3, 'card_type' => 'chinamobile']],
         100 => [['goods_id' => 8680, 'price' => 100.2, 'quality' => 3, 'card_type' => 'chinamobile']],
         200 => [['goods_id' => 8681, 'price' => 200.4, 'quality' => 3, 'card_type' => 'chinamobile']],
-//        300 => [['goods_id' => 8682, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 8683, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        300 => [['goods_id' => 8682, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 8683, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -9106,6 +9106,19 @@ $tianchen_trd_phone = ['name' => 'tianchen_trd', 'store_id' => 337, 'qualitys' =
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$qiantu_phone = ['name' => 'qiantu', 'store_id' => 342, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 8742, 'price' => 10.013, 'quality' => 2, 'card_type' => 'chinamobile']],
+//        20 => [['goods_id' => 8743, 'price' => 20.026, 'quality' => 2, 'card_type' => 'chinamobile']],
+//        30 => [['goods_id' => 8744, 'price' => 30.039, 'quality' => 2, 'card_type' => 'chinamobile']],
+//        50 => [['goods_id' => 8745, 'price' => 50.065, 'quality' => 2, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 8746, 'price' => 100.13, 'quality' => 2, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 8747, 'price' => 200.26, 'quality' => 2, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 8748, 'price' => 300.39, 'quality' => 2, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 8749, 'price' => 500.65, 'quality' => 2, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -9387,6 +9400,7 @@ $phone_providers = [
     ['name' => 'quanzhen_hf_man', 'cfg' => $quanzhen_hf_man_phone],
     ['name' => 'meixu_sec', 'cfg' => $meixu_sec_phone],
     ['name' => 'tianchen_trd', 'cfg' => $tianchen_trd_phone],
+    ['name' => 'qiantu', 'cfg' => $qiantu_phone],
 ];
 $config['phone_providers'] = $phone_providers;
 
@@ -9524,6 +9538,18 @@ $shuzishijie = ['name' => 'shuzishijie', 'store_id' => 340, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$piaoyi_oil = ['name' => 'piaoyi_oil', 'store_id' => 341, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 8741, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$tongka_fetch = ['name' => 'tongka_fetch', 'store_id' => 343, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 8750, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
     ['name' => 'jumithird', 'cfg' => $jumithird],
@@ -9547,6 +9573,8 @@ $third_providers = [
     ['name' => 'xinde', 'cfg' => $xinde],
     ['name' => 'xiecheng', 'cfg' => $xiecheng],
     ['name' => 'shuzishijie', 'cfg' => $shuzishijie],
+    ['name' => 'piaoyi_oil', 'cfg' => $piaoyi_oil],
+    ['name' => 'tongka_fetch', 'cfg' => $tongka_fetch],
 ];
 $config['third_providers'] = $third_providers;
 

+ 16 - 16
data/config/yl/refill.ini.php

@@ -7330,27 +7330,27 @@ $youjunyinys_phone = ['name' => 'youjunyinys', 'store_id' => 275, 'qualitys' =>
 
 $youjuntf_phone = ['name' => 'youjuntf', 'store_id' => 277, 'qualitys' => '3',
     'amount' => [
-        10 => [['goods_id' => 8280, 'price' => 10.3, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 8281, 'price' => 20.6, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 8282, 'price' => 30.6, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 8283, 'price' => 51, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 8284, 'price' => 102, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 8285, 'price' => 204, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        300 => [['goods_id' => 8286, 'price' => 300, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 8287, 'price' => 500, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 8280, 'price' => 10.3, 'quality' => 3, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 8281, 'price' => 20.6, 'quality' => 3, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 8282, 'price' => 30.6, 'quality' => 3, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 8283, 'price' => 51, 'quality' => 3, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 8284, 'price' => 102, 'quality' => 3, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 8285, 'price' => 204, 'quality' => 3, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 8286, 'price' => 300, 'quality' => 3, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 8287, 'price' => 500, 'quality' => 3, 'card_type' => 'chinamobile']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
 $youlaitf_phone = ['name' => 'youlaitf', 'store_id' => 278, 'qualitys' => '3',
     'amount' => [
-        10 => [['goods_id' => 8288, 'price' => 10.3, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 8289, 'price' => 20.6, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 8290, 'price' => 30.6, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 8291, 'price' => 51, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 8292, 'price' => 102, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 8293, 'price' => 204, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        300 => [['goods_id' => 8294, 'price' => 300, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 8295, 'price' => 500, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 8288, 'price' => 10.3, 'quality' => 3, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 8289, 'price' => 20.6, 'quality' => 3, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 8290, 'price' => 30.6, 'quality' => 3, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 8291, 'price' => 51, 'quality' => 3, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 8292, 'price' => 102, 'quality' => 3, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 8293, 'price' => 204, 'quality' => 3, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 8294, 'price' => 300, 'quality' => 3, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 8295, 'price' => 500, 'quality' => 3, 'card_type' => 'chinamobile']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 8 - 8
data/config/zy/refill.ini.php

@@ -1548,12 +1548,12 @@ $by_online_cb_phone = ['name' => 'by_online_cb', 'store_id' => 67, 'qualitys' =>
         200 => [
             ['goods_id' => 6810, 'price' => 200, 'quality' => 3, 'card_type' => 'chinamobile'],
         ],
-//        300 => [
-//            ['goods_id' => 6811, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-//        ],
-//        500 => [
-//            ['goods_id' => 6812, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-//        ]
+        300 => [
+            ['goods_id' => 6811, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile'],
+        ],
+        500 => [
+            ['goods_id' => 6812, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile'],
+        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1565,8 +1565,8 @@ $by_online_kami_cb_phone = ['name' => 'by_online_kami_cb', 'store_id' => 68, 'qu
         50 => [['goods_id' => 6816, 'price' => 50, 'quality' => 3, 'card_type' => 'chinamobile']],
         100 => [['goods_id' => 6817, 'price' => 100, 'quality' => 3, 'card_type' => 'chinamobile']],
         200 => [['goods_id' => 6818, 'price' => 200, 'quality' => 3, 'card_type' => 'chinamobile']],
-//        300 => [['goods_id' => 6819, 'price' => 300, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        500 => [['goods_id' => 6820, 'price' => 500, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        300 => [['goods_id' => 6819, 'price' => 300, 'quality' => 3, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 6820, 'price' => 500, 'quality' => 3, 'card_type' => 'chinamobile']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 53 - 0
data/logic/queue.logic.php

@@ -1686,4 +1686,57 @@ class queueLogic
             return callback(false, "$chname has not need_refund.");
         }
     }
+
+    public function onHnydCbSuccess($params)
+    {
+        $getProvider = function ($name, $type = 'RefillPhone')
+        {
+            $file = BASE_HELPER_RAPI_PATH . "/$name/{$type}.php";
+            if (!file_exists($file)) {
+                Log::record("provider api file=$file not exist.", Log::DEBUG);
+                return false;
+            } else {
+                require_once($file);
+                Log::record("file={$file} load success.", Log::DEBUG);
+            }
+
+            $class_name = "refill\\{$name}\\{$type}";
+            if (class_exists($class_name, false)) {
+                $caller = new $class_name([]);
+                return $caller;
+            }
+            else {
+                $error = "Base Error: class {$class_name} isn't exists!";
+                Log::record($error, Log::ERR);
+                return false;
+            }
+        };
+
+        $order_id = intval($params['order_id'] ?? 0);
+        if($order_id <= 0) {
+            return callback(true, "Order id is nothing.");
+        }
+
+        $mod_refill = Model('refill_order');
+        $mod_order = Model('vr_order');
+
+        $order_info = $mod_order->getOrderInfo(['order_id' => $order_id]);
+        $refill_info = $mod_refill->getOrderInfo(['order_id' => $order_id]);
+
+        if(empty($order_info) || empty($refill_info)) {
+            return callback(false, "no order");
+        }
+
+        $chname = $refill_info['channel_name'];
+        $provider = $getProvider($chname);
+
+        if (empty($provider)) {
+            return callback(false, "cannot create $chname provider.");
+        }
+
+        [$succ, $msg, $offical_sn] = $provider->query($refill_info);
+        Log::record("order_sn={$refill_info['order_sn']} offical_sn=$offical_sn");
+
+        return callback($succ, "$chname provider query $msg.");
+    }
 }

+ 5 - 5
helper/mtopcard/mtopcard.php

@@ -335,11 +335,11 @@ function is_validate($status)
 
 function valid_phone($card_no)
 {
-//    $open = new open_query();
-//    [$succ,$result] = $open->validate($card_no);
-//    if($succ) {
-//        return $result;
-//    }
+    $open = new open_query();
+    [$succ,$result] = $open->validate($card_no);
+    if($succ) {
+        return $result;
+    }
     $query = new card_query();
     return $query->validate($card_no);
 }

+ 1 - 0
helper/mtopcard/open_query.php

@@ -5,6 +5,7 @@ namespace mtopcard;
 class open_query
 {
     private const OPENAPI_URL = 'https://openapi.xyzshops.cn/api.php/CardInfo/query';
+//    private const OPENAPI_URL = 'http://39.101.140.116:8080/api.php/CardInfo/query';
     private const APPID = 'ea97586b4aa0c141e4456912f3325f7f';
     private const SECURE = '92c51d28e3405c923decf1b333cec3ce';
 

BIN
helper/refill/api/xyz/bier_fs/20230614天津电信调价函.png


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

@@ -208,7 +208,7 @@ class config
 
         "6-30-23" => 28.65, "6-50-23" => 47.75, "6-100-23" => 95.5, "6-200-23" => 191,//四川 23
         "6-30-15" => 28.65, "6-50-15" => 47.75, "6-100-15" => 95.5, "6-200-15" => 191,//山东 15
-        "6-30-2" => 28.65, "6-50-2" => 47.75, "6-100-2" => 95.5, "6-200-2" => 191,//天津 2
+        "6-30-2" => 28.65, "6-50-2" => 47.25, "6-100-2" => 94.5, "6-200-2" => 189,//天津 2
         "6-30-25" => 28.65, "6-50-25" => 47.75, "6-100-25" => 95.5, "6-200-25" => 191,//云南 25
         "6-30-19" => 28.8, "6-50-19" => 48, "6-100-19" => 96, "6-200-19" => 192,//广东 19
         "6-50-9" => 47.75, "6-100-9" => 95.5, "6-200-9" => 191,//上海 9

+ 3 - 42
helper/refill/api/xyz/by_online/RefillPhone.php

@@ -113,7 +113,8 @@ class RefillPhone extends refill\IRefillPhone
                     {
                         if ($record->canceled()) {
                             $order_state = ORDER_STATE_CANCEL;
-                        } elseif ($record->successed()) {
+                        }
+                        elseif ($record->successed()) {
                             $order_state = ORDER_STATE_SUCCESS;
                             Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $record->trade_id()]);
                         }
@@ -124,9 +125,7 @@ class RefillPhone extends refill\IRefillPhone
                         return [true, $order_state, $charge_id];
                     }
                     elseif(time() - $refill_info['commit_time'] >= 2700) {
-//                        return [true, ORDER_STATE_NOEXIST, $charge_id];
-                        //return [true, ORDER_STATE_NOEXIST, $charge_id];
-                        return [true, ORDER_STATE_CANCEL, $charge_id];
+                        return [true, ORDER_STATE_NOEXIST, $charge_id];
                     }
                     else {
                         return [false, '没有移动返回的原始数据', ''];
@@ -139,44 +138,6 @@ class RefillPhone extends refill\IRefillPhone
         }
     }
 
-//    public function query($refill_info)
-//    {
-//        $params['appId'] = config::APP_ID;
-//        $params['version'] = '1.0';
-//        $params['merchantOrderNo'] = $refill_info['order_sn'];
-//        $sign = config::sign($params);
-//        $params['sign'] = $sign;
-//
-//        $resp = http_request(config::QUERY_URL, $params);
-//
-//        if (empty($resp)) {
-//            return [false, '网络错误', ''];
-//        } else {
-//            Log::record($resp, Log::DEBUG);
-//            $resp = json_decode($resp, true);
-//            if (empty($resp)) {
-//                return [false, '网络错误'];
-//            } elseif ($resp['code'] === 1000) {
-//                $status = $resp['data']['order_status'];
-//                if ($status === 7) {
-//                    $updata['official_sn'] = $resp['data']['charge_id'];
-//                    Model('refill_order')->edit($refill_info['order_id'], $updata);
-//                    $order_state = ORDER_STATE_SUCCESS;
-//                } elseif (in_array($status, [3, 4, 6], true)) {
-//                    $order_state = ORDER_STATE_CANCEL;
-//                } elseif (in_array($status, [0, 1, 2, 5], true)) {
-//                    $order_state = ORDER_STATE_SEND;
-//                } else {
-//                    return [false, $status];
-//                }
-//
-//                return [true, $order_state];
-//            } else {
-//                return [false, $resp['msg']];
-//            }
-//        }
-//    }
-
     public function balance()
     {
         $params['appId'] = config::APP_ID;

+ 13 - 24
helper/refill/api/xyz/by_online/hnyd.php

@@ -34,22 +34,19 @@ class record
 
     public function canceled()
     {
-        $id = trim($this->mRecord['CANCEL_CHARGE_ID']);
-        if(empty($id)) {
-            return false;
-        } else {
-            return true;
-        }
+        $deal_tag = $this->deal_tag();
+        return ($deal_tag === 2);
+    }
+
+    private function deal_tag()
+    {
+        return intval($this->mRecord['DEAL_TAG'] ?? 0);
     }
 
     public function successed()
     {
-        $charge_time = $this->charge_time();
-        if(empty($this->charge_id()) or empty($this->trade_id()) or $this->fee() <= 0 or $charge_time=== false or $charge_time <= 0) {
-            return false;
-        } else {
-            return true;
-        }
+        $deal_tag = $this->deal_tag();
+        return ($deal_tag === 1);
     }
 }
 
@@ -77,9 +74,10 @@ class response
         }
         else
         {
-            $keys = [ "MONTH", "RECV_FEE", "RECV_TIME", "BIND_SERIAL_NUMBER",
-                "OUT_TRADE_ID", "GROUP_ID", "CHARGE_ID", "CANCEL_CHARGE_ID",
-                "CANCEL_TAG", "CANCEL_TIME", "REMARK", "LOCAL_SN", "CUST_NAME"];
+            $keys = ["DEAL_INFO","MONTH","DEAL_TAG","USER_ID_OUT","SERIAL_NUMBER_OUT",
+                     "DEAL_TIME","RECV_FEE","RECV_TIME","BIND_SERIAL_NUMBER","OUT_TRADE_ID",
+                     "GROUP_ID","CHARGE_ID","CANCEL_CHARGE_ID","ACCT_ID_OUT","CANCEL_TAG",
+                     "CANCEL_TIME","REMARK","LOCAL_SN","KITE_ORDER_NUM","CUST_NAME"];
 
             $item = [];
             foreach ($keys as $key) {
@@ -101,17 +99,8 @@ class response
             if($chid == $charge_id) {
                 return new record($record);
             }
-            elseif($chid === '1111111111') {
-                return new record($record);
-            }
         }
 
         return false;
     }
-
-    public function record_count()
-    {
-        $count = intval($this->mResult['X_RECORDNUM'] ?? 0);
-        return $count;
-    }
 }

BIN
helper/refill/api/xyz/dezhi_fs/20230613移动江苏贵州福建云南-电信广东四川新疆江苏调价函.png


BIN
helper/refill/api/xyz/dezhi_fs/20230614新疆移动调价函.jpg


BIN
helper/refill/api/xyz/dezhi_fs/20230614江苏电信调价函.jpg


+ 9 - 9
helper/refill/api/xyz/dezhi_fs/config.php

@@ -27,11 +27,11 @@ class config
 
     const Price = [
         //移动
-        "4-30-24" => 27.9, "4-50-24" => 46.5, "4-100-24" => 93, "4-200-24" => 186,//贵州 24
-        "4-30-10" => 28.29, "4-50-10" => 47.15, "4-100-10" => 94.3, "4-200-10" => 188.6,//江苏 10
+        "4-30-24" => 27.96, "4-50-24" => 46.6, "4-100-24" => 93.2, "4-200-24" => 186.4,//贵州 24
+        "4-30-10" => 28.56, "4-50-10" => 47.6, "4-100-10" => 95.2, "4-200-10" => 190.4,//江苏 10
         "4-30-15" => 28.56, "4-50-15" => 47.6, "4-100-15" => 95.2, "4-200-15" => 190.4,//山东 15
-        "4-30-13" => 28.08, "4-50-13" => 46.8, "4-100-13" => 93.6, "4-200-13" => 187.2,//福建 13
-        "4-30-25" => 27.9, "4-50-25" => 46.5, "4-100-25" => 93, "4-200-25" => 186,//云南 25
+        "4-30-13" => 28.05, "4-50-13" => 46.75, "4-100-13" => 93.5, "4-200-13" => 187,//福建 13
+        "4-30-25" => 28.05, "4-50-25" => 46.75, "4-100-25" => 93.5, "4-200-25" => 187,//云南 25
         "4-50-16" => 46.9, "4-100-16" => 93.8, "4-200-16" => 187.6,//河南 16
         "4-50-3" => 47.1, "4-100-3" => 94.2, "4-200-3" => 188.4,//河北 3
         "4-30-20" => 28.41, "4-50-20" => 47.35, "4-100-20" => 94.7, "4-200-20" => 189.4,//广西 20
@@ -39,18 +39,18 @@ class config
         "4-50-11" => 47.75, "4-100-11" => 95.5, "4-200-11" => 191,//浙江 11
         "4-50-14" => 46.8, "4-100-14" => 93.6, "4-200-14" => 187.2,//江西 14
         "4-30-19" => 28.65, "4-50-19" => 47.75, "4-100-19" => 95.5, "4-200-19" => 191,//广东 19
-        "4-30-31" => 27.75, "4-50-31" => 46.25, "4-100-31" => 92.5, "4-200-31" => 185,//新疆 31
+        "4-30-31" => 28.2, "4-50-31" => 47, "4-100-31" => 94, "4-200-31" => 188,//新疆 31
         "4-30-6" => 27.96, "4-50-6" => 46.6, "4-100-6" => 93.2, "4-200-6" => 186.4,//辽宁 6
 
         //电信
-        "6-30-19" => 28.26, "6-50-19" => 47.1, "6-100-19" => 94.2, "6-200-19" => 188.4,//广东 19
+        "6-30-19" => 28.2, "6-50-19" => 47, "6-100-19" => 94, "6-200-19" => 188,//广东 19
         "6-30-9" => 28.26, "6-50-9" => 47.1, "6-100-9" => 94.2, "6-200-9" => 188.4,//上海 9
-        "6-30-23" => 27.84, "6-50-23" => 46.4, "6-100-23" => 92.8, "6-200-23" => 185.6,//四川 23
+        "6-30-23" => 27.9, "6-50-23" => 46.5, "6-100-23" => 93, "6-200-23" => 186,//四川 23
         "6-30-2" => 27.99, "6-50-2" => 46.65, "6-100-2" => 93.3, "6-200-2" => 186.6,//天津 2
         "6-30-18" => 28.44, "6-50-18" => 47.4, "6-100-18" => 94.8, "6-200-18" => 189.6,//湖南 18
         "6-30-13" => 27.54, "6-50-13" => 45.9, "6-100-13" => 91.8, "6-200-13" => 183.6,//福建 13
         "6-30-11" => 28.14, "6-50-11" => 46.9, "6-100-11" => 93.8, "6-200-11" => 187.6,//浙江 11
-        "6-50-31" => 46.5, "6-100-31" => 93, "6-200-31" => 186,//新疆 31
-        "6-30-10" => 28.05, "6-50-10" => 46.75, "6-100-10" => 93.5, "6-200-10" => 187,//江苏 10
+        "6-30-31" => 27.9, "6-50-31" => 46.5, "6-100-31" => 93, "6-200-31" => 186,//新疆 31
+        "6-30-10" => 28.26, "6-50-10" => 47.1, "6-100-10" => 94.2, "6-200-10" => 188.4,//江苏 10
     ];
 }

BIN
helper/refill/api/xyz/feimingyu_fs/20230613四川电信调价函.jpg


+ 17 - 1
helper/refill/api/xyz/feimingyu_fs/config.php

@@ -69,6 +69,20 @@ class config
                 100 => 31354,
                 200 => 313619,
             ],
+            //湖南
+            18 => [
+                30  => 31038,
+                50  => 31039,
+                100 => 31040,
+                200 => 310598,
+            ],
+            //新疆
+            31 => [
+                30  => 32592,
+                50  => 32593,
+                100 => 32594,
+                200 => 325628,
+            ],
         ],
         mtopcard\ChinaTelecomCard => [
             //广东
@@ -118,11 +132,13 @@ class config
         "4-30-25" => 28.2, "4-50-25" => 47, "4-100-25" => 94, "4-200-25" => 188,//云南 25
         "4-30-23" => 27.75, "4-50-23" => 46.25, "4-100-23" => 92.5, "4-200-23" => 185,//四川 23
         "4-30-6" => 27.9, "4-50-6" => 46.5, "4-100-6" => 93, "4-200-6" => 186,//辽宁 6
+        "4-30-18" => 27.75, "4-50-18" => 46.25, "4-100-18" => 92.5, "4-200-18" => 185,//湖南 18
+        "4-30-31" => 27.75, "4-50-31" => 46.25, "4-100-31" => 92.5, "4-200-31" => 185,//新疆 31
 
         //电信
         "6-30-19" => 28.05, "6-50-19" => 46.75, "6-100-19" => 93.5, "6-200-19" => 187,//广东 19
         "6-30-10" => 28.05, "6-50-10" => 46.75, "6-100-10" => 93.5, "6-200-10" => 187,//江苏 10
-        "6-30-23" => 27.6, "6-50-23" => 46, "6-100-23" => 92, "6-200-23" => 184,//四川 23
+        "6-30-23" => 27.75, "6-50-23" => 46.25, "6-100-23" => 92.5, "6-200-23" => 185,//四川 23
         "6-30-31" => 27.9, "6-50-31" => 46.5, "6-100-31" => 93, "6-200-31" => 186,//新疆 31
         "6-30-13" => 27.45, "6-50-13" => 45.75, "6-100-13" => 91.5, "6-200-13" => 183,//福建 13
     ];

+ 13 - 0
helper/refill/api/xyz/feimingyu_fs/对接文档-yezi.txt

@@ -70,3 +70,16 @@ http://60.204.138.14:9086/searchbalance.do
 272320	福建电信50元直充
 272321	福建电信100元直充
 272589	福建电信200元直充
+
+2023.6.15
+
+产品编码 	名称
+31038	湖南移动30元直充
+31039	湖南移动50元直充
+31040	湖南移动100元直充
+310598	湖南移动200元直充
+
+32592	新疆移动30元直充
+32593	新疆移动50元直充
+32594	新疆移动100元直充
+325628	新疆移动200元直充

BIN
helper/refill/api/xyz/guochuang/20230614辽宁移动调价函.jpg


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

@@ -64,7 +64,7 @@ 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.71, "4-20-6" => 19.42, "4-30-6" => 29.13, "4-50-6" => 48.55, "4-100-6" => 97.1, "4-200-6" => 194.2, "4-300-6" => 291.3, "4-500-6" => 485.5,//辽宁 6
+        "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-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

+ 10 - 9
helper/refill/api/xyz/huiyuan/RefillCallBack.php

@@ -31,18 +31,19 @@ class RefillCallBack implements refill\IRefillCallBack
         $order_sn = $params['bill_id'];
         $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
         if (empty($order_info)) {
-            return [false, false, false,false];
+            return [false, false, false, false];
         }
-        $order_id = $order_info['order_id'];
 
+        $order_id = $order_info['order_id'];
         if ($status === '成功') {
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === '失败') {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            $official_sn = strtolower($params['operator_bill_no']) == 'null' ? '' : $params['operator_bill_no'];
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true];
+        } elseif ($status === '失败') {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 3 - 0
helper/refill/api/xyz/huiyuan/RefillPhone.php

@@ -111,6 +111,9 @@ class RefillPhone extends refill\IRefillPhone
             {
                 $status = $resp['bill_status'];
                 if ($status === '成功') {
+                    $official_sn = $resp['operator_bill_no'];
+                    $updata['official_sn'] = $official_sn;
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($status === '失败') {
                     $order_state = ORDER_STATE_CANCEL;

+ 3 - 0
helper/refill/api/xyz/huiyuan/api.txt

@@ -34,3 +34,6 @@ ABJSUPZGDX100CZ:中国电信_100元直充
 ABJSUPZGDX200CZ:中国电信_200元直充
 ABJSUPZGDX300CZ:中国电信_300元直充
 ABJSUPZGDX500CZ:中国电信_500元直充
+
+
+凭证的更新好了,operator_bill_no 这个参数

+ 15 - 0
helper/refill/api/xyz/piaoyi_oil/API信息.txt

@@ -0,0 +1,15 @@
+接口文档:
+https://www.showdoc.com.cn/1231131675594800?page_id=6199048649200038
+接口地址在文档上有
+密码:123456
+
+账号登录地址:https://agent.cqpiaoyi.com/
+账号:yl-syj
+对接KEY:a590f89a07a8173e186a2e749ff212a3
+登录密码:q123456
+
+绑定白名单:
+47.108.191.216
+47.108.191.235
+47.108.160.38
+47.108.193.136

+ 69 - 0
helper/refill/api/xyz/piaoyi_oil/RefillCallBack.php

@@ -0,0 +1,69 @@
+<?php
+namespace refill\piaoyi_oil;
+
+require_once(BASE_HELPER_RAPI_PATH . '/piaoyi_oil/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+        $sign = $this->sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}{$value}";
+            }
+        }
+        $content .= config::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['outOrderNumber'];
+        $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 === 200) {
+            $official_sn = strtolower($params['brandOrderNumber']) == 'null' ? '' : $params['brandOrderNumber'];
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 300) {
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 187 - 0
helper/refill/api/xyz/piaoyi_oil/RefillPhone.php

@@ -0,0 +1,187 @@
+<?php
+
+namespace refill\piaoyi_oil;
+
+require_once(BASE_HELPER_RAPI_PATH . '/piaoyi_oil/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillThird
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function getProductCode($goods_id, $sys_pcode)
+    {
+        $thrid_refill = Model('thrid_refill');
+        $product = $thrid_refill->getProviderProduct($this->mStoreID,$goods_id,$sys_pcode);
+        if (empty($product)) {
+            return false;
+        } else {
+            return $product['channel_code'];
+        }
+    }
+
+    private function req_params($card_no, $amount, string $order_sn, $product_code)
+    {
+        $params['agentName'] = config::agentName;
+        $params['chargeNum'] = 1;
+        $params['chargeNumber'] = $card_no;
+        $params['chargeFace'] = $amount;
+        $params['notifyUrl'] = config::NOTIFY_URL;
+        $params['outOrderNumber'] = $order_sn;
+        $params['productId'] = $product_code;
+        $params['timestamp'] = $this->getMillisecond();
+        return $params;
+    }
+
+    private function getProductAmount($sys_pcode)
+    {
+        $third_refill = Model('thrid_refill');
+        $product = $third_refill->getProduct(['system_code' => $sys_pcode, 'opened' => 1]);
+        if (empty($product)) {
+            return false;
+        } else {
+            return $product['refill_amount'];
+        }
+    }
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $goods_id = intval($params['goods_id']);
+
+        $amount = $this->getProductAmount($params['product_code']);
+        if(empty($amount)) {
+            return [false, '产品未开启', false];
+        }
+
+        $product_code = $this->getProductCode($goods_id, $params['product_code']);
+        Model('thrid_refill')->edit_third($params['order_id'], ['chcode' => $product_code]);
+
+        $params = $this->req_params($card_no, $amount, $order_sn, $product_code);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $params = json_encode($params);
+        $resp = http_post_data(config::ORDER_URL, $params , config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 200) {
+                return [true, $resp['data']['orderNumber'], false];
+            } elseif ($resp['code'] === 500) {
+                $net_errno = "HTTP-{$resp['code']}";
+                return [false, $resp['msg'], true];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['agentName'] = config::agentName;
+        $params['outOrderNumber'] = $refill_info['order_sn'];
+        $params['timestamp'] = $this->getMillisecond();
+        $params['sign'] = $this->sign($params);
+
+        $params = json_encode($params);
+        $resp = http_post_data(config::QUERY_URL, $params , config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+            elseif ($resp['code'] === 200)
+            {
+                $offical_sn = '';
+                $status = $resp['data']['orderStatus'];
+                if ($status === '200') {
+                    $offical_sn = $resp['data']['brandOrderNumber'];
+                    $updata['official_sn'] = $offical_sn;
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === '300') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '4') {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $status, $offical_sn];
+                }
+                return [true, $order_state, $offical_sn];
+            }
+            elseif ($resp['code'] === 3000 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST, ''];
+            }
+            else {
+                return [false, $resp['msg'], ''];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['agentName'] = config::agentName;
+        $params['timestamp'] = $this->getMillisecond();
+        $params['sign'] = $this->sign($params);
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::BALANCE_URL, $params , config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] === 200) {
+                return [true, $resp['data']['balance']];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}{$value}";
+            }
+        }
+        $content .= config::KEY;
+        return md5($content);
+    }
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function getMillisecond()
+    {
+        $cur = microtime (true);
+        $cur = intval($cur * 1000);
+        return $cur;
+    }
+}

+ 17 - 0
helper/refill/api/xyz/piaoyi_oil/config.php

@@ -0,0 +1,17 @@
+<?php
+
+
+namespace refill\piaoyi_oil;
+
+class config
+{
+    const ORDER_URL = 'https://agent.cqpiaoyi.com/prod-api/agent/apiOrderCredit/add';
+    const QUERY_URL = 'https://agent.cqpiaoyi.com/prod-api/agent/apiOrderCredit/get';
+    const BALANCE_URL = 'https://agent.cqpiaoyi.com/prod-api/agent/apiOrderCredit/balance';
+
+    const agentName = 'yl-syj';
+    const KEY = 'a590f89a07a8173e186a2e749ff212a3';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_piaoyi_oil.php";
+
+    const ExtHeaders = ['Content-Type: application/json'];
+}

BIN
helper/refill/api/xyz/piaoyi_oil/产品编码.xlsx


BIN
helper/refill/api/xyz/qianqian_fs/20230614天津电信调价函.png


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

@@ -173,7 +173,7 @@ class config
         "6-30-19" => 28.8, "6-50-19" => 48, "6-100-19" => 96, "6-200-19" => 192,//广东 19
         "6-30-23" => 28.8, "6-50-23" => 48, "6-100-23" => 96, "6-200-23" => 192,//四川 23
         "6-30-15" => 28.8, "6-50-15" => 48, "6-100-15" => 96, "6-200-15" => 192,//山东 15
-        "6-30-2" => 28.8, "6-50-2" => 48, "6-100-2" => 96, "6-200-2" => 192,//天津 2
+        "6-30-2" => 28.8, "6-50-2" => 47.25, "6-100-2" => 94.5, "6-200-2" => 189,//天津 2
         "6-30-25" => 28.8, "6-50-25" => 48, "6-100-25" => 96, "6-200-25" => 192,//云南 25
         "6-50-9" => 48, "6-100-9" => 96, "6-200-9" => 192,//上海 9
         "6-30-18" => 28.8, "6-50-18" => 48, "6-100-18" => 96, "6-200-18" => 192,//湖南 18

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

@@ -0,0 +1,50 @@
+<?php
+namespace refill\qiantu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/qiantu/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, ''];
+        }
+
+        $official_sn = '';
+        $order_id = $order_info['order_id'];
+        if ($status === 1) {
+            $official_sn = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        } elseif ($status === 9) {
+            return [$order_id, false, true, true, $official_sn];
+        } else {
+            return [$order_id, false, false, false, $official_sn];
+        }
+    }
+}

+ 157 - 0
helper/refill/api/xyz/qiantu/RefillPhone.php

@@ -0,0 +1,157 @@
+<?php
+
+namespace refill\qiantu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/qiantu/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'] = '';
+        $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, config::ExtHeaders, $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', '2'], true)) {
+                return [true, $resp['orderid'], false];
+            } elseif (in_array($resultno, config::ERR_NOS, true)) {
+                return [false, $resultno, false];
+            } elseif ($resultno === '9999' || $resultno === '5006') {
+                $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'];
+        $key = config::KEY;
+        $content = "userid={$params['userid']}&sporderid={$params['sporderid']}&key={$key}";
+        $params['sign'] = strtoupper(md5($content));
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误', ''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp))
+            {
+                return [false, '网络错误', ''];
+            }
+            else
+            {
+                $official_sn = '';
+                $resultno = $resp['resultno'];
+                if ($resultno === '1') {
+                    $official_sn = $resp['remark1'];
+                    $updata['official_sn'] = $official_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, $official_sn];
+                }
+
+                return [true, $order_state, $official_sn];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['userid'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$params['userid']}&key={$key}";
+        $params['sign'] = strtoupper(md5($content));
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        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 strtoupper(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);
+    }
+}

+ 24 - 0
helper/refill/api/xyz/qiantu/config.php

@@ -0,0 +1,24 @@
+<?php
+namespace refill\qiantu;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://39.103.136.121:9086/onlinepay.do';
+    const QUERY_URL= 'http://39.103.136.121:9086/searchpay.do';
+    const BALANCE_URL = 'http://39.103.136.121:9086/searchbalance.do';
+
+    const USER_ID= '10003166';
+    const KEY = '3taYTWC8iQfHZmN2kHknHFj4YDmikzaK';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_qiantu.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 ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;'];
+}

+ 6 - 0
helper/refill/api/xyz/qiantu/对接文档-yezi.txt

@@ -0,0 +1,6 @@
+http://39.103.136.121:9080/login.jsp
+账号:yelinkeji
+密码:yelinkeji123
+
+用户编号 10003166
+密钥 3taYTWC8iQfHZmN2kHknHFj4YDmikzaK

BIN
helper/refill/api/xyz/qiantu/通信充值接口.doc


+ 39 - 0
helper/refill/api/xyz/tongka_fetch/RefillCallBack.php

@@ -0,0 +1,39 @@
+<?php
+
+
+namespace refill\tongka_fetch;
+
+require_once(BASE_HELPER_RAPI_PATH . '/tongka_fetch/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return true;
+    }
+
+    public function notify($params)
+    {
+        $order_sn = $params['order_sn'];
+        $status = intval($params['status']);
+
+        $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 === 1) {
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 0) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 61 - 0
helper/refill/api/xyz/tongka_fetch/RefillPhone.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace refill\tongka_fetch;
+
+require_once(BASE_HELPER_RAPI_PATH . '/tongka_fetch/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillThird
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
+    {
+        $params['tel'] = $phone;
+        $params['mch_order_id'] = $order_sn;
+        $params['mchid'] = config::MCHID;
+        $params['price'] = $amount;
+        $params['notify'] = config::NOTIFY_URL;
+        $params['teltype'] = config::operator[$card_type];
+        $params['timeout'] = 50;
+        $params['time'] = time();
+        $params['rand'] = rand(100000,999999);
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        //大面值 直接返回成功
+//        refill\util::send_normal($params['order_sn']);
+        return [true , '',false];
+    }
+
+    public function query($refill_info)
+    {
+        $params['mch_order_id'] = $refill_info['order_sn'];
+        $params['mchid'] = config::MCHID;
+        $content = $params['mchid'] . $params['mch_order_id'] . config::KEY;
+        $params['sign'] = md5($content);
+        $resp = http_request(config::QUERY_URL, $params , 'POST' , false);
+        if ($resp === false) {
+            return [false, '系统错误'];
+        } else {
+            $rand = mt_rand(0,1);
+            return [$rand , ''];
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content  = $params['mchid'] . $params['tel'] . $params['mch_order_id'] . $params['price'] . $params['teltype'] . $params['timeout'] . $params['notify'];
+        $content .= $params['time'] . $params['rand'] . $key;
+        return md5($content);
+    }
+}

+ 20 - 0
helper/refill/api/xyz/tongka_fetch/config.php

@@ -0,0 +1,20 @@
+<?php
+
+
+namespace refill\tongka_fetch;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'https://www.baidu.com/';
+    const QUERY_URL = 'https://www.baidu.com/';
+
+    const MCHID = 10019;
+    const KEY = '953b8e10a70ef4e85b77f09448c0e316';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_baidu.php";
+    const operator = [
+        mtopcard\ChinaMobileCard  => 2,
+        mtopcard\ChinaUnicomCard  => 1,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+}

+ 32 - 31
helper/refill/api/xyz/yanhao/RefillPhone.php

@@ -57,36 +57,37 @@ class RefillPhone extends refill\IRefillPhone
 
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
-        $params = $this->req_params($card_no, $params['order_sn']);
-        $goods_id = intval($params['goods_id']);
-        $channel_code = $this->getProductCode($goods_id, $params['product_code']);
-        if(empty($channel_code)) {
-            return [false, '产品有误', false];
-        }
-        $params['ProductNumber'] = $channel_code;
-        $sign = $this->sign($params);
-        $params['Sign'] = $sign;
-
-        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
-
-        if (empty($resp)) {
-            return [false, '系统错误', true];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if (empty($resp)) {
-                return [false, '系统错误', true];
-            } elseif ($resp['Code'] === 0) {
-                return [true, $resp['OutOrderID'], false];
-            } elseif ($resp['Code'] === -170 || $resp['Code'] === -180){
-                $net_errno = "HTTP-{$resp['Code']}";
-                return [false, $net_errno, true];
-            } else {
-                return [false, $resp['Msg'], false];
-            }
-        }
+        return [true, '', false];
+//        $params = $this->req_params($card_no, $params['order_sn']);
+//        $goods_id = intval($params['goods_id']);
+//        $channel_code = $this->getProductCode($goods_id, $params['product_code']);
+//        if(empty($channel_code)) {
+//            return [false, '产品有误', false];
+//        }
+//        $params['ProductNumber'] = $channel_code;
+//        $sign = $this->sign($params);
+//        $params['Sign'] = $sign;
+//
+//        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+//
+//        if (empty($resp)) {
+//            return [false, '系统错误', true];
+//        }
+//        else
+//        {
+//            Log::record($resp, Log::DEBUG);
+//            $resp = json_decode($resp, true);
+//            if (empty($resp)) {
+//                return [false, '系统错误', true];
+//            } elseif ($resp['Code'] === 0) {
+//                return [true, $resp['OutOrderID'], false];
+//            } elseif ($resp['Code'] === -170 || $resp['Code'] === -180){
+//                $net_errno = "HTTP-{$resp['Code']}";
+//                return [false, $net_errno, true];
+//            } else {
+//                return [false, $resp['Msg'], false];
+//            }
+//        }
     }
 
     public function query($refill_info)
@@ -177,4 +178,4 @@ class RefillPhone extends refill\IRefillPhone
         $cur = intval($cur * 1000);
         return $cur;
     }
-}
+}

+ 1 - 1
helper/refill/api/yl/bier_fs/config.php

@@ -208,7 +208,7 @@ class config
 
         "6-30-23" => 28.65, "6-50-23" => 47.75, "6-100-23" => 95.5, "6-200-23" => 191,//四川 23
         "6-30-15" => 28.65, "6-50-15" => 47.75, "6-100-15" => 95.5, "6-200-15" => 191,//山东 15
-        "6-30-2" => 28.65, "6-50-2" => 47.75, "6-100-2" => 95.5, "6-200-2" => 191,//天津 2
+        "6-30-2" => 28.65, "6-50-2" => 47.25, "6-100-2" => 94.5, "6-200-2" => 189,//天津 2
         "6-30-25" => 28.65, "6-50-25" => 47.75, "6-100-25" => 95.5, "6-200-25" => 191,//云南 25
         "6-30-19" => 28.8, "6-50-19" => 48, "6-100-19" => 96, "6-200-19" => 192,//广东 19
         "6-50-9" => 47.75, "6-100-9" => 95.5, "6-200-9" => 191,//上海 9

+ 9 - 9
helper/refill/api/yl/dezhi_fs/config.php

@@ -27,11 +27,11 @@ class config
 
     const Price = [
         //移动
-        "4-30-24" => 27.9, "4-50-24" => 46.5, "4-100-24" => 93, "4-200-24" => 186,//贵州 24
-        "4-30-10" => 28.29, "4-50-10" => 47.15, "4-100-10" => 94.3, "4-200-10" => 188.6,//江苏 10
+        "4-30-24" => 27.96, "4-50-24" => 46.6, "4-100-24" => 93.2, "4-200-24" => 186.4,//贵州 24
+        "4-30-10" => 28.56, "4-50-10" => 47.6, "4-100-10" => 95.2, "4-200-10" => 190.4,//江苏 10
         "4-30-15" => 28.56, "4-50-15" => 47.6, "4-100-15" => 95.2, "4-200-15" => 190.4,//山东 15
-        "4-30-13" => 28.08, "4-50-13" => 46.8, "4-100-13" => 93.6, "4-200-13" => 187.2,//福建 13
-        "4-30-25" => 27.9, "4-50-25" => 46.5, "4-100-25" => 93, "4-200-25" => 186,//云南 25
+        "4-30-13" => 28.05, "4-50-13" => 46.75, "4-100-13" => 93.5, "4-200-13" => 187,//福建 13
+        "4-30-25" => 28.05, "4-50-25" => 46.75, "4-100-25" => 93.5, "4-200-25" => 187,//云南 25
         "4-50-16" => 46.9, "4-100-16" => 93.8, "4-200-16" => 187.6,//河南 16
         "4-50-3" => 47.1, "4-100-3" => 94.2, "4-200-3" => 188.4,//河北 3
         "4-30-20" => 28.41, "4-50-20" => 47.35, "4-100-20" => 94.7, "4-200-20" => 189.4,//广西 20
@@ -39,18 +39,18 @@ class config
         "4-50-11" => 47.75, "4-100-11" => 95.5, "4-200-11" => 191,//浙江 11
         "4-50-14" => 46.8, "4-100-14" => 93.6, "4-200-14" => 187.2,//江西 14
         "4-30-19" => 28.65, "4-50-19" => 47.75, "4-100-19" => 95.5, "4-200-19" => 191,//广东 19
-        "4-30-31" => 27.75, "4-50-31" => 46.25, "4-100-31" => 92.5, "4-200-31" => 185,//新疆 31
+        "4-30-31" => 28.2, "4-50-31" => 47, "4-100-31" => 94, "4-200-31" => 188,//新疆 31
         "4-30-6" => 27.96, "4-50-6" => 46.6, "4-100-6" => 93.2, "4-200-6" => 186.4,//辽宁 6
 
         //电信
-        "6-30-19" => 28.26, "6-50-19" => 47.1, "6-100-19" => 94.2, "6-200-19" => 188.4,//广东 19
+        "6-30-19" => 28.2, "6-50-19" => 47, "6-100-19" => 94, "6-200-19" => 188,//广东 19
         "6-30-9" => 28.26, "6-50-9" => 47.1, "6-100-9" => 94.2, "6-200-9" => 188.4,//上海 9
-        "6-30-23" => 27.84, "6-50-23" => 46.4, "6-100-23" => 92.8, "6-200-23" => 185.6,//四川 23
+        "6-30-23" => 27.9, "6-50-23" => 46.5, "6-100-23" => 93, "6-200-23" => 186,//四川 23
         "6-30-2" => 27.99, "6-50-2" => 46.65, "6-100-2" => 93.3, "6-200-2" => 186.6,//天津 2
         "6-30-18" => 28.44, "6-50-18" => 47.4, "6-100-18" => 94.8, "6-200-18" => 189.6,//湖南 18
         "6-30-13" => 27.54, "6-50-13" => 45.9, "6-100-13" => 91.8, "6-200-13" => 183.6,//福建 13
         "6-30-11" => 28.14, "6-50-11" => 46.9, "6-100-11" => 93.8, "6-200-11" => 187.6,//浙江 11
-        "6-50-31" => 46.5, "6-100-31" => 93, "6-200-31" => 186,//新疆 31
-        "6-30-10" => 28.05, "6-50-10" => 46.75, "6-100-10" => 93.5, "6-200-10" => 187,//江苏 10
+        "6-30-31" => 27.9, "6-50-31" => 46.5, "6-100-31" => 93, "6-200-31" => 186,//新疆 31
+        "6-30-10" => 28.26, "6-50-10" => 47.1, "6-100-10" => 94.2, "6-200-10" => 188.4,//江苏 10
     ];
 }

+ 17 - 1
helper/refill/api/yl/feimingyu_fs/config.php

@@ -69,6 +69,20 @@ class config
                 100 => 31354,
                 200 => 313619,
             ],
+            //湖南
+            18 => [
+                30  => 31038,
+                50  => 31039,
+                100 => 31040,
+                200 => 310598,
+            ],
+            //新疆
+            31 => [
+                30  => 32592,
+                50  => 32593,
+                100 => 32594,
+                200 => 325628,
+            ],
         ],
         mtopcard\ChinaTelecomCard => [
             //广东
@@ -118,11 +132,13 @@ class config
         "4-30-25" => 28.2, "4-50-25" => 47, "4-100-25" => 94, "4-200-25" => 188,//云南 25
         "4-30-23" => 27.75, "4-50-23" => 46.25, "4-100-23" => 92.5, "4-200-23" => 185,//四川 23
         "4-30-6" => 27.9, "4-50-6" => 46.5, "4-100-6" => 93, "4-200-6" => 186,//辽宁 6
+        "4-30-18" => 27.75, "4-50-18" => 46.25, "4-100-18" => 92.5, "4-200-18" => 185,//湖南 18
+        "4-30-31" => 27.75, "4-50-31" => 46.25, "4-100-31" => 92.5, "4-200-31" => 185,//新疆 31
 
         //电信
         "6-30-19" => 28.05, "6-50-19" => 46.75, "6-100-19" => 93.5, "6-200-19" => 187,//广东 19
         "6-30-10" => 28.05, "6-50-10" => 46.75, "6-100-10" => 93.5, "6-200-10" => 187,//江苏 10
-        "6-30-23" => 27.6, "6-50-23" => 46, "6-100-23" => 92, "6-200-23" => 184,//四川 23
+        "6-30-23" => 27.75, "6-50-23" => 46.25, "6-100-23" => 92.5, "6-200-23" => 185,//四川 23
         "6-30-31" => 27.9, "6-50-31" => 46.5, "6-100-31" => 93, "6-200-31" => 186,//新疆 31
         "6-30-13" => 27.45, "6-50-13" => 45.75, "6-100-13" => 91.5, "6-200-13" => 183,//福建 13
     ];

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

@@ -64,7 +64,7 @@ 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.71, "4-20-6" => 19.42, "4-30-6" => 29.13, "4-50-6" => 48.55, "4-100-6" => 97.1, "4-200-6" => 194.2, "4-300-6" => 291.3, "4-500-6" => 485.5,//辽宁 6
+        "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-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

+ 1 - 1
helper/refill/api/yl/qianqian_fs/config.php

@@ -173,7 +173,7 @@ class config
         "6-30-19" => 28.8, "6-50-19" => 48, "6-100-19" => 96, "6-200-19" => 192,//广东 19
         "6-30-23" => 28.8, "6-50-23" => 48, "6-100-23" => 96, "6-200-23" => 192,//四川 23
         "6-30-15" => 28.8, "6-50-15" => 48, "6-100-15" => 96, "6-200-15" => 192,//山东 15
-        "6-30-2" => 28.8, "6-50-2" => 48, "6-100-2" => 96, "6-200-2" => 192,//天津 2
+        "6-30-2" => 28.8, "6-50-2" => 47.25, "6-100-2" => 94.5, "6-200-2" => 189,//天津 2
         "6-30-25" => 28.8, "6-50-25" => 48, "6-100-25" => 96, "6-200-25" => 192,//云南 25
         "6-50-9" => 48, "6-100-9" => 96, "6-200-9" => 192,//上海 9
         "6-30-18" => 28.8, "6-50-18" => 48, "6-100-18" => 96, "6-200-18" => 192,//湖南 18

+ 6 - 2
helper/refill/api/zy/by_online_cb/RefillCallBack.php

@@ -4,6 +4,7 @@ namespace refill\by_online_cb;
 require_once(BASE_HELPER_RAPI_PATH . '/by_online_cb/config.php');
 
 use refill;
+use QueueClient;
 
 class RefillCallBack implements refill\IRefillCallBack
 {
@@ -32,10 +33,13 @@ class RefillCallBack implements refill\IRefillCallBack
         if ($status === 7) {
             $data['official_sn'] = strtolower($params['charge_id']) == 'null' ? '' : $params['charge_id'];
             Model('refill_order')->edit($order_id, $data);
+            QueueClient::async_push("onHnydCbSuccess", ['order_id' => $order_id], 1);
             return [$order_id, true, false, true];
-        } elseif (in_array($status, [3, 4, 6], true)) {
+        }
+        elseif (in_array($status, [3, 4, 6], true)) {
             return [$order_id, false, true, true];
-        } else {
+        }
+        else {
             return [$order_id, false, false, false];
         }
     }

+ 1 - 2
helper/refill/api/zy/by_online_cb/RefillPhone.php

@@ -117,8 +117,7 @@ class RefillPhone extends refill\IRefillPhone
                         return [true, $order_state, $charge_id];
                     }
                     elseif(time() - $refill_info['commit_time'] >= 2700) {
-//                        return [true, ORDER_STATE_NOEXIST, $charge_id];
-                        return [true, ORDER_STATE_CANCEL, $charge_id];
+                        return [true, ORDER_STATE_NOEXIST, $charge_id];
                     }
                     else {
                         return [false, '没有移动返回的原始数据', ''];

+ 13 - 24
helper/refill/api/zy/by_online_cb/hnyd.php

@@ -34,22 +34,19 @@ class record
 
     public function canceled()
     {
-        $id = trim($this->mRecord['CANCEL_CHARGE_ID']);
-        if(empty($id)) {
-            return false;
-        } else {
-            return true;
-        }
+        $deal_tag = $this->deal_tag();
+        return ($deal_tag === 2);
+    }
+
+    private function deal_tag()
+    {
+        return intval($this->mRecord['DEAL_TAG'] ?? 0);
     }
 
     public function successed()
     {
-        $charge_time = $this->charge_time();
-        if(empty($this->charge_id()) or empty($this->trade_id()) or $this->fee() <= 0 or $charge_time=== false or $charge_time <= 0) {
-            return false;
-        } else {
-            return true;
-        }
+        $deal_tag = $this->deal_tag();
+        return ($deal_tag === 1);
     }
 }
 
@@ -77,9 +74,10 @@ class response
         }
         else
         {
-            $keys = [ "MONTH", "RECV_FEE", "RECV_TIME", "BIND_SERIAL_NUMBER",
-                "OUT_TRADE_ID", "GROUP_ID", "CHARGE_ID", "CANCEL_CHARGE_ID",
-                "CANCEL_TAG", "CANCEL_TIME", "REMARK", "LOCAL_SN", "CUST_NAME"];
+            $keys = ["DEAL_INFO","MONTH","DEAL_TAG","USER_ID_OUT","SERIAL_NUMBER_OUT",
+                     "DEAL_TIME","RECV_FEE","RECV_TIME","BIND_SERIAL_NUMBER","OUT_TRADE_ID",
+                     "GROUP_ID","CHARGE_ID","CANCEL_CHARGE_ID","ACCT_ID_OUT","CANCEL_TAG",
+                     "CANCEL_TIME","REMARK","LOCAL_SN","KITE_ORDER_NUM","CUST_NAME"];
 
             $item = [];
             foreach ($keys as $key) {
@@ -101,17 +99,8 @@ class response
             if($chid == $charge_id) {
                 return new record($record);
             }
-            elseif($chid === '1111111111') {
-                return new record($record);
-            }
         }
 
         return false;
     }
-
-    public function record_count()
-    {
-        $count = intval($this->mResult['X_RECORDNUM'] ?? 0);
-        return $count;
-    }
 }

+ 1 - 1
helper/refill/api/zy/by_online_kami_cb/RefillCallBack.php

@@ -32,8 +32,8 @@ class RefillCallBack implements refill\IRefillCallBack
 
         if ($status === 7) {
             $data['official_sn'] = strtolower($params['charge_id']) == 'null' ? '' : $params['charge_id'];
-
             Model('refill_order')->edit($order_id, $data);
+            QueueClient::async_push("onHnydCbSuccess", ['order_id' => $order_id], 1);
             return [$order_id, true, false, true];
         } elseif (in_array($status, [3, 4, 6], true)) {
             return [$order_id, false, true, true];

+ 1 - 2
helper/refill/api/zy/by_online_kami_cb/RefillPhone.php

@@ -117,8 +117,7 @@ class RefillPhone extends refill\IRefillPhone
                         return [true, $order_state, $charge_id];
                     }
                     elseif(time() - $refill_info['commit_time'] >= 2700) {
-//                        return [true, ORDER_STATE_NOEXIST, $charge_id];
-                        return [true, ORDER_STATE_CANCEL, $charge_id];
+                        return [true, ORDER_STATE_NOEXIST, $charge_id];
                     }
                     else {
                         return [false, '没有移动返回的原始数据', ''];

+ 13 - 24
helper/refill/api/zy/by_online_kami_cb/hnyd.php

@@ -34,22 +34,19 @@ class record
 
     public function canceled()
     {
-        $id = trim($this->mRecord['CANCEL_CHARGE_ID']);
-        if(empty($id)) {
-            return false;
-        } else {
-            return true;
-        }
+        $deal_tag = $this->deal_tag();
+        return ($deal_tag === 2);
+    }
+
+    private function deal_tag()
+    {
+        return intval($this->mRecord['DEAL_TAG'] ?? 0);
     }
 
     public function successed()
     {
-        $charge_time = $this->charge_time();
-        if(empty($this->charge_id()) or empty($this->trade_id()) or $this->fee() <= 0 or $charge_time=== false or $charge_time <= 0) {
-            return false;
-        } else {
-            return true;
-        }
+        $deal_tag = $this->deal_tag();
+        return ($deal_tag === 1);
     }
 }
 
@@ -77,9 +74,10 @@ class response
         }
         else
         {
-            $keys = [ "MONTH", "RECV_FEE", "RECV_TIME", "BIND_SERIAL_NUMBER",
-                "OUT_TRADE_ID", "GROUP_ID", "CHARGE_ID", "CANCEL_CHARGE_ID",
-                "CANCEL_TAG", "CANCEL_TIME", "REMARK", "LOCAL_SN", "CUST_NAME"];
+            $keys = ["DEAL_INFO","MONTH","DEAL_TAG","USER_ID_OUT","SERIAL_NUMBER_OUT",
+                     "DEAL_TIME","RECV_FEE","RECV_TIME","BIND_SERIAL_NUMBER","OUT_TRADE_ID",
+                     "GROUP_ID","CHARGE_ID","CANCEL_CHARGE_ID","ACCT_ID_OUT","CANCEL_TAG",
+                     "CANCEL_TIME","REMARK","LOCAL_SN","KITE_ORDER_NUM","CUST_NAME"];
 
             $item = [];
             foreach ($keys as $key) {
@@ -101,17 +99,8 @@ class response
             if($chid == $charge_id) {
                 return new record($record);
             }
-            elseif($chid === '1111111111') {
-                return new record($record);
-            }
         }
 
         return false;
     }
-
-    public function record_count()
-    {
-        $count = intval($this->mResult['X_RECORDNUM'] ?? 0);
-        return $count;
-    }
 }

+ 1 - 0
helper/refill/util.php

@@ -570,6 +570,7 @@ class util
         if (defined('COMPANY_NAME') && in_array(COMPANY_NAME, ['ZY_COMPANY'])) {
             $ins = Cache::getInstance('cacheredis');
             $name = 'loop_order_check_query';
+            $spec = intval($spec);
             $key = "{$card_no}-{$spec}";
             $ins->hIncrBy($name, $key, -1);
         }

+ 6 - 0
mobile/callback/refill_piaoyi_oil.php

@@ -0,0 +1,6 @@
+<?php
+$content = $_SERVER['post_content'];
+$input = json_decode($content,true);
+
+refill\util::push_notify('piaoyi_oil',$input);
+echo ('success');

+ 4 - 0
mobile/callback/refill_qiantu.php

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

+ 1 - 1
rdispatcher/proxy.php

@@ -10,7 +10,7 @@ class proxy
 {
     private function is_loop_order(refill\order $order)
     {
-        if($order->is_third()) {
+        if($order->is_third() || $order->is_oil()) {
             return false;
         }
 

+ 20 - 3
test/TestCardNo.php

@@ -23,11 +23,11 @@ class TestCardNo extends TestCase
 
     public function testQueryCardInfo()
     {
-        for ($i = 0; $i < 200; $i++) {
+        for ($i = 0; $i < 2000; $i++) {
             $query = new mtopcard\open_query();
             [$succ,$ret] = $query->validate('13911129867');
             Log::record("$i succ=$succ",Log::DEBUG);
-            sleep(1);
+//            sleep(1);
         }
     }
 
@@ -44,7 +44,7 @@ class TestCardNo extends TestCase
 
     public function testYzValidate()
     {
-        
+
 
     }
 
@@ -100,4 +100,21 @@ class TestCardNo extends TestCase
         $card_type = mtopcard\card_type($card_no,$region);
 
     }
+
+    public function testLoop_order()
+    {
+        $ins = Cache::getInstance('cacheredis');
+        $name = 'loop_order_check_query';
+        $loop_order = $ins->hget($name, '', '*');
+
+        $cond['vr_order.order_state'] = ORDER_STATE_SEND;
+        $order_list = Model('refill_order')->getAllOrders($cond);
+
+        foreach ($order_list as $order)
+        {
+            $card_no = $order['card_no'];
+            $spec = intval($order['refill_amount']);
+            $key = "{$card_no}-{$spec}";
+        }
+    }
 }

File diff suppressed because it is too large
+ 30 - 4
test/TestRefill.php


+ 10 - 2
test/TestRefund.php

@@ -244,8 +244,16 @@ class TestRefund extends TestCase
     public function testOneOrder()
     {
         $provider = $this->getProvider('by_online');
-        $order_sn = '5744450737576478180405';
-        [$succ, $resp] = $provider->query(['order_sn' => $order_sn, 'official_sn' => '']);
+
+        $params = [
+            '8013920739815620475078' => '1123061172453041',
+            '0375610739886119616188' => '1123061272466229',
+
+        ];
+        foreach ($params as $order_sn => $official_sn)
+        {
+            [$succ, $resp] = $provider->query(['order_sn' => $order_sn, 'official_sn' => $official_sn]);
+        }
     }
 
     private function check_order($cond)