Skip to content

Commit

Permalink
Permite que o cliente HTTP, que envia requisição para o PagSeguro,
Browse files Browse the repository at this point in the history
siga redirects.

Signed-off-by: Manoel Campos <[email protected]>
  • Loading branch information
manoelcampos committed Jan 11, 2024
1 parent ba3144e commit 2e50417
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>br.com.competeaqui</groupId>
<artifactId>pagseguro-api</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>

<name>PagSeguro Java API</name>
<description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

import static java.net.http.HttpClient.Redirect;
import static java.net.http.HttpRequest.BodyPublishers;

/**
Expand All @@ -32,7 +33,7 @@ public class PixOrderService {
public PixOrderService(@NonNull final String baseUrl, @NonNull final String token) {
this.serviceUrl = Util.validateUrl(baseUrl + "/orders");
this.token = token;
this.client = HttpClient.newBuilder().build();
this.client = HttpClient.newBuilder().followRedirects(Redirect.NORMAL).build();
this.jsonMapper = new ObjectMapper();
this.jsonMapper.registerModule(new JavaTimeModule());
}
Expand Down

0 comments on commit 2e50417

Please sign in to comment.