12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace refill\suhu_wozhifu;
- class config
- {
- const MEMBER_ID = '24622';
- const KEY = 'eh7hd6sixx8tgarb1gkrnmxjs4sixyjf';
- const ORDER_URL = 'http://api.kuaijiaofei.com/submitRechargeOrder';
- const QUERY_URL = 'http://api.kuaijiaofei.com/queryRechargeOrder';
- const BALANCE_URL = 'http://api.kuaijiaofei.com/queryRechargeMember';
- //需要速交费技术记录地址
- const NOTIFY_URL = BASE_SITE_URL . "/racc/callback/mh/suhu_wozhifu.php";
- const ERRCODES = [101, 102, 103, 104, 105, 106, 107, 108, 109];
- private static $stStoreProducts = [
- 50 => [ 4=> '10314', 5 => '10308'],
- 100 => [ 4=> '10315', 5 => '10309'],
- 200 => [ 4=> '10316', 5 => '10310'],
- 300 => [ 4=> '10317', 5 => '10311']
- ];
- public static function sign($params)
- {
- if (is_object($params)) { //对象转数组
- $params = json_decode(json_encode($params), true);
- }
- $params['sign_key'] = config::KEY;
- ksort($params);
- $formatData = [];
- foreach ($params as $k => $v) {
- if (is_array($v) || is_object($v)) {
- $v = json_encode($v, JSON_UNESCAPED_UNICODE);
- }
- if ((!empty($v) || (string)$v === '0') && $k != 'sign') {
- $formatData[] = "$k=$v";
- }
- }
- $signStr = implode('&', $formatData);
- return md5($signStr);
- }
- public static function sku_code($card_type, $amount)
- {
- if (array_key_exists($amount, self::$stStoreProducts)) {
- if (array_key_exists($card_type, self::$stStoreProducts[$amount])) {
- return self::$stStoreProducts[$amount][$card_type];
- }
- }
- return false;
- }
- }
|