Sfoglia il codice sorgente

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

stanley-king 3 mesi fa
parent
commit
af305c6948
48 ha cambiato i file con 2074 aggiunte e 10 eliminazioni
  1. 26 2
      admin/control/ordersendlist.php
  2. 9 0
      admin/templates/default/merchant.ratios.php
  3. 15 0
      admin/templates/default/refill.order.monitor.notify.php
  4. 18 0
      admin/templates/default/refill.order.send.index.php
  5. 38 0
      data/config/xyz/phone.ini.php
  6. 230 0
      data/config/yl/phone.ini.php
  7. BIN
      helper/refill/api/xyz/guochuang/20241226_dx_shanxi.png
  8. BIN
      helper/refill/api/xyz/guochuang/20241227_dx_shanxi.png
  9. BIN
      helper/refill/api/xyz/guochuang/20241230_dx_hubei.jpg
  10. BIN
      helper/refill/api/xyz/guochuang/20241230_dx_shandong.jpg
  11. BIN
      helper/refill/api/xyz/guochuang/20250102_dx_shanxi.jpg
  12. 3 2
      helper/refill/api/xyz/guochuang/config.php
  13. 36 0
      helper/refill/api/xyz/masheng/API.MD
  14. 51 0
      helper/refill/api/xyz/masheng/RefillCallBack.php
  15. 144 0
      helper/refill/api/xyz/masheng/RefillPhone.php
  16. 41 0
      helper/refill/api/xyz/masheng/config.php
  17. 1 3
      helper/refill/api/xyz/qingyu/config.php
  18. 7 1
      helper/refill/api/yl/chengchong_fs/API.MD
  19. 7 0
      helper/refill/api/yl/chengchong_fs/config.php
  20. 36 0
      helper/refill/api/yl/cuyun/API.MD
  21. 52 0
      helper/refill/api/yl/cuyun/RefillCallBack.php
  22. 146 0
      helper/refill/api/yl/cuyun/RefillPhone.php
  23. 46 0
      helper/refill/api/yl/cuyun/config.php
  24. 3 2
      helper/refill/api/yl/guochuang/config.php
  25. 22 0
      helper/refill/api/yl/lihui/API.MD
  26. 52 0
      helper/refill/api/yl/lihui/RefillCallBack.php
  27. 146 0
      helper/refill/api/yl/lihui/RefillPhone.php
  28. 46 0
      helper/refill/api/yl/lihui/config.php
  29. BIN
      helper/refill/api/yl/lihui/product_code.jpg
  30. 33 0
      helper/refill/api/yl/tengsu/API.MD
  31. 52 0
      helper/refill/api/yl/tengsu/RefillCallBack.php
  32. 146 0
      helper/refill/api/yl/tengsu/RefillPhone.php
  33. 46 0
      helper/refill/api/yl/tengsu/config.php
  34. 14 0
      helper/refill/api/yl/yeyankc001/API.MD
  35. 76 0
      helper/refill/api/yl/yeyankc001/RefillCallBack.php
  36. 161 0
      helper/refill/api/yl/yeyankc001/RefillPhone.php
  37. 13 0
      helper/refill/api/yl/yeyankc001/config.php
  38. 14 0
      helper/refill/api/yl/yeyankc002/API.MD
  39. 76 0
      helper/refill/api/yl/yeyankc002/RefillCallBack.php
  40. 161 0
      helper/refill/api/yl/yeyankc002/RefillPhone.php
  41. 13 0
      helper/refill/api/yl/yeyankc002/config.php
  42. 4 0
      mobile/callback/refill_cuyun.php
  43. 4 0
      mobile/callback/refill_lihui.php
  44. 7 0
      mobile/callback/refill_masheng.php
  45. 4 0
      mobile/callback/refill_tengsu.php
  46. 4 0
      mobile/callback/refill_yeyankc001.php
  47. 4 0
      mobile/callback/refill_yeyankc002.php
  48. 67 0
      test/TestRefill.php

+ 26 - 2
admin/control/ordersendlist.php

@@ -42,14 +42,38 @@ class ordersendlistControl extends SystemControl
 
         if ($timeout_type > 0)
         {
-            if (in_array($timeout_type, [1, 2]))
+            if (in_array($timeout_type, [1, 2, 8, 9, 10, 11, 12, 13]))
             {
                 if ($timeout_type === 1) {
                     $time_cond['refill_order.order_time'] = ['between', [$cur_time - 3600, $cur_time - 1800]];
                     $time_cond['vr_order.add_time'] = ['between', [$cur_time - 3600, $cur_time]];
                 }
                 if ($timeout_type === 2) {
-                    $time_cond['refill_order.order_time'] = ['between', [$start_day, $cur_time - 3600]];
+                    $time_cond['refill_order.order_time'] = ['between', [$cur_time - 5400, $cur_time - 3600]];
+                    $time_cond['vr_order.add_time'] = ['between', [$cur_time - 5400, $cur_time]];
+                }
+                if ($timeout_type === 8) {
+                    $time_cond['refill_order.order_time'] = ['between', [$cur_time - 7200, $cur_time - 5400]];
+                    $time_cond['vr_order.add_time'] = ['between', [$cur_time - 7200, $cur_time]];
+                }
+                if ($timeout_type === 9) {
+                    $time_cond['refill_order.order_time'] = ['between', [$cur_time - 9000, $cur_time - 7200]];
+                    $time_cond['vr_order.add_time'] = ['between', [$cur_time - 9000, $cur_time]];
+                }
+                if ($timeout_type === 10) {
+                    $time_cond['refill_order.order_time'] = ['between', [$cur_time - 10800, $cur_time - 9000]];
+                    $time_cond['vr_order.add_time'] = ['between', [$cur_time - 10800, $cur_time]];
+                }
+                if ($timeout_type === 11) {
+                    $time_cond['refill_order.order_time'] = ['between', [$cur_time - 12600, $cur_time - 10800]];
+                    $time_cond['vr_order.add_time'] = ['between', [$cur_time - 12600, $cur_time]];
+                }
+                if ($timeout_type === 12) {
+                    $time_cond['refill_order.order_time'] = ['between', [$cur_time - 14400, $cur_time - 12600]];
+                    $time_cond['vr_order.add_time'] = ['between', [$cur_time - 14400, $cur_time]];
+                }
+                if ($timeout_type === 13) {
+                    $time_cond['refill_order.order_time'] = ['between', [$start_day, $cur_time - 14400]];
                     $time_cond['vr_order.add_time'] = ['between', [$start_day, $cur_time]];
                 }
             }

+ 9 - 0
admin/templates/default/merchant.ratios.php

@@ -108,6 +108,7 @@
                         <th class="align-center w10pre">30分钟</th>
                         <th class="align-center w10pre">1小时</th>
                         <th class="align-center w10pre">2小时</th>
+                        <th class="align-center w10pre">3小时</th>
                         <th class="align-center w10pre">当天</th>
                 </thead>
                 <tbody class="tbodyd">
@@ -150,6 +151,14 @@
                                     <?php } ?>
                                 </td>
                                 <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][10800][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][10800][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][10800][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][10800][1] - $v['ratio']['ALL'][10800][0]) ?? 0; ?></span>,<?php echo $v['ratio']['ALL'][10800][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][10800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][10800][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][10800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][10800][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][10800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][10800][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
                                     <?php if ($v['ratio']['ALL'][86400][1] > 0) { ?>
                                         <?php echo ($v['ratio']['ALL'][86400][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][86400][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][86400][1] - $v['ratio']['ALL'][86400][0]) ?? 0; ?></span>,<?php echo $v['ratio']['ALL'][86400][1]; ?>) <br>
                                         <?php echo ($v['ratio']['YD'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][86400][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][86400][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][86400][0]) ?? 0; ?>)

