config.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace refill\jike;
  3. use mtopcard;
  4. class config
  5. {
  6. const ORDER_URL = 'https://www.geexfinance.com/geex-point/api/tripartite/transactions/payMobile';
  7. const QUERY_URL = 'https://www.geexfinance.com/geex-point/api/tripartite/transactions/queryOrder';
  8. const BALANCE_URL = 'https://www.geexfinance.com/geex-point/api/tripartite/transactions/queryBalance';
  9. const APP_KEY = 'GLVw5NCOXfJogOR0I9';
  10. const APP_SECRET = 'yA9mOXslZV1YnD5hjBGvKo1PIPD7v8v8';
  11. const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_jike.php";
  12. const operator = [
  13. mtopcard\ChinaMobileCard => 1,
  14. mtopcard\ChinaUnicomCard => 2,
  15. mtopcard\ChinaTelecomCard => 3
  16. ];
  17. const ExtHeaders = ['Content-Type: application/json;charset=UTF-8'];
  18. public static function sign($params)
  19. {
  20. ksort($params);
  21. $content = '';
  22. foreach ($params as $key => $value) {
  23. if(self::check_empty($value) === false) {
  24. $content .= "{$key}={$value}&";
  25. }
  26. }
  27. $content .= 'appSecret='.config::APP_SECRET;
  28. return md5($content);
  29. }
  30. public static function check_empty($value)
  31. {
  32. if (!isset($value))
  33. return true;
  34. if ($value === null)
  35. return true;
  36. if (trim($value) === "")
  37. return true;
  38. return false;
  39. }
  40. }