<commit_before># Maxmind minFraud PHP API #

## Installing with Composer ##

### Define Your Dependencies ###

We recommend installing this package with [Composer](http://getcomposer.org/).
To do this, add ```minfraud/http``` to your ```composer.json``` file.

```json
{
    "require": {
        "minfraud/http": "~1.53"
    }
}
```

### Install Composer ###

Run in your project root:

```
curl -s http://getcomposer.org/installer | php
```

### Install Dependencies ###

Run in your project root:

```
php composer.phar install
```

### Require Autoloader ###

You can autoload all dependencies by adding this to your code:
```
require 'vendor/autoload.php';
```

## Installing without Composer ##

Place the files in the `src` directory in the `include_path` as specified in
your `php.ini` file or place them in the same directory as your PHP scripts.

## Example Scripts ##

See `examples/minfraud.php` for complete example how to use this API with the
minFraud service.

See `examples/telephone-verification.php` for complete example how to use
this API with the Telephone Verification service.

These scripts can be run from the shell.

## API Documentation for minFraud service ##

$ccfs = new CreditCardFraudDetection;
  This creates a new CreditCardFraudDetection object

$ccfs->isSecure
  If isSecure is set to 0 then it uses regular HTTP.
  If isSecure is set to 1 then it uses Secure HTTPS (requires Curl PHP binding)

$ccfs->input($hash)
  Takes a hash and uses it as input for the server.
  See http://dev.maxmind.com/minfraud/ for details on input fields.

$ccfs->query();
  Queries the server with the fields passed to the input method
  and stores the output.

$hash = $ccfs->output();
  Returns the output from the server.
  See http://dev.maxmind.com/minfraud/ for details on output fields.<commit_msg>Clean up markdown a bit<commit_after># Maxmind minFraud PHP API #

## Installing with Composer ##

### Define Your Dependencies ###

We recommend installing this package with [Composer](http://getcomposer.org/).
To do this, add ```minfraud/http``` to your ```composer.json``` file.

```json
{
    "require": {
        "minfraud/http": "~1.53"
    }
}
```

### Install Composer ###

Run in your project root:

```
curl -s http://getcomposer.org/installer | php
```

### Install Dependencies ###

Run in your project root:

```
php composer.phar install
```

### Require Autoloader ###

You can autoload all dependencies by adding this to your code:
```
require 'vendor/autoload.php';
```

## Installing without Composer ##

Place the files in the `src` directory in the `include_path` as specified in
your `php.ini` file or place them in the same directory as your PHP scripts.

## Example Scripts ##

See `examples/minfraud.php` for complete example how to use this API with the
minFraud service.

See `examples/telephone-verification.php` for complete example how to use
this API with the Telephone Verification service.

These scripts can be run from the shell.

## Usage ##

```php

$ccfs = new CreditCardFraudDetection;
$ccfs->input($hash);
$ccfs->query();
$hash = $ccfs->output();

```
### $ccfs->isSecure ###

If isSecure is set to 0 then it uses regular HTTP. If isSecure is set to 1
then it uses Secure HTTPS (requires Curl PHP binding)

### $ccfs->input($hash) ###

Takes a hash and uses it as input for the server. See
http://dev.maxmind.com/minfraud/ for details on input fields.

### $ccfs->query() ###
  Queries the server with the fields passed to the input method
  and stores the output.

### $ccfs->output();

Returns the output from the server. See http://dev.maxmind.com/minfraud/
for details on output fields.
{'fraction_non_alphanumeric': 0.11863013698630137, 'fraction_numerical': 0.0027397260273972603, 'mean_word_length': 4.001369863013698, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '152067', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1124, 'n_words': 451}