+ 15 - 0
admin/templates/default/refill.order.monitor.notify.php

@@ -268,9 +268,24 @@
                         <option value="3600"
                                 <?php if ($_GET['total_time'] == '3600'){ ?>selected<?php } ?>>一小时
                         </option>
+                        <option value="5400"
+                                <?php if ($_GET['total_time'] == '5400'){ ?>selected<?php } ?>>一小时半
+                        </option>
                         <option value="7200"
                                 <?php if ($_GET['total_time'] == '7200'){ ?>selected<?php } ?>>两小时
                         </option>
+                        <option value="9000"
+                                <?php if ($_GET['total_time'] == '9000'){ ?>selected<?php } ?>>两小时半
+                        </option>
+                        <option value="10800"
+                                <?php if ($_GET['total_time'] == '10800'){ ?>selected<?php } ?>>三小时
+                        </option>
+                        <option value="12600"
+                                <?php if ($_GET['total_time'] == '12600'){ ?>selected<?php } ?>>三小时半
+                        </option>
+                        <option value="14400"
+                                <?php if ($_GET['total_time'] == '14400'){ ?>selected<?php } ?>>四小时
+                        </option>
                         <option value="86400"
                                 <?php if ($_GET['total_time'] == '86400'){ ?>selected<?php } ?>>二十四小时
                         </option>

+ 18 - 0
admin/templates/default/refill.order.send.index.php

@@ -199,6 +199,24 @@
                         <option value="2"
                                 <?php if ($_GET['time'] == '2'){ ?>selected<?php } ?>>耗时一小时订单
                         </option>
+                        <option value="8"
+                                <?php if ($_GET['time'] == '8'){ ?>selected<?php } ?>>耗时一小时半订单
+                        </option>
+                        <option value="9"
+                                <?php if ($_GET['time'] == '9'){ ?>selected<?php } ?>>耗时2小时订单
+                        </option>
+                        <option value="10"
+                                <?php if ($_GET['time'] == '10'){ ?>selected<?php } ?>>耗时2小时半订单
+                        </option>
+                        <option value="11"
+                                <?php if ($_GET['time'] == '11'){ ?>selected<?php } ?>>耗时3小时订单
+                        </option>
+                        <option value="12"
+                                <?php if ($_GET['time'] == '12'){ ?>selected<?php } ?>>耗时3小时半订单
+                        </option>
+                        <option value="13"
+                                <?php if ($_GET['time'] == '13'){ ?>selected<?php } ?>>耗时4小时订单
+                        </option>
                         <option value="3"
                                 <?php if ($_GET['time'] == '3'){ ?>selected<?php } ?>>特定耗时3分钟订单
                         </option>

+ 38 - 0
data/config/xyz/phone.ini.php

@@ -3832,6 +3832,43 @@ $youge_sec_phone = [
 //        ]
     ]
 ];
+$masheng_phone = [
+    'name' => 'masheng', 'store_id' => 428, 'qualitys' => '2', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 9369, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9369, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 9370, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9370, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 9371, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9371, 'price' => 33.87, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+//            ['goods_id' => 9372, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9372, 'price' => 50.8, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 9373, 'price' => 101.6, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9373, 'price' => 101.6, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 9374, 'price' => 203.2, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9374, 'price' => 203.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 9375, 'price' => 304.8, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9375, 'price' => 304.8, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 9376, 'price' => 508, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9376, 'price' => 508, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ]
+    ]
+];
 
 $phone_providers = [
 	[ 'name' => 'xunyin', 'cfg' => $xunyin_phone ],
@@ -3947,4 +3984,5 @@ $phone_providers = [
     [ 'name' => 'qingyu', 'cfg' => $qingyu_phone ],
     [ 'name' => 'yifutong', 'cfg' => $yifutong_phone ],
     [ 'name' => 'youge_sec', 'cfg' => $youge_sec_phone ],
+//    [ 'name' => 'masheng', 'cfg' => $masheng_phone ],
 	];

+ 230 - 0
data/config/yl/phone.ini.php

@@ -2014,6 +2014,231 @@ $youge_phone = [
 //        ]
     ]
 ];
