getMessage(); } } /** * 查询账户余额 * @author php迷途小书童 * @created 2021/1/14 16:34 */ public static function checkAmount($user) { $data = [ 'platformNo' => env('GZC.PLATFORM_NO'), 'appNo' => env('GZC.APP_NO'), 'conName' => $user['user_name'], 'conCertType' => 1, 'conCertNo' => $user['user_card'], ]; return self::request('POST', '/v1/api/third/in/in30', $data); } /** * 获取TOKEN * @return mixed|string * @author php迷途小书童 * @created 2021/1/14 14:38 */ public static function getTokenFromServer() { $timestamp = (int)(microtime(true) * 1000); $appid = env('GZC.APP_ID'); $data = [ 'appid' => $appid, 'sign' => self::getSignContent($timestamp, $appid), 'timestamp' => $timestamp ]; return self::request('POST', '/v1/api/third/auth/token', $data); } /** * 获取签名 * @return string * @author php迷途小书童 * @created 2020/10/29 9:35 */ public static function getSignContent(int $timestamp, string $appid) { $appsecret = md5(env('GZC.APP_SECRET')); $stringToBeSigned = "appid={$appid}&secret={$appsecret}×tamp={$timestamp}"; return md5($stringToBeSigned); } }