VERSION
VERSION = 'v1.16.0' :
This class provides a client API for accessing MaxMind minFraud Score, Insights and Factors.
The constructor takes your MaxMind account ID and license key. The object
returned is immutable. To build up a request, call the ->with*()
methods.
Each of these returns a new object (a clone of the original) with the
additional data. These can be chained together:
$client = new MinFraud(6, 'LICENSE_KEY');
$score = $client->withDevice(['ip_address' => '1.1.1.1',
'session_age' => 3600.5,
'session_id' => 'foobar',
'accept_language' => 'en-US'])
->withEmail(['domain' => 'maxmind.com'])
->score();
If the request fails, an exception is thrown.
__construct(int $accountId, string $licenseKey, array $options = []) : mixed
int | $accountId | Your MaxMind account ID |
string | $licenseKey | Your MaxMind license key |
array | $options | An array of options. Possible keys:
|
with(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the array to be sent to the web service set to `$values`. Existing values will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withDevice(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `device` array set to `$values`. Existing `device` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withEvent(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `events` array set to `$values`. Existing `event` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withAccount(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `account` array set to `$values`. Existing `account` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withEmail(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `email` array set to `$values`. Existing `email` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withBilling(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `billing` array set to `$values`. Existing `billing` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withShipping(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `shipping` array set to `$values`. Existing `shipping` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withPayment(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `payment` array set to `$values`. Existing `payment` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withCreditCard(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `credit_card` array set to `$values`. Existing `credit_card` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withCustomInputs(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `custom_inputs` array set to `$values`. Existing `custom_inputs` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withOrder(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with the `order` array set to `$values`. Existing `order` data will be replaced.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
withShoppingCartItem(array $values) : \MaxMind\MinFraud
This returns a `MinFraud` object with `$values` added to the shopping cart array.
array | $values |
A new immutable MinFraud object. This object is a clone of the original with additional data.
score() : \MaxMind\MinFraud\Model\Score
This method performs a minFraud Score lookup using the request data in the current object and returns a model object for minFraud Score.
when the request has missing or invalid data
when there is an issue authenticating the request
when your account is out of funds
when the request is invalid for some other reason, e.g., invalid JSON in the POST.
when an unexpected HTTP error occurs
when some other error occurs. This also serves as the base class for the above exceptions.
minFraud Score model object
insights() : \MaxMind\MinFraud\Model\Insights
This method performs a minFraud Insights lookup using the request data in the current object and returns a model object for minFraud Insights.
when the request has missing or invalid data
when there is an issue authenticating the request
when your account is out of funds
when the request is invalid for some other reason, e.g., invalid JSON in the POST.
when an unexpected HTTP error occurs
when some other error occurs. This also serves as the base class for the above exceptions.
minFraud Insights model object
factors() : \MaxMind\MinFraud\Model\Factors
This method performs a minFraud Factors lookup using the request data in the current object and returns a model object for minFraud Factors.
when the request has missing or invalid data
when there is an issue authenticating the request
when your account is out of funds
when the request is invalid for some other reason, e.g., invalid JSON in the POST.
when an unexpected HTTP error occurs
when some other error occurs. This also serves as the base class for the above exceptions.
minFraud Factors model object