Skip to content
Merged
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
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ To do this, add the dependency to your pom.xml:

Add the following to your `build.gradle` file:

```
```groovy
repositories {
mavenCentral()
}
dependencies {
compile 'com.maxmind.minfraud:minfraud:4.0.0'
implementation 'com.maxmind.minfraud:minfraud:4.0.0'
}
```

Expand All @@ -47,8 +47,11 @@ takes your MaxMind account ID and license key as arguments. For example:
WebServiceClient client = new WebServiceClient.Builder(6, "ABCD567890").build();
```

If you would like to use the Sandbox environment, you can use the `host` method
that belongs to the Builder. For example,
The `WebServiceClient` object is thread-safe and can be reused across requests.
Reusing the object allows connection pooling and improves performance.

If you would like to use the Sandbox environment, you can use the `host` method
that belongs to the Builder. For example:

```java
WebServiceClient client = new WebServiceClient.Builder(6, "ABCD567890")
Expand Down Expand Up @@ -78,13 +81,13 @@ After creating the transaction object, send a Score request by calling the
ScoreResponse score = client.score(transaction);
```

an Insights request by calling `insights` method:
Send an Insights request by calling the `insights` method:

```java
InsightsResponse insights = client.insights(transaction);
```

a Factors request by calling `factors` method:
Send a Factors request by calling the `factors` method:

```java
FactorsResponse factors = client.factors(transaction);
Expand All @@ -96,9 +99,9 @@ If the request fails, an exception will be thrown.
To report a transaction:

```java
TransactionReport transaction = new TransactionReport.Builder(
InetAddress.getByName("1.1.1.1"), Tag.NOT_FRAUD
).build();
TransactionReport transaction = new TransactionReport.Builder(Tag.NOT_FRAUD)
.ipAddress(InetAddress.getByName("1.1.1.1"))
.build();
client.reportTransaction(transaction);
```

Expand Down Expand Up @@ -128,12 +131,12 @@ Checked exceptions:
* `MinFraudException` - This will be thrown when the server returns an
unexpected response. This also serves as the base class for the above
checked exceptions.
* `HttpException` -This will be thrown when an unexpected HTTP error
* `HttpException` - This will be thrown when an unexpected HTTP error
occurs such as an internal server error or other unexpected status code.

## Examples
## Examples ##

### Insights
### Insights ###

```java
Transaction request = new Transaction.Builder(
Expand Down Expand Up @@ -164,7 +167,7 @@ Transaction request = new Transaction.Builder(
).creditCard(
new CreditCard.Builder()
.avsResult('N')
.bankName("BanK of New Haven")
.bankName("Bank of New Haven")
.bankPhoneCountryCode("1")
.bankPhoneNumber("313-231-3213")
.cvvResult('Y')
Expand Down Expand Up @@ -243,23 +246,24 @@ WebServiceClient client = new WebServiceClient.Builder(6, "ABCD567890").build();
System.out.println(client.insights(request));
```

### Report Transactions API
### Report Transactions API ###

MaxMind encourages the use of this API, as data received through this channel
is continually used to improve the accuracy of our fraud detection algorithms.

To use the Report Transactions API, create a new `TransactionReport` object. A
valid tag at least one of the following are required arguments: IP address,
MaxMind ID, minFraud ID, or transaction ID. Additional parameters may also be
set, as documented below.
valid tag and at least one of the following are required: IP address, MaxMind
ID, minFraud ID, or transaction ID. Additional parameters may also be set, as
documented below.

If the report is successful, nothing is returned. If the report fails, an
exception with be thrown.
exception will be thrown.

See the API documentation for more details.

```java
TransactionReport transaction = new TransactionReport.Builder(InetAddress.getByName("1.1.1.1"), Tag.NOT_FRAUD)
TransactionReport transaction = new TransactionReport.Builder(Tag.NOT_FRAUD)
.ipAddress(InetAddress.getByName("1.1.1.1"))
.chargebackCode("mycode")
.maxmindId("12345678")
.minfraudId(UUID.fromString("58fa38d8-4b87-458b-a22b-f00eda1aa20d"))
Expand Down
Loading