12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace refill\jianjiao;
- class config
- {
- const ORDER_URL = 'https://jj.dmjvip.com/index.php/third/mobile/createOrder';
- const QUERY_URL = 'https://jj.dmjvip.com/index.php/third/mobile/queryOrder';
- const BALANCE_URL = 'https://jj.dmjvip.com/index.php/third/account/queryAmount';
- const APP_KEY = '3l6kd2yqsvcwftij';
- const APP_SECRET = '3qe7jlk2t5a6gwd01ymxnzuoc48vphbi';
- const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_jianjiao.php";
- const ExtHeaders = ['Content-Type: application/json;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 .= 'app_secret='.config::APP_SECRET;
- 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;
- }
- }
|