From 08d7f8851db5cbce08a9d35788d559c05efd6a4a Mon Sep 17 00:00:00 2001 From: Allan Mariucci Carvalho Date: Tue, 5 Aug 2025 13:46:03 -0300 Subject: [PATCH 1/2] Update OAuthClient.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Na hora de obter a URL de autorização falta uma parte do path. --- src/MercadoPago/Client/OAuth/OAuthClient.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MercadoPago/Client/OAuth/OAuthClient.php b/src/MercadoPago/Client/OAuth/OAuthClient.php index 4580e6dc..2dcab013 100644 --- a/src/MercadoPago/Client/OAuth/OAuthClient.php +++ b/src/MercadoPago/Client/OAuth/OAuthClient.php @@ -17,6 +17,8 @@ final class OAuthClient extends MercadoPagoClient private const URL = "/oauth/token"; + private const AUTHORIZATION_URL = "/authorization"; + /** Default constructor. Uses the default http client used by the SDK or custom http client provided. */ public function __construct(?MPHttpClient $MPHttpClient = null) { @@ -40,7 +42,7 @@ public function getAuthorizationURL(string $app_id, string $redirect_uri, string ]; $query_string = http_build_query($query_params); - return OAuthClient::AUTH_URL . '?' . $query_string; + return OAuthClient::AUTH_URL . OAuthClient::AUTHORIZATION_URL . '?' . $query_string; } /** From 1765f97d57014e44f11b2f22eae65a81541252e9 Mon Sep 17 00:00:00 2001 From: Allan Mariucci Carvalho Date: Thu, 7 Aug 2025 11:16:59 -0300 Subject: [PATCH 2/2] =?UTF-8?q?Simplificado=20a=20modifica=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MercadoPago/Client/OAuth/OAuthClient.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/MercadoPago/Client/OAuth/OAuthClient.php b/src/MercadoPago/Client/OAuth/OAuthClient.php index 2dcab013..afefb5fd 100644 --- a/src/MercadoPago/Client/OAuth/OAuthClient.php +++ b/src/MercadoPago/Client/OAuth/OAuthClient.php @@ -13,12 +13,10 @@ /** Client responsible for performing OAuth authorizartion. */ final class OAuthClient extends MercadoPagoClient { - private const AUTH_URL = "https://auth.mercadopago.com"; + private const AUTH_URL = "https://auth.mercadopago.com/authorization"; private const URL = "/oauth/token"; - private const AUTHORIZATION_URL = "/authorization"; - /** Default constructor. Uses the default http client used by the SDK or custom http client provided. */ public function __construct(?MPHttpClient $MPHttpClient = null) { @@ -42,7 +40,7 @@ public function getAuthorizationURL(string $app_id, string $redirect_uri, string ]; $query_string = http_build_query($query_params); - return OAuthClient::AUTH_URL . OAuthClient::AUTHORIZATION_URL . '?' . $query_string; + return OAuthClient::AUTH_URL . '?' . $query_string; } /**