From 336e4c7fea2b37b7b920129dab12bd65a4222ea0 Mon Sep 17 00:00:00 2001 From: Marianne Bianca De Melo Bezerra Date: Wed, 24 Apr 2024 18:38:29 -0300 Subject: [PATCH] adjusting set of access token --- src/main/java/com/mercadopago/client/MercadoPagoClient.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/mercadopago/client/MercadoPagoClient.java b/src/main/java/com/mercadopago/client/MercadoPagoClient.java index 03470cb1..876c3bf5 100644 --- a/src/main/java/com/mercadopago/client/MercadoPagoClient.java +++ b/src/main/java/com/mercadopago/client/MercadoPagoClient.java @@ -285,7 +285,7 @@ private Map addDefaultHeaders(MPRequest request) { } if (!request.getUri().contains(OAUTH_TOKEN) && !headers.containsKey(Headers.AUTHORIZATION)) { - headers.put(Headers.AUTHORIZATION, String.format(BEARER, getAccessToken(null))); + headers.put(Headers.AUTHORIZATION, String.format(BEARER, request.getAccessToken())); } return headers; } @@ -298,10 +298,6 @@ private Map addCustomHeaders(String uri, MPRequestOptions reques } } - if (!uri.contains(OAUTH_TOKEN)) { - headers.put(Headers.AUTHORIZATION, String.format(BEARER, getAccessToken(requestOptions))); - } - return headers; }