Forráskód Böngészése

Merge branch 'rtest' into ralb

stanley-king 3 éve
szülő
commit
806f8e3d62
47 módosított fájl, 1275 hozzáadás és 24 törlés
  1. 81 1
      data/config/win/refill.ini.php
  2. 86 6
      data/config/xyz/refill.ini.php
  3. 86 6
      data/config/xyzadm/refill.ini.php
  4. 9 1
      helper/refill/api/lingzh/weishengyjd/RefillPhone.php
  5. 4 0
      helper/refill/api/lingzh/weishengyjd/config.php
  6. 9 1
      helper/refill/api/lingzh/weishengysix/RefillPhone.php
  7. 4 0
      helper/refill/api/lingzh/weishengysix/config.php
  8. 9 1
      helper/refill/api/lingzh/weishengywt/RefillPhone.php
  9. 4 0
      helper/refill/api/lingzh/weishengywt/config.php
  10. 50 0
      helper/refill/api/xyz/bingdht/RefillCallBack.php
  11. 112 0
      helper/refill/api/xyz/bingdht/RefillPhone.php
  12. 11 0
      helper/refill/api/xyz/bingdht/api.txt
  13. 26 0
      helper/refill/api/xyz/bingdht/config.php
  14. 51 0
      helper/refill/api/xyz/hongxudagy996/RefillCallBack.php
  15. 128 0
      helper/refill/api/xyz/hongxudagy996/RefillPhone.php
  16. 11 0
      helper/refill/api/xyz/hongxudagy996/api.txt
  17. 15 0
      helper/refill/api/xyz/hongxudagy996/config.php
  18. 51 0
      helper/refill/api/xyz/hongxudayz996/RefillCallBack.php
  19. 128 0
      helper/refill/api/xyz/hongxudayz996/RefillPhone.php
  20. 11 0
      helper/refill/api/xyz/hongxudayz996/api.txt
  21. 15 0
      helper/refill/api/xyz/hongxudayz996/config.php
  22. 9 1
      helper/refill/api/xyz/qijutang/RefillPhone.php
  23. 4 0
      helper/refill/api/xyz/qijutang/config.php
  24. 9 1
      helper/refill/api/xyz/suyuan/RefillPhone.php
  25. 4 0
      helper/refill/api/xyz/suyuan/config.php
  26. 9 1
      helper/refill/api/xyz/weiyiwt/RefillPhone.php
  27. 4 0
      helper/refill/api/xyz/weiyiwt/config.php
  28. 9 1
      helper/refill/api/xyz/yinteng/RefillPhone.php
  29. 4 0
      helper/refill/api/xyz/yinteng/config.php
  30. 9 1
      helper/refill/api/xyz/yonghe/RefillPhone.php
  31. 4 0
      helper/refill/api/xyz/yonghe/config.php
  32. 51 0
      helper/refill/api/xyz/yuecheng/RefillCallBack.php
  33. 128 0
      helper/refill/api/xyz/yuecheng/RefillPhone.php
  34. 4 0
      helper/refill/api/xyz/yuecheng/account.txt
  35. 22 0
      helper/refill/api/xyz/yuecheng/config.php
  36. BIN
      helper/refill/api/xyz/yuecheng/跃程充值平台接口文档V4.0.4_直充类.docx
  37. 9 1
      helper/refill/api/xyz/yunchonggong/RefillPhone.php
  38. 4 0
      helper/refill/api/xyz/yunchonggong/config.php
  39. 9 1
      helper/refill/api/xyz/yunchonggongman/RefillPhone.php
  40. 4 0
      helper/refill/api/xyz/yunchonggongman/config.php
  41. 9 1
      helper/refill/api/xyz/zhongst/RefillPhone.php
  42. 4 0
      helper/refill/api/xyz/zhongst/config.php
  43. 9 0
      helper/refill/policy/channel_filter.php
  44. 4 0
      mobile/callback/refill_bingdht.php
  45. 7 0
      mobile/callback/refill_hongxudagy996.php
  46. 7 0
      mobile/callback/refill_hongxudayz996.php
  47. 38 0
      test/TestRefill.php

+ 81 - 1
data/config/win/refill.ini.php

