Bladeren bron

Merge branch 'raccount' into radmin

stanley-king 1 jaar geleden
bovenliggende
commit
1381b3c992
90 gewijzigde bestanden met toevoegingen van 3968 en 171 verwijderingen
  1. 2 2
      data/config/win/base.ini.php
  2. 166 43
      data/config/xyz/refill.ini.php
  3. 64 4
      data/config/yl/refill.ini.php
  4. 214 0
      data/config/zy/refill.ini.php
  5. 1 1
      docker/compose/xiaoyu/conf/nginx/nginx.conf
  6. 39 0
      helper/refill/api/xyz/by_online_mix_cb/API信息.txt
  7. 46 0
      helper/refill/api/xyz/by_online_mix_cb/RefillCallBack.php
  8. 156 0
      helper/refill/api/xyz/by_online_mix_cb/RefillPhone.php
  9. 59 0
      helper/refill/api/xyz/by_online_mix_cb/config.php
  10. 106 0
      helper/refill/api/xyz/by_online_mix_cb/hnyd.php
  11. BIN
      helper/refill/api/xyz/by_online_mix_cb/纸莺运营商数据管理平台对外接口.pdf
  12. BIN
      helper/refill/api/xyz/dongyefs/20230808广东移动调价函.jpg
  13. 2 1
      helper/refill/api/xyz/dongyefs/RefillCallBack.php
  14. 1 1
      helper/refill/api/xyz/dongyefs/RefillPhone.php
  15. 12 1
      helper/refill/api/xyz/dongyefs/config.php
  16. 35 0
      helper/refill/api/xyz/feihan_hf/RefillCallBack.php
  17. 167 0
      helper/refill/api/xyz/feihan_hf/RefillPhone.php
  18. 20 0
      helper/refill/api/xyz/feihan_hf/api.txt
  19. 21 0
      helper/refill/api/xyz/feihan_hf/config.php
  20. BIN
      helper/refill/api/xyz/feihan_hf/飞翰话费报价-20230801(国研).xlsx
  21. BIN
      helper/refill/api/xyz/guochuang/20230731辽宁移动调价函.jpg
  22. BIN
      helper/refill/api/xyz/guochuang/20230801广东移动调价函.jpg
  23. BIN
      helper/refill/api/xyz/guochuang/20230801辽宁移动调价函.jpg
  24. 2 2
      helper/refill/api/xyz/guochuang/config.php
  25. 61 0
      helper/refill/api/xyz/juhu/RefillCallBack.php
  26. 144 0
      helper/refill/api/xyz/juhu/RefillPhone.php
  27. BIN
      helper/refill/api/xyz/juhu/api.docx
  28. 15 0
      helper/refill/api/xyz/juhu/api.txt
  29. 21 0
      helper/refill/api/xyz/juhu/config.php
  30. 8 1
      helper/refill/api/xyz/meixu_sec/config.php
  31. 11 1
      helper/refill/api/xyz/meixu_sec/对接文档-yezi.txt
  32. 48 0
      helper/refill/api/xyz/zhenghe/API信息.txt
  33. 15 17
      helper/refill/api/xyz/zhenghe/RefillCallBack.php
  34. 65 61
      helper/refill/api/xyz/zhenghe/RefillPhone.php
  35. 0 15
      helper/refill/api/xyz/zhenghe/api.txt
  36. 42 13
      helper/refill/api/xyz/zhenghe/config.php
  37. BIN
      helper/refill/api/xyz/zhenghe/hq接口文档V1.0.docx
  38. 50 0
      helper/refill/api/yl/bailun/RefillCallBack.php
  39. 142 0
      helper/refill/api/yl/bailun/RefillPhone.php
  40. 32 0
      helper/refill/api/yl/bailun/api.txt
  41. 45 0
      helper/refill/api/yl/bailun/config.php
  42. 3 2
      helper/refill/api/yl/dongyefs/RefillCallBack.php
  43. 1 1
      helper/refill/api/yl/dongyefs/RefillPhone.php
  44. 12 1
      helper/refill/api/yl/dongyefs/config.php
  45. 2 2
      helper/refill/api/yl/guochuang/config.php
  46. 76 0
      helper/refill/api/yl/qudaiwafeiyintwo/RefillCallBack.php
  47. 161 0
      helper/refill/api/yl/qudaiwafeiyintwo/RefillPhone.php
  48. 7 0
      helper/refill/api/yl/qudaiwafeiyintwo/api.txt
  49. 13 0
      helper/refill/api/yl/qudaiwafeiyintwo/config.php
  50. 76 0
      helper/refill/api/zy/huanqiu_sec/RefillCallBack.php
  51. 161 0
      helper/refill/api/zy/huanqiu_sec/RefillPhone.php
  52. 7 0
      helper/refill/api/zy/huanqiu_sec/api.txt
  53. 13 0
      helper/refill/api/zy/huanqiu_sec/config.php
  54. 76 0
      helper/refill/api/zy/lifangfeiyin/RefillCallBack.php
  55. 161 0
      helper/refill/api/zy/lifangfeiyin/RefillPhone.php
  56. 7 0
      helper/refill/api/zy/lifangfeiyin/api.txt
  57. 13 0
      helper/refill/api/zy/lifangfeiyin/config.php
  58. 76 0
      helper/refill/api/zy/lifangyind/RefillCallBack.php
  59. 161 0
      helper/refill/api/zy/lifangyind/RefillPhone.php
  60. 7 0
      helper/refill/api/zy/lifangyind/api.txt
  61. 13 0
      helper/refill/api/zy/lifangyind/config.php
  62. 76 0
      helper/refill/api/zy/mengjihuanoyin/RefillCallBack.php
  63. 161 0
      helper/refill/api/zy/mengjihuanoyin/RefillPhone.php
  64. 7 0
      helper/refill/api/zy/mengjihuanoyin/api.txt
  65. 13 0
      helper/refill/api/zy/mengjihuanoyin/config.php
  66. 76 0
      helper/refill/api/zy/mengjihuaqgf/RefillCallBack.php
  67. 161 0
      helper/refill/api/zy/mengjihuaqgf/RefillPhone.php
  68. 7 0
      helper/refill/api/zy/mengjihuaqgf/api.txt
  69. 13 0
      helper/refill/api/zy/mengjihuaqgf/config.php
  70. 76 0
      helper/refill/api/zy/qudaiwanotwo/RefillCallBack.php
  71. 161 0
      helper/refill/api/zy/qudaiwanotwo/RefillPhone.php
  72. 7 0
      helper/refill/api/zy/qudaiwanotwo/api.txt
  73. 13 0
      helper/refill/api/zy/qudaiwanotwo/config.php
  74. 76 0
      helper/refill/api/zy/weibian_qy/RefillCallBack.php
  75. 176 0
      helper/refill/api/zy/weibian_qy/RefillPhone.php
  76. 7 0
      helper/refill/api/zy/weibian_qy/api.txt
  77. 13 0
      helper/refill/api/zy/weibian_qy/config.php
  78. 4 0
      mobile/callback/refill_bailun.php
  79. 4 0
      mobile/callback/refill_feihan_hf.php
  80. 4 0
      mobile/callback/refill_huanqiu_sec.php
  81. 4 0
      mobile/callback/refill_lifangfeiyin.php
  82. 4 0
      mobile/callback/refill_lifangyind.php
  83. 4 0
      mobile/callback/refill_mengjihuanoyin.php
  84. 4 0
      mobile/callback/refill_mengjihuaqgf.php
  85. 4 0
      mobile/callback/refill_qudaiwafeiyintwo.php
  86. 4 0
      mobile/callback/refill_qudaiwanotwo.php
  87. 4 0
      mobile/callback/refill_weibian_qy.php
  88. 3 2
      mobile/callback/refill_zhenghe.php
  89. 18 0
      test/TestRefill.php
  90. 6 0
      test/TestRefillYl.php

+ 2 - 2
data/config/win/base.ini.php

@@ -10,13 +10,13 @@ define('BONUS_EXPIRY_DATE',true);
 define('USE_BONUS_RATE',false);
 define('SERVER_TYPE','panda');
 define('CROSS_DOAMIN',true);
-define('COOKIE_DOMAIN','192.168.1.218');
+define('COOKIE_DOMAIN','192.168.31.168');
 define('COMPANY_NAME', 'XYZ_COMPANY');
 define('NET_IP','123.117.109.96');
 define('ZERO_GOODS_ID', 6666);
 define('ADMIN_NAME', 'YELIN');
 
-$SRV_HOST = 'http://192.168.1.218';
+$SRV_HOST = 'http://192.168.31.168';
 $REMOTE_IMG_HOST = $SRV_HOST;
 
 $config = [];

+ 166 - 43
data/config/xyz/refill.ini.php

