setPostParams($post); $result = json_decode($curl->post(static::URL), true); if ($curl->responseCode != 200) throw new Exception($curl->responseCode); if ($curl->errorText) throw new Exception(1304, $curl->errorText); if (isset($result['error']) && is_string($result['error'])) throw new Exception(1304, $result['error']); $json = json_encode($result); return $json; } }