@@ -1448,6 +1448,82 @@ $yunchonggongman_phone = ['name' => 'yunchonggongman', 'store_id' => 88,'quality
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$hongxudayz996_phone = ['name' => 'hongxudayz996', 'store_id' => 90, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6817, 'price' => 9.96, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6818, 'price' => 19.92, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6819, 'price' => 29.88, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6820, 'price' => 49.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6821, 'price' => 99.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6822, 'price' => 199.2, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6823, 'price' => 298.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6824, 'price' => 498, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$hongxudagy996_phone = ['name' => 'hongxudagy996', 'store_id' => 91, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6825, 'price' => 9.96, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6826, 'price' => 19.92, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6827, 'price' => 29.88, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6828, 'price' => 49.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6829, 'price' => 99.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6830, 'price' => 199.2, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6831, 'price' => 298.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6832, 'price' => 498, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$bingdht_phone = ['name' => 'bingdht', 'store_id' => 92,'qualitys' => '5',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6833, 'price' => 9.05, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6833, 'price' => 8.95, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        20 => [
+            ['goods_id' => 6834, 'price' => 18.1, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6834, 'price' => 17.9, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        30 => [
+            ['goods_id' => 6835, 'price' => 27.15, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6835, 'price' => 26.85, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        50 => [
+            ['goods_id' => 6836, 'price' => 45.25, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6836, 'price' => 44.75, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        100 => [
+            ['goods_id' => 6837, 'price' => 90.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6837, 'price' => 89.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        200 => [
+            ['goods_id' => 6838, 'price' => 181, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6838, 'price' => 179, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        300 => [
+            ['goods_id' => 6839, 'price' => 271.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6839, 'price' => 268.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        500 => [
+            ['goods_id' => 6840, 'price' => 452.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6840, 'price' => 447.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yuecheng_phone = ['name' => 'yuecheng', 'store_id' => 93, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6841, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6842, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6843, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6844, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6845, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6846, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6847, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6848, 'price' => 496.5, '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],
@@ -1508,7 +1584,11 @@ $phone_providers = [
     ['name' => 'hongxudayz', 'cfg' => $hongxudayz_phone],
     ['name' => 'hongxudagy', 'cfg' => $hongxudagy_phone],
     ['name' => 'yunchonggong', 'cfg' => $yunchonggong_phone],
-    ['name' => 'yunchonggongman', 'cfg' => $yunchonggongman_phone]
+    ['name' => 'yunchonggongman', 'cfg' => $yunchonggongman_phone],
+    ['name' => 'hongxudayz996', 'cfg' => $hongxudayz996_phone],
+    ['name' => 'hongxudagy996', 'cfg' => $hongxudagy996_phone],
+    ['name' => 'bingdht', 'cfg' => $bingdht_phone],
+//    ['name' => 'yuecheng', 'cfg' => $yuecheng_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 86 - 6
data/config/xyz/refill.ini.php

@@ -163,12 +163,12 @@ $legou_oil = ['name' => 'legou', 'store_id' => 80,'qualitys' => '3',
     ],
     'period' => [], 'refill_type' => 'api'];
 
-$yingdian_oil = ['name' => 'yingdian', 'store_id' => 89, 'qualitys' => '5',
+$yingdian_oil = ['name' => 'yingdian', 'store_id' => 89, 'qualitys' => '1',
     'amount' => [
-        100 => [['goods_id' => 6813, 'price' => 97, 'quality' => 5, 'card_type' => 'sinopec,petrochina']],
-        200 => [['goods_id' => 6814, 'price' => 194, 'quality' => 5, 'card_type' => 'sinopec,petrochina']],
-        500 => [['goods_id' => 6815, 'price' => 485, 'quality' => 5, 'card_type' => 'sinopec,petrochina']],
-        1000 => [['goods_id' => 6816, 'price' => 970, 'quality' => 5, 'card_type' => 'sinopec,petrochina']]
+        100 => [['goods_id' => 6813, 'price' => 97, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6814, 'price' => 194, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6815, 'price' => 485, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6816, 'price' => 970, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
     ],
     'period' => [], 'refill_type' => 'api'];
 
@@ -1448,6 +1448,82 @@ $yunchonggongman_phone = ['name' => 'yunchonggongman', 'store_id' => 88,'quality
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$hongxudayz996_phone = ['name' => 'hongxudayz996', 'store_id' => 90, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6817, 'price' => 9.96, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6818, 'price' => 19.92, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6819, 'price' => 29.88, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6820, 'price' => 49.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6821, 'price' => 99.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6822, 'price' => 199.2, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6823, 'price' => 298.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6824, 'price' => 498, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$hongxudagy996_phone = ['name' => 'hongxudagy996', 'store_id' => 91, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6825, 'price' => 9.96, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6826, 'price' => 19.92, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6827, 'price' => 29.88, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6828, 'price' => 49.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6829, 'price' => 99.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6830, 'price' => 199.2, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6831, 'price' => 298.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6832, 'price' => 498, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$bingdht_phone = ['name' => 'bingdht', 'store_id' => 92,'qualitys' => '5',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6833, 'price' => 9.05, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6833, 'price' => 8.95, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        20 => [
+            ['goods_id' => 6834, 'price' => 18.1, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6834, 'price' => 17.9, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        30 => [
+            ['goods_id' => 6835, 'price' => 27.15, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6835, 'price' => 26.85, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        50 => [
+            ['goods_id' => 6836, 'price' => 45.25, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6836, 'price' => 44.75, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        100 => [
+            ['goods_id' => 6837, 'price' => 90.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6837, 'price' => 89.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        200 => [
+            ['goods_id' => 6838, 'price' => 181, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6838, 'price' => 179, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        300 => [
+            ['goods_id' => 6839, 'price' => 271.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6839, 'price' => 268.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        500 => [
+            ['goods_id' => 6840, 'price' => 452.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6840, 'price' => 447.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yuecheng_phone = ['name' => 'yuecheng', 'store_id' => 93, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6841, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6842, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6843, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6844, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6845, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6846, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6847, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6848, 'price' => 496.5, '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],
@@ -1508,7 +1584,11 @@ $phone_providers = [
     ['name' => 'hongxudayz', 'cfg' => $hongxudayz_phone],
     ['name' => 'hongxudagy', 'cfg' => $hongxudagy_phone],
     ['name' => 'yunchonggong', 'cfg' => $yunchonggong_phone],
-    ['name' => 'yunchonggongman', 'cfg' => $yunchonggongman_phone]
+    ['name' => 'yunchonggongman', 'cfg' => $yunchonggongman_phone],
+    ['name' => 'hongxudayz996', 'cfg' => $hongxudayz996_phone],
+    ['name' => 'hongxudagy996', 'cfg' => $hongxudagy996_phone],
+    ['name' => 'bingdht', 'cfg' => $bingdht_phone],
+//    ['name' => 'yuecheng', 'cfg' => $yuecheng_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 86 - 6
data/config/xyzadm/refill.ini.php

@@ -163,12 +163,12 @@ $legou_oil = ['name' => 'legou', 'store_id' => 80,'qualitys' => '3',
     ],
     'period' => [], 'refill_type' => 'api'];
 
-$yingdian_oil = ['name' => 'yingdian', 'store_id' => 89, 'qualitys' => '5',
+$yingdian_oil = ['name' => 'yingdian', 'store_id' => 89, 'qualitys' => '1',
     'amount' => [
-        100 => [['goods_id' => 6813, 'price' => 97, 'quality' => 5, 'card_type' => 'sinopec,petrochina']],
-        200 => [['goods_id' => 6814, 'price' => 194, 'quality' => 5, 'card_type' => 'sinopec,petrochina']],
-        500 => [['goods_id' => 6815, 'price' => 485, 'quality' => 5, 'card_type' => 'sinopec,petrochina']],
-        1000 => [['goods_id' => 6816, 'price' => 970, 'quality' => 5, 'card_type' => 'sinopec,petrochina']]
+        100 => [['goods_id' => 6813, 'price' => 97, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6814, 'price' => 194, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6815, 'price' => 485, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6816, 'price' => 970, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
     ],
     'period' => [], 'refill_type' => 'api'];
 
@@ -1448,6 +1448,82 @@ $yunchonggongman_phone = ['name' => 'yunchonggongman', 'store_id' => 88,'quality
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$hongxudayz996_phone = ['name' => 'hongxudayz996', 'store_id' => 90, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6817, 'price' => 9.96, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6818, 'price' => 19.92, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6819, 'price' => 29.88, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6820, 'price' => 49.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6821, 'price' => 99.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6822, 'price' => 199.2, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6823, 'price' => 298.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6824, 'price' => 498, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$hongxudagy996_phone = ['name' => 'hongxudagy996', 'store_id' => 91, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6825, 'price' => 9.96, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6826, 'price' => 19.92, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6827, 'price' => 29.88, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6828, 'price' => 49.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6829, 'price' => 99.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6830, 'price' => 199.2, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6831, 'price' => 298.8, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6832, 'price' => 498, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$bingdht_phone = ['name' => 'bingdht', 'store_id' => 92,'qualitys' => '5',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6833, 'price' => 9.05, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6833, 'price' => 8.95, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        20 => [
+            ['goods_id' => 6834, 'price' => 18.1, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6834, 'price' => 17.9, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        30 => [
+            ['goods_id' => 6835, 'price' => 27.15, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6835, 'price' => 26.85, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        50 => [
+            ['goods_id' => 6836, 'price' => 45.25, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6836, 'price' => 44.75, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        100 => [
+            ['goods_id' => 6837, 'price' => 90.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6837, 'price' => 89.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        200 => [
+            ['goods_id' => 6838, 'price' => 181, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6838, 'price' => 179, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        300 => [
+            ['goods_id' => 6839, 'price' => 271.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6839, 'price' => 268.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ],
+        500 => [
+            ['goods_id' => 6840, 'price' => 452.5, 'quality' => 5, 'card_type' => 'chinamobile,chinatelecom'],
+            ['goods_id' => 6840, 'price' => 447.5, 'quality' => 5, 'card_type' => 'chinaunicom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yuecheng_phone = ['name' => 'yuecheng', 'store_id' => 93, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 6841, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6842, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6843, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6844, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6845, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6846, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6847, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6848, 'price' => 496.5, '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],
@@ -1508,7 +1584,11 @@ $phone_providers = [
     ['name' => 'hongxudayz', 'cfg' => $hongxudayz_phone],
     ['name' => 'hongxudagy', 'cfg' => $hongxudagy_phone],
     ['name' => 'yunchonggong', 'cfg' => $yunchonggong_phone],
-    ['name' => 'yunchonggongman', 'cfg' => $yunchonggongman_phone]
+    ['name' => 'yunchonggongman', 'cfg' => $yunchonggongman_phone],
+    ['name' => 'hongxudayz996', 'cfg' => $hongxudayz996_phone],
+    ['name' => 'hongxudagy996', 'cfg' => $hongxudagy996_phone],
+    ['name' => 'bingdht', 'cfg' => $bingdht_phone],
+//    ['name' => 'yuecheng', 'cfg' => $yuecheng_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 9 - 1
helper/refill/api/lingzh/weishengyjd/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/lingzh/weishengyjd/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 1
helper/refill/api/lingzh/weishengysix/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/lingzh/weishengysix/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 1
helper/refill/api/lingzh/weishengywt/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/lingzh/weishengywt/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

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

@@ -0,0 +1,50 @@
+<?php
+namespace refill\bingdht;
+
+require_once(BASE_HELPER_RAPI_PATH . '/bingdht/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')->getOrderInfo(['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];
+        }
+    }
+}

+ 112 - 0
helper/refill/api/xyz/bingdht/RefillPhone.php

@@ -0,0 +1,112 @@
+<?php
+
+namespace refill\bingdht;
+
+require_once(BASE_HELPER_RAPI_PATH . '/bingdht/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['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 = intval($resp['nRtn']);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn == 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], false];
+            }
+        }
+    }
+
+    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 = intval($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])) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $status];
+            }
+            return [true, $order_state];
+        }
+    }
+
+    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);
+    }
+}

+ 11 - 0
helper/refill/api/xyz/bingdht/api.txt

@@ -0,0 +1,11 @@
+开发文档:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ
+
+话费、油卡下单地址:http://116.62.100.67:10186/plat/api/old/submitorder
+查询地址:http://116.62.100.67:10186/plat/api/old/queryorder
+查询余额地址:http://116.62.100.67:10186/plat/api/old/queryBalance
+
+管理端:http://116.62.100.67:10186/plat/index
+账号:bjyz001
+初始密码:123456
+商户ID:200044
+密钥:53c402addd464518960b1eeff9097445

+ 26 - 0
helper/refill/api/xyz/bingdht/config.php

@@ -0,0 +1,26 @@
+<?php
+
+
+namespace refill\bingdht;
+
+use mtopcard;
+class config
+{
+    //lt 895 yd dx 905
+    const ORDER_URL = 'http://116.62.100.67:10186/plat/api/old/submitorder';
+    const QUERY_URL= 'http://116.62.100.67:10186/plat/api/old/queryorder';
+
+    const USER_ID= '200044';
+    const KEY = '53c402addd464518960b1eeff9097445';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_bingdht.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_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+}

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

@@ -0,0 +1,51 @@
+<?php
+namespace refill\hongxudagy996;
+
+require_once(BASE_HELPER_RAPI_PATH . '/hongxudagy996/config.php');
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::MER_ID;
+        $key = config::KEY;
+        $content = "{$params['supply_id']}{$params['order_status']}{$userid}{$params['product_no']}{$params['mer_oid']}{$params['phone_no']}{$params['product_face']}";
+        $content .= $key;
+        return strtoupper(md5($content));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['order_status']);
+        $order_sn = $params['mer_oid'];
+        $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 === 0) {
+            $data['official_sn'] = strtolower($params['cp_id']) == 'null' ? '' : $params['cp_id'];
+            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];
+        }
+    }
+}

+ 128 - 0
helper/refill/api/xyz/hongxudagy996/RefillPhone.php

@@ -0,0 +1,128 @@
+<?php
+
+namespace refill\hongxudagy996;
+
+require_once(BASE_HELPER_RAPI_PATH . '/hongxudagy996/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['mer_id'] = config::MER_ID;
+        $params['mer_oid'] = $order_sn;
+        $params['product_face'] = $amount;
+        $params['product_num'] = 1;
+        $params['recharge_amount'] = round($amount * config::PRICE, 2);
+        $params['phone_no'] = $phone;
+        $params['notify_url'] = config::NOTIFY_URL;
+        $params['request_time'] = date("YmdHis");
+        $params['recharge_type'] = 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, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'GET', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] == true && $resp['code'] == 100) {
+                return [true, $resp['data']['supply_id'], false];
+            } elseif ($resp['code'] == 999) {
+                $net_errno = "HTTP-999";
+                return [false, $resp['msg'], false];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['mer_oid'] = $refill_info['order_sn'];
+        $params['mer_id'] = config::MER_ID;
+        $params['tsp'] = date("YmdHis");
+        $content = "{$params['mer_oid']}{$params['mer_id']}{$params['tsp']}".config::KEY;
+        $params['sign'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'GET', false, []);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp))
+            {
+                return [false, '网络错误'];
+            }
+            else
+            {
+                $code = $resp['code'];
+                if (in_array($code, [100, 101, 102, 103, 888]))
+                {
+                    $order_status = intval($resp['data']['order_status']);
+                    if ($order_status === 0) {
+                        $updata['official_sn'] = $resp['data']['cp_id'];
+                        Model('refill_order')->edit($refill_info['order_id'], $updata);
+                        $order_state = ORDER_STATE_SUCCESS;
+                    } elseif ($order_status === 3) {
+                        $order_state = ORDER_STATE_CANCEL;
+                    } elseif (in_array($order_status, [1, 2])) {
+                        $order_state = ORDER_STATE_SEND;
+                    } else {
+                        return [false, $resp['msg']];
+                    }
+
+                    return [true, $order_state];
+                }
+                elseif ($code === 258 && (time() - $refill_info['commit_time'] >= 600)) {
+                    return [true, ORDER_STATE_NOEXIST];
+                }
+                else {
+                    return [false, $resp['msg']];
+                }
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::MER_ID;
+        $key = config::KEY;
+        $content = "{$userid}{$params['mer_oid']}{$params['product_face']}{$params['product_num']}{$params['recharge_amount']}{$params['phone_no']}{$params['notify_url']}";
+        $content .= "{$params['request_time']}{$params['recharge_type']}{$key}";
+        return md5($content);
+    }
+
+    public function xmlToArray($xml)
+    {
+        $replace_str = str_replace(' ','','encoding="gbk"');
+        $xml = mb_convert_encoding($xml,"UTF-8","gbk");
+        $xml = str_replace($replace_str, "encoding='utf-8'", $xml);
+        return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
+    }
+}

+ 11 - 0
helper/refill/api/xyz/hongxudagy996/api.txt

@@ -0,0 +1,11 @@
+椰子2
+http://8.134.12.246:8998/aportal/login.html
+账户:bjyezi2   密码:1234qwer&
+商户密匙:	17b10ba72d34d55a2312285616f131e4  商户编号:	bjyz2
+
+
+
+国研2
+http://8.134.12.246:8998/aportal/login.html
+账号:bjguoyan2  密码:1234qwer&
+商户密匙:	38e7271536d6e95a3b907e8003c0ad7c    商户编号:	bjgy2

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

@@ -0,0 +1,15 @@
+<?php
+
+
+namespace refill\hongxudagy996;
+
+class config
+{
+    const ORDER_URL = 'http://8.134.12.246:8090/recieverOrder';
+    const QUERY_URL = 'http://8.134.12.246:8090/queryOrder';
+
+    const MER_ID = 'bjgy2';
+    const KEY = '38e7271536d6e95a3b907e8003c0ad7c';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_hongxudagy996.php";
+    const PRICE = 0.996;
+}

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

@@ -0,0 +1,51 @@
+<?php
+namespace refill\hongxudayz996;
+
+require_once(BASE_HELPER_RAPI_PATH . '/hongxudayz996/config.php');
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::MER_ID;
+        $key = config::KEY;
+        $content = "{$params['supply_id']}{$params['order_status']}{$userid}{$params['product_no']}{$params['mer_oid']}{$params['phone_no']}{$params['product_face']}";
+        $content .= $key;
+        return strtoupper(md5($content));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['order_status']);
+        $order_sn = $params['mer_oid'];
+        $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 === 0) {
+            $data['official_sn'] = strtolower($params['cp_id']) == 'null' ? '' : $params['cp_id'];
+            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];
+        }
+    }
+}

+ 128 - 0
helper/refill/api/xyz/hongxudayz996/RefillPhone.php

@@ -0,0 +1,128 @@
+<?php
+
+namespace refill\hongxudayz996;
+
+require_once(BASE_HELPER_RAPI_PATH . '/hongxudayz996/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['mer_id'] = config::MER_ID;
+        $params['mer_oid'] = $order_sn;
+        $params['product_face'] = $amount;
+        $params['product_num'] = 1;
+        $params['recharge_amount'] = round($amount * config::PRICE, 2);
+        $params['phone_no'] = $phone;
+        $params['notify_url'] = config::NOTIFY_URL;
+        $params['request_time'] = date("YmdHis");
+        $params['recharge_type'] = 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, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'GET', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] == true && $resp['code'] == 100) {
+                return [true, $resp['data']['supply_id'], false];
+            } elseif ($resp['code'] == 999) {
+                $net_errno = "HTTP-999";
+                return [false, $resp['msg'], false];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['mer_oid'] = $refill_info['order_sn'];
+        $params['mer_id'] = config::MER_ID;
+        $params['tsp'] = date("YmdHis");
+        $content = "{$params['mer_oid']}{$params['mer_id']}{$params['tsp']}".config::KEY;
+        $params['sign'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'GET', false, []);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp))
+            {
+                return [false, '网络错误'];
+            }
+            else
+            {
+                $code = $resp['code'];
+                if (in_array($code, [100, 101, 102, 103, 888]))
+                {
+                    $order_status = intval($resp['data']['order_status']);
+                    if ($order_status === 0) {
+                        $updata['official_sn'] = $resp['data']['cp_id'];
+                        Model('refill_order')->edit($refill_info['order_id'], $updata);
+                        $order_state = ORDER_STATE_SUCCESS;
+                    } elseif ($order_status === 3) {
+                        $order_state = ORDER_STATE_CANCEL;
+                    } elseif (in_array($order_status, [1, 2])) {
+                        $order_state = ORDER_STATE_SEND;
+                    } else {
+                        return [false, $resp['msg']];
+                    }
+
+                    return [true, $order_state];
+                }
+                elseif ($code === 258 && (time() - $refill_info['commit_time'] >= 600)) {
+                    return [true, ORDER_STATE_NOEXIST];
+                }
+                else {
+                    return [false, $resp['msg']];
+                }
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::MER_ID;
+        $key = config::KEY;
+        $content = "{$userid}{$params['mer_oid']}{$params['product_face']}{$params['product_num']}{$params['recharge_amount']}{$params['phone_no']}{$params['notify_url']}";
+        $content .= "{$params['request_time']}{$params['recharge_type']}{$key}";
+        return md5($content);
+    }
+
+    public function xmlToArray($xml)
+    {
+        $replace_str = str_replace(' ','','encoding="gbk"');
+        $xml = mb_convert_encoding($xml,"UTF-8","gbk");
+        $xml = str_replace($replace_str, "encoding='utf-8'", $xml);
+        return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
+    }
+}

+ 11 - 0
helper/refill/api/xyz/hongxudayz996/api.txt

@@ -0,0 +1,11 @@
+椰子2
+http://8.134.12.246:8998/aportal/login.html
+账户:bjyezi2   密码:1234qwer&
+商户密匙:	17b10ba72d34d55a2312285616f131e4  商户编号:	bjyz2
+
+
+
+国研2
+http://8.134.12.246:8998/aportal/login.html
+账号:bjguoyan2  密码:1234qwer&
+商户密匙:	38e7271536d6e95a3b907e8003c0ad7c    商户编号:	bjgy2

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

@@ -0,0 +1,15 @@
+<?php
+
+
+namespace refill\hongxudayz996;
+
+class config
+{
+    const ORDER_URL = 'http://8.134.12.246:8090/recieverOrder';
+    const QUERY_URL = 'http://8.134.12.246:8090/queryOrder';
+
+    const MER_ID = 'bjyz2';
+    const KEY = '17b10ba72d34d55a2312285616f131e4';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_hongxudayz996.php";
+    const PRICE = 0.996;
+}

+ 9 - 1
helper/refill/api/xyz/qijutang/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/xyz/qijutang/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 1
helper/refill/api/xyz/suyuan/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/xyz/suyuan/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 1
helper/refill/api/xyz/weiyiwt/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/xyz/weiyiwt/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 1
helper/refill/api/xyz/yinteng/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/xyz/yinteng/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 1
helper/refill/api/xyz/yonghe/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/xyz/yonghe/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

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

@@ -0,0 +1,51 @@
+<?php
+namespace refill\yuecheng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yuecheng/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)
+    {
+        $cid = config::CID;
+        $key = config::KEY;
+        $content = "{$params['sid']}{$params['ste']}{$cid}{$params['pid']}{$params['oid']}{$params['pn']}{$params['tf']}";
+        $content .= $key;
+        return strtoupper(md5($content));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['ste']);
+        $order_sn = $params['oid'];
+        $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 === 0) {
+            $data['official_sn'] = strtolower($params['cpid']) == 'null' ? '' : $params['cpid'];
+            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];
+        }
+    }
+}

+ 128 - 0
helper/refill/api/xyz/yuecheng/RefillPhone.php

@@ -0,0 +1,128 @@
+<?php
+
+namespace refill\yuecheng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yuecheng/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['oid'] = $order_sn;
+        $params['cid'] = config::CID;
+        $params['pr'] = $amount;
+        $params['nb'] = 1;
+        $params['fm'] = $params['pr'] * $params['nb'];
+        $params['pn'] = $phone;
+        $params['ru'] = config::NOTIFY_URL;
+        $params['tsp'] = date("YmdHis");
+        $params['bt'] = 0;
+        $params['ut'] = 0;
+        $params['cp'] = config::operator[$card_type];
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'GET', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] == true && $resp['code'] == 100) {
+                $data = $resp['data'];
+                return [true, $data['sid'], false];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['oid'] = $refill_info['order_sn'];
+        $params['cid'] = config::CID;
+        $params['tsp'] = date("YmdHis");
+        $content = "{$params['oid']}{$params['cid']}{$params['tsp']}".config::KEY;
+        $params['sign'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'GET', false, []);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp))
+            {
+                return [false, '网络错误'];
+            }
+            else
+            {
+                $code = $resp['code'];
+                if (in_array($code, [100, 101, 102, 103]))
+                {
+                    $order_status = intval($resp['data']['ste']);
+                    if ($order_status === 0) {
+                        $updata['official_sn'] = $resp['data']['cpid'];
+                        Model('refill_order')->edit($refill_info['order_id'], $updata);
+                        $order_state = ORDER_STATE_SUCCESS;
+                    } elseif ($order_status === 3) {
+                        $order_state = ORDER_STATE_CANCEL;
+                    } elseif (in_array($order_status, [1, 2])) {
+                        $order_state = ORDER_STATE_SEND;
+                    } else {
+                        return [false, $resp['msg']];
+                    }
+
+                    return [true, $order_state];
+                }
+                elseif ($code === 258 && (time() - $refill_info['commit_time'] >= 600)) {
+                    return [true, ORDER_STATE_NOEXIST];
+                }
+                else {
+                    return [false, $resp['msg']];
+                }
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $cid = config::CID;
+        $key = config::KEY;
+        $content = "{$params['oid']}{$cid}{$params['pr']}{$params['nb']}{$params['fm']}{$params['pn']}{$params['ru']}";
+        $content .= "{$params['tsp']}{$params['bt']}{$key}";
+        return md5($content);
+    }
+
+    public function xmlToArray($xml)
+    {
+        $replace_str = str_replace(' ','','encoding="gbk"');
+        $xml = mb_convert_encoding($xml,"UTF-8","gbk");
+        $xml = str_replace($replace_str, "encoding='utf-8'", $xml);
+        return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
+    }
+}

+ 4 - 0
helper/refill/api/xyz/yuecheng/account.txt

@@ -0,0 +1,4 @@
+http://81.71.131.53:33080/hops-aportal/login
+guoyanhf
+qwe123!@#
+密钥:77de670b7746d735c303f6dcdb089d05

+ 22 - 0
helper/refill/api/xyz/yuecheng/config.php

@@ -0,0 +1,22 @@
+<?php
+
+
+namespace refill\yuecheng;
+
+use mtopcard;
+class config
+{
+    //993
+    const ORDER_URL = 'http://81.71.131.53:48455/recieverOrderAdvanced';
+    const QUERY_URL = 'http://81.71.131.53:48455/queryOrder_cp';
+
+    const CID = 'gyhf';
+    const KEY = '77de670b7746d735c303f6dcdb089d05';
+//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yuecheng.php";
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+    const operator = [
+        mtopcard\ChinaMobileCard  => 'YD',
+        mtopcard\ChinaUnicomCard  => 'LT',
+        mtopcard\ChinaTelecomCard => 'DX'
+    ];
+}

BIN
helper/refill/api/xyz/yuecheng/跃程充值平台接口文档V4.0.4_直充类.docx


+ 9 - 1
helper/refill/api/xyz/yunchonggong/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/xyz/yunchonggong/config.php

@@ -19,4 +19,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 1
helper/refill/api/xyz/yunchonggongman/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/xyz/yunchonggongman/config.php

@@ -19,4 +19,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 1
helper/refill/api/xyz/zhongst/RefillPhone.php

@@ -45,11 +45,19 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp, Log::DEBUG);
             $resp = json_decode($resp, true);
+            $nRtn = intval($resp['nRtn']);
             if (empty($resp)) {
                 return [false, '网络错误', true];
-            } elseif ($resp['nRtn'] == 0) {
+            } elseif ($nRtn == 0) {
                 return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NO)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resp['szRtnCode'], false];
             }
         }

+ 4 - 0
helper/refill/api/xyz/zhongst/config.php

@@ -18,4 +18,8 @@ class config
         mtopcard\ChinaTelecomCard => 3
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NO = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
 }

+ 9 - 0
helper/refill/policy/channel_filter.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace refill;
+
+class channel_filter
+{
+    
+
+}

+ 4 - 0
mobile/callback/refill_bingdht.php

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

+ 7 - 0
mobile/callback/refill_hongxudagy996.php

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

+ 7 - 0
mobile/callback/refill_hongxudayz996.php

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

+ 38 - 0
test/TestRefill.php

@@ -695,9 +695,27 @@ class TestRefill extends TestCase
         $data = '{"sale_value":"29.76","supply_id":"18790079","order_status":"0","mer_oid":"86521626446475240639","phone_no":"18500608333","mer_id":"bjgyfl","sale_discount":"0.992","sign":"9BDA608364D4E08C653E8C6798151AC2","cp_id":"","product_no":"HFLTBJ_****00003000","product_face":"30","cp_ctype":""}';
         $input = json_decode($data, true);
         refill\RefillFactory::instance()->notify('hongxudagy',$input);
+    }
 
+    public function testHongxudayz996()
+    {
+        $providers = new refill\hongxudayz996\RefillPhone([]);
+//        $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '73691626753698522472']);
+        $data = '{"sale_value":"29.88","supply_id":"18888477","order_status":"3","mer_oid":"73691626753698522472","phone_no":"18500608333","mer_id":"bjyz2","sale_discount":"0.996","sign":"8E98EA2B6B81D832EBA8F89611A3F9B9","cp_id":"","product_no":"HFLTBJ_****00003000","product_face":"30","cp_ctype":""}';
+        $input = json_decode($data, true);
+        refill\RefillFactory::instance()->notify('hongxudayz996',$input);
     }
 
+    public function testHongxudagy996()
+    {
+        $providers = new refill\hongxudagy996\RefillPhone([]);
+//        $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '87681626758209689412']);
+        $data = '{"sale_value":"29.88","supply_id":"18889758","order_status":"3","mer_oid":"87681626758209689412","phone_no":"18500608333","mer_id":"bjgy2","sale_discount":"0.996","sign":"0CBA5B8F34D40914CB86CC74BE8EF15B","cp_id":"","product_no":"HFLTBJ_****00003000","product_face":"30","cp_ctype":""}';
+        $input = json_decode($data, true);
+        refill\RefillFactory::instance()->notify('hongxudagy996',$input);
+    }
     public function testYunchonggong()
     {
         $providers = new refill\yunchonggong\RefillPhone([]);
@@ -708,6 +726,26 @@ class TestRefill extends TestCase
         refill\RefillFactory::instance()->notify('yunchonggong',$input);
     }
 
+    public function testBingdht()
+    {
+        $providers = new refill\bingdht\RefillPhone([]);
+//        $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '62491626761331174794']);
+        $data = '{"szOrderId":"62491626761331174794","fSalePrice":"45.25","szAgentId":"200044","nFlag":"3","szVerifyString":"46745191d31b16ee7978a7f5554357d6","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"50"}';
+        $input = json_decode($data, true);
+        refill\RefillFactory::instance()->notify('bingdht',$input);
+    }
+
+    public function testYuecheng()
+    {
+        $providers = new refill\yuecheng\RefillPhone([]);
+//        $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
+        $resp = $providers->query(['order_sn' => '45101626776884387650']);
+        $data = '{"szOrderId":"62491626761331174794","fSalePrice":"45.25","szAgentId":"200044","nFlag":"3","szVerifyString":"46745191d31b16ee7978a7f5554357d6","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"50"}';
+        $input = json_decode($data, true);
+//        refill\RefillFactory::instance()->notify('yuecheng',$input);
+    }
+
     public function testPrice()
     {
         $amounts = [10, 20, 30, 50, 100, 200, 300, 500];