+$cuyun_phone = [
+    'name' => 'cuyun', 'store_id' => 342, 'qualitys' => '1', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8745, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8745, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8745, 'price' => 10, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8746, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8746, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8746, 'price' => 20, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 8747, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8747, 'price' => 28.26, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8747, 'price' => 30, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8748, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8748, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8748, 'price' => 48.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8749, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8749, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8749, 'price' => 96.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8750, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8750, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8750, 'price' => 193.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8751, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8751, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8751, 'price' => 300, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8752, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8752, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8752, 'price' => 500, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ]
+];
+$lihui_phone = [
+    'name' => 'lihui', 'store_id' => 343, 'qualitys' => '1', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8753, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8753, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8753, 'price' => 10, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8754, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8754, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8754, 'price' => 20, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 8755, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8755, 'price' => 28.17, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8755, 'price' => 30, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8756, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8756, 'price' => 46.95, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8756, 'price' => 48.35, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8757, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8757, 'price' => 93.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8757, 'price' => 96.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8758, 'price' => 193, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8758, 'price' => 187.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8758, 'price' => 193.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8759, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8759, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8759, 'price' => 300, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8760, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8760, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8760, 'price' => 500, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ]
+];
+$yeyankc001_phone = [
+    'name' => 'yeyankc001', 'store_id' => 344, 'qualitys' => '2', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8761, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8761, 'price' => 10, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8761, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8762, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8762, 'price' => 20, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8762, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8763, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8763, 'price' => 30, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8763, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8764, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8764, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8764, 'price' => 50, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8765, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8765, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8765, 'price' => 100, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8766, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8766, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8766, 'price' => 200, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8767, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8767, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8767, 'price' => 300, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8768, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8768, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8768, 'price' => 500, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ]
+    ]
+];
+$yeyankc002_phone = [
+    'name' => 'yeyankc002', 'store_id' => 345, 'qualitys' => '2', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8769, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8769, 'price' => 10, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8769, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8770, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8770, 'price' => 20, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8770, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8771, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8771, 'price' => 30, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8771, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8772, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8772, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8772, 'price' => 50, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8773, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8773, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8773, 'price' => 100, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8774, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8774, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8774, 'price' => 200, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8775, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8775, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8775, 'price' => 300, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8776, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8776, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8776, 'price' => 500, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ]
+    ]
+];
+$tengsu_phone = [
+    'name' => 'tengsu', 'store_id' => 346, 'qualitys' => '1', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8777, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8777, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8777, 'price' => 10, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8778, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8778, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8778, 'price' => 20, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 8779, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8779, 'price' => 28.26, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8779, 'price' => 30, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8780, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8780, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8780, 'price' => 50, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8781, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8781, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8781, 'price' => 97, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8782, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8782, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8782, 'price' => 194, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+//            ['goods_id' => 8783, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8783, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8783, 'price' => 291, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        500 => [
+//            ['goods_id' => 8784, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8784, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8784, 'price' => 500, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ]
+];
 
 
 $phone_providers = [
@@ -2084,4 +2309,9 @@ $phone_providers = [
     [ 'name' => 'dexin', 'cfg' => $dexin_phone ],
     [ 'name' => 'chengchong_fs', 'cfg' => $chengchong_fs_phone ],
     [ 'name' => 'youge', 'cfg' => $youge_phone ],
+    [ 'name' => 'cuyun', 'cfg' => $cuyun_phone ],
+    [ 'name' => 'lihui', 'cfg' => $lihui_phone ],
+    [ 'name' => 'yeyankc001', 'cfg' => $yeyankc001_phone ],
+    [ 'name' => 'yeyankc002', 'cfg' => $yeyankc002_phone ],
+    [ 'name' => 'tengsu', 'cfg' => $tengsu_phone ],
 	];

BIN
helper/refill/api/xyz/guochuang/20241226_dx_shanxi.png


BIN
helper/refill/api/xyz/guochuang/20241227_dx_shanxi.png


BIN
helper/refill/api/xyz/guochuang/20241230_dx_hubei.jpg


BIN
helper/refill/api/xyz/guochuang/20241230_dx_shandong.jpg


BIN
helper/refill/api/xyz/guochuang/20250102_dx_shanxi.jpg


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

@@ -98,10 +98,10 @@ class config
         "5-20-23" => 20.08, "5-30-23" => 30.12, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
         "5-10-31" => 10.22, "5-20-31" => 20.22, "5-30-31" => 30.24, "5-50-31" => 50.25, "5-100-31" => 100.3, "5-200-31" => 200.4, "5-300-31" => 300.6, "5-500-31" => 501,//新疆 31
         //电信
-        "6-10-27" => 10.005, "6-20-27" => 20.01, "6-30-27" => 30.015, "6-50-27" => 50.025, "6-100-27" => 100.05, "6-200-27" => 200.1, "6-300-27" => 300.15, "6-500-27" => 501,//陕西 27
+        "6-10-27" => 9.955, "6-20-27" => 19.91, "6-30-27" => 29.865, "6-50-27" => 49.775, "6-100-27" => 99.55, "6-200-27" => 199.94, "6-300-27" => 299.91, "6-500-27" => 501,//陕西 27
         "6-10-4" => 10.37, "6-20-4" => 20.39, "6-30-4" => 30.42, "6-50-4" => 50.45, "6-100-4" => 100.6, "6-200-4" => 201.2, "6-300-4" => 301.8, "6-500-4" => 503,//山西 4
         "6-10-18" => 10.04, "6-20-18" => 20.08, "6-30-18" => 30.12, "6-50-18" => 50.15, "6-100-18" => 100.3, "6-200-18" => 200.6, "6-300-18" => 300.9, "6-500-18" => 501.5,//湖南 18
-        "6-10-15" => 10.27, "6-20-15" => 20.29, "6-30-15" => 30.33, "6-50-15" => 50.7, "6-100-15" => 101, "6-200-15" => 200.4, "6-300-15" => 300.6, "6-500-15" => 501,//山东 15
+        "6-10-15" => 10.37, "6-20-15" => 20.38, "6-30-15" => 30.42, "6-50-15" => 50.8, "6-100-15" => 101, "6-200-15" => 200.4, "6-300-15" => 300.6, "6-500-15" => 501,//山东 15
         "6-10-12" => 10.21, "6-20-12" => 20.22, "6-30-12" => 30.24, "6-50-12" => 50.2, "6-100-12" => 100.4, "6-200-12" => 200.8, "6-300-12" => 301.2, "6-500-12" => 502,//安徽 12
         "6-10-2" => 10.12, "6-20-2" => 20.16, "6-30-2" => 30.21, "6-50-2" => 50.175, "6-100-2" => 100.35, "6-200-2" => 200.7, "6-300-2" => 301.05, "6-500-2" => 501.75,//天津 2
         "6-10-20" => 10.16, "6-20-20" => 20.18, "6-30-20" => 30.21, "6-50-20" => 50.35, "6-100-20" => 100.45, "6-200-20" => 200.6, "6-300-20" => 300.9, "6-500-20" => 501.5,//广西 20
@@ -110,5 +110,6 @@ class config
         "6-10-16" => 10.18, "6-20-16" => 20.2, "6-30-16" => 30.27, "6-50-16" => 50.325, "6-100-16" => 100.45, "6-200-16" => 200.5, "6-300-16" => 300.75, "6-500-16" => 501.25,//河南 16
         "6-10-13" => 10.07, "6-20-13" => 20.14, "6-30-13" => 30.21, "6-50-13" => 50.5, "6-100-13" => 100.9, "6-200-13" => 200.8, "6-300-13" => 300.9, "6-500-13" => 501.5,//福建 13
         "6-10-6" => 10.21, "6-20-6" => 20.24, "6-30-6" => 30.27, "6-50-6" => 50.175, "6-100-6" => 100.35, "6-200-6" => 200.7, "6-300-6" => 301.05, "6-500-6" => 501.75,//辽宁 6
+        "6-10-17" => 10.23, "6-20-17" => 20.46, "6-30-17" => 30.69, "6-50-17" => 51.1,//湖北 17
     ];
 }

