config.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace refill\shuzishijie;
  3. use mtopcard;
  4. class config
  5. {
  6. const ORDER_URL = 'http://openapi.1688sup.com/recharge/order';
  7. const QUERY_URL = 'http://openapi.1688sup.com/recharge/query';
  8. const BALANCE_URL = 'http://openapi.1688sup.com/recharge/info';
  9. const merchantId = '24982';
  10. const secret_key = '643fc488678854a1b87e064b0129f79a';
  11. const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_shuzishijie.php";
  12. const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
  13. const ERRCODES = ['1000', '1001', '1002', '1003', '1004', '1005', '1006', '1007', '1008', '1009', '1010', '1011', '1012'];
  14. const operator = [
  15. mtopcard\ThirdCardPhone => 1,
  16. mtopcard\ThirdCardQQ => 2,
  17. ];
  18. public static function sign($params)
  19. {
  20. unset($params['version']);
  21. ksort($params);
  22. $sign = '';
  23. foreach ($params as $key => $value) {
  24. $sign .= sprintf('%s=%s&', $key, $value);
  25. }
  26. $sign = $sign . 'key=' . config::secret_key;
  27. return strtoupper(md5($sign));
  28. }
  29. }