12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace refill\feinimoshu_hf;
- class config
- {
- const CHANNEL_HOST = 'http://122.114.168.35';
- const ORDER_URL = config::CHANNEL_HOST . '/gateway/api.run/submit';
- const QUERY_URL = config::CHANNEL_HOST . '/gateway/api.run/order';
- const BALANCE_URL = config::CHANNEL_HOST . '/gateway/api.run/account';
- const APPID = 'CZ30533982';
- const APPKEY = 'lvrg4xoqvrozuq2irjza2a6dlenrsv';
- const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_feinimoshu_hf.php";
- public static function body($params)
- {
- ksort($params);
- $body = "";
- $i = 0;
- foreach ($params as $k => $v)
- {
- if (false === self::check_empty($v) && "@" != substr($v, 0, 1))
- {
- if ($i == 0) {
- $body .= "{$k}" . "=" . urlencode($v);
- } else {
- $body .= "&" . "{$k}" . "=" . urlencode($v);
- }
- $i++;
- }
- }
- return $body;
- }
- private static function check_empty($value)
- {
- if (!isset($value))
- return true;
- if ($value === null)
- return true;
- if (trim($value) === "")
- return true;
- return false;
- }
- }
|