+ 36 - 0
helper/refill/api/xyz/masheng/API.MD

@@ -0,0 +1,36 @@
+
+## 玛昇快充
+
+### 账号:
+> http://admin.mashengquanyi.com/telequity
+- 登陆账号:4637888
+- 登陆密码:123456
+- 商户号:4637888
+- KEY:K0DYDKRH05KYBWI4846Z9VRR
+
+### 对接:
+- api接口文档地址:
+  > http://api.mashengquanyi.com
+- 话费下单地址:
+  > http://api.mashengquanyi.com/api/addOrder
+- 订单主动查询地址:
+  > http://api.mashengquanyi.com/api/payment/order
+- 余额查询:
+  > http://api.mashengquanyi.com/api/payment/query/bank
+
+### 店铺
+- 账号:masheng
+- 密码:masheng67890
+
+### 编码
+100YDJS	中国移动100-秒到
+200YDJS	移动200-秒到
+300YDJS	移动300-秒到
+500YDJS	移动500-秒到
+
+30DXJS	电信30-秒到
+50DXJS	电信50-秒到
+100DXJS	中国电信100-秒到
+200DXJS	电信200-秒到
+300DXJS	电信300-秒到
+500DXJS	电信500-秒到

+ 51 - 0
helper/refill/api/xyz/masheng/RefillCallBack.php

@@ -0,0 +1,51 @@
+<?php
+namespace refill\masheng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/masheng/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): string
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "agent_id=$userid&amount={$params['amount']}&batch_no={$params['batch_no']}&key=$key&order_id={$params['order_id']}&pay_at={$params['pay_at']}&status={$params['status']}";
+        return md5($content);
+    }
+
+    public function notify($params): array
+    {
+        $status = intval($params['status']);
+        $order_sn = $params['batch_no'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false, false, ''];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === 2) {
+            $official_sn = $params['refid '];
+
+            $data['official_sn'] = $official_sn;
+            $data['ch_trade_no'] = $params['order_id'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        } elseif ($status === 4) {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['order_id']]);
+            return [$order_id, false, true, true, ''];
+        } else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 144 - 0
helper/refill/api/xyz/masheng/RefillPhone.php

