config.php 1.2 KB

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