PHP code example of fraudshield / fraudshield-php

1. Go to this page and download the library: Download fraudshield/fraudshield-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fraudshield / fraudshield-php example snippets



Fraudshield\Fraudshield;
use Fraudshield\Reports\ConversionReport;

$fs = new Fraudshield(USER_ID, API_TOKEN);

// create a conversion report
$report = new ConversionReport(186,'2017-06-05', '2017-06-05'); 

// dump the report content
var_dump($fs->getReport($report));


Fraudshield\Fraudshield;
use Fraudshield\Reports\FraudReport;

$fs = new Fraudshield(USER_ID, API_TOKEN);

// create a conversion report
$report = new FraudReport(186,'2017-06-05', '2017-06-05');

// add data sources
$report
    ->addDataSource('sub_id')
    ->addDataSource('partner')
    ->addDataSource('affiliate')
    ->addDataSource('product')
    ->addDataSource('goal');

// add filter
$report
    ->addFilter('min_conversions', 1)
    ->addFilter('min_rejection_rate', 1)
    ->addFilter('max_rejection_rate', 50)
    ->addFilter('min_goals_reached', 50)
    ->addFilter('max_goals_reached', 50);

// dump the report content
var_dump($fs->getReport($report));