|
3 | 3 | import com.fasterxml.jackson.core.type.TypeReference; |
4 | 4 | import com.fasterxml.jackson.databind.InjectableValues; |
5 | 5 | import com.fasterxml.jackson.databind.InjectableValues.Std; |
6 | | -import com.maxmind.minfraud.exception.*; |
| 6 | +import com.maxmind.minfraud.exception.AuthenticationException; |
| 7 | +import com.maxmind.minfraud.exception.HttpException; |
| 8 | +import com.maxmind.minfraud.exception.InsufficientFundsException; |
| 9 | +import com.maxmind.minfraud.exception.InvalidRequestException; |
| 10 | +import com.maxmind.minfraud.exception.MinFraudException; |
| 11 | +import com.maxmind.minfraud.exception.PermissionRequiredException; |
7 | 12 | import com.maxmind.minfraud.request.Transaction; |
8 | 13 | import com.maxmind.minfraud.request.TransactionReport; |
9 | 14 | import com.maxmind.minfraud.response.FactorsResponse; |
10 | 15 | import com.maxmind.minfraud.response.InsightsResponse; |
11 | 16 | import com.maxmind.minfraud.response.ScoreResponse; |
12 | | - |
13 | 17 | import java.io.Closeable; |
14 | 18 | import java.io.IOException; |
15 | 19 | import java.io.InputStream; |
16 | | -import java.net.*; |
| 20 | +import java.net.InetSocketAddress; |
| 21 | +import java.net.Proxy; |
| 22 | +import java.net.ProxySelector; |
| 23 | +import java.net.URI; |
| 24 | +import java.net.URISyntaxException; |
17 | 25 | import java.net.http.HttpClient; |
18 | 26 | import java.net.http.HttpRequest; |
19 | 27 | import java.net.http.HttpResponse; |
20 | 28 | import java.nio.charset.StandardCharsets; |
21 | 29 | import java.time.Duration; |
22 | | -import java.util.*; |
| 30 | +import java.util.ArrayList; |
| 31 | +import java.util.Base64; |
| 32 | +import java.util.Collections; |
| 33 | +import java.util.HashMap; |
| 34 | +import java.util.List; |
| 35 | +import java.util.Map; |
23 | 36 |
|
24 | 37 | /** |
25 | 38 | * Client for MaxMind minFraud Score, Insights, and Factors |
@@ -48,8 +61,8 @@ private WebServiceClient(WebServiceClient.Builder builder) { |
48 | 61 | // HttpClient supports basic auth, but it will only send it after the |
49 | 62 | // server responds with an unauthorized. As such, we just make the |
50 | 63 | // Authorization header ourselves. |
51 | | - authHeader = "Basic " + |
52 | | - Base64.getEncoder() |
| 64 | + authHeader = "Basic " |
| 65 | + + Base64.getEncoder() |
53 | 66 | .encodeToString((builder.accountId + ":" + builder.licenseKey) |
54 | 67 | .getBytes(StandardCharsets.UTF_8)); |
55 | 68 |
|
@@ -502,12 +515,12 @@ public void close() throws IOException { |
502 | 515 |
|
503 | 516 | @Override |
504 | 517 | public String toString() { |
505 | | - return "WebServiceClient{" + |
506 | | - "host='" + host + '\'' + |
507 | | - ", port=" + port + |
508 | | - ", useHttps=" + useHttps + |
509 | | - ", locales=" + locales + |
510 | | - ", httpClient=" + httpClient + |
511 | | - '}'; |
| 518 | + return "WebServiceClient{" |
| 519 | + + "host='" + host + '\'' |
| 520 | + + ", port=" + port |
| 521 | + + ", useHttps=" + useHttps |
| 522 | + + ", locales=" + locales |
| 523 | + + ", httpClient=" + httpClient |
| 524 | + + '}'; |
512 | 525 | } |
513 | 526 | } |
0 commit comments