Jump to content
nrlatsha

[Contribution] Credit Card Fraud Detection Service

Recommended Posts

Calvn - I thinkI may have overlooked something that I should have caught, maybe, try this:

 

Remove the code you added to admin/orders.php

 

Look for this:

  <td><table border="0" cellspacing="0" cellpadding="2">
   <tr>
   <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
   <td class="main"><?php echo $order->info['payment_method']; ?></td>
 </tr>

 

And add the code again after it:

// Addition for MaxMind CC check Noel Latsha

$check_maxmind_query = tep_db_query("select distance, country_match, country_code, free_mail, anonymous_proxy, score, bin_match, bin_country, err, proxy_score, spam_score, bin_name, cust_phone, ip_city, ip_latitude, ip_longitude, ip_region, ip_isp, ip_org, hi_risk from " . TABLE_ORDERS_MAXMIND . " where order_id = '" . (int)$oID . "'");
$maxmind_query = tep_db_fetch_array($check_maxmind_query);
$max_score = round($maxmind_query['score']);
switch ($max_score) {
 case 0:
	 $max_comment = '(Extremely Low risk)';
	 break;
 case 1:
	 $max_comment = '(Very Low risk)';
	 break;
 case 2:
	 $max_comment = '(Low risk)';
	 break;
 case 3:
	 $max_comment = '(Low risk)';
	 break;
 case 4:
	 $max_comment = '(Low-Medium risk)';
	 break;
 case 5:
	 $max_comment = '(Medium risk)';
	 break;
 case 6:
	 $max_comment = '(Medium-high risk)';
	 break;
 case 7:
	 $max_comment = '(High risk)';
	 break;
 case 8:
	 $max_comment = '(Very High risk)';
	 break;
 case 9:
	 $max_comment = '(Extremely High risk)';
	 break;
 case 10:
	 $max_comment = '(I can smell the fraud from here)';
	 break;
 }

