config.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace refill\kachong_new;
  3. use mtopcard;
  4. class config
  5. {
  6. const ORDER_URL = 'http://42.193.245.133:5001/plat/api/old/submitorder';
  7. const QUERY_URL= 'http://42.193.245.133:5001/plat/api/old/queryorder';
  8. const BALANCE_URL= 'http://42.193.245.133:5001/plat/api/old/queryBalance';
  9. const USER_ID= '200517';
  10. const KEY = '618702d302bab75af6b429b5563047ec';
  11. const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_kachong_new.php";
  12. const operator = [
  13. mtopcard\ChinaMobileCard => 1,
  14. mtopcard\ChinaUnicomCard => 2,
  15. mtopcard\ChinaTelecomCard => 3
  16. ];
  17. const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
  18. const ERR_NOS = [
  19. 1000,1001,1003,1004,1023,1024,1025,1026,2001,2002,2003,2020,2021,2025,2026,1006,2030,3003
  20. ];
  21. static function extractOfficialSn($officialSnStr): string
  22. {
  23. $officialSn = '';
  24. if (preg_match_all("/(\d+)/", $officialSnStr, $matches)) {
  25. foreach ($matches[1] as $item) {
  26. if (strlen($officialSn) < strlen($item)) {
  27. $officialSn = $item;
  28. }
  29. }
  30. }
  31. return $officialSn;
  32. }
  33. }