@@ -0,0 +1,144 @@
+<?php
+
+namespace refill\masheng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/masheng/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): array
+    {
+        $productid = config::ProductIdS[$card_type][$amount] ?? false;
+        if ($productid === false){
+            return [];
+        }
+
+        $params['batch_no'] = $order_sn;
+        $params['agent_id'] = config::USER_ID;
+        $params['productNo'] = $productid;
+        $params['account'] = $phone;
+        $params['notify_url'] = config::NOTIFY_URL;
+        $params['add_at'] = date("Y-m-d H:i:s");
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0): array
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
+        if (empty($params)) {
+            return [false, '产品编码有误', false];
+        }
+
+        $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'] === 200) {
+                return [true, '', false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info): array
+    {
+        $params['agent_id'] = config::USER_ID;
+        $params['batch_no'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "agent_id={$params['agent_id']}&batch_no={$params['batch_no']}&key=$key";
+        $params['sign'] = md5($content);
+
+        $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'] === 200 && !empty($resp['result']))
+            {
+                $official_sn = '';
+
+                $status = intval($resp['result']['status']);
+                if ($status === 1) {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === 2) {
+                    $official_sn = $resp['result']['refid']; //TODO 临时代码,等上游更新文档后进行调整
+
+                    $updata['official_sn'] = $official_sn;
+                    $updata['ch_trade_no'] = $resp['result']['order_id'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === 4) {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $resp['result']['order_id']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } else {
+                    return [false, $resp['message'], ''];
+                }
+
+                return [true, $order_state, $official_sn];
+            }
+            else {
+                return [false, $resp['message'], ''];
+            }
+        }
+    }
+
+    public function balance(): array
+    {
+        $params['agent_id'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "agent_id={$params['agent_id']}&key=$key";
+        $params['sign'] = md5($content);
+
+        $resp = http_request(config::BALANCE_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'] === 200) {
+                return [true, $resp['result']['recharge_amount']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    private function sign($params): string
+    {
+        $key = config::KEY;
+        $content = "account={$params['account']}&add_at={$params['add_at']}&agent_id={$params['agent_id']}&batch_no={$params['batch_no']}";
+        $content .= "&key=$key&notify_url={$params['notify_url']}&productNo={$params['productNo']}";
+        return md5($content);
+    }
+}

+ 41 - 0
helper/refill/api/xyz/masheng/config.php

@@ -0,0 +1,41 @@
+<?php
+
+
+namespace refill\masheng;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://api.mashengquanyi.com/api/addOrder';
+    const QUERY_URL= 'http://api.mashengquanyi.com/api/payment/order';
+    const BALANCE_URL = 'http://api.mashengquanyi.com/api/payment/query/bank';
+
+    const USER_ID= '4637888';
+    const KEY = 'K0DYDKRH05KYBWI4846Z9VRR';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_masheng.php";
+
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;'];
+
+    const ProductIdS = [
+        mtopcard\ChinaMobileCard =>
+            [
+                100 => '100YDJS',
+                200 => '200YDJS',
+                300 => '300YDJS',
+                500 => '500YDJS',
+            ],
+        mtopcard\ChinaUnicomCard =>
+            [
+
+            ],
+        mtopcard\ChinaTelecomCard =>
+            [
+                30 => '30DXJS',
+                50 => '50DXJS',
+                100 => '100DXJS',
+                200 => '200DXJS',
+                300 => '300DXJS',
+                500 => '500DXJS',
+            ]
+    ];
+}

+ 1 - 3
helper/refill/api/xyz/qingyu/config.php

@@ -45,9 +45,7 @@ class config
         ksort($params);
         $content = '';
         foreach ($params as $key => $value) {
-            if(self::check_empty($value) === false) {
-                $content .= "{$key}{$value}";
-            }
+            $content .= "{$key}{$value}";
         }
         $content .= config::CP_KEY;
         return md5($content);

+ 7 - 1
helper/refill/api/yl/chengchong_fs/API.MD

@@ -50,4 +50,10 @@
 
 湖南电信200元    3430200
 湖南电信100元    3430100
-湖南电信50元    3430050
+湖南电信50元    3430050
+
+
+天津电信50-200  折扣95
+天津电信50元    3120050
+天津电信100元    3120100
+天津电信200元    3120200

+ 7 - 0
helper/refill/api/yl/chengchong_fs/config.php

@@ -80,6 +80,12 @@ class config
                 100 => 3430100,
                 200 => 3430200,
             ],
+            //天津
+            2 => [
+                50  => 3120050,
+                100 => 3120100,
+                200 => 3120200,
+            ],
         ]
     ];
 
@@ -96,5 +102,6 @@ class config
         "6-50-27" => 47.5, "6-100-27" => 95, "6-200-27" => 190, //陕西
         "6-50-19" => 47.5, "6-100-19" => 95, "6-200-19" => 190, //广东
         "6-50-18" => 47.5, "6-100-18" => 95, "6-200-18" => 190, //湖南
+        "6-50-2" => 47.5, "6-100-2" => 95, "6-200-2" => 190, //天津
     ];
 }

+ 36 - 0
helper/refill/api/yl/cuyun/API.MD

@@ -0,0 +1,36 @@
+## 促云全国1号
+
+### 正式环境:
+- 话费下单地址:http://8.130.117.16:16188/plat/api/hf/submitorder
+- 查询地址:http://8.130.117.16:16188/plat/api/queryorder
+- 查询余额地址:http://8.130.117.16:16188/plat/api/querybalance
+
+- 客户端地址:http://8.130.117.16:16188/plat/login
+- 账号:xj888
+- 密码:xj123456
+- 客户ID:100007
+- 密钥:8d9f255d731440c0a71b23fa9cc97780
+
+### 对接文档地址:
+> https://docs.qq.com/doc/DWEhQWEhDVEJIdUVC
+
+### 店铺账号
+- cuyun
+- cuyun67890
+
+### 产品编码
+
+全国移动50元  产品编码1000050
+全国移动100元 产品编码1000100
+全国移动200元 产品编码1000200
+
+全国联通30元 产品编码 2000030
+全国联通50元 产品编码 2000050
+全国联通100元 产品编码2000100
+全国联通200元 产品编码2000200
+
+全国电信50元 产品编码3000050
+全国电信100元 产品编码3000100
+全国电信200元 产品编码3000200
+
+移动966联通942电信968

+ 52 - 0
helper/refill/api/yl/cuyun/RefillCallBack.php

@@ -0,0 +1,52 @@
+<?php
+namespace refill\cuyun;
+
+require_once(BASE_HELPER_RAPI_PATH . '/cuyun/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $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 === 2) {
+            $official_sn = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 146 - 0
helper/refill/api/yl/cuyun/RefillPhone.php

@@ -0,0 +1,146 @@
+<?php
+
+namespace refill\cuyun;
+
+require_once(BASE_HELPER_RAPI_PATH . '/cuyun/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, int $card_type, string $order_sn)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['szProductId'] = config::Product[$card_type][$amount];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        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['szVerifyString'] = $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);
+
+            $nRtn = $resp['nRtn'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误', ''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误', ''];
+            }
+
+            $official_sn = '';
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $official_sn = $resp['szRtnMsg'];
+
+                $updata['official_sn'] = $official_sn;
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] > 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg'], ''];
+            }
+
+            return [true, $order_state, $official_sn];
+        }
+    }
+
+    public function balance()
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
+            } else {
+                return [false, $resp['szRtnCode']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
+}

+ 46 - 0
helper/refill/api/yl/cuyun/config.php

@@ -0,0 +1,46 @@
+<?php
+
+
+namespace refill\cuyun;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://8.130.117.16:16188/plat/api/hf/submitorder';
+    const QUERY_URL= 'http://8.130.117.16:16188/plat/api/queryorder';
+    const BALANCE_URL = 'http://8.130.117.16:16188/plat/api/querybalance';
+
+    const USER_ID= '100007';
+    const KEY = '8d9f255d731440c0a71b23fa9cc97780';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_cuyun.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+
+    const Product = [
+        mtopcard\ChinaMobileCard => [
+            50 => 1000050,
+            100 => 1000100,
+            200 => 1000200,
+        ],
+        mtopcard\ChinaUnicomCard => [
+            30  => 2000030,
+            50  => 2000050,
+            100 => 2000100,
+            200 => 2000200,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            50  => 3000050,
+            100 => 3000100,
+            200 => 3000200,
+        ],
+    ];
+}

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