?>
       </table>    
   <table width="100%" cellpadding="2" cellspacing="0" border="0">
         <tr>
           <td colspan="7" class="main"><?php echo '<br><b>' . MAXMIND_SCORE . '   <font color="red">' . $maxmind_query['score'] . '</font> ' . $max_comment . '</b>'; ?></td>
         </tr>
         <tr class="dataTableRow">
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_COUNTRY; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['country_match'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_CODE; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['country_code'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_HI_RISK; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['hi_risk'] . '</b>'; ?></td>
         </tr>
         <tr>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_BIN_MATCH; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['bin_match'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_BIN_COUNTRY; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['bin_country'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_BIN_NAME; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['bin_name'] . '</b>'; ?></td>
         </tr>
         <tr class="dataTableRow">
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_IP_ISP; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['ip_isp'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_IP_ISP_ORG; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['ip_org'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_DISTANCE; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['distance'] . '</b>'; ?></td>
         </tr>
         <tr>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_ANONYMOUS; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['anonymous_proxy'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_PROXY_SCORE; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['proxy_score'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_SPAM; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['spam_score'] . '</b>'; ?></td>
         </tr>
         <tr class="dataTableRow">
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_FREE_EMAIL; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['free_mail'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_CUST_PHONE; ?></td>
           <td width="18%" class="dataTableContent"><a href="http://www.whitepages.com/search/Reverse_Phone?phone=<?php echo $order->customer['telephone']; ?>" target="_blank"><?php echo '<b>' . $maxmind_query['cust_phone'] . '</b>'; ?></td>
           <td width="14%" class="dataTableContent"><?php echo MAXMIND_ERR; ?></td>
           <td width="18%" class="dataTableContent"><?php echo '<b>' . $maxmind_query['err'] . '</b>'; ?></td>
         </tr>
       </table>
       <table width="100%" cellpadding="2" cellspacing="0" border="0">
         <tr> </tr>
   <tr>
           <td colspan="4" class="dataTableContent" width="75%" align="center"><?php echo MAXMIND_DETAILS . '   ' . MAXMIND_MAXMIND; ?></td>
         </tr>
         <tr class="dataTableRow">
           <td width="25%" class="dataTableContent"><?php echo MAXMIND_IP_CITY . '<b>' . $maxmind_query['ip_city'] . '</b>'; ?></td>
           <td width="25%" class="dataTableContent"><?php echo MAXMIND_IP_REGION . '<b>' . $maxmind_query['ip_region'] . '</b>'; ?></td>
           <td width="25%" class="dataTableContent"><?php echo MAXMIND_IP_LATITUDE . '<b>' . $maxmind_query['ip_latitude'] . '</b>'; ?></td>
           <td width="25%" class="dataTableContent"><?php echo MAXMIND_IP_LONGITUDE . '<b>' . $maxmind_query['ip_longitude'] . '</b>'; ?></td>
         </tr>
         <tr>
           <td colspan="4"><?php echo tep_draw_separator(); ?></td>
         </tr>

<?php // End addition for MaxMind Noel Latsha

 

Let me know if that does it... Its not a true fix, but it should get you runnin. for now.


9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Share this post


Link to post
Share on other sites

Warning: First argument to array_keys() should be an array in /home/hobby/public_html/catalog/includes/modules/maxmind/maxmind.php on line 57

 

Warning: Cannot add header information - headers already sent by (output started at /home/hobby/public_html/catalog/includes/modules/maxmind/maxmind.php:57) in /home/hobby/public_html/catalog/includes/functions/general.php on line 29

 

 

This is what i get...

and if i del line 57 it works but i don?t get any maxmind result in admin area..

please help

 

Jake

Share this post


Link to post
Share on other sites
please anyone??? i can?t get it to work...

HangerS - Sorry for the delay, work keeps me busy. Download v1.4 and see if that one works and let me know.


9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Share this post


Link to post
Share on other sites

Hi.. tried that today.. same error.. im using it with cc.php and i have used the maxmind files in default cc user map..

Share this post


Link to post
Share on other sites

not sure, but it seems like a function may be defined twice. what's on line 29 and 57?

 

Noel: i just finished a lot of school work, so i'll try and test that code soon. thanks for ur help.


Most likely your question has been answered, please do a search first.

Share this post


Link to post
Share on other sites

hello to everybody,

 

first i have to excuse my english.

 

i installed today the lastest upload.

 

everything ok.

perfect install-instructions.

on step 5 there is a little mistake - catalog/admin/includes/languages/english.php is the right

 

i have the problem, that i receive in the orders.php in the admin only emty outputs.

 

when i make a test with the maxtest.php than i receive following errors:

 

error: you need to install curl if you want secure HTTPS or specify the variable to be = 0server: www2.maxmind.com result: 0

Warning: array_keys(): The first argument should be an array in /www/webs/shopaqua/docs/admin/maxtest.php on line 79

 

maybe someone knows, what i have done wrong.

 

many thanks for your help

tom

Share this post


Link to post
Share on other sites

I have also installed the contribution

 

I am NOT getting any errors at least so the mod is fine.

 

But since i am using 2Checkout, this mod does not display anything .

 

it just like not having it installed in the first place.

 

So this mod is NOT compatible with 2Checkout Payment Method

Share this post


Link to post
Share on other sites
please anyone??? i can?t get it to work...

HangerS - Sorry for the delay, work keeps me busy. Download v1.4 and see if that one works and let me know.

Tried that today.. same errors.. the line that?s seems to be the problem is..

 

$outputkeys = array_keys($h);

 

in maxmind.php same in maxtest.php...

 

Im not using secure ssl and have changed the value to 0.

Can?t figure it out.. please help..

Share this post


Link to post
Share on other sites

Warning: First argument to array_keys() should be an array in /home/hobby/public_html/catalog/includes/modules/maxmind/maxmind.php on line 53

 

Warning: Cannot add header information - headers already sent by (output started at /home/hobby/public_html/catalog/includes/modules/maxmind/maxmind.php:53) in /home/hobby/public_html/catalog/includes/functions/general.php on line 29

 

 

******************************************************************

maxmind.php

// If you have cURL and an SSL connection available, leave the next line uncommented

// Otherwise comment it our by adding "//" in front of it.

$ccfs->isSecure = 0;

 

$ccfs->input($h);

$ccfs->query();

$h = $ccfs->output();

***LINE 53!***------>$outputkeys = array_keys($h);

$sql_data_array = array(

 

 

*******************************************************************

general.php

////

// Redirect to another page or site

function tep_redirect($url) {

if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url

$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL

}

}

 

****LINE 29!****----->header('Location: ' . $url);

 

tep_exit();

}

 

////

 

********************************************************************

 

Someone please help....

Share this post


Link to post
Share on other sites

I am trying to use the script but when I placed my test order it came up like

 

MAXMIND_SCORE 0.00

MAXMIND_COUNTRY Yes MAXMIND_CODE US MAXMIND_HI_RISK No

MAXMIND_BIN_MATCH Yes MAXMIND_BIN_COUNTRY US MAXMIND_BIN_NAME

MAXMIND_IP_ISP Comcast Cable MAXMIND_IP_ISP_ORG Comcast Cable MAXMIND_DISTANCE 8

MAXMIND_ANONYMOUS No MAXMIND_PROXY_SCORE 0.00 MAXMIND_SPAM 0.00

MAXMIND_FREE_EMAIL No MAXMIND_CUST_PHONE Yes MAXMIND_ERR

 

MAXMIND_DETAILS MAXMIND_MAXMIND

MAXMIND_IP_CITY MAXMIND_IP_REGION MAXMIND_IP_LATITUDE MAXMIND_IP_LONGITUDE

 

Any one have any suggestions on what I can try.

Share this post


Link to post
Share on other sites

You're missing the language defines from step 5 of the installation instructions which need to be added to your catalog/includes/languages/english.php file

 

The good news is that you're actually getting a good response from MaxMind, so your setup is correct.


... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Share this post


Link to post
Share on other sites

HangerS ? Did you upload the new versions of creditcardfrauddetection and httpbase as well? I don't see anything wrong with either file, and made some changes, but not many, mostly moving some code here and there for V5.12

 

Is the database getting populated with the results?

 

FlyingMonkey - Sorry it took so long to get back to you. When they use auth.net for cc, what shows in admin for you? I mean, does it give any more info as far as cc number, exp, so on and so forth. I may have asked this before, but I'm just looking for somewhere to put the extra info to be sure it gets there for all CC's, not just auth.net and what not. May turn it into an include here soon, or rewrite the entire thing soon...time permitting...

 

TomTomTom - You need to open maxmind.php and look for the part that talks about cURL, you'll need to uncomment the line like this:

$ccfs->isSecure = 0;

 

Farrukh - Does 2ckeckout send you a copy of the cc number and exp, stuff like that? You have the other info, I wonder if there can be a manual process for this. That would be the next major release though.

 

 

I think I got everyone there, didn't I.


9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Share this post


Link to post
Share on other sites
HangerS ? Did you upload the new versions of creditcardfrauddetection and httpbase as well? I don't see anything wrong with either file, and made some changes, but not many, mostly moving some code here and there for V5.12

Have tried all versions.. same error.. seems that i have runned in to a wall.. my host provider have promesed me to install ssl and curl next week.. i?l wait and see if that helps..

Share this post


Link to post
Share on other sites

Noel: No it doesn't, this is the information it provides. It's with the default Authorize.net

 

Order # 19

Order Date & Time 09/07/2004 16:36:50

Payment Method: Authorize.net

 

* Loaded versions are not supported in the forums

Edited by 241

Most likely your question has been answered, please do a search first.

Share this post


Link to post
Share on other sites

2Checkout does not provide any information on Credit Card details

 

the details customer enters is transfered to 2CO.

 

We do not collect any infromation and 2CO's terms also states that the Merchant should not collect Customer's credit card details.

Share this post


Link to post
Share on other sites

FlyingMonkey - I'll have to take a look at a way for this to work with yours. The problem lies with so many different credit cards and contribs, finding the correct place with yours.

 

Farrukh - And I'm sure they are doing their own fraud screening there... :rolleyes:

 

HangerS - I'll upload 5.12 tonight and see if that helps, this should work without cURL or anything.


9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Share this post


Link to post
Share on other sites

Noel: don't stress about it, if you don't have the time. i understand, how difficult it is to support all of the different variations/contributions of osC. It'd just be a nice additional feature.


Most likely your question has been answered, please do a search first.

Share this post


Link to post
Share on other sites

Has anyone tried using this service in the UK? I was just wondering how useful it is to a UK based business, I see they only do the state service in the US and Canada.


/* Intellectual property: are you for or against the human race? */

if ( you want exclusive ownership of an idea ) {

keep your idea to yourself;

// you greedy bastard

}

Share this post


Link to post
Share on other sites
HangerS - I'll upload 5.12 tonight and see if that helps, this should work without cURL or anything.

 

 

Sweet I?l try that one..

 

 

//Jake

Edited by HangerS

Share this post


Link to post
Share on other sites
Sweet I?l try that one..

//Jake

 

:blush: Guess I have to upload it in order to download it....

 

V1.53 - Released. Added:

Change notes: 09 Sept 2004 08:20:59 V1.52

(1) Added comment to relate scores

(2) Updated english.php link.

(3) Moved code around

(4) Added more info to debug code

 

Basically for maxtest.php, it shows you everything inside the array that posts to the database. Hopefully this will offer more info on where things go wrong, not that things are meant to go wrong.

 

FlyingMonkey - Didn't forget about you. I'm still working it for your side. Also thinking about making it a straight function. But only time will tell....

 

Oh yeah, youmay ask why the jump from 1.51 to 1.53. Just read my signature... Thats why its 1.53, my bad... :D


9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Share this post


Link to post
Share on other sites

Hi guys...

 

I?m sad to say that i get the same error with the new 1.52release...

in maxtest it works perfekt... but in live situation i get the same error when it

comes to checkout_process.php..

 

Warning: First argument to array_keys() should be an array in /home/hobby/public_html/catalog/includes/modules/maxmind/maxmind.php on line 56

 

Warning: Cannot add header information - headers already sent by (output started at /home/hobby/public_html/catalog/includes/modules/maxmind/maxmind.php:56) in /home/hobby/public_html/catalog/includes/functions/general.php on line 29

 

 

I realy want this sweet cont to work.. :'( :'(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×