From e87ee69b5c35089c628d320d2d4b9704526c6f51 Mon Sep 17 00:00:00 2001 From: Baurzhan Kiyakov <57826472+bkiyakov@users.noreply.github.com> Date: Mon, 4 Mar 2024 19:08:05 +0600 Subject: [PATCH 1/2] New api authorization scheme name --- src/Clients/MindboxClientV3.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Clients/MindboxClientV3.php b/src/Clients/MindboxClientV3.php index 80ab50d..17661bb 100644 --- a/src/Clients/MindboxClientV3.php +++ b/src/Clients/MindboxClientV3.php @@ -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. @@ -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; } /** From 6b01b3ae0662d70967479add31dbc26504f00a4e Mon Sep 17 00:00:00 2001 From: Baurzhan Kiyakov <57826472+bkiyakov@users.noreply.github.com> Date: Mon, 4 Mar 2024 19:34:07 +0600 Subject: [PATCH 2/2] fix tests --- tests/Clients/MindboxClientV3Test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Clients/MindboxClientV3Test.php b/tests/Clients/MindboxClientV3Test.php index 21eac33..08106c2 100644 --- a/tests/Clients/MindboxClientV3Test.php +++ b/tests/Clients/MindboxClientV3Test.php @@ -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' @@ -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' @@ -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' ],