From 3d786c6ffaeaa8d1e0e89a634796ac8ad1ed6bac Mon Sep 17 00:00:00 2001 From: Alexandre Segura Date: Thu, 30 Jan 2025 12:07:47 +0100 Subject: [PATCH 1/2] Fix AUTH_URL. --- src/MercadoPago/Client/OAuth/OAuthClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MercadoPago/Client/OAuth/OAuthClient.php b/src/MercadoPago/Client/OAuth/OAuthClient.php index 4580e6dc..afefb5fd 100644 --- a/src/MercadoPago/Client/OAuth/OAuthClient.php +++ b/src/MercadoPago/Client/OAuth/OAuthClient.php @@ -13,7 +13,7 @@ /** 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"; From 16abd9d1917806737c013306458117ec63d2e09a Mon Sep 17 00:00:00 2001 From: Alexandre Segura Date: Thu, 30 Jan 2025 12:08:56 +0100 Subject: [PATCH 2/2] Update test. --- tests/MercadoPago/Client/Unit/OAuth/OAuthClientUnitTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/MercadoPago/Client/Unit/OAuth/OAuthClientUnitTest.php b/tests/MercadoPago/Client/Unit/OAuth/OAuthClientUnitTest.php index e9e9a6bc..6ac403a4 100644 --- a/tests/MercadoPago/Client/Unit/OAuth/OAuthClientUnitTest.php +++ b/tests/MercadoPago/Client/Unit/OAuth/OAuthClientUnitTest.php @@ -18,7 +18,7 @@ public function testGetAuthorizationURLSuccess(): void { $client = new OAuthClient(); $url = $client->getAuthorizationURL("app_id", "redirect_uri", "random_id"); - $expected = "https://auth.mercadopago.com?client_id=app_id&response_type=code&platform_id=mp&state=random_id&redirect_uri=redirect_uri"; + $expected = "https://auth.mercadopago.com/authorization?client_id=app_id&response_type=code&platform_id=mp&state=random_id&redirect_uri=redirect_uri"; $this->assertSame($expected, $url); }