$value) { if ($value !== '') $sign .= sprintf('%s=%s&', $ke, $value); } return strtoupper(md5($sign . 'key=' . $key)); } /** * @param $mobile * @param $order_id * @param $money * @return mixed */ public static function fastRecharge($mobile, $order_id, $money) { $url = "/api/recharge/server"; $domain = sys_config('site_url', ''); if (strstr($domain, 'http://')) { $domain = substr($domain, 7); } else { $domain = substr($domain, 8); } $time = time(); $data = [ 'appId' => self::$app_id, 'mobile' => $mobile, 'orderId' => $order_id, 'amount' => $money, 'notifyUrl' => sys_config('site_url', '') . '/api/mobile/notify', 'timestamp' => $time, 'urlHost' => $domain]; $data['sign'] = self::getSign($data); $res = do_request(self::$domain . $url, $data); return json_decode($res, true); } /** * @param $mobile * @param $order_id * @param $money * @return mixed */ public static function slowRecharge($mobile, $order_id, $money) { $url = "/api/rechargeslow/server"; $domain = sys_config('site_url', ''); if (strstr($domain, 'http://')) { $domain = substr($domain, 7); } else { $domain = substr($domain, 8); } $time = time(); $data = [ 'appId' => self::$app_id, 'mobile' => $mobile, 'orderId' => $order_id, 'amount' => $money, 'notifyUrl' => sys_config('site_url', '') . '/api/mobile/notify', 'timestamp' => $time, 'urlHost' => $domain]; $data['sign'] = self::getSign($data); $res = do_request(self::$domain . $url, $data); return json_decode($res, true); } }