config.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
  12. const ExtHeaders = ['Content-Type: application/json;charset=UTF-8'];
  13. public static function sign($params)
  14. {
  15. ksort($params);
  16. $content = '';
  17. foreach ($params as $key => $value) {
  18. if(self::check_empty($value) === false) {
  19. $content .= "{$key}={$value}&";
  20. }
  21. }
  22. $content .= 'appSecret='.config::APP_SECRET;
  23. return md5($content);
  24. }
  25. public static function check_empty($value)
  26. {
  27. if (!isset($value))
  28. return true;
  29. if ($value === null)
  30. return true;
  31. if (trim($value) === "")
  32. return true;
  33. return false;
  34. }
  35. }