123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace refill\chanlian;
- use mtopcard;
- class config
- {
- //回调地址需 上游配置
- const ORDER_URL = 'http://cl.whale123.com/api/do';
- const QUERY_URL = 'http://cl.whale123.com/api/queryorder';
- const BALANCE_URL = 'http://cl.whale123.com/api/querybalance';
- const CP_ID = '69535';
- const CP_KEY = '2f86ed2977d0def38';
- const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_chanlian.php";
- const operator = [
- mtopcard\ChinaMobileCard => 1,
- mtopcard\ChinaUnicomCard => 2,
- mtopcard\ChinaTelecomCard => 3
- ];
- const Product = [
- mtopcard\ChinaMobileCard => [
- 100 => 20005,
- 200 => 20006,
- 300 => 20007,
- 500 => 20008
- ],
- mtopcard\ChinaUnicomCard => [
- 50 => 20012,
- 100 => 20013,
- 200 => 20014,
- 300 => 20015,
- ],
- mtopcard\ChinaTelecomCard => [
- 100 => 20021,
- 200 => 20022,
- 300 => 20023,
- 500 => 20024
- ],
- ];
- const ERR_STATUS = ['-10001', '-10002', '-10003', '-10004', '-10013', '-10005', '-10006', '-10007', '-10008', '-10009', '-10011', '-10012', '-10015', '-10016'];
- const NET_ERR_STATUS = ['-10010', '-10000', '-999'];
- public static function sign($params)
- {
- ksort($params);
- $content = '';
- foreach ($params as $key => $value) {
- $content .= "{$key}{$value}";
- }
- $content .= config::CP_KEY;
- return md5($content);
- }
- public static function check_empty($value)
- {
- if (!isset($value))
- return true;
- if (trim($value) === "")
- return true;
- return false;
- }
- }
|