config.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace refill\leyou;
  3. # 乐友(油费)
  4. use mtopcard;
  5. class config
  6. {
  7. const ORDER_URL = 'http://lorp-api.shujubuy.com/api/v1/submitOrder';
  8. const QUERY_URL = 'http://lorp-api.shujubuy.com/api/v1/queryOrder';
  9. const BALANCE_URL = 'http://lorp-api.shujubuy.com/api/v1/queryBalance';
  10. const APP_KEY = '550b3e8e00144ad0b823416cfd83f1ae';
  11. const USER_NAME = 'guoyan';
  12. const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_leyou.php";
  13. const ExtHeaders = [
  14. 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
  15. 'X-Submit-Username: ' . self::USER_NAME
  16. ];
  17. const operator = [
  18. mtopcard\PetroChinaCard => 2,
  19. mtopcard\SinopecCard => 1,
  20. ];
  21. const product_code = [
  22. mtopcard\PetroChinaCard => [
  23. 50 => 200050,
  24. 100 => 200100,
  25. 200 => 200200,
  26. 500 => 200500,
  27. 1000 => 201000
  28. ],
  29. mtopcard\SinopecCard =>
  30. [
  31. 50 => 100050,
  32. 100 => 100100,
  33. 200 => 100200,
  34. 500 => 100500,
  35. 1000 => 101000,
  36. 2000 => 102000
  37. ],
  38. ];
  39. const SIGN_KEY_SORT = [
  40. 'username',
  41. 'orderNumber',
  42. 'number',
  43. 'productNo',
  44. 'money',
  45. 'orderTime'
  46. ];
  47. public static function extract_official_sn($voucher): string
  48. {
  49. $matches = [];
  50. if (preg_match("/\:(\d+)/", $voucher, $matches)) {
  51. return $matches[1];
  52. } else {
  53. return '';
  54. }
  55. }
  56. }