config.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace refill\liantongzx;
  3. class config
  4. {
  5. //回调地址上游后台配置
  6. const ORDER_URL = 'https://yx.mail.wo.cn:11443/rechargeplat-rest/rechargeIntf/singleRecharge';
  7. const QUERY_URL= 'https://yx.mail.wo.cn:11443/rechargeplat-rest/rechargeIntf/queryRechargeRecord';
  8. const BALANCE_URL= 'https://yx.mail.wo.cn:11443/rechargeplat-rest/getUserBalance';
  9. const APP_KEY = 'Dbjyz';
  10. const APP_SECRET = 'C1A0845BEBB9F2BC62A53CC920EF440D';
  11. const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_liantongzx.php";
  12. const ExtHeaders = ['Content-Type: application/json' , 'Accept: application/json;charset=UTF-8'];
  13. public static function sign($params)
  14. {
  15. $content = '';
  16. ksort($params);
  17. foreach ($params as $key => $val){
  18. if(false === self::check_empty($val)) {
  19. $content .= "{$key}{$val}";
  20. }
  21. }
  22. $content .= "key=".config::APP_SECRET;
  23. return strtoupper(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. }