minFraud PHP API v1.0.0
  • Namespace
  • Class

Namespaces

  • GeoIp2
    • Database
    • Exception
    • Model
    • Record
    • Test
      • Database
      • Model
      • WebService
    • WebService
  • MaxMind
    • MinFraud
      • Model
  • PHP

Classes

  • MinFraud

Class MinFraud

This class provides a client API for accessing MaxMind minFraud Score and Insights.

Usage

The constructor takes your MaxMind user 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', 'accept_language' => 'en-US']) ->withEmail(['domain' => 'maxmind.com']) ->score();

If the request fails, an exception is thrown.

Namespace: MaxMind
Located at MinFraud.php

Methods summary

public
# __construct( integer $userId, string $licenseKey, array $options = [] )

Parameters

$userId
Your MaxMind user ID
$licenseKey
Your MaxMind license key
$options

An array of options. Possible keys:

  • host - The host to use when connecting to the web service.
  • userAgent - The prefix for the User-Agent header to use in the request.
  • caBundle - The bundle of CA root certificates to use in the request.
  • connectTimeout - The connect timeout to use for the request.
  • timeout - The timeout to use for the request.
  • proxy - The HTTP proxy to use. May include a schema, port, username, and password, e.g., http://username:password@127.0.0.1:10.
  • locales - An array of locale codes to use for the location name properties.
  • validateInput - Default is true. Determines whether values passed to the with*() methods are validated. It is recommended that you leave validation on while developing and only (optionally) disable it before deployment.
public MaxMind\MinFraud
# with( $values )

This returns a MinFraud object with the array to be sent to the web service set to $values. Existing values will be replaced.

This returns a MinFraud object with the array to be sent to the web service set to $values. Existing values will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud API docs
public MaxMind\MinFraud
# withDevice( $values )

This returns a MinFraud object with the device array set to $values. Existing device data will be replaced.

This returns a MinFraud object with the device array set to $values. Existing device data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud device API docs
public MaxMind\MinFraud
# withEvent( $values )

This returns a MinFraud object with the events array set to $values. Existing event data will be replaced.

This returns a MinFraud object with the events array set to $values. Existing event data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud event API docs
public MaxMind\MinFraud
# withAccount( $values )

This returns a MinFraud object with the account array set to $values. Existing account data will be replaced.

This returns a MinFraud object with the account array set to $values. Existing account data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud account API docs
public MaxMind\MinFraud
# withEmail( $values )

This returns a MinFraud object with the email array set to $values. Existing email data will be replaced.

This returns a MinFraud object with the email array set to $values. Existing email data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud email API docs
public MaxMind\MinFraud
# withBilling( $values )

This returns a MinFraud object with the billing array set to $values. Existing billing data will be replaced.

This returns a MinFraud object with the billing array set to $values. Existing billing data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud billing API docs
public MaxMind\MinFraud
# withShipping( $values )

This returns a MinFraud object with the shipping array set to $values. Existing shipping data will be replaced.

This returns a MinFraud object with the shipping array set to $values. Existing shipping data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud shipping API docs
public MaxMind\MinFraud
# withPayment( $values )

This returns a MinFraud object with the payment array set to $values. Existing payment data will be replaced.

This returns a MinFraud object with the payment array set to $values. Existing payment data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud payment API docs
public MaxMind\MinFraud
# withCreditCard( $values )

This returns a MinFraud object with the credit_card array set to $values. Existing credit_card data will be replaced.

This returns a MinFraud object with the credit_card array set to $values. Existing credit_card data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud credit_card API docs
public MaxMind\MinFraud
# withOrder( $values )

This returns a MinFraud object with the order array set to $values. Existing order data will be replaced.

This returns a MinFraud object with the order array set to $values. Existing order data will be replaced.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud order API docs
public MaxMind\MinFraud
# withShoppingCartItem( $values )

This returns a MinFraud object with $values added to the shopping cart array.

This returns a MinFraud object with $values added to the shopping cart array.

Parameters

$values

Returns

MaxMind\MinFraud

Link

minFraud shopping cart item API docs
public MaxMind\MinFraud\Model\Score
# score( )

This method performs a minFraud Score lookup using the request data in the current object and returns a model object for minFraud Score.

This method performs a minFraud Score lookup using the request data in the current object and returns a model object for minFraud Score.

Returns

MaxMind\MinFraud\Model\Score
minFraud Score model object.

Throws

MaxMind\Exception\InvalidInputException

when the request has missing or invalid data.


MaxMind\Exception\AuthenticationException

when there is an issue authenticating the request.


MaxMind\Exception\InsufficientFundsException
when your account is out of funds.
MaxMind\Exception\InvalidRequestException

when the request is invalid for some other reason, e.g., invalid JSON in the POST.


MaxMind\Exception\HttpException
when an unexpected HTTP error occurs.
MaxMind\Exception\WebServiceException

when some other error occurs. This also serves as the base class for the above exceptions.

public MaxMind\MinFraud\Model\Insights
# insights( )

This method performs a minFraud Insights lookup using the request data in the current object and returns a model object for minFraud Insights.

This method performs a minFraud Insights lookup using the request data in the current object and returns a model object for minFraud Insights.

Returns

MaxMind\MinFraud\Model\Insights
minFraud Insights model object.

Throws

MaxMind\Exception\InvalidInputException

when the request has missing or invalid data.


MaxMind\Exception\AuthenticationException

when there is an issue authenticating the request.


MaxMind\Exception\InsufficientFundsException
when your account is out of funds.
MaxMind\Exception\InvalidRequestException

when the request is invalid for some other reason, e.g., invalid JSON in the POST.


MaxMind\Exception\HttpException
when an unexpected HTTP error occurs.
MaxMind\Exception\WebServiceException

when some other error occurs. This also serves as the base class for the above exceptions.

public MaxMind\MinFraud\Model\Factors
# factors( )

This method performs a minFraud Factors lookup using the request data in the current object and returns a model object for minFraud Factors.

This method performs a minFraud Factors lookup using the request data in the current object and returns a model object for minFraud Factors.

Returns

MaxMind\MinFraud\Model\Factors
minFraud Factors model object.

Throws

MaxMind\Exception\InvalidInputException

when the request has missing or invalid data.


MaxMind\Exception\AuthenticationException

when there is an issue authenticating the request.


MaxMind\Exception\InsufficientFundsException
when your account is out of funds.
MaxMind\Exception\InvalidRequestException

when the request is invalid for some other reason, e.g., invalid JSON in the POST.


MaxMind\Exception\HttpException
when an unexpected HTTP error occurs.
MaxMind\Exception\WebServiceException

when some other error occurs. This also serves as the base class for the above exceptions.

Constants summary

string VERSION
# 'v1.0.0'
minFraud PHP API v1.0.0 API documentation generated by ApiGen