123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace refill\kuaikuai;
- use mtopcard;
- class config
- {
- const ORDER_URL = 'http://119.23.55.151:8181/mpayment/client/recharge/commit';
- const QUERY_URL = 'http://119.23.55.151:8181/mpayment/client/recharge/queryOrder';
- const BALANCE_URL = 'http://119.23.55.151:8181/mpayment/client/recharge/searchAmount';
- const UID = '2c922ab97f2683b5017f3e5ea24c1af9';
- const KEY = 'c6dfcca5df320fa224fcfba865d96800';
- const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_kuaikuai.php";
- const ExtHeaders = ['Content-Type: application/json'];
- const PRODUCT = [
- mtopcard\ChinaMobileCard => [
- ],
- mtopcard\ChinaUnicomCard => [
- 30 => '2c922ab97f2683b5017f3eef25b057b8',
- 50 => '2c922ab97f2683b5017f3eef25b457ba',
- 100 => '2c922ab97f2683b5017f3eef25b757bc',
- 200 => '2c922ab97f2683b5017f3eef25ba57be',
- 300 => '2c922ab97f2683b5017f3eef25bd57c0',
- ],
- mtopcard\ChinaTelecomCard => [
- 10 => '2c922ab97f2683b5017f3ef2f5d659db',
- 20 => '2c922ab97f2683b5017f3ef2f5da59dd',
- ],
- ];
- public static function sign($params)
- {
- ksort($params);
- $content = '';
- foreach ($params as $key => $value) {
- if(self::check_empty($value) === false) {
- $content .= "{$key}={$value}&";
- }
- }
- $content .= 'key='.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;
- }
- }
|