1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace refill\binyu;
- class config
- {
- //https://docs.qq.com/doc/DZU9xSUhXYVBNRXhj
- const ORDER_URL = 'https://phone.shanghaibinyu.top/api/charge';
- const QUERY_URL = 'https://phone.shanghaibinyu.top/api/query';
- const BALANCE_URL = 'https://phone.shanghaibinyu.top/api/balance';
- const MCH_ID = '4';
- const SECRET_KEY = '781b78f0cc0817afab0e017cbb314308';
- const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_binyu.php";
- const ExtHeaders = ['Content-Type: application/json'];
- public static function sign($params)
- {
- ksort($params);
- $content = '';
- foreach ($params as $key => $value) {
- if(self::check_empty($value) === false) {
- $content .= "{$key}={$value}&";
- }
- }
- $content .= 'secret_key=' . config::SECRET_KEY;
- return md5(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;
- }
- }
|