123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace refill\bailian;
- use mtopcard;
- class config
- {
- const ORDER_URL = 'http://101.37.252.250/cg/api/Owned/Charge';
- const QUERY_URL = 'http://101.37.252.250/cg/api/Owned/Query';
- const BALANCE_URL = 'http://101.37.252.250/cg/api/MacInfo/Balance';
- const MAC_ID = '1646476170480002';
- const KEY = 'ffcb6768ad0a8b631acd29355a31b50d';
- const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_bailian.php";
- const PRODUCT = [
- mtopcard\SinopecCard => [
- 500 => 100004,
- 1000 => 100005
- ]
- ];
- const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
- public static function sign($params)
- {
- ksort($params);
- $content = '';
- foreach ($params as $key => $value) {
- if(self::check_empty($value) === false) {
- $content .= "{$key}{$value}";
- }
- }
- $content .= config::KEY;
- return md5($content);
- }
- public static function check_empty($value)
- {
- if (!isset($value))
- return true;
- if ($value === null)
- return true;
- if (trim($value) === "")
- return true;
- return false;
- }
- }
|