|
...
|
...
|
@@ -80,14 +80,23 @@ class Api |
|
|
|
{
|
|
|
|
$recv_window = '5000';
|
|
|
|
$queryString = '';
|
|
|
|
$postBody = '';
|
|
|
|
|
|
|
|
if ($method == 'GET' && !empty($params)) {
|
|
|
|
ksort($params);
|
|
|
|
$queryString = http_build_query($params);
|
|
|
|
}
|
|
|
|
|
|
|
|
$sign_str = $timestamp . $this->apiInfo->key . $recv_window . $path . $queryString;
|
|
|
|
if ($method == 'POST' && !empty($params)) {
|
|
|
|
$sign_str .= json_encode($params);
|
|
|
|
ksort($params);
|
|
|
|
$postBody = json_encode($params);
|
|
|
|
}
|
|
|
|
|
|
|
|
$sign_str = $timestamp . $this->apiInfo->key . $recv_window . $path;
|
|
|
|
if ($queryString) {
|
|
|
|
$sign_str .= '?' . $queryString;
|
|
|
|
}
|
|
|
|
if ($postBody) {
|
|
|
|
$sign_str .= $postBody;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hash_hmac('sha256', $sign_str, $this->apiInfo->secret);
|
...
|
...
|
|