Board index   FAQ   Search  
Register  Login
Board index PHP Your Scripts

Script to screen online fraud

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

Script to screen online fraud

Postby chrislim2888 » Thu Mar 07, 2013 9:06 pm

This sample code shows you how to screen an order by entering all the relevant information into the request parameters.

Code: Select all
<?php
$apiKey = '<Get a free license key from fraudlabspro.com>';
$params['format']           = 'json';
$params['ip']               = $_SERVER['REMOTE_ADDR'];
$params['bill_city']        = 'Cleveland';
$params['bill_state']       = 'OH';
$params['bill_zip_code']    = '44115';
$params['bill_country']     = 'US';
$params['ship_addr']        = '4987 Bingamon Road';
$params['ship_city']        = 'Cleveland';
$params['ship_state']       = 'OH';
$params['ship_zip_code']    = '44115';
$params['ship_country']     = 'US';
$params['email_domain']     = 'gmail.com';
$params['phone']            = '440-5551961';
$params['email_hash']       = fraudlabspro_hash('user@gmail.com');
$params['username_hash']    = fraudlabspro_hash('kevinowen');
$params['password_hash']    = fraudlabspro_hash('3X2hd8cWNw9q');
$params['bin_no']           = '558265';
$params['bank_name']        = 'Bank of Ocean View';
$params['bank_phone']       = '212-500-2489';
$params['card_hash']        = fraudlabspro_hash('5582657189029269');
$params['avs_result']               = 'Y';
$params['cvv_result']               = 'M';
$params['user_order_id']    = '7893';
$params['amount']           = '99.95';
$params['quantity']         = '1';
$params['department']       = 'Online Store';
$params['payment_mode']     = 'creditcard';
 
$query = '';
 
foreach($params as $key=>$value){
    $query .= '&' . $key . '=' . rawurlencode($value);
}
 
$try = 0;
do {
    $result = file_get_contents('https://api.fraudlabspro.com/v1/order/screen?key=' . $apiKey . $query);
} while(!$result && $rty++ < 3);
 
$data = json_decode($result);
 
echo '<pre>';
print_r($data);
echo '</pre>';
 
function fraudlabspro_hash($s){
    $hash = 'fraudlabspro_' . $s;
    for($i=0; $i<65536; $i++) $hash = sha1('fraudlabspro_' . $hash);
 
    return $hash;
}
?>

chrislim2888
New php-forum User
New php-forum User
 
Posts: 5
Joined: Fri Mar 09, 2012 1:06 am

Re: Script to screen online fraud

Postby seandisanti » Fri Mar 15, 2013 8:58 am

It seems a little silly to expect people to send absolutely all of the info necessary to commit fraud to an unknown 3rd party to find out if it's a fraudulent transaction. Technically they're should already have a clearing house or payment processor that should be checking responses from the card company anyway. I mean best case scenario, they've just given away all of their customer's transaction and billing information to an unauthorized 3rd party.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 773
Joined: Mon Oct 01, 2012 12:32 pm


Return to Your Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron