osCommerce Fraud Prevention Module

Overview

This module helps you to screen the order transaction for online fraud in osCommerce. It screens every order transaction and provides you the fraud validation result on the order details page.

This module requires a valid FraudLabs Pro license key to function. Please sign up for a free Micro Plan if you do not have one.
Download
For osCommerce version 2.3.x or later Download
Installation
  1. Download the package.
  2. Unzip the package.
  3. Upload catalog/includes/modules/fraudlabs_pro/process_order.php into server.
  4. Upload catalog/admin/includes/modules/fraudlabs_pro/summary.php into server.
  5. Upload catalog/admin/includes/modules/fraudlabs_pro/feedback.php into server.
  6. Open catalog/includes/modules/fraudlabs_pro/process_order.php (the server copy) with text editor, search for the below code and replace YOUR_LICENSE_KEY_HERE with your license key.
    $flpData['key'] = 'YOUR_LICENSE_KEY_HERE';
    Note: we assume the default osCommerce is used during the installation. Shall the custom path being used, please upload the files to the correct folders.
  7. Open catalog/checkout_process.php with a text editor.
  8. Search for:
    $insert_id = tep_db_insert_id();
    And replace with:
    $insert_id = tep_db_insert_id();
    
    include(DIR_WS_MODULES . '/fraudlabs_pro/process_order.php');
  9. Open catalog/admin/orders.php with a text editor.
  10. Search for:
    $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
    And replace with:
    $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
    
    include(DIR_WS_MODULES . 'fraudlabs_pro/feedback.php');
  11. Search for:
    tep_remove_order($oID, $HTTP_POST_VARS['restock']);
    And replace with:
    tep_remove_order($oID, $HTTP_POST_VARS['restock']);
    tep_db_query("delete from fraudlabs_pro where order_id='". $oID ."'");
  12. Search for:
    <tr>
    	<td class="main"><br /><strong><?php echo TABLE_HEADING_COMMENTS; ?></strong></td>
    </tr>
    And replace with:
    <tr>
    	<td><?php include(DIR_WS_MODULES . 'fraudlabs_pro/summary.php'); ?><td>
    </tr>
    <tr>
    	<td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
    </tr>
  13. Create a fraudlabs table in osCommerce database using the below SQL query.
    CREATE TABLE `fraudlabs_pro` (
    	`flp_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    	`api_key` CHAR(32) NULL DEFAULT NULL,
    	`is_country_match` CHAR(2) NULL DEFAULT NULL,
    	`is_high_risk_country` CHAR(2) NULL DEFAULT NULL,
    	`distance_in_km` INT(10) NULL DEFAULT NULL,
    	`distance_in_mile` INT(10) NULL DEFAULT NULL,
    	`ip_address` VARCHAR(15) NULL DEFAULT NULL,
    	`ip_country` CHAR(2) NULL DEFAULT NULL,
    	`ip_continent` VARCHAR(10) NULL DEFAULT NULL,
    	`ip_region` VARCHAR(50) NULL DEFAULT NULL,
    	`ip_city` VARCHAR(50) NULL DEFAULT NULL,
    	`ip_latitude` DECIMAL(14,6) NULL DEFAULT '0.000000',
    	`ip_longitude` DECIMAL(14,6) NULL DEFAULT '0.000000',
    	`ip_timezone` VARCHAR(6) NULL DEFAULT NULL,
    	`ip_elevation` INT(10) NULL DEFAULT NULL,
    	`ip_domain` VARCHAR(100) NULL DEFAULT NULL,
    	`ip_mobile_mnc` VARCHAR(50) NULL DEFAULT NULL,
    	`ip_mobile_mcc` CHAR(2) NULL DEFAULT NULL,
    	`ip_mobile_brand` VARCHAR(50) NULL DEFAULT NULL,
    	`ip_netspeed` VARCHAR(10) NULL DEFAULT NULL,
    	`ip_isp_name` VARCHAR(50) NULL DEFAULT NULL,
    	`ip_usage_type` VARCHAR(50) NULL DEFAULT NULL,
    	`is_free_email` VARCHAR(2) NULL DEFAULT NULL,
    	`is_new_domain_name` VARCHAR(2) NULL DEFAULT NULL,
    	`is_proxy_ip_address` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bin_found` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bin_country_match` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bin_name_match` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bin_phone_match` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bin_prepaid` VARCHAR(2) NULL DEFAULT NULL,
    	`is_address_ship_forward` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bill_ship_city_match` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bill_ship_state_match` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bill_ship_country_match` VARCHAR(2) NULL DEFAULT NULL,
    	`is_bill_ship_postal_match` VARCHAR(2) NULL DEFAULT NULL,
    	`is_ip_blacklist` VARCHAR(2) NULL DEFAULT NULL,
    	`is_email_blacklist` VARCHAR(2) NULL DEFAULT NULL,
    	`is_credit_card_blacklist` VARCHAR(2) NULL DEFAULT NULL,
    	`is_device_blacklist` VARCHAR(2) NULL DEFAULT NULL,
    	`is_user_blacklist` VARCHAR(2) NULL DEFAULT NULL,
    	`user_order_id` INT(10) NULL DEFAULT NULL,
    	`user_order_memo` VARCHAR(100) NULL DEFAULT NULL,
    	`fraudlabspro_score` INT(10) NULL DEFAULT '0',
    	`fraudlabspro_distribution` INT(10) NULL DEFAULT '0',
    	`fraudlabspro_status` VARCHAR(10) NULL DEFAULT NULL,
    	`fraudlabspro_id` VARCHAR(15) NULL DEFAULT NULL,
    	`fraudlabspro_version` VARCHAR(5) NULL DEFAULT NULL,
    	`fraudlabspro_error_code` VARCHAR(3) NULL DEFAULT NULL,
    	`fraudlabspro_message` VARCHAR(50) NULL DEFAULT NULL,
    	`fraudlabspro_credits` VARCHAR(10) NULL DEFAULT NULL,
    	`order_id` INT(11) NOT NULL,
    	PRIMARY KEY (`flp_id`),
    	INDEX `idx_order_id` (`order_id`)
    )
    COLLATE='utf8_general_ci'
    ENGINE=MyISAM;
  14. Done.
Articles & Tutorials