@@ -288,10 +288,10 @@ $quanzhen_oil = ['name' => 'quanzhen', 'store_id' => 325, 'qualitys' => '5',
 //        50 => [
 //            ['goods_id' => 8654, 'price' => 50.25, 'quality' => 5, 'card_type' => 'petrochina']
 //        ],
-//        100 => [
-//            ['goods_id' => 8655, 'price' => 100.5, 'quality' => 5, 'card_type' => 'petrochina'],
-//            ['goods_id' => 8655, 'price' => 100.7, 'quality' => 5, 'card_type' => 'sinopec'],
-//        ],
+        100 => [
+            ['goods_id' => 8655, 'price' => 100.2, 'quality' => 5, 'card_type' => 'petrochina'],
+            ['goods_id' => 8655, 'price' => 100.2, 'quality' => 5, 'card_type' => 'sinopec'],
+        ],
         200 => [
             ['goods_id' => 8656, 'price' => 199.4, 'quality' => 5, 'card_type' => 'petrochina'],
             ['goods_id' => 8656, 'price' => 199.4, 'quality' => 5, 'card_type' => 'sinopec'],
@@ -4875,41 +4875,41 @@ $cangxin_yi_phone = ['name' => 'cangxin_yi', 'store_id' => 191,'qualitys' => '2'
 $zhenghe_phone = ['name' => 'zhenghe', 'store_id' => 192,'qualitys' => '2',
     'amount' => [
         1 => [
-            ['goods_id' => 8463, 'price' => 1.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8463, 'price' => 1.015, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         2 => [
-            ['goods_id' => 8464, 'price' => 2.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8464, 'price' => 2.03, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         3 => [
-            ['goods_id' => 8465, 'price' => 3.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8465, 'price' => 3.045, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         4 => [
-            ['goods_id' => 8466, 'price' => 4.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8466, 'price' => 4.06, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         5 => [
-            ['goods_id' => 8467, 'price' => 5.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8467, 'price' => 5.075, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         6 => [
-            ['goods_id' => 8468, 'price' => 6.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8468, 'price' => 6.06, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         7 => [
-            ['goods_id' => 8469, 'price' => 7.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8469, 'price' => 7.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         8 => [
-            ['goods_id' => 8470, 'price' => 8.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8470, 'price' => 8.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         9 => [
-            ['goods_id' => 8471, 'price' => 9.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8471, 'price' => 9.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         10 => [
-            ['goods_id' => 7625, 'price' => 10.15, 'quality' => 2, 'card_type' => 'chinaunicom']
+            ['goods_id' => 7625, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
         20 => [
-            ['goods_id' => 7626, 'price' => 20.2, 'quality' => 2, 'card_type' => 'chinaunicom']
+            ['goods_id' => 7626, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
         30 => [
             ['goods_id' => 7627, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7627, 'price' => 30.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7627, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7627, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinatelecom'],
         ],
         50 => [
@@ -4934,6 +4934,7 @@ $zhenghe_phone = ['name' => 'zhenghe', 'store_id' => 192,'qualitys' => '2',
         ],
         500 => [
             ['goods_id' => 7632, 'price' => 501.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7632, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7632, 'price' => 501.5, 'quality' => 2, 'card_type' => 'chinatelecom'],
         ]
     ],
@@ -8976,16 +8977,16 @@ $jiuyi_yin_phone = ['name' => 'jiuyi_yin', 'store_id' => 322, 'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$huiyuan_phone = ['name' => 'huiyuan', 'store_id' => 326, 'qualitys' => '2',
+$huiyuan_phone = ['name' => 'huiyuan', 'store_id' => 326, 'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 8659, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 8660, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 8661, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 8662, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 8663, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 8664, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 8665, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 8666, 'price' => 499, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 8659, 'price' => 9.98, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 8660, 'price' => 19.96, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 8661, 'price' => 29.94, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 8662, 'price' => 49.9, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 8663, 'price' => 99.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 8664, 'price' => 199.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 8665, 'price' => 299.4, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 8666, 'price' => 499, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -9115,14 +9116,35 @@ $quanzhen_hf_man_phone = ['name' => 'quanzhen_hf_man', 'store_id' => 332, 'quali
 
 $meixu_sec_phone = ['name' => 'meixu_sec', 'store_id' => 336, 'qualitys' => '2',
     'amount' => [
-//        10 => [['goods_id' => 8719, 'price' => 9.96, 'quality' => 2, 'card_type' => 'chinatelecom']],
-//        20 => [['goods_id' => 8720, 'price' => 19.92, 'quality' => 2, 'card_type' => 'chinatelecom']],
-//        30 => [['goods_id' => 8721, 'price' => 29.88, 'quality' => 2, 'card_type' => 'chinatelecom']],
-        50 => [['goods_id' => 8722, 'price' => 50.55, 'quality' => 2, 'card_type' => 'chinatelecom']],
-        100 => [['goods_id' => 8723, 'price' => 100.5, 'quality' => 2, 'card_type' => 'chinatelecom']],
-        200 => [['goods_id' => 8724, 'price' => 200.6, 'quality' => 2, 'card_type' => 'chinatelecom']],
-        300 => [['goods_id' => 8725, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinatelecom']],
-        500 => [['goods_id' => 8726, 'price' => 501.5, 'quality' => 2, 'card_type' => 'chinatelecom']]
+        10 => [
+            ['goods_id' => 8719, 'price' => 10.18, 'quality' => 2, 'card_type' => 'chinamobile'],
+        ],
+        20 => [
+            ['goods_id' => 8720, 'price' => 20.36, 'quality' => 2, 'card_type' => 'chinamobile']
+        ],
+        30 => [
+            ['goods_id' => 8721, 'price' => 30.54, 'quality' => 2, 'card_type' => 'chinamobile']
+        ],
+        50 => [
+            ['goods_id' => 8722, 'price' => 50.4, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8722, 'price' => 50.55, 'quality' => 2, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8723, 'price' => 100.55, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8723, 'price' => 100.5, 'quality' => 2, 'card_type' => 'chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 8724, 'price' => 201.1, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8724, 'price' => 200.6, 'quality' => 2, 'card_type' => 'chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 8725, 'price' => 301.65, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8725, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 8726, 'price' => 502.75, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8726, 'price' => 501.5, 'quality' => 2, 'card_type' => 'chinatelecom'],
+        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -9210,7 +9232,7 @@ $yuntian_fs_phone = ['name' => 'yuntian_fs', 'store_id' => 346, 'qualitys' => '1
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$kainuo_phone = ['name' => 'kainuo', 'store_id' => 349, 'qualitys' => '2',
+$kainuo_phone = ['name' => 'kainuo', 'store_id' => 349, 'qualitys' => '1',
     'amount' => [
 //        10 => [
 //            ['goods_id' => 8770, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
@@ -9228,19 +9250,19 @@ $kainuo_phone = ['name' => 'kainuo', 'store_id' => 349, 'qualitys' => '2',
 //            ['goods_id' => 8772, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinatelecom']
 //        ],
         50 => [
-            ['goods_id' => 8773, 'price' => 49.7, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8773, 'price' => 49.7, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8773, 'price' => 49.7, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 8773, 'price' => 49.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8773, 'price' => 49.7, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8773, 'price' => 49.7, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 8774, 'price' => 99.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8774, 'price' => 99.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8774, 'price' => 99.4, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 8774, 'price' => 99.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8774, 'price' => 99.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8774, 'price' => 99.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 8775, 'price' => 198.8, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8775, 'price' => 198.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8775, 'price' => 198.8, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 8775, 'price' => 198.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8775, 'price' => 198.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8775, 'price' => 198.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
 //        300 => [
 //            ['goods_id' => 8776, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
@@ -9295,6 +9317,104 @@ $hunchongby_phone = ['name' => 'hunchongby', 'store_id' => 350, 'qualitys' => '3
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$juhu_phone = ['name' => 'juhu', 'store_id' => 351, 'qualitys' => '1',
+    'amount' => [
+//        10 => [['goods_id' => 8804, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 8805, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        30 => [['goods_id' => 8806, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 8807, 'price' => 49.65, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 8808, 'price' => 99.3, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 8809, 'price' => 198.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        300 => [['goods_id' => 8810, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 8811, 'price' => 496.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$by_online_mix_cb_phone = ['name' => 'by_online_mix_cb', 'store_id' => 352, 'qualitys' => '3',
+    'amount' => [
+        1 => [
+            ['goods_id' => 8812, 'price' => 1, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        2 => [
+            ['goods_id' => 8813, 'price' => 2, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        3 => [
+            ['goods_id' => 8814, 'price' => 3, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        4 => [
+            ['goods_id' => 8815, 'price' => 4, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        5 => [
+            ['goods_id' => 8816, 'price' => 5, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        6 => [
+            ['goods_id' => 8817, 'price' => 6, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        7 => [
+            ['goods_id' => 8818, 'price' => 7, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        8 => [
+            ['goods_id' => 8819, 'price' => 8, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        9 => [
+            ['goods_id' => 8820, 'price' => 9, 'quality' => 3, 'card_type' => 'chinamobile'],
+        ],
+        10 => [['goods_id' => 8821, 'price' => 10, 'quality' => 3, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 8822, 'price' => 20, 'quality' => 3, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 8823, 'price' => 30, 'quality' => 3, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 8824, 'price' => 50, 'quality' => 3, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 8825, 'price' => 100, 'quality' => 3, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 8826, 'price' => 200, 'quality' => 3, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 8827, 'price' => 300, 'quality' => 3, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 8828, 'price' => 500, 'quality' => 3, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$feihan_hf_phone = ['name' => 'feihan_hf', 'store_id' => 353, 'qualitys' => '2',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8829, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8829, 'price' => 10.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8829, 'price' => 10.23, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8830, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8830, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8830, 'price' => 20.26, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8831, 'price' => 30.105, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8831, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8831, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+//            ['goods_id' => 8832, 'price' => 49.7, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8832, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8832, 'price' => 49.7, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8833, 'price' => 100.15, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8833, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8833, 'price' => 100.3, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8834, 'price' => 200.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8834, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8834, 'price' => 200.6, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8835, 'price' => 300.45, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8835, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8835, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8836, 'price' => 500.75, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8836, 'price' => 501, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8836, 'price' => 501.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -9581,6 +9701,9 @@ $phone_providers = [
     ['name' => 'yuntian_fs', 'cfg' => $yuntian_fs_phone],
     ['name' => 'kainuo', 'cfg' => $kainuo_phone],
     ['name' => 'hunchongby', 'cfg' => $hunchongby_phone],
+    ['name' => 'juhu', 'cfg' => $juhu_phone],
+    ['name' => 'by_online_mix_cb', 'cfg' => $by_online_mix_cb_phone],
+    ['name' => 'feihan_hf', 'cfg' => $feihan_hf_phone],
 
 ];
 $config['phone_providers'] = $phone_providers;

+ 64 - 4
data/config/yl/refill.ini.php

@@ -7463,19 +7463,77 @@ $yuntian_fs_phone = ['name' => 'yuntian_fs', 'store_id' => 285, 'qualitys' => '1
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$juhu_phone = ['name' => 'juhu', 'store_id' => 288, 'qualitys' => '2',
+$juhu_phone = ['name' => 'juhu', 'store_id' => 288, 'qualitys' => '1',
     'amount' => [
 //        10 => [['goods_id' => 8345, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
 //        20 => [['goods_id' => 8346, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
 //        30 => [['goods_id' => 8347, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 8348, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 8349, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 8350, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 8348, 'price' => 49.65, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 8349, 'price' => 99.3, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 8350, 'price' => 198.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
 //        300 => [['goods_id' => 8351, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
 //        500 => [['goods_id' => 8352, 'price' => 496.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$bailun_phone = ['name' => 'bailun', 'store_id' => 289, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8353, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8353, 'price' => 10.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8353, 'price' => 10.23, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8354, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8354, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8354, 'price' => 20.26, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8355, 'price' => 30.105, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8355, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8355, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8356, 'price' => 49.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8356, 'price' => 49.7, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8356, 'price' => 49.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8357, 'price' => 99.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8357, 'price' => 99.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8357, 'price' => 99.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8358, 'price' => 198.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8358, 'price' => 198.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8358, 'price' => 198.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8359, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8359, 'price' => 300.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8359, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8360, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8360, 'price' => 501, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8360, 'price' => 501.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$qudaiwafeiyintwo_phone = ['name' => 'qudaiwafeiyintwo', 'store_id' => 290, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 8361, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 8362, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 8363, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 8364, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 8365, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 8366, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 8367, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 8368, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -7717,6 +7775,8 @@ $phone_providers = [
     ['name' => 'yuntian', 'cfg' => $yuntian_phone],
     ['name' => 'yuntian_fs', 'cfg' => $yuntian_fs_phone],
     ['name' => 'juhu', 'cfg' => $juhu_phone],
+    ['name' => 'bailun', 'cfg' => $bailun_phone],
+    ['name' => 'qudaiwafeiyintwo', 'cfg' => $qudaiwafeiyintwo_phone],
 
 ];
 $config['phone_providers'] = $phone_providers;

+ 214 - 0
data/config/zy/refill.ini.php

@@ -2202,6 +2202,33 @@ $yiyunwozhifu_phone = ['name' => 'yiyunwozhifu', 'store_id' => 90, 'qualitys' =>
 
 $qilianhcfei_phone = ['name' => 'qilianhcfei', 'store_id' => 91, 'qualitys' => '2',
     'amount' => [
+        1 => [
+            ['goods_id' => 7048, 'price' => 1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        2 => [
+            ['goods_id' => 7049, 'price' => 2, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        3 => [
+            ['goods_id' => 7050, 'price' => 3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        4 => [
+            ['goods_id' => 7051, 'price' => 4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        5 => [
+            ['goods_id' => 7052, 'price' => 5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        6 => [
+            ['goods_id' => 7053, 'price' => 6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        7 => [
+            ['goods_id' => 7054, 'price' => 7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        8 => [
+            ['goods_id' => 7055, 'price' => 8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        9 => [
+            ['goods_id' => 7056, 'price' => 9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
         10 => [
             ['goods_id' => 6981, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
         ],
@@ -2298,6 +2325,180 @@ $by_online_mix_cb_phone = ['name' => 'by_online_mix_cb', 'store_id' => 93, 'qual
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$qudaiwanotwo_phone = ['name' => 'qudaiwanotwo', 'store_id' => 97, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 7040, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        20 => [
+            ['goods_id' => 7041, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        30 => [
+            ['goods_id' => 7042, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 7043, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 7044, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 7045, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 7046, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 7047, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$lifangfeiyin_phone = ['name' => 'lifangfeiyin', 'store_id' => 98, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 7057, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        20 => [
+            ['goods_id' => 7058, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        30 => [
+            ['goods_id' => 7059, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 7060, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 7061, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 7062, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 7063, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 7064, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$lifangyind_phone = ['name' => 'lifangyind', 'store_id' => 99, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 7065, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        20 => [
+            ['goods_id' => 7066, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        30 => [
+            ['goods_id' => 7067, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 7068, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 7069, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 7070, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 7071, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 7072, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$mengjihuanoyin_phone = ['name' => 'mengjihuanoyin', 'store_id' => 100, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 7073, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        20 => [
+            ['goods_id' => 7074, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        30 => [
+            ['goods_id' => 7075, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 7076, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 7077, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 7078, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 7079, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 7080, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$huanqiu_sec_phone = ['name' => 'huanqiu_sec', 'store_id' => 101, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 7081, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        20 => [
+            ['goods_id' => 7082, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        30 => [
+            ['goods_id' => 7083, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 7084, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 7085, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 7086, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 7087, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 7088, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$mengjihuaqgf_phone = ['name' => 'mengjihuaqgf', 'store_id' => 102, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 7089, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        20 => [
+            ['goods_id' => 7090, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        30 => [
+            ['goods_id' => 7091, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 7092, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 7093, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 7094, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 7095, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 7096, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
     ['name' => 'yezi_hf', 'cfg' => $yezi_hf_phone],
     ['name' => 'yezia', 'cfg' => $yezia_phone],
@@ -2373,6 +2574,12 @@ $phone_providers = [
     ['name' => 'qilianhcfei', 'cfg' => $qilianhcfei_phone],
     ['name' => 'huishiy', 'cfg' => $huishiy_phone],
     ['name' => 'by_online_mix_cb', 'cfg' => $by_online_mix_cb_phone],
+    ['name' => 'qudaiwanotwo', 'cfg' => $qudaiwanotwo_phone],
+    ['name' => 'lifangfeiyin', 'cfg' => $lifangfeiyin_phone],
+    ['name' => 'lifangyind', 'cfg' => $lifangyind_phone],
+    ['name' => 'mengjihuanoyin', 'cfg' => $mengjihuanoyin_phone],
+    ['name' => 'huanqiu_sec', 'cfg' => $huanqiu_sec_phone],
+    ['name' => 'mengjihuaqgf', 'cfg' => $mengjihuaqgf_phone],
 
 ];
 
@@ -2464,6 +2671,12 @@ $xinde_qy = ['name' => 'xinde_qy', 'store_id' => 94, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$weibian_qy = ['name' => 'weibian_qy', 'store_id' => 96, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 7039, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
     ['name' => 'byq_tianrui', 'cfg' => $byq_tianrui],
     ['name' => 'youlaicomeqy', 'cfg' => $youlaicomeqy],
@@ -2479,6 +2692,7 @@ $third_providers = [
     ['name' => 'huanxishuqy', 'cfg' => $huanxishuqy],
     ['name' => 'qudaiwqy', 'cfg' => $qudaiwqy],
     ['name' => 'xinde_qy', 'cfg' => $xinde_qy],
+    ['name' => 'weibian_qy', 'cfg' => $weibian_qy],
 ];
 $config['third_providers'] = $third_providers;
 

+ 1 - 1
docker/compose/xiaoyu/conf/nginx/nginx.conf

@@ -28,7 +28,7 @@ http
     {
     	listen       80;
         set  $folder_name /var/www/html;
-        server_name 192.168.1.218 www.xyxy.com;
+        server_name 192.168.31.168 www.xyxy.com;
         root $folder_name;
         index index.html index.php;
     	client_max_body_size 100m;

+ 39 - 0
helper/refill/api/xyz/by_online_mix_cb/API信息.txt

@@ -0,0 +1,39 @@
+测试域名 http://commapitest.bjzykj.work
+正式域名 http://commapi.bjzykj.work
+
+APPid:9
+version 1.0 版本号 默认 1.0
+APPkey:Hgxsyv041Jo45MR
+APPSecret:Hgxsyv041jQBaojkVZkdCKp6pUoYc1E4
+
+1 北京
+2 天津
+3 上海
+4 重庆
+5 河北
+6 山西
+8 辽宁
+9 吉林
+10 黑龙江
+11 江苏
+12 浙江
+13 安徽
+14 福建
+15 江西
+16 山东
+17 河南
+18 湖北
+19 湖南
+20 广东
+21 甘肃
+22 四川
+23 贵州
+24 海南
+25 云南
+26 青海
+27 陕西
+28 广西
+29 西藏
+30 宁夏
+31 新疆
+32 内蒙古

+ 46 - 0
helper/refill/api/xyz/by_online_mix_cb/RefillCallBack.php

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

+ 156 - 0
helper/refill/api/xyz/by_online_mix_cb/RefillPhone.php

@@ -0,0 +1,156 @@
+<?php
+
+namespace refill\by_online_mix_cb;
+
+require_once(BASE_HELPER_RAPI_PATH . '/by_online_mix_cb/config.php');
+require_once(BASE_HELPER_RAPI_PATH . '/by_online_mix_cb/hnyd.php');
+
+use refill;
+use Log;
+use Cache;
+
+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, $regin_no)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['version'] = '1.0';
+        $params['merchantOrderNo'] = $order_sn;
+        $params['productId'] = 1;
+        $params['account'] = "{$phone}";
+        $params['amt'] = $amount * 100;
+        $params['callbackUrl'] = config::NOTIFY_URL;
+        $params['provinceId'] = config::ProvinceMap[$regin_no];
+        $params['parameter'] = '';
+        $params['extra'] = '';
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0)
+    {
+        $regin_no = $params['regin_no'] ?? -1;
+        if ($regin_no <= 0) {
+            return [false, '省份获取错误', false];
+        }
+
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $params['order_sn'], $regin_no);
+        $sign = config::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'] === 1000) {
+                Model()->table('refill_order')->where(['order_sn' => $order_sn])->update(['official_sn' => $resp['data']['charge_id']]);
+                return [true, $resp['data']['order_sn'], false];
+            }
+            elseif ($resp['code'] === 1001) {
+                $err = 998;
+                $net_errno = "HTTP-$err";
+                return [false, $resp['msg'], true];
+            }
+            else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['version'] = '1.0';
+        $params['merchantOrderNo'] = $refill_info['order_sn'];
+        $params['is_HN'] = 2;
+        $sign = config::sign($params);
+        $params['sign'] = $sign;
+
+        $charge_id = $refill_info['official_sn'];
+        $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)
+            {
+                if(empty($resp['data'])) {
+                    return [false, '没有移动返回的原始数据', ''];
+                }
+                else
+                {
+                    ksort($resp);
+                    $response = new response($resp['data']);
+                    $record = $response->find_record($charge_id);
+                    if($record !== false)
+                    {
+                        if ($record->canceled()) {
+                            $order_state = ORDER_STATE_CANCEL;
+                        } elseif ($record->successed()) {
+                            $order_state = ORDER_STATE_SUCCESS;
+                            Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $record->trade_id()]);
+                        } else {
+                            $order_state = ORDER_STATE_SEND;
+                        }
+                        return [true, $order_state, $charge_id];
+                    }
+                    elseif(time() - $refill_info['commit_time'] >= 2700) {
+                        return [true, ORDER_STATE_NOEXIST, $charge_id];
+                    }
+                    else {
+                        return [false, '没有移动返回的原始数据', ''];
+                    }
+                }
+            }
+            else {
+                return [false, $resp['msg'], ''];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['appId'] = config::APP_ID;
+        $params['version'] = '1.0';
+        $sign = config::sign($params);
+        $params['sign'] = $sign;
+
+        $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'] === 1000) {
+                return [true, $resp['data']['balance'] / 100];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+}

+ 59 - 0
helper/refill/api/xyz/by_online_mix_cb/config.php

@@ -0,0 +1,59 @@
+<?php
+namespace refill\by_online_mix_cb;
+
+class config
+{
+    const ORDER_URL = 'http://commapi.bjzykj.work/comm/recharge';
+    const QUERY_URL = 'http://commapi.bjzykj.work/comm/orderQuery';
+    const BALANCE_URL = 'http://commapi.bjzykj.work/comm/account';
+
+    const APP_ID = '9';
+    const APP_KEY = 'Hgxsyv041Jo45MR';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_by_online_mix_cb.php";
+    const ExtHeaders = ['Content-Type: application/json'];
+
+    public static function sign($params)
+    {
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            $content .= "{$key}={$value}&";
+        }
+        $content .= config::APP_KEY;
+        return md5($content);
+    }
+
+    const ProvinceMap = [
+        1	=> 1,  //'北京',
+        2	=> 2,  //'天津',
+        3	=> 5, //'河北',
+        4	=> 6, //'山西',
+        5	=> 32,  //'内蒙古',
+        6	=> 8,  //'辽宁',
+        7	=> 9,  //'吉林',
+        8	=> 10,  //'黑龙江',
+        9	=> 3,  //'上海',
+        10	=> 11, //'江苏',
+        11	=> 12, //'浙江',
+        12	=> 13, //'安徽',
+        13	=> 14, //'福建',
+        14	=> 15, //'江西',
+        15	=> 16, //'山东',
+        16	=> 17,  //'河南',
+        17	=> 18, //'湖北',
+        18	=> 19, //'湖南',
+        19	=> 20, //'广东',
+        20	=> 28, //'广西',
+        21	=> 24, //'海南',
+        22	=> 4,  //'重庆',
+        23	=> 22, //'四川',
+        24	=> 23, //'贵州',
+        25	=> 25, //'云南',
+        26	=> 29, //'西藏',
+        27	=> 27, //'陕西',
+        28	=> 21, //'甘肃',
+        29	=> 26, //'青海',
+        30	=> 30, //'宁夏',
+        31	=> 31  //'新疆'
+    ];
+}

+ 106 - 0
helper/refill/api/xyz/by_online_mix_cb/hnyd.php

@@ -0,0 +1,106 @@
+<?php
+
+namespace refill\by_online_mix_cb;
+
+class record
+{
+    private $mRecord;
+    public function __construct($record)
+    {
+        $this->mRecord = $record;
+    }
+
+    public function charge_id() {
+        return trim($this->mRecord['CHARGE_ID']);
+    }
+
+    public function trade_id() {
+        return trim($this->mRecord['OUT_TRADE_ID']);
+    }
+
+    public function fee()
+    {
+        return intval($this->mRecord['RECV_FEE']);
+    }
+
+    public function charge_time()
+    {
+        if(empty($this->mRecord['RECV_TIME'])) {
+            return false;
+        } else {
+            return strtotime($this->mRecord['RECV_TIME']);
+        }
+    }
+
+    public function canceled()
+    {
+        $deal_tag = $this->deal_tag();
+        return ($deal_tag === 2);
+    }
+
+    private function deal_tag()
+    {
+        return intval($this->mRecord['DEAL_TAG'] ?? 0);
+    }
+
+    public function successed()
+    {
+        $deal_tag = $this->deal_tag();
+        return ($deal_tag === 1);
+    }
+}
+
+
+class response
+{
+    private $mResult;
+    private $mRecords = [];
+    private $respCode;
+    public function __construct($resp)
+    {
+        $this->respCode = intval($resp['respCode']);
+        $this->mResult = $resp['result'];
+        ksort($this->mResult);
+
+        if(isset($this->mResult['data']))
+        {
+            $items = $this->mResult['data'];
+            foreach ( $items as $item)
+            {
+                ksort($item);
+                $this->mRecords[] = $item;
+            }
+            unset($this->mResult['data']);
+        }
+        else
+        {
+            $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) {
+                $item[$key] = $this->mResult[$key] ?? "";
+            }
+            ksort($item);
+            $this->mRecords[] = $item;
+            foreach ($keys as $key) {
+                unset($this->mResult[$key]);
+            }
+        }
+    }
+
+    public function find_record($charge_id)
+    {
+        foreach ($this->mRecords as $record)
+        {
+            $chid = $record['CHARGE_ID'];
+            if($chid == $charge_id) {
+                return new record($record);
+            }
+        }
+
+        return false;
+    }
+}

BIN
helper/refill/api/xyz/by_online_mix_cb/纸莺运营商数据管理平台对外接口.pdf


BIN
helper/refill/api/xyz/dongyefs/20230808广东移动调价函.jpg


+ 2 - 1
helper/refill/api/xyz/dongyefs/RefillCallBack.php

@@ -36,7 +36,8 @@ class RefillCallBack implements refill\IRefillCallBack
 
         $order_id = $order_info['order_id'];
         if ($status === 1) {
-            $data['official_sn'] = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $official_sn = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $data['official_sn'] = config::trim_prefix($official_sn);
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false, true];
         } elseif ($status === 9) {

+ 1 - 1
helper/refill/api/xyz/dongyefs/RefillPhone.php

@@ -112,7 +112,7 @@ class RefillPhone extends refill\IRefillPhone
             {
                 $resultno = $resp['resultno'];
                 if ($resultno === '1') {
-                    $updata['official_sn'] = $resp['remark1'];
+                    $updata['official_sn'] = config::trim_prefix($resp['remark1']);
                     Model('refill_order')->edit($refill_info['order_id'], $updata);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resultno === '9') {

+ 12 - 1
helper/refill/api/xyz/dongyefs/config.php

@@ -20,6 +20,17 @@ class config
         '5001','5002','5003','5004','5005','5008','5009','5010','5011','5012'
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;'];
+
+    public static function trim_prefix($official_sn){
+        $prefix = 'ydkc';
+        $length = strlen($prefix);
+
+        if ((substr($official_sn, 0, $length) === $prefix)) {
+            $official_sn = substr($official_sn, $length);
+        }
+        return $official_sn;
+    }
+
     const product_id = [
         mtopcard\ChinaMobileCard => [
             6 => [
@@ -96,7 +107,7 @@ class config
         "4-30-7" => 29.73, "4-50-7" => 49.55, "4-100-7" => 99.1, "4-200-7" => 198.2, "4-300-7" => 297.3, "4-500-7" => 495.5,//吉林 7
         "4-10-9" => 9.91, "4-20-9" => 19.82, "4-30-9" => 29.73, "4-50-9" => 49.55, "4-100-9" => 99.1, "4-200-9" => 198.2, "4-300-9" => 297.3, "4-500-9" => 495.5,//上海 9
         "4-10-13" => 9.89, "4-20-13" => 19.78, "4-30-13" => 29.67, "4-50-13" => 49.45, "4-100-13" => 98.9, "4-200-13" => 197.8, "4-300-13" => 296.7, "4-500-13" => 494.5,//福建 13
-        "4-30-19" => 29.97, "4-50-19" => 49.95, "4-100-19" => 99.9, "4-200-19" => 199.8, "4-300-19" => 299.7, "4-500-19" => 499.5,//广东 19
+        "4-30-19" => 30, "4-50-19" => 50, "4-100-19" => 100, "4-200-19" => 200, "4-300-19" => 300, "4-500-19" => 500,//广东 19
         "4-10-29" => 9.82, "4-20-29" => 19.64, "4-30-29" => 29.46, "4-50-29" => 49.1, "4-100-29" => 98.2, "4-200-29" => 196.4, "4-300-29" => 294.6, "4-500-29" => 491,//青海 29
         "4-10-8" => 10.04, "4-20-8" => 20.08, "4-30-8" => 30.12, "4-50-8" => 50.2, "4-100-8" => 100.4, "4-200-8" => 200.8,//黑龙江 8
         "4-50-5" => 50.1, "4-100-5" => 100.2, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5

+ 35 - 0
helper/refill/api/xyz/feihan_hf/RefillCallBack.php

@@ -0,0 +1,35 @@
+<?php
+namespace refill\feihan_hf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/feihan_hf/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return true;
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['ret_code']);
+        $order_sn = $params['sporder_id'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 1) {
+            $official_sn = strtolower($params['serial_no']) == 'null' ? '' : $params['serial_no'];
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true];
+        } elseif ($status === 9) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 167 - 0
helper/refill/api/xyz/feihan_hf/RefillPhone.php

@@ -0,0 +1,167 @@
+<?php
+
+namespace refill\feihan_hf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/feihan_hf/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $card_no, int $amount, int $card_type, string $order_sn)
+    {
+        $params['userid'] = config::USER_ID;
+        $params['userpws'] = md5(config::USER_PWS);
+        $params['cardid'] = config::goods_id;
+        $params['cardnum'] = $amount;
+        $params['sporder_id'] = $order_sn;
+        $params['sporder_time'] = date("YmdHis");
+        $params['game_userid'] = $card_no;
+        $params['ret_url'] = config::NOTIFY_URL;
+        $params['version'] = '6.0';
+        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['md5_str'] = $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);
+
+            $retCode = $resp['retcode'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($retCode === '1') {
+                return [true, $resp['orderid'], false];
+            } elseif (in_array($retCode, config::ERR_NOS, true)) {
+                return [false, $resp['err_msg'], false];
+            } elseif ($retCode === '9999') {
+                $net_errno = "HTTP-{$retCode}";
+                return [false, $resp['err_msg'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['err_msg'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['userid'] = config::USER_ID;
+        $params['userpws'] = md5(config::USER_PWS);
+        $params['sporder_id'] = $refill_info['order_sn'];
+        $params['version'] = '6.0';
+
+        $key = config::KEY;
+        $content = "{$params['userid']}{$params['userpws']}{$params['sporder_id']}{$key}";
+        $params['md5_str'] = 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, 'GB2312');
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            elseif ($resp['retcode'] === '1')
+            {
+                $status = $resp['game_state'];
+                if ($status === '1') {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === '9') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '0') {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['err_msg']];
+                }
+                return [true, $order_state];
+            }
+            elseif ($resp['retcode'] === '1010' && (time() - $refill_info['commit_time'] > 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['err_msg']];
+
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['userid'] = config::USER_ID;
+        $params['userpws'] = md5(config::USER_PWS);
+        $params['version'] = '6.0';
+
+        $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, 'GB2312');
+
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['retcode'] === '1') {
+                return [true, $resp['totalBalance']];
+            } else {
+                return [false, $resp['err_msg']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content = "{$params['userid']}{$params['userpws']}{$params['cardid']}{$params['cardnum']}{$params['sporder_id']}{$params['sporder_time']}{$params['game_userid']}";
+        $content .= $key;
+        return strtoupper(md5($content));
+    }
+
+    public function xmlToArray($xml, $encode = 'GBK')
+    {
+        $getEncoder = function ($xml,$default_encode)
+        {
+            $ret = preg_match("/<?xml\s+[\s\S]*(encoding=[\"']([^\"']*)[\"'])[\s\S]*?>/", $xml, $res);
+            if($ret !== false && count($res) === 3) {
+                return [$res[2], $res[1]];
+            } else {
+                return [$default_encode,'encoding="' . $default_encode . '"'];
+            }
+        };
+
+        [$encode, $replace_str] = $getEncoder($xml, $encode);
+        $xml = mb_convert_encoding($xml,"utf-8","{$encode}");
+        $xml = str_replace($replace_str, "encoding='utf-8'", $xml);
+        return refill\util::xmlToArray($xml);
+    }
+}

+ 20 - 0
helper/refill/api/xyz/feihan_hf/api.txt

@@ -0,0 +1,20 @@
+userid:A230801001
+userpws:F0EC8B1E2BC73541
+keystr:D10CD71CA9AFD303
+
+
+测试环境账号:
+userid:A08566
+userpws:of111111    需要 MD5 小写
+秘钥(keystr):OFCARD
+测试号码:15715155515
+
+http://openapi.ofpay.com
+
+话费商品编码:140101
+
+ret_code                充值状态     1成功   9失败
+ordersuccesstime   充值完成时间
+sporder_id             外部订单号
+err_msg                 失败原因
+serial_no                官方流水号

+ 21 - 0
helper/refill/api/xyz/feihan_hf/config.php

@@ -0,0 +1,21 @@
+<?php
+namespace refill\feihan_hf;
+
+class config
+{
+    const ORDER_URL = 'http://api2.ofpay.com/onlineorder.do';
+    const QUERY_URL= 'http://api2.ofpay.com/queryOrderInfo.do';
+    const BALANCE_URL = 'http://api2.ofpay.com/newqueryuserinfo.do';
+
+    const USER_ID = 'A230801001';
+    const USER_PWS = 'F0EC8B1E2BC73541';
+    const KEY = 'D10CD71CA9AFD303';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_feihan_hf.php";
+
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+    const ERR_NOS = [
+        '4001', '1037', '9998', '331', '321', '319', '1008', '1007', '1005', '1004', '1003', '1002', '11', '1001'
+    ];
+
+    const goods_id = 140101;
+}

BIN
helper/refill/api/xyz/feihan_hf/飞翰话费报价-20230801(国研).xlsx


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


BIN
helper/refill/api/xyz/guochuang/20230801广东移动调价函.jpg


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


+ 2 - 2
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.72, "4-20-6" => 19.44, "4-30-6" => 29.16, "4-50-6" => 48.6, "4-100-6" => 97.2, "4-200-6" => 194.4, "4-300-6" => 291.6, "4-500-6" => 486,//辽宁 6
+        "4-10-6" => 9.745, "4-20-6" => 19.49, "4-30-6" => 29.235, "4-50-6" => 48.725, "4-100-6" => 97.45, "4-200-6" => 194.9, "4-300-6" => 292.35, "4-500-6" => 487.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
@@ -72,7 +72,7 @@ class config
         "4-10-13" => 9.965, "4-20-13" => 19.93, "4-30-13" => 29.895, "4-50-13" => 49.825, "4-100-13" => 99.65, "4-200-13" => 199.3, "4-300-13" => 298.95, "4-500-13" => 498.25,//福建 13
         "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
-        "4-10-19" => 10.005, "4-20-19" => 20.1, "4-30-19" => 29.985, "4-50-19" => 49.975, "4-100-19" => 99.95, "4-200-19" => 199.9, "4-300-19" => 299.85, "4-500-19" => 499.75,//广东 19
+        "4-10-19" => 10.005, "4-20-19" => 20.1, "4-30-19" => 30.015, "4-50-19" => 50.025, "4-100-19" => 100.05, "4-200-19" => 200.1, "4-300-19" => 300.15, "4-500-19" => 500.25,//广东 19
         "4-10-7" => 9.93, "4-20-7" => 19.86, "4-30-7" => 29.52, "4-50-7" => 49.2, "4-100-7" => 98.4, "4-200-7" => 196.8, "4-300-7" => 295.2, "4-500-7" => 492,//吉林 7
         "4-10-1" => 10.31, "4-20-1" => 20.32, "4-30-1" => 30.33, "4-50-1" => 50.35, "4-100-1" => 100.4, "4-200-1" => 200.3, "4-300-1" => 300.45, "4-500-1" => 500.75,//北京 1
         "4-10-22" => 10.015, "4-20-22" => 20.03, "4-30-22" => 30.045, "4-50-22" => 50.075, "4-100-22" => 100.15, "4-200-22" => 200.3, "4-300-22" => 300.45, "4-500-22" => 500.75,//重庆 22

+ 61 - 0
helper/refill/api/xyz/juhu/RefillCallBack.php

@@ -0,0 +1,61 @@
+<?php
+
+
+namespace refill\juhu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/juhu/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)
+    {
+        $body = $params['order_number'];
+        $body .= $params['shipping_status'];
+        $body .= $params['tradeNo'];
+        $body .= config::API_CERT;
+        return strtolower(md5($body));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['shipping_status']);
+        $order_sn = $params['tradeNo'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+//0	充值失败
+//1	充值成功
+//2	充值中(非最终结果)
+//3	退款中(充值失败)
+//4	已退款(充值失败)
+//5	充值中未发货(非最终结果)
+//其他	提单成功(非最终结果)
+
+        $order_id = $order_info['order_id'];
+        if ($status === 1) {
+            $data['official_sn'] = strtolower($params['voucher']) == 'null' ? '' : $params['voucher'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status == 0 || $status == 4) {
+            return [$order_id, false, true,true];
+        } else { //status == 3 or status == 5
+            return [$order_id, false, false,false];
+        }
+    }
+}

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

@@ -0,0 +1,144 @@
+<?php
+
+namespace refill\juhu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/juhu/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 $card_type, $amount, string $order_sn)
+    {
+        $params['phone'] = $phone;
+        $params['product_id'] = $amount;
+        $params['notify_url'] = config::NOTIFY_URL;
+        $params['tradeNo'] = $order_sn;
+        $params['type'] = config::operator[$card_type];
+
+        return json_encode($params);
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $card_type, $amount, $order_sn);
+        $time = time();
+        $api_user_name = config::API_USER_NAME;
+        $sign = $this->sign($time);
+
+        $header = [
+            'Content-Type: application/json',
+            "API-USER-NAME: {$api_user_name}",
+            "API-NAME: OrderCreate",
+            "API-TIMESTAMP: {$time}",
+            "API-SIGNATURE: {$sign}",
+        ];
+        $resp = http_post_data(config::REQUEST_URL, $params, $header, $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['ack'] == 'success') {
+                return [true, $resp['message']['order_number'], false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['tradeNo'] = $refill_info['order_sn'];
+
+        $time = time();
+        $api_user_name = config::API_USER_NAME;
+        $sign = $this->sign($time);
+
+        $header = [
+            'Content-Type: application/json',
+            "API-USER-NAME: {$api_user_name}",
+            "API-NAME: OrderQuery",
+            "API-TIMESTAMP: {$time}",
+            "API-SIGNATURE: {$sign}",
+        ];
+
+        $resp = http_post_data(config::REQUEST_URL, json_encode($params), $header);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['ack'] === 'success') {
+                $data = $resp['order'];
+                if ($data['shipping_status'] === '1') {
+                    $updata['official_sn'] = strtolower($data['voucher']) == 'null' ? '' : $data['voucher'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif (in_array($data['shipping_status'], ['0', '3', '4'], true)) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($data['shipping_status'], ['2', '5'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['message']];
+                }
+                return [true, $order_state];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $time = time();
+        $api_user_name = config::API_USER_NAME;
+        $sign = $this->sign($time);
+
+        $header = [
+            'Content-Type: application/json',
+            "API-USER-NAME: {$api_user_name}",
+            "API-NAME: BalanceQuery",
+            "API-TIMESTAMP: {$time}",
+            "API-SIGNATURE: {$sign}",
+        ];
+
+        $resp = http_post_data(config::REQUEST_URL, '', $header);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['ack'] === 'success') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    private function sign($time)
+    {
+        $ip = config::API_IP;
+        $cert = config::API_CERT;
+        $content = $ip . $time . $cert;
+
+        return md5($content);
+    }
+}

BIN
helper/refill/api/xyz/juhu/api.docx


+ 15 - 0
helper/refill/api/xyz/juhu/api.txt

@@ -0,0 +1,15 @@
+新账号信息:
+后台网址http://jmd.txiat.cn/cmsAdmin/
+接口地址http://jmd.txiat.cn/APIHfKc/v2/
+账户13988889998
+密码13988889998
+(自行修改)
+API-USER-NAME
+74168ea67149ab816f8c3a7d47d4d0e8
+API-CERT
+ecc03bafbd5810f2e243b824cbbdef8f
+
+
+
+
+13430177773,默认成功。15014018311 默认失败,扣费金额0,用这俩个号码提交50面值测试

+ 21 - 0
helper/refill/api/xyz/juhu/config.php

@@ -0,0 +1,21 @@
+<?php
+
+
+namespace refill\juhu;
+
+use mtopcard;
+class config
+{
+    const REQUEST_URL = 'http://jmd.txiat.cn/APIHfKc/v2/';
+    const API_USER_NAME= '74168ea67149ab816f8c3a7d47d4d0e8';
+    const API_CERT = 'ecc03bafbd5810f2e243b824cbbdef8f';
+    const NOTIFY_URL =  BASE_SITE_URL."/mobile/callback/refill_juhu.php";
+
+    const API_IP = NET_IP;
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+}

+ 8 - 1
helper/refill/api/xyz/meixu_sec/config.php

@@ -24,7 +24,14 @@ class config
     ];
     const ProductId = [
         mtopcard\ChinaMobileCard => [
-
+            10 => 30000003370,
+            20 => 30000003371,
+            30 => 30000003372,
+            50 => 30000003373,
+            100 => 30000003374,
+            200 => 30000003375,
+            300 => 30000003376,
+            500 => 30000003377,
         ],
         mtopcard\ChinaUnicomCard => [
 

+ 11 - 1
helper/refill/api/xyz/meixu_sec/对接文档-yezi.txt

@@ -17,4 +17,14 @@
 30000003449	全国电信电渠话费500元
 
 2023.7.14
-30000003445 全国电信电渠话费50元
+30000003445 全国电信电渠话费50元
+
+2023.8.11
+30000003370  全国移动和包话费10元
+30000003371  全国移动和包话费20元
+30000003372  全国移动和包话费30元
+30000003373  全国移动和包话费50元
+30000003374  全国移动和包话费100元
+30000003375  全国移动和包话费200元
+30000003376  全国移动和包话费300元
+30000003377  全国移动和包话费500元

+ 48 - 0
helper/refill/api/xyz/zhenghe/API信息.txt

@@ -0,0 +1,48 @@
+登录参数
+http://api.bjxytxkj.com.cn:1008/hqorder/login
+账号:200024
+密码:123456(请及时更改初始密码)
+
+接口参数
+ID:200024
+秘钥:b5c5bae0bbf84eb58c3f38b091342059
+
+下单地址:http://api.bjxytxkj.com.cn:1008/hqorder/api/submit
+查询地址:http://api.bjxytxkj.com.cn:1008/hqorder/api/query
+查询余额地址:http://api.bjxytxkj.com.cn:1008/hqorder/api/balance
+
+请登录后台查看  产品  产品折扣  产品编码
+
+全国移动30元	1000030
+全国移动50元	1000050
+全国移动100元	1000100
+全国移动200元	1000200
+全国移动300元	1000300
+全国移动500元	1000500
+
+
+全国联通1元	2000001
+全国联通2元	2000002
+全国联通3元	2000003
+全国联通4元	2000004
+全国联通5元	2000005
+全国联通6元	2000006
+全国联通7元	2000007
+全国联通8元	2000008
+全国联通9元	2000009
+全国联通10元	2000010
+全国联通20元	2000020
+全国联通30元	2000030
+全国联通50元	2000050
+全国联通100元	2000100
+全国联通200元	2000200
+全国联通300元	2000300
+全国联通500元	2000500
+
+
+全国电信30元	3000030
+全国电信50元	3000050
+全国电信100元	3000100
+全国电信200元	3000200
+全国电信300元	3000300
+全国电信500元	3000500

+ 15 - 17
helper/refill/api/xyz/zhenghe/RefillCallBack.php

@@ -9,7 +9,7 @@ class RefillCallBack implements refill\IRefillCallBack
     public function verify($params): bool
     {
         $sign = $this->sign($params);
-        if ($params['szVerifyString'] == $sign) {
+        if ($params['sign'] == $sign) {
             return true;
         } else {
             return false;
@@ -18,33 +18,31 @@ class RefillCallBack implements refill\IRefillCallBack
 
     private function sign($params)
     {
-        $userid = config::USER_ID;
+        $mchid = config::MCHID;
         $key = config::KEY;
-        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
-        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        $content  = "mchid={$mchid}&orderid={$params['orderid']}&oid={$params['oid']}&number={$params['number']}&status={$params['status']}&key={$key}";
         return md5($content);
     }
 
     public function notify($params)
     {
-        $status = intval($params['nFlag']);
-        $order_sn = $params['szOrderId'];
+        $order_sn = $params['orderid'];
         $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'];
+        $status = intval($params['status']);
         if ($status === 2) {
-            $data['official_sn'] = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+            $official_sn = strtolower($params['voucher']) == 'null' ? '' : $params['voucher'];
+            $data['official_sn'] = $official_sn;
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 3) {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true, $official_sn];
+        } elseif ($status === 3) {
+            return [$order_id, false, true, true, ''];
+        } else {
+            return [$order_id, false, false, false, ''];
         }
     }
-}
+}

+ 65 - 61
helper/refill/api/xyz/zhenghe/RefillPhone.php

@@ -16,15 +16,12 @@ class RefillPhone extends refill\IRefillPhone
 
     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['nProductClass'] = 1;
-        $params['nProductType'] = 1;
-        $params['szTimeStamp'] = date("Y-m-d H:i:s");
-        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        $params['mchid'] = config::MCHID;
+        $params['orderid'] = $order_sn;
+        $params['number'] = $phone;
+        $params['productid'] = config::product_id[$card_type][$amount];
+        $params['timestamp'] = $this->getMillisecond();
+        $params['backurl'] = config::NOTIFY_URL;
         return $params;
     }
 
@@ -34,108 +31,115 @@ class RefillPhone extends refill\IRefillPhone
         $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
 
         $sign = $this->sign($params);
-        $params['szVerifyString'] = $sign;
+        $params['sign'] = $sign;
 
-        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+        $params = json_encode($params);
+        $resp = http_post_data(config::ORDER_URL, $params , config::ExtHeaders, $net_errno);
 
         if (empty($resp)) {
-            return [false, '网络错误', true];
+            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];
+                return [false, '系统错误', true];
+            } elseif ($resp['status'] === 0) {
+                return [true, $resp['oid'], false];
+            } elseif ($resp['status'] === -1) {
+                return [false, $resp['msg'], false];
             } else {
-                $err = 998;
-                $net_errno = "HTTP-{$err}";
-                return [false, $resp['szRtnCode'], true];
+                $net_errno = "HTTP-998";
+                return [false, $resp['msg'], true];
             }
         }
     }
 
     public function query($refill_info)
     {
-        $params['szAgentId'] = config::USER_ID;
-        $params['szOrderId'] = $refill_info['order_sn'];
+        $params['mchid'] = config::MCHID;
+        $params['orderid'] = $refill_info['order_sn'];
         $key = config::KEY;
-        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
-        $params['szVerifyString'] = md5($content);
+        $content = "mchid={$params['mchid']}&orderid={$params['orderid']}&key={$key}";
+        $params['sign'] = md5($content);
 
-        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+        $params = json_encode($params);
+        $resp = http_post_data(config::QUERY_URL, $params , config::ExtHeaders);
 
         if (empty($resp)) {
-            return [false, '网络错误'];
+            return [false, '系统错误', ''];
         }
         else
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
             if (empty($resp)) {
-                return [false, '网络错误'];
+                return [false, '系统错误', ''];
             }
-
-            $status = $resp['nRtn'];
-            if ($status === 5012) {
-                $updata['official_sn'] = $resp['szRtnMsg'];
-                Model('refill_order')->edit($refill_info['order_id'], $updata);
-                $order_state = ORDER_STATE_SUCCESS;
-            } elseif ($status === 5013) {
-                $order_state = ORDER_STATE_CANCEL;
-            } elseif (in_array($status, [5011,5019],true)) {
-                $order_state = ORDER_STATE_SEND;
-            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
-                $order_state = ORDER_STATE_NOEXIST;
-            } else {
-                return [false, $resp['szRtnMsg']];
+            else {
+                $offical_sn = '';
+                $status = $resp['status'];
+                if ($status === 2) {
+                    $offical_sn = $resp['voucher'];
+                    $updata['official_sn'] = $offical_sn;
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === 3) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === 1) {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === 4 && (time() - $refill_info['commit_time'] > 300)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $status, $offical_sn];
+                }
+                return [true, $order_state, $offical_sn];
             }
-
-            return [true, $order_state];
         }
     }
 
     public function balance()
     {
-        $params['szAgentId'] = config::USER_ID;
+        $params['mchid'] = config::MCHID;
         $key = config::KEY;
-        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
-        $params['szVerifyString'] = md5($content);
+        $content = "mchid={$params['mchid']}&key={$key}";
+        $params['sign'] = md5($content);
+        $params = json_encode($params);
 
-        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+        $resp = http_post_data(config::BALANCE_URL, $params , config::ExtHeaders);
 
         if (empty($resp)) {
-            return [false, '网络错误'];
+            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']];
+                return [false, '系统错误'];
+            } elseif ($resp['status'] === 1) {
+                return [true, $resp['balance']];
             } else {
-                return [false, $resp['szRtnCode']];
+                return [false, $resp['msg']];
             }
         }
     }
 
     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}";
+        $content  = "mchid={$params['mchid']}&orderid={$params['orderid']}&number={$params['number']}&productid={$params['productid']}";
+        $content .= "&timestamp={$params['timestamp']}&key={$key}";
         return md5($content);
     }
-}
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function getMillisecond()
+    {
+        $cur = microtime (true);
+        return intval($cur * 1000);
+    }
+}

+ 0 - 15
helper/refill/api/xyz/zhenghe/api.txt

@@ -1,15 +0,0 @@
-后台参数
-客户地址:http://47.98.208.128:10186/plat/index
-账号:gyhb
-密码:123456
-
-对接参数
-ID:200032
-秘钥:70fc4782de6e4686b7d1d125d3cd28ff
-
-正式环境:
-话费下单地址:http://47.98.208.128:10186/plat/api/old/submitorder
-查询地址:http://47.98.208.128:10186/plat/api/old/queryorder
-查询余额地址:http://47.98.208.128:10186/plat/api/old/queryBalance
-
-对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ

+ 42 - 13
helper/refill/api/xyz/zhenghe/config.php

@@ -6,21 +6,50 @@ namespace refill\zhenghe;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://47.98.208.128:10186/plat/api/old/submitorder';
-    const QUERY_URL= 'http://47.98.208.128:10186/plat/api/old/queryorder';
-    const BALANCE_URL = 'http://47.98.208.128:10186/plat/api/old/queryBalance';
+    const ORDER_URL = 'http://api.bjxytxkj.com.cn:1008/hqorder/api/submit';
+    const QUERY_URL = 'http://api.bjxytxkj.com.cn:1008/hqorder/api/query';
+    const BALANCE_URL = 'http://api.bjxytxkj.com.cn:1008/hqorder/api/balance';
 
-    const USER_ID= '200032';
-    const KEY = '70fc4782de6e4686b7d1d125d3cd28ff';
+    const MCHID = '200024';
+    const KEY = 'b5c5bae0bbf84eb58c3f38b091342059';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_zhenghe.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 ExtHeaders = ['Content-Type: application/json'];
 
-    const ERR_NOS = [
-        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    const product_id = [
+        mtopcard\ChinaMobileCard => [
+            30 => 1000030,
+            50 => 1000050,
+            100 => 1000100,
+            200 => 1000200,
+            300 => 1000300,
+            500 => 1000500
+        ],
+        mtopcard\ChinaUnicomCard => [
+            1 => 2000001,
+            2 => 2000002,
+            3 => 2000003,
+            4 => 2000004,
+            5 => 2000005,
+            6 => 2000006,
+            7 => 2000007,
+            8 => 2000008,
+            9 => 2000009,
+            10 => 2000010,
+            20 => 2000020,
+            30 => 2000030,
+            50 => 2000050,
+            100 => 2000100,
+            200 => 2000200,
+            300 => 2000300,
+            500 => 2000500
+        ],
+        mtopcard\ChinaTelecomCard => [
+            30 => 3000030,
+            50 => 3000050,
+            100 => 3000100,
+            200 => 3000200,
+            300 => 3000300,
+            500 => 3000500
+        ],
     ];
 }

BIN
helper/refill/api/xyz/zhenghe/hq接口文档V1.0.docx


+ 50 - 0
helper/refill/api/yl/bailun/RefillCallBack.php

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

+ 142 - 0
helper/refill/api/yl/bailun/RefillPhone.php

@@ -0,0 +1,142 @@
+<?php
+
+namespace refill\bailun;
+
+require_once(BASE_HELPER_RAPI_PATH . '/bailun/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, '网络错误'];
+            }
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $updata['official_sn'] = $resp['szRtnMsg'];
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg']];
+            }
+
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['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);
+    }
+}

+ 32 - 0
helper/refill/api/yl/bailun/api.txt

@@ -0,0 +1,32 @@
+正式环境:
+话费提交地址:http://121.40.244.114:10186/plat/api/old/submitorder
+查询地址:http://121.40.244.114:10186/plat/api/old/queryorder
+查询余额地址:http://121.40.244.114:10186/plat/api/old/queryBalance
+
+对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ
+
+客户端地址:http://121.40.244.114:10186/plat/index
+
+
+账户信息
+
+账号:ylhfws
+密码:123456ylhfws
+
+ID:  200053
+密钥:6daa337a78264287a52179d6a74efe46
+
+
+
+
+全国移动50元	1000050
+全国移动100元	1000100
+全国移动200元	1000200
+
+全国联通50元	2000050
+全国联通100元	2000100
+全国联通200元	2000200
+
+全国电信50元	3000050
+全国电信100元	3000100
+全国电信200元	3000200

+ 45 - 0
helper/refill/api/yl/bailun/config.php

@@ -0,0 +1,45 @@
+<?php
+
+
+namespace refill\bailun;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.40.244.114:10186/plat/api/old/submitorder';
+    const QUERY_URL= 'http://121.40.244.114:10186/plat/api/old/queryorder';
+    const BALANCE_URL = 'http://121.40.244.114:10186/plat/api/old/queryBalance';
+
+    const USER_ID= '200053';
+    const KEY = '6daa337a78264287a52179d6a74efe46';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_bailun.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 => [
+            50  => 2000050,
+            100 => 2000100,
+            200 => 2000200,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            50  => 3000050,
+            100 => 3000100,
+            200 => 3000200,
+        ],
+    ];
+}

+ 3 - 2
helper/refill/api/yl/dongyefs/RefillCallBack.php

@@ -29,14 +29,15 @@ class RefillCallBack implements refill\IRefillCallBack
     {
         $status = intval($params['resultno']);
         $order_sn = $params['sporderid'];
-        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
         if (empty($order_info)) {
             return [false, false, false,false];
         }
 
         $order_id = $order_info['order_id'];
         if ($status === 1) {
-            $data['official_sn'] = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $official_sn = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $data['official_sn'] = config::trim_prefix($official_sn);
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false, true];
         } elseif ($status === 9) {

+ 1 - 1
helper/refill/api/yl/dongyefs/RefillPhone.php

@@ -112,7 +112,7 @@ class RefillPhone extends refill\IRefillPhone
             {
                 $resultno = $resp['resultno'];
                 if ($resultno === '1') {
-                    $updata['official_sn'] = $resp['remark1'];
+                    $updata['official_sn'] = config::trim_prefix($resp['remark1']);
                     Model('refill_order')->edit($refill_info['order_id'], $updata);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resultno === '9') {

+ 12 - 1
helper/refill/api/yl/dongyefs/config.php

@@ -20,6 +20,17 @@ class config
         '5001','5002','5003','5004','5005','5008','5009','5010','5011','5012'
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;'];
+
+    public static function trim_prefix($official_sn){
+        $prefix = 'ydkc';
+        $length = strlen($prefix);
+
+        if ((substr($official_sn, 0, $length) === $prefix)) {
+            $official_sn = substr($official_sn, $length);
+        }
+        return $official_sn;
+    }
+
     const product_id = [
         mtopcard\ChinaMobileCard => [
             6 => [
@@ -96,7 +107,7 @@ class config
         "4-30-7" => 29.73, "4-50-7" => 49.55, "4-100-7" => 99.1, "4-200-7" => 198.2, "4-300-7" => 297.3, "4-500-7" => 495.5,//吉林 7
         "4-10-9" => 9.91, "4-20-9" => 19.82, "4-30-9" => 29.73, "4-50-9" => 49.55, "4-100-9" => 99.1, "4-200-9" => 198.2, "4-300-9" => 297.3, "4-500-9" => 495.5,//上海 9
         "4-10-13" => 9.89, "4-20-13" => 19.78, "4-30-13" => 29.67, "4-50-13" => 49.45, "4-100-13" => 98.9, "4-200-13" => 197.8, "4-300-13" => 296.7, "4-500-13" => 494.5,//福建 13
-        "4-30-19" => 29.97, "4-50-19" => 49.95, "4-100-19" => 99.9, "4-200-19" => 199.8, "4-300-19" => 299.7, "4-500-19" => 499.5,//广东 19
+        "4-30-19" => 30, "4-50-19" => 50, "4-100-19" => 100, "4-200-19" => 200, "4-300-19" => 300, "4-500-19" => 500,//广东 19
         "4-10-29" => 9.82, "4-20-29" => 19.64, "4-30-29" => 29.46, "4-50-29" => 49.1, "4-100-29" => 98.2, "4-200-29" => 196.4, "4-300-29" => 294.6, "4-500-29" => 491,//青海 29
         "4-10-8" => 10.04, "4-20-8" => 20.08, "4-30-8" => 30.12, "4-50-8" => 50.2, "4-100-8" => 100.4, "4-200-8" => 200.8,//黑龙江 8
         "4-50-5" => 50.1, "4-100-5" => 100.2, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5

+ 2 - 2
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.72, "4-20-6" => 19.44, "4-30-6" => 29.16, "4-50-6" => 48.6, "4-100-6" => 97.2, "4-200-6" => 194.4, "4-300-6" => 291.6, "4-500-6" => 486,//辽宁 6
+        "4-10-6" => 9.745, "4-20-6" => 19.49, "4-30-6" => 29.235, "4-50-6" => 48.725, "4-100-6" => 97.45, "4-200-6" => 194.9, "4-300-6" => 292.35, "4-500-6" => 487.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
@@ -72,7 +72,7 @@ class config
         "4-10-13" => 9.965, "4-20-13" => 19.93, "4-30-13" => 29.895, "4-50-13" => 49.825, "4-100-13" => 99.65, "4-200-13" => 199.3, "4-300-13" => 298.95, "4-500-13" => 498.25,//福建 13
         "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
-        "4-10-19" => 10.005, "4-20-19" => 20.1, "4-30-19" => 29.985, "4-50-19" => 49.975, "4-100-19" => 99.95, "4-200-19" => 199.9, "4-300-19" => 299.85, "4-500-19" => 499.75,//广东 19
+        "4-10-19" => 10.005, "4-20-19" => 20.1, "4-30-19" => 30.015, "4-50-19" => 50.025, "4-100-19" => 100.05, "4-200-19" => 200.1, "4-300-19" => 300.15, "4-500-19" => 500.25,//广东 19
         "4-10-7" => 9.93, "4-20-7" => 19.86, "4-30-7" => 29.52, "4-50-7" => 49.2, "4-100-7" => 98.4, "4-200-7" => 196.8, "4-300-7" => 295.2, "4-500-7" => 492,//吉林 7
         "4-10-1" => 10.31, "4-20-1" => 20.32, "4-30-1" => 30.33, "4-50-1" => 50.35, "4-100-1" => 100.4, "4-200-1" => 200.3, "4-300-1" => 300.45, "4-500-1" => 500.75,//北京 1
         "4-10-22" => 10.015, "4-20-22" => 20.03, "4-30-22" => 30.045, "4-50-22" => 50.075, "4-100-22" => 100.15, "4-200-22" => 200.3, "4-300-22" => 300.45, "4-500-22" => 500.75,//重庆 22

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

@@ -0,0 +1,76 @@
+<?php
+namespace refill\qudaiwafeiyintwo;
+
+require_once(BASE_HELPER_RAPI_PATH . '/qudaiwafeiyintwo/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)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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)
+    {
+        $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];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        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/qudaiwafeiyintwo/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\qudaiwafeiyintwo;
+
+require_once(BASE_HELPER_RAPI_PATH . '/qudaiwafeiyintwo/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['act'] = '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)
+    {
+        $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)
+    {
+        $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)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['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];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $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, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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);
+    }
+}

+ 7 - 0
helper/refill/api/yl/qudaiwafeiyintwo/api.txt

@@ -0,0 +1,7 @@
+https://co-data.zylife.co//merchant/#/login
+
+qudaiwafeiyintwo
+hjsicu_89
+
+124
+56c70b683e834a1c5c3750f4a98e48c2

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

@@ -0,0 +1,13 @@
+<?php
+
+namespace refill\qudaiwafeiyintwo;
+
+class config
+{
+    const ORDER_URL = 'https://co-api.zylife.co/mobile/index.php';
+
+    const MCH_ID = 124;
+    const KEY = '56c70b683e834a1c5c3750f4a98e48c2';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_qudaiwafeiyintwo.php";
+
+}

+ 76 - 0
helper/refill/api/zy/huanqiu_sec/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\huanqiu_sec;
+
+require_once(BASE_HELPER_RAPI_PATH . '/huanqiu_sec/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)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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)
+    {
+        $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];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        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/zy/huanqiu_sec/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\huanqiu_sec;
+
+require_once(BASE_HELPER_RAPI_PATH . '/huanqiu_sec/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $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)
+    {
+        $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)
+    {
+        $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)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['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];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $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, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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);
+    }
+}

+ 7 - 0
helper/refill/api/zy/huanqiu_sec/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+huanqiu2hao
+dfh_oi3
+
+10464
+7df8ce20f6d21d24e580ab764e647d5c

+ 13 - 0
helper/refill/api/zy/huanqiu_sec/config.php

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

+ 76 - 0
helper/refill/api/zy/lifangfeiyin/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\lifangfeiyin;
+
+require_once(BASE_HELPER_RAPI_PATH . '/lifangfeiyin/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)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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)
+    {
+        $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];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        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/zy/lifangfeiyin/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\lifangfeiyin;
+
+require_once(BASE_HELPER_RAPI_PATH . '/lifangfeiyin/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['act'] = '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)
+    {
+        $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)
+    {
+        $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)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['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];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $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, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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);
+    }
+}

+ 7 - 0
helper/refill/api/zy/lifangfeiyin/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+lifangfeiyin
+sdfx_yu34
+
+10461
+45201ba13d459fbc7c5ebcca602f94d3

+ 13 - 0
helper/refill/api/zy/lifangfeiyin/config.php

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

+ 76 - 0
helper/refill/api/zy/lifangyind/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\lifangyind;
+
+require_once(BASE_HELPER_RAPI_PATH . '/lifangyind/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)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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)
+    {
+        $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];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        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/zy/lifangyind/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\lifangyind;
+
+require_once(BASE_HELPER_RAPI_PATH . '/lifangyind/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['act'] = '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)
+    {
+        $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)
+    {
+        $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)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['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];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $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, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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);
+    }
+}

+ 7 - 0
helper/refill/api/zy/lifangyind/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+lifangyind
+uoix_9oc
+
+10462
+7bd3428d8432d47034adf5628d043605

+ 13 - 0
helper/refill/api/zy/lifangyind/config.php

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

+ 76 - 0
helper/refill/api/zy/mengjihuanoyin/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\mengjihuanoyin;
+
+require_once(BASE_HELPER_RAPI_PATH . '/mengjihuanoyin/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)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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)
+    {
+        $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];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        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/zy/mengjihuanoyin/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\mengjihuanoyin;
+
+require_once(BASE_HELPER_RAPI_PATH . '/mengjihuanoyin/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['act'] = '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)
+    {
+        $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)
+    {
+        $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)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['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];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $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, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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);
+    }
+}

+ 7 - 0
helper/refill/api/zy/mengjihuanoyin/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+mengjihuanoyin
+weyux_io3
+
+10463
+bd6d125f29453c74eaff82a968e13b49

+ 13 - 0
helper/refill/api/zy/mengjihuanoyin/config.php

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

+ 76 - 0
helper/refill/api/zy/mengjihuaqgf/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\mengjihuaqgf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/mengjihuaqgf/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)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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)
+    {
+        $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];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        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/zy/mengjihuaqgf/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\mengjihuaqgf;
+
+require_once(BASE_HELPER_RAPI_PATH . '/mengjihuaqgf/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['act'] = '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)
+    {
+        $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)
+    {
+        $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)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['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];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $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, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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);
+    }
+}

+ 7 - 0
helper/refill/api/zy/mengjihuaqgf/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+mengjihuaqgf
+yuioiux3_io
+
+10465
+7900de5358404b4d56e5d1219f989e68

+ 13 - 0
helper/refill/api/zy/mengjihuaqgf/config.php

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

+ 76 - 0
helper/refill/api/zy/qudaiwanotwo/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\qudaiwanotwo;
+
+require_once(BASE_HELPER_RAPI_PATH . '/qudaiwanotwo/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)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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)
+    {
+        $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];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        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/zy/qudaiwanotwo/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\qudaiwanotwo;
+
+require_once(BASE_HELPER_RAPI_PATH . '/qudaiwanotwo/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['act'] = '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)
+    {
+        $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)
+    {
+        $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)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['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];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $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, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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);
+    }
+}

+ 7 - 0
helper/refill/api/zy/qudaiwanotwo/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+qudaiwanotwo
+dui32_lkk
+
+10458
+f8cd723eeec59a9e15bb9007a0b65367

+ 13 - 0
helper/refill/api/zy/qudaiwanotwo/config.php

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

+ 76 - 0
helper/refill/api/zy/weibian_qy/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\weibian_qy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/weibian_qy/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)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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)
+    {
+        $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];
+        }
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        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];
+        }
+    }
+}

+ 176 - 0
helper/refill/api/zy/weibian_qy/RefillPhone.php

@@ -0,0 +1,176 @@
+<?php
+
+namespace refill\weibian_qy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/weibian_qy/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillThird
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params($phone, string $order_sn, $product_code)
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'add_third';
+        $params['product_code'] = $product_code;
+        $params['mchid'] = config::MCH_ID;
+        $params['cardno'] = $phone;
+        $params['order_sn'] = $order_sn;
+        $params['quantity'] = 1;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    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'];
+        }
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $goods_id = intval($params['goods_id']);
+        $product_code = $this->getProductCode($goods_id, $params['product_code']);
+
+        $params = $this->req_params($card_no, $params['order_sn'], $product_code);
+        $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)
+    {
+        $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)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['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];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $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, $resp['datas']['balance']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        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);
+    }
+}

+ 7 - 0
helper/refill/api/zy/weibian_qy/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+weibian-qy
+123456
+
+10457
+6db969fcc2f4e9f715e7155612f576cc

+ 13 - 0
helper/refill/api/zy/weibian_qy/config.php

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

+ 4 - 0
mobile/callback/refill_bailun.php

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

+ 4 - 0
mobile/callback/refill_feihan_hf.php

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

+ 4 - 0
mobile/callback/refill_huanqiu_sec.php

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

+ 4 - 0
mobile/callback/refill_lifangfeiyin.php

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

+ 4 - 0
mobile/callback/refill_lifangyind.php

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

+ 4 - 0
mobile/callback/refill_mengjihuanoyin.php

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

+ 4 - 0
mobile/callback/refill_mengjihuaqgf.php

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

+ 4 - 0
mobile/callback/refill_qudaiwafeiyintwo.php

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

+ 4 - 0
mobile/callback/refill_qudaiwanotwo.php

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

+ 4 - 0
mobile/callback/refill_weibian_qy.php

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

+ 3 - 2
mobile/callback/refill_zhenghe.php

@@ -1,4 +1,5 @@
 <?php
-
-refill\util::push_notify('zhenghe',$_POST);
+$content = $_SERVER['post_content'] ?? [];
+$input = json_decode($content,true);
+refill\util::push_notify('zhenghe',$input);
 echo ('ok');

+ 18 - 0
test/TestRefill.php

@@ -3584,6 +3584,24 @@ class TestRefill extends TestCase
 
     }
 
+    public function testJuhu()
+    {
+        $provider = $this->getProvider('juhu');
+        $resp = $provider->balance();
+    }
+
+    public function testFeihan_hf()
+    {
+        //        $provider = $this->getProvider('feihan_hf');
+//        $resp = $provider->add(15715155515, 4, 50, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
+
+        $body = '{"err_msg":"","ordersuccesstime":"20230802150200","sign":"52920F6CECE7DE9ACE4A0A0224DEFD0C","sporder_id":"58431690957151281598","userid":"A08566","ret_code":"1"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('feihan_hf','RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
+    }
+
     public function testAmingjd()
     {
 //        $provider = new refill\amingjd\RefillPhone([]);

+ 6 - 0
test/TestRefillYl.php

@@ -1080,4 +1080,10 @@ class TestRefillYl extends TestCase
         $resp = $provider->notify($params);
 
     }
+
+    public function testBailun()
+    {
+        $provider = $this->getProvider('bailun');
+        $resp = $provider->balance();
+    }
 }