Skip to content

Commit

Permalink
New api authorization scheme name (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkiyakov authored Mar 4, 2024
1 parent 974ca20 commit da7b1ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Clients/MindboxClientV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class MindboxClientV3 extends AbstractMindboxClient

const TMP_V3_URL = 'https://api-ru.mindbox.cloud/v3/operations/';
/**
* Секретный ключ.
* Имя схемы авторизации по секретному ключу.
*/
const SECRET_KEY_NAME = 'Mindbox secretKey';
const SECRET_KEY_AUTHORIZATION_SCHEME_NAME = 'SecretKey';

/**
* @var string Доменная зона API.
Expand Down Expand Up @@ -143,7 +143,7 @@ private function getDeviceUUID()
*/
protected function prepareAuthorizationHeader()
{
return static::SECRET_KEY_NAME . '="' . $this->secretKey . '"';
return static::SECRET_KEY_AUTHORIZATION_SCHEME_NAME . ' ' . $this->secretKey;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Clients/MindboxClientV3Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function expectedArgsForSendProvider()
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => 'Mindbox secretKey="' . $this->secret . '"',
'Authorization' => 'SecretKey ' . $this->secret,
'X-Customer-IP' => '',
'Mindbox-Integration' => 'PhpSDK',
'Mindbox-Integration-Version' => '1.0'
Expand All @@ -61,7 +61,7 @@ public function expectedArgsForSendProvider()
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => 'Mindbox secretKey="' . $this->secret . '"',
'Authorization' => 'SecretKey ' . $this->secret,
'X-Customer-IP' => '',
'Mindbox-Integration' => 'PhpSDK',
'Mindbox-Integration-Version' => '1.0'
Expand All @@ -86,7 +86,7 @@ public function expectedArgsForSendProvider()
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => 'Mindbox secretKey="' . $this->secret . '"',
'Authorization' => 'SecretKey ' . $this->secret,
'Mindbox-Integration' => 'PhpSDK',
'Mindbox-Integration-Version' => '1.0'
],
Expand Down

0 comments on commit da7b1ce

Please sign in to comment.