config.php 986 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace refill\huishi;
  3. class config
  4. {
  5. const ORDER_URL = 'https://telephone-grant.hijin.vip/api/v1/submitOrder';
  6. const QUERY_URL = 'https://telephone-grant.hijin.vip/api/v1/queryOrder';
  7. const BALANCE_URL = 'https://telephone-grant.hijin.vip/api/v1/queryAccount';
  8. const API_KEY = '07onE26tNyaU';
  9. const API_SECRET = '12bc663f78ac1ed8cffb6be228db7a9c';
  10. const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_huishi.php";
  11. const ExtHeaders = ['Content-Type: application/json;charset=UTF-8'];
  12. public static function pub_params()
  13. {
  14. $cur_time = microtime (true);
  15. $cur_time = intval($cur_time * 1000);
  16. $params['timestamp'] = $cur_time;
  17. $params['sign'] = self::sign($cur_time);
  18. $params['api_key'] = config::API_KEY;
  19. return $params;
  20. }
  21. public static function sign($timestamp)
  22. {
  23. return strtolower(md5(strtolower(md5(config::API_KEY . $timestamp)) . config::API_SECRET));
  24. }
  25. }