From 4f968eb79d8f7323705a8c1b28e94d90e7c20ab0 Mon Sep 17 00:00:00 2001 From: Max Grim Date: Tue, 27 Apr 2021 19:00:25 +0300 Subject: [PATCH] fix generate signatue If send data type "e-mail" then binance return: [Signature for this request is not valid.] When using the Binance Corporate API If need to add functions for working with the Binance Corporate API, just tell me how to name the functions correctly =) Now: sub_accounts() - [/sapi/v1/sub-account/list] sub_account_assets() - [...] sub_account_deposit_address - [...] sub_account_deposits [...] sub_account_transfer_universal [...] --- php-binance-api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php-binance-api.php b/php-binance-api.php index ce78194..ef85cfa 100755 --- a/php-binance-api.php +++ b/php-binance-api.php @@ -1121,6 +1121,7 @@ protected function httpRequest(string $url, string $method = "GET", array $param } $query = http_build_query($params, '', '&'); + $query = str_replace([ '%40' ], [ '@' ], $query);//if send data type "e-mail" then binance return: [Signature for this request is not valid.] $signature = hash_hmac('sha256', $query, $this->api_secret); if ($method === "POST") { $endpoint = $base . $url;