@@ -24,12 +24,12 @@ To do this, add the dependency to your pom.xml:
2424
2525Add the following to your ` build.gradle ` file:
2626
27- ```
27+ ``` groovy
2828repositories {
2929 mavenCentral()
3030}
3131dependencies {
32- compile 'com.maxmind.minfraud:minfraud:4.0.0'
32+ implementation 'com.maxmind.minfraud:minfraud:4.0.0'
3333}
3434```
3535
@@ -47,8 +47,11 @@ takes your MaxMind account ID and license key as arguments. For example:
4747WebServiceClient client = new WebServiceClient .Builder (6 , " ABCD567890" ). build();
4848```
4949
50- If you would like to use the Sandbox environment, you can use the ` host ` method
51- that belongs to the Builder. For example,
50+ The ` WebServiceClient ` object is thread-safe and can be reused across requests.
51+ Reusing the object allows connection pooling and improves performance.
52+
53+ If you would like to use the Sandbox environment, you can use the ` host ` method
54+ that belongs to the Builder. For example:
5255
5356``` java
5457WebServiceClient client = new WebServiceClient .Builder (6 , " ABCD567890" )
@@ -78,13 +81,13 @@ After creating the transaction object, send a Score request by calling the
7881ScoreResponse score = client. score(transaction);
7982```
8083
81- an Insights request by calling ` insights ` method:
84+ Send an Insights request by calling the ` insights ` method:
8285
8386``` java
8487InsightsResponse insights = client. insights(transaction);
8588```
8689
87- a Factors request by calling ` factors ` method:
90+ Send a Factors request by calling the ` factors ` method:
8891
8992``` java
9093FactorsResponse factors = client. factors(transaction);
@@ -96,9 +99,9 @@ If the request fails, an exception will be thrown.
9699To report a transaction:
97100
98101``` java
99- TransactionReport transaction = new TransactionReport .Builder (
100- InetAddress . getByName(" 1.1.1.1" ), Tag . NOT_FRAUD
101- ) . build();
102+ TransactionReport transaction = new TransactionReport .Builder (Tag . NOT_FRAUD )
103+ .ipAddress( InetAddress . getByName(" 1.1.1.1" ))
104+ .build();
102105client. reportTransaction(transaction);
103106```
104107
@@ -128,12 +131,12 @@ Checked exceptions:
128131* ` MinFraudException ` - This will be thrown when the server returns an
129132 unexpected response. This also serves as the base class for the above
130133 checked exceptions.
131- * ` HttpException ` -This will be thrown when an unexpected HTTP error
134+ * ` HttpException ` - This will be thrown when an unexpected HTTP error
132135 occurs such as an internal server error or other unexpected status code.
133136
134- ## Examples
137+ ## Examples ##
135138
136- ### Insights
139+ ### Insights ###
137140
138141``` java
139142Transaction request = new Transaction .Builder (
@@ -164,7 +167,7 @@ Transaction request = new Transaction.Builder(
164167 ). creditCard(
165168 new CreditCard .Builder ()
166169 .avsResult(' N' )
167- .bankName(" BanK of New Haven" )
170+ .bankName(" Bank of New Haven" )
168171 .bankPhoneCountryCode(" 1" )
169172 .bankPhoneNumber(" 313-231-3213" )
170173 .cvvResult(' Y' )
@@ -243,23 +246,24 @@ WebServiceClient client = new WebServiceClient.Builder(6, "ABCD567890").build();
243246System . out. println(client. insights(request));
244247```
245248
246- ### Report Transactions API
249+ ### Report Transactions API ###
247250
248251MaxMind encourages the use of this API, as data received through this channel
249252is continually used to improve the accuracy of our fraud detection algorithms.
250253
251254To use the Report Transactions API, create a new ` TransactionReport ` object. A
252- valid tag at least one of the following are required arguments : IP address,
253- MaxMind ID, minFraud ID, or transaction ID. Additional parameters may also be
254- set, as documented below.
255+ valid tag and at least one of the following are required: IP address, MaxMind
256+ ID, minFraud ID, or transaction ID. Additional parameters may also be set, as
257+ documented below.
255258
256259If the report is successful, nothing is returned. If the report fails, an
257- exception with be thrown.
260+ exception will be thrown.
258261
259262See the API documentation for more details.
260263
261264``` java
262- TransactionReport transaction = new TransactionReport .Builder (InetAddress . getByName(" 1.1.1.1" ), Tag . NOT_FRAUD )
265+ TransactionReport transaction = new TransactionReport .Builder (Tag . NOT_FRAUD )
266+ .ipAddress(InetAddress . getByName(" 1.1.1.1" ))
263267 .chargebackCode(" mycode" )
264268 .maxmindId(" 12345678" )
265269 .minfraudId(UUID . fromString(" 58fa38d8-4b87-458b-a22b-f00eda1aa20d" ))
0 commit comments