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 classWebServiceClient.BuilderBuildercreates instances ofWebServiceClientfrom values set by the methods.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close any open connections and return resources to the system.FactorsResponsefactors(Transaction transaction)Make a minFraud Factors request to the web service using the transaction request object passed to the method.InsightsResponseinsights(Transaction transaction)Make a minFraud Insights request to the web service using the transaction request object passed to the method.voidreportTransaction(TransactionReport transaction)Make a Report Transaction request to the web service using the TransactionReport request object passed to the method.ScoreResponsescore(Transaction transaction)Make a minFraud Score request to the web service using the transaction request object passed to the method.StringtoString()
-
-
-
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 IOExceptionClose any open connections and return resources to the system.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-