@@ -98,10 +98,10 @@ class config
         "5-20-23" => 20.08, "5-30-23" => 30.12, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
         "5-10-31" => 10.22, "5-20-31" => 20.22, "5-30-31" => 30.24, "5-50-31" => 50.25, "5-100-31" => 100.3, "5-200-31" => 200.4, "5-300-31" => 300.6, "5-500-31" => 501,//新疆 31
         //电信
-        "6-10-27" => 10.005, "6-20-27" => 20.01, "6-30-27" => 30.015, "6-50-27" => 50.025, "6-100-27" => 100.05, "6-200-27" => 200.1, "6-300-27" => 300.15, "6-500-27" => 501,//陕西 27
+        "6-10-27" => 9.955, "6-20-27" => 19.91, "6-30-27" => 29.865, "6-50-27" => 49.775, "6-100-27" => 99.55, "6-200-27" => 199.94, "6-300-27" => 299.91, "6-500-27" => 501,//陕西 27
         "6-10-4" => 10.37, "6-20-4" => 20.39, "6-30-4" => 30.42, "6-50-4" => 50.45, "6-100-4" => 100.6, "6-200-4" => 201.2, "6-300-4" => 301.8, "6-500-4" => 503,//山西 4
         "6-10-18" => 10.04, "6-20-18" => 20.08, "6-30-18" => 30.12, "6-50-18" => 50.15, "6-100-18" => 100.3, "6-200-18" => 200.6, "6-300-18" => 300.9, "6-500-18" => 501.5,//湖南 18
-        "6-10-15" => 10.27, "6-20-15" => 20.29, "6-30-15" => 30.33, "6-50-15" => 50.7, "6-100-15" => 101, "6-200-15" => 200.4, "6-300-15" => 300.6, "6-500-15" => 501,//山东 15
+        "6-10-15" => 10.37, "6-20-15" => 20.38, "6-30-15" => 30.42, "6-50-15" => 50.8, "6-100-15" => 101, "6-200-15" => 200.4, "6-300-15" => 300.6, "6-500-15" => 501,//山东 15
         "6-10-12" => 10.21, "6-20-12" => 20.22, "6-30-12" => 30.24, "6-50-12" => 50.2, "6-100-12" => 100.4, "6-200-12" => 200.8, "6-300-12" => 301.2, "6-500-12" => 502,//安徽 12
         "6-10-2" => 10.12, "6-20-2" => 20.16, "6-30-2" => 30.21, "6-50-2" => 50.175, "6-100-2" => 100.35, "6-200-2" => 200.7, "6-300-2" => 301.05, "6-500-2" => 501.75,//天津 2
         "6-10-20" => 10.16, "6-20-20" => 20.18, "6-30-20" => 30.21, "6-50-20" => 50.35, "6-100-20" => 100.45, "6-200-20" => 200.6, "6-300-20" => 300.9, "6-500-20" => 501.5,//广西 20
@@ -110,5 +110,6 @@ class config
         "6-10-16" => 10.18, "6-20-16" => 20.2, "6-30-16" => 30.27, "6-50-16" => 50.325, "6-100-16" => 100.45, "6-200-16" => 200.5, "6-300-16" => 300.75, "6-500-16" => 501.25,//河南 16
         "6-10-13" => 10.07, "6-20-13" => 20.14, "6-30-13" => 30.21, "6-50-13" => 50.5, "6-100-13" => 100.9, "6-200-13" => 200.8, "6-300-13" => 300.9, "6-500-13" => 501.5,//福建 13
         "6-10-6" => 10.21, "6-20-6" => 20.24, "6-30-6" => 30.27, "6-50-6" => 50.175, "6-100-6" => 100.35, "6-200-6" => 200.7, "6-300-6" => 301.05, "6-500-6" => 501.75,//辽宁 6
+        "6-10-17" => 10.23, "6-20-17" => 20.46, "6-30-17" => 30.69, "6-50-17" => 51.1,//湖北 17
     ];
 }

+ 22 - 0
helper/refill/api/yl/lihui/API.MD

@@ -0,0 +1,22 @@
+## 栎辉全国1号(普充)
+
+### 正式环境:
+- 话费下单地址:http://121.199.22.114:16188/plat/api/hf/submitorder
+- 查询地址:http://121.199.22.114:16188/plat/api/queryorder
+- 查询余额地址:http://121.199.22.114:16188/plat/api/querybalance
+
+- 客户端地址:http://121.199.22.114:16188/plat/login
+- 账号:炫捷-WT
+- 密码:xj123456
+- 客户ID:100009
+- 密钥:2d49eba8bf1743fabd56f1223d7faa19
+
+### 对接文档地址:
+> https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ
+
+### 店铺账号
+- lihui
+- lihui67890
+
+### 折扣
+移动965 电信967 联通939

+ 52 - 0
helper/refill/api/yl/lihui/RefillCallBack.php

