Package com.maxmind.minfraud
Class WebServiceClient
- java.lang.Object
-
- com.maxmind.minfraud.WebServiceClient
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class WebServiceClient extends Object implements Closeable
Client for MaxMind minFraud Score, Insights, and Factors
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebServiceClient.Builder
Builder
creates instances ofWebServiceClient
from values set by the methods.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close any open connections and return resources to the system.FactorsResponse
factors(Transaction transaction)
Make a minFraud Factors request to the web service using the transaction request object passed to the method.InsightsResponse
insights(Transaction transaction)
Make a minFraud Insights request to the web service using the transaction request object passed to the method.void
reportTransaction(TransactionReport transaction)
Make a Report Transaction request to the web service using the TransactionReport request object passed to the method.ScoreResponse
score(Transaction transaction)
Make a minFraud Score request to the web service using the transaction request object passed to the method.String
toString()
-
-
-
Method Detail
-
factors
public FactorsResponse factors(Transaction transaction) throws IOException, MinFraudException, InsufficientFundsException, InvalidRequestException, AuthenticationException, PermissionRequiredException, HttpException
Make a minFraud Factors request to the web service using the transaction request object passed to the method.- Parameters:
transaction
- A transaction request object.- Returns:
- An Factors model object
- Throws:
InsufficientFundsException
- when there are insufficient funds on the account.AuthenticationException
- when there is a problem authenticating.InvalidRequestException
- when the request is invalid for some other reason.PermissionRequiredException
- when permission is required to use the service.MinFraudException
- when the web service returns unexpected content.HttpException
- when the web service returns an unexpected response.IOException
- when some other IO error occurs.
-
insights
public InsightsResponse insights(Transaction transaction) throws IOException, MinFraudException, InsufficientFundsException, InvalidRequestException, AuthenticationException, PermissionRequiredException, HttpException
Make a minFraud Insights request to the web service using the transaction request object passed to the method.- Parameters:
transaction
- A transaction request object.- Returns:
- An Insights model object
- Throws:
InsufficientFundsException
- when there are insufficient funds on the account.AuthenticationException
- when there is a problem authenticating.InvalidRequestException
- when the request is invalid for some other reason.PermissionRequiredException
- when permission is required to use the service.MinFraudException
- when the web service returns unexpected content.HttpException
- when the web service returns an unexpected response.IOException
- when some other IO error occurs.
-
score
public ScoreResponse score(Transaction transaction) throws IOException, MinFraudException, InsufficientFundsException, InvalidRequestException, AuthenticationException, PermissionRequiredException, HttpException
Make a minFraud Score request to the web service using the transaction request object passed to the method.- Parameters:
transaction
- A transaction request object.- Returns:
- An Score model object
- Throws:
InsufficientFundsException
- when there are insufficient funds on the account.AuthenticationException
- when there is a problem authenticating.InvalidRequestException
- when the request is invalid for some other reason.PermissionRequiredException
- when permission is required to use the service.MinFraudException
- when the web service returns unexpected content.HttpException
- when the web service returns an unexpected response.IOException
- when some other IO error occurs.
-
reportTransaction
public void reportTransaction(TransactionReport transaction) throws IOException, MinFraudException, InsufficientFundsException, InvalidRequestException, AuthenticationException, PermissionRequiredException, HttpException
Make a Report Transaction request to the web service using the TransactionReport request object passed to the method.- Parameters:
transaction
- A TransactionReport request object.- Throws:
InsufficientFundsException
- when there are insufficient funds on the account.AuthenticationException
- when there is a problem authenticating.InvalidRequestException
- when the request is invalid for some other reason.PermissionRequiredException
- when permission is required to use the service.MinFraudException
- when the web service returns unexpected content.HttpException
- when the web service returns an unexpected response.IOException
- when some other IO error occurs.
-
close
public void close() throws IOException
Close any open connections and return resources to the system.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-