Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/com/checkout/ApacheHttpClientTransport.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@
}

private Header[] sanitiseHeaders(final Header[] headers) {
// TODO: discuss whether Cko-Idempotency-Key should also be filtered — it is a per-request

Check warning on line 366 in src/main/java/com/checkout/ApacheHttpClientTransport.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-java&issues=AZ0fuATuGkojc2DtL2ib&open=AZ0fuATuGkojc2DtL2ib&pullRequest=562
// unique identifier (not a credential), but filtering it reduces exposure in INFO logs.
// Uncomment the line below once agreed.
// .filter(it -> !it.getName().equalsIgnoreCase(CKO_IDEMPOTENCY_KEY))
return Arrays.stream(headers)
.filter(it -> !it.getName().equals(AUTHORIZATION))
.toArray(Header[]::new);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/checkout/CheckoutApiException.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.Map;

@Getter
@ToString
@ToString(exclude = "responseHeaders")
public final class CheckoutApiException extends CheckoutException {

private final Integer httpStatusCode;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/checkout/GsonSerializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.google.gson.reflect.TypeToken;
import com.google.gson.typeadapters.RuntimeTypeAdapterFactory;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.EnumUtils;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
Expand All @@ -67,6 +68,7 @@
import java.util.stream.IntStream;

@Getter
@Slf4j
public class GsonSerializer implements Serializer {

private static final List<DateTimeFormatter> DEFAULT_FORMATTERS = Arrays.asList(
Expand Down Expand Up @@ -438,7 +440,7 @@ private static JsonDeserializer<ProductResponse> getProductDeserializer() {
}
}
} catch (IllegalAccessException e) {
System.err.println("Error setting field: " + entry.getKey() + ", " + e.getMessage());
log.warn("Error setting field: {}", entry.getKey(), e);
}
});

Expand Down
Loading