@@ -0,0 +1,52 @@
+<?php
+namespace refill\lihui;
+
+require_once(BASE_HELPER_RAPI_PATH . '/lihui/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $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 === 2) {
+            $official_sn = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 146 - 0
helper/refill/api/yl/lihui/RefillPhone.php

@@ -0,0 +1,146 @@
+<?php
+
+namespace refill\lihui;
+
+require_once(BASE_HELPER_RAPI_PATH . '/lihui/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, int $card_type, string $order_sn)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['szProductId'] = config::Product[$card_type][$amount];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        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['szVerifyString'] = $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);
+
+            $nRtn = $resp['nRtn'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误', ''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误', ''];
+            }
+
+            $official_sn = '';
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $official_sn = $resp['szRtnMsg'];
+
+                $updata['official_sn'] = $official_sn;
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] > 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg'], ''];
+            }
+
+            return [true, $order_state, $official_sn];
+        }
+    }
+
+    public function balance()
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
+            } else {
+                return [false, $resp['szRtnCode']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
+}

+ 46 - 0
helper/refill/api/yl/lihui/config.php

@@ -0,0 +1,46 @@
+<?php
+
+
+namespace refill\lihui;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.199.22.114:16188/plat/api/hf/submitorder';
+    const QUERY_URL= 'http://121.199.22.114:16188/plat/api/queryorder';
+    const BALANCE_URL = 'http://121.199.22.114:16188/plat/api/querybalance';
+
+    const USER_ID= '100009';
+    const KEY = '2d49eba8bf1743fabd56f1223d7faa19';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_lihui.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+
+    const Product = [
+        mtopcard\ChinaMobileCard => [
+            50 => 1000050,
+            100 => 1000100,
+            200 => 1000200,
+        ],
+        mtopcard\ChinaUnicomCard => [
+            30  => 2000030,
+            50  => 2000050,
+            100 => 2000100,
+            200 => 2000200,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            50  => 3000050,
+            100 => 3000100,
+            200 => 3000200,
+        ],
+    ];
+}

BIN
helper/refill/api/yl/lihui/product_code.jpg


+ 33 - 0
helper/refill/api/yl/tengsu/API.MD

@@ -0,0 +1,33 @@
+## 腾速全国1号
+
+### 正式环境:
+- 话费下单地址:http://121.43.172.242:16188/plat/api/hf/submitorder
+- 查询地址:http://121.43.172.242:16188/plat/api/queryorder
+- 查询余额地址:http://121.43.172.242:16188/plat/api/querybalance
+
+- 客户端地址:http://121.43.172.242:16188/plat/login
+- 账号:FQS999
+- 密码:123456
+- 客户ID:100033
+- 密钥:9d52bec94e45417b924ba2689064d8f3
+
+### 对接文档地址:
+> https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ
+
+### 店铺账号
+- tengsu
+- tengsu67890
+
+### 产品编码
+全国移动50元 1000050
+全国移动100元 1000100
+全国移动200元 1000200
+
+全国联通200元 2000200
+全国联通100元 2000100
+全国联通50元 2000050
+全国联通30元 2000030
+
+全国电信300元 3000300
+全国电信200元 3000200
+全国电信100元 3000100

+ 52 - 0
helper/refill/api/yl/tengsu/RefillCallBack.php

@@ -0,0 +1,52 @@
+<?php
+namespace refill\tengsu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/tengsu/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $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 === 2) {
+            $official_sn = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 146 - 0
helper/refill/api/yl/tengsu/RefillPhone.php

@@ -0,0 +1,146 @@
+<?php
+
+namespace refill\tengsu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/tengsu/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, int $card_type, string $order_sn)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['szProductId'] = config::Product[$card_type][$amount];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        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['szVerifyString'] = $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);
+
+            $nRtn = $resp['nRtn'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误', ''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误', ''];
+            }
+
+            $official_sn = '';
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $official_sn = $resp['szRtnMsg'];
+
+                $updata['official_sn'] = $official_sn;
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] > 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg'], ''];
+            }
+
+            return [true, $order_state, $official_sn];
+        }
+    }
+
+    public function balance()
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
+            } else {
+                return [false, $resp['szRtnCode']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
+}

+ 46 - 0
helper/refill/api/yl/tengsu/config.php

@@ -0,0 +1,46 @@
+<?php
+
+
+namespace refill\tengsu;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.43.172.242:16188/plat/api/hf/submitorder';
+    const QUERY_URL= 'http://121.43.172.242:16188/plat/api/queryorder';
+    const BALANCE_URL = 'http://121.43.172.242:16188/plat/api/querybalance';
+
+    const USER_ID= '100033';
+    const KEY = '9d52bec94e45417b924ba2689064d8f3';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_tengsu.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+
+    const Product = [
+        mtopcard\ChinaMobileCard => [
+            50 => 1000050,
+            100 => 1000100,
+            200 => 1000200,
+        ],
+        mtopcard\ChinaUnicomCard => [
+            30  => 2000030,
+            50  => 2000050,
+            100 => 2000100,
+            200 => 2000200,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            100 => 3000100,
+            200 => 3000200,
+            300 => 3000300,
+        ],
+    ];
+}

+ 14 - 0
helper/refill/api/yl/yeyankc001/API.MD

@@ -0,0 +1,14 @@
+### 椰焱快充1
+- 后台地址:https://admin.xyzshops.cn/merchant/#/login
+
+### 机构账号
+- yeyankc001
+- jklciu_o89
+- 10534
+
+### 店铺账号
+- yeyankc001
+- yeyankc00167890
+- 
+### 密钥
+d82d011ad5ccf314c00970c84be16a21

+ 76 - 0
helper/refill/api/yl/yeyankc001/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\yeyankc001;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yeyankc001/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;
+        }
+    }
+
+    protected function check_empty($value): bool
+    {
+        if (!isset($value))
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params): string
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+        return md5($body);
+    }
+
+    public function notify($params): array
+    {
+        $status = $params['state'];
+        $order_sn = $params['order_sn'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false, false, ''];
+        }
+        $official_sn = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 'CANCEL') {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['trade_no']]);
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 161 - 0
helper/refill/api/yl/yeyankc001/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\yeyankc001;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yeyankc001/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): array
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'add';
+        $params['mchid'] = config::MCH_ID;
+        $params['cardno'] = $phone;
+        $params['amount'] = $amount;
+        $params['order_sn'] = $order_sn;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0): array
+    {
+        $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 , [] , $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, '', false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info): array
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'query';
+        $params['mchid'] = config::MCH_ID;
+        $params['order_sn'] = $refill_info['order_sn'];
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+        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)
+            {
+                $official_sn = strtolower($resp['official_sn']) == 'null' ? '' : $resp['official_sn'];
+
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = $official_sn;
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($data['order_state'] === '0') {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $data['trade_no']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($data['order_state'], ['10', '20', '30', '50'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['message'], ''];
+                }
+                return [true, $order_state, $official_sn];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST, ''];
+            }
+            else
+            {
+                return [false, $resp['message'], ''];
+            }
+        }
+    }
+
+    public function balance(): array
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'balance';
+        $params['mchid'] = config::MCH_ID;
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+
+        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, ncPriceFormat($resp['datas']['balance'])];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value): bool
+    {
+        if (!isset($value))
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params): string
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+
+        return md5($body);
+    }
+}

+ 13 - 0
helper/refill/api/yl/yeyankc001/config.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace refill\yeyankc001;
+
+class config
+{
+    const ORDER_URL = 'https://www.xyzshops.cn/mobile/index.php';
+
+    const MCH_ID = 10534;
+    const KEY = 'd82d011ad5ccf314c00970c84be16a21';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yeyankc001.php";
+
+}

+ 14 - 0
helper/refill/api/yl/yeyankc002/API.MD

@@ -0,0 +1,14 @@
+### 椰焱快充2
+- 后台地址:https://admin.xyzshops.cn/merchant/#/login
+
+### 机构账号
+- yeyankc002
+- choi_78
+- 10535
+
+### 店铺账号
+- yeyankc002
+- yeyankc00267890
+- 
+### 密钥
+2293e8e41d95a9386b1f9dbb4a85837e

+ 76 - 0
helper/refill/api/yl/yeyankc002/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\yeyankc002;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yeyankc002/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;
+        }
+    }
+
+    protected function check_empty($value): bool
+    {
+        if (!isset($value))
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params): string
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+        return md5($body);
+    }
+
+    public function notify($params): array
+    {
+        $status = $params['state'];
+        $order_sn = $params['order_sn'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false, false, ''];
+        }
+        $official_sn = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 'CANCEL') {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['trade_no']]);
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 161 - 0
helper/refill/api/yl/yeyankc002/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\yeyankc002;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yeyankc002/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): array
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'add';
+        $params['mchid'] = config::MCH_ID;
+        $params['cardno'] = $phone;
+        $params['amount'] = $amount;
+        $params['order_sn'] = $order_sn;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0): array
+    {
+        $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 , [] , $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, '', false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info): array
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'query';
+        $params['mchid'] = config::MCH_ID;
+        $params['order_sn'] = $refill_info['order_sn'];
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+        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)
+            {
+                $official_sn = strtolower($resp['official_sn']) == 'null' ? '' : $resp['official_sn'];
+
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = $official_sn;
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($data['order_state'] === '0') {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $data['trade_no']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($data['order_state'], ['10', '20', '30', '50'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['message'], ''];
+                }
+                return [true, $order_state, $official_sn];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST, ''];
+            }
+            else
+            {
+                return [false, $resp['message'], ''];
+            }
+        }
+    }
+
+    public function balance(): array
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'balance';
+        $params['mchid'] = config::MCH_ID;
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+
+        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, ncPriceFormat($resp['datas']['balance'])];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value): bool
+    {
+        if (!isset($value))
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params): string
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+
+        return md5($body);
+    }
+}

+ 13 - 0
helper/refill/api/yl/yeyankc002/config.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace refill\yeyankc002;
+
+class config
+{
+    const ORDER_URL = 'https://www.xyzshops.cn/mobile/index.php';
+
+    const MCH_ID = 10535;
+    const KEY = '2293e8e41d95a9386b1f9dbb4a85837e';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yeyankc002.php";
+
+}

+ 4 - 0
mobile/callback/refill_cuyun.php

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

+ 4 - 0
mobile/callback/refill_lihui.php

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

+ 7 - 0
mobile/callback/refill_masheng.php

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

+ 4 - 0
mobile/callback/refill_tengsu.php

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

+ 4 - 0
mobile/callback/refill_yeyankc001.php

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

+ 4 - 0
mobile/callback/refill_yeyankc002.php

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

+ 67 - 0
test/TestRefill.php

@@ -6321,6 +6321,73 @@ class TestRefill extends TestCase
         $provider = $this->getProvider('youge_sec');
         $resp = $provider->balance();
     }
+
+    public function testcuyun()
+    {
+        $provider = $this->getProvider('cuyun');
+        $resp = $provider->balance();
+    }
+
+    public function testlihui()
+    {
+        $provider = $this->getProvider('lihui');
+        $resp = $provider->balance();
+    }
+
+    public function testyeyankc001()
+    {
+        $provider = $this->getProvider('yeyankc001');
+        $resp = $provider->balance();
+    }
+
+    public function testyeyankc002()
+    {
+        $provider = $this->getProvider('yeyankc002');
+        $resp = $provider->balance();
+    }
+
+    public function testmasheng()
+    {
+        $provider = $this->getProvider('masheng');
+        $resp = $provider->balance();
+//
+//        $query_params = [
+//            'order_sn' => $this->make_sn(),
+//        ];
+//        $provider->query($query_params);
+
+//        $net_errno = '';
+//        $provider->add('13911129867',4, 1, ['order_sn' => $this->make_sn()], $net_errno);
+    }
+    public function testsign()
+    {
+        $sign = function($params)
+        {
+            ksort($params);
+            $content = '';
+            foreach ($params as $key => $value) {
+                $content .= "{$key}{$value}";
+            }
+            $content .= '3845afd20883a8e16';
+            return md5($content);
+        };
+        $sgin = $sign([
+            'cpid' => '57974',
+            'order_no' => '24123018453457974331926531',
+            'mobile' => '15712899758',
+            'amount' => '100',
+            'status' => 'failed',
+            'sz_order_no' => '',
+            'ret_para' => '1434340788899534324530',
+//            'sign' => '99469ee5770c27f8a849f2cf2c652e25'
+        ]);
+    }
+
+    public function testtengsu()
+    {
+        $provider = $this->getProvider('tengsu');
+        $resp = $provider->balance();
+    }
 }