config.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace refill\jianjiao;
  3. class config
  4. {
  5. const ORDER_URL = 'https://jj.dmjvip.com/index.php/third/mobile/createOrder';
  6. const QUERY_URL = 'https://jj.dmjvip.com/index.php/third/mobile/queryOrder';
  7. const BALANCE_URL = 'https://jj.dmjvip.com/index.php/third/account/queryAmount';
  8. const APP_KEY = '3l6kd2yqsvcwftij';
  9. const APP_SECRET = '3qe7jlk2t5a6gwd01ymxnzuoc48vphbi';
  10. const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_jianjiao.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 .= 'app_secret='.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. }