Jump to content
nrlatsha

[Contribution] MaxMind Fraud Detection Service v3.0

Recommended Posts

I assume it shows the same blank spot for BIN on the admin side too...

 

What processor/processor module are you using? You can PM me that information if you're not comfortable leaving it here.


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

I also assume the BIN shows up fine for you when you run maxtest.php?

 

But... It worked fine on MaxMind v2.1?


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

Started on an admin page to make testing easier.

 

Any requests?


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

New version up! v3.4!

 

Now with an Admin-side test page!

 

Change notes: 13 May 2013 21:05:01 V3.4

(1) Added test page for inputs and outputs

(2) Updated English.php

 

http://addons.oscommerce.com/info/8316

 

Let me know your ideas, thoughts, feelings, etc.

post-25810-0-42212100-1368498073_thumb.png

post-25810-0-70638300-1368498084_thumb.png


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

I forgot to mention, its a file replacement upgrade only! Just copy two new files, replace one english.php file and you're done!


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

 

Should be: $h['requested_type'] = $requested_type;

 

Hi I have installed this into my store (CRE Loaded store) and it all works fine now, just a few points:

 

1) The above code that you advised longhorn1999 has not been updated in the maxmind.php file

 

2) In Step7, waht is the purpose of this line?

 

If ((tep_not_null($sql_data_array['cc_number'])) || (tep_not_null($HTTP_POST_VARS['cc_number_nh-dns'])) || (tep_not_null($HTTP_POST_VARS['cc_number_nh-dns'])))

 

I had to remove it, it was the only way to get it working on my store

 

3) In Step 3, it should be: require(DIR_WS_MODULES . 'maxmind/OrderTableAddition.php');

 

4) If you are installing this into a CRE Loaded store, In order to get the admin test files to work, some additional work is required to make them compatible i.e. lines that reference template_top and template_bottom need to be removed. Session links also need to be added, I didn't bother as I just ran the tests within store orders.

 

I hope that this information helps someone else who might get stuck :)

 

Great job of the mod by the way!

Share this post


Link to post
Share on other sites

Excellent! Glad to hear it's working!

 

Hi I have installed this into my store (CRE Loaded store) and it all works fine now, just a few points:

 

1) The above code that you advised longhorn1999 has not been updated in the maxmind.php file

 

I'm not sure how I missed that, will add it to v3.5 base files.

 

2) In Step7, waht is the purpose of this line?

 

If ((tep_not_null($sql_data_array['cc_number'])) || (tep_not_null($HTTP_POST_VARS['cc_number_nh-dns'])) || (tep_not_null($HTTP_POST_VARS['cc_number_nh-dns'])))

 

I had to remove it, it was the only way to get it working on my store

 

I'm not sure why I have the double var in there, must have been a copy/paste error, but it was due to the storage of the CC number in multiple areas, It was an attempt to only query MaxMind if you had some data in one of those fields. I've only really dealt with Authorize.net and haven't had many other requests for other processors. I'm more than willing to code towards more, but I need some requests from the community because the amount of payment modules is staggering.

 

3) In Step 3, it should be: require(DIR_WS_MODULES . 'maxmind/OrderTableAddition.php');

 

I'm not sure I'm understanding this note. Was it a new install or an upgrade?

 

Good catch! I missed it three times while researching this note (backslash vs. forward slash)!

 

4) If you are installing this into a CRE Loaded store, In order to get the admin test files to work, some additional work is required to make them compatible i.e. lines that reference template_top and template_bottom need to be removed. Session links also need to be added, I didn't bother as I just ran the tests within store orders.

 

I hope that this information helps someone else who might get stuck :)

 

Great job of the mod by the way!

 

Wow, great info! I'll see if I can find a good place to throw that in with the instructions for 'specialty' osCommerce Builds.


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

from error_log:

[27-Feb-2014 02:02:25] PHP Warning:  fopen(/tmp/maxmind.ws.cache) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in /home/user2/public_html/includes/modules/maxmind/HTTPBase.php on line 136
[27-Feb-2014 02:02:25] PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /home/user2/public_html/includes/modules/maxmind/HTTPBase.php on line 137
[27-Feb-2014 02:02:25] PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /home/user2/public_html/includes/modules/maxmind/HTTPBase.php on line 138
[27-Feb-2014 02:02:25] PHP Warning:  fclose(): supplied argument is not a valid stream resource in /home/user2/public_html/includes/modules/maxmind/HTTPBase.php on line 139

 

Hi Noel,

 

I'm not sure if anyone else has noticed this, but this error has popped up lately in the error log for my site. MaxMind itself seems to still be working as all the same info shows up in my admin, but the error log grows every time a transaction goes through.

 

lines 136-139 of includes/modules/maxmind/HTTPBase.php:

   $fh = fopen($this->wsIpaddrCacheFile,'w');
   fwrite($fh,$ipstr . "\n");
   fwrite($fh,$datetime . "\n");
   fclose($fh);

 

I've been using v3.3 of Noel's MaxMind add-on, though 3.4 is available and it's a quick upgrade. As I don't think that I've changed any relevant code on my site, I'm thinking that there is something that's changed on MaxMind's end.

 

Any ideas on this?

 

Regardless or these error logs, this module still works and I recommend it for every e-commerce retailer. Thanks Noel for your add-on and for maintaining it!

 

Nick

Share this post


Link to post
Share on other sites

I don't see any difference in the files from 3.3 to 3.4 at all. 3.4 was an administrative test page update and a file drop. Maxmind's latest version of HTTPBase is changed, but I haven't had a chance to test it. I'm trying to get my development system back online.

 

Has anyone else seen this problem?

 

At first glance, it looks like a permissions issue on the temp file (/tmp/maxmind.ws.cache) as it tries to write it to the upload tmp dir. That might be the change if you've migrated anytime in recent history and that option is not set in your PHP.ini

 

Can you look for the following in your php.ini file?

 

upload_tmp_dir /tmp


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

I don't see any difference in the files from 3.3 to 3.4 at all. 3.4 was an administrative test page update and a file drop. Maxmind's latest version of HTTPBase is changed, but I haven't had a chance to test it. I'm trying to get my development system back online.

 

Has anyone else seen this problem?

 

At first glance, it looks like a permissions issue on the temp file (/tmp/maxmind.ws.cache) as it tries to write it to the upload tmp dir. That might be the change if you've migrated anytime in recent history and that option is not set in your PHP.ini

 

Can you look for the following in your php.ini file?

 

upload_tmp_dir /tmp

 

Hey Noel,

 

I just did a search of php.ini, and upload_tmp_dir/tmp is not there.

 

In lines 482-484, I do see the following:

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

 

But I'm not sure what the system default is.

Share this post


Link to post
Share on other sites

It's usually /tmp, and can look just like this in php.ini:

 

upload_tmp_dir /tmp

 

If you changed hosts, and that file is different, it might be your problem. That's what the error leads me to believe. If you can modify that line, restart apache and run an order through, I'm betting that error will go away.


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

It's usually /tmp, and can look just like this in php.ini:

 

upload_tmp_dir /tmp

 

If you changed hosts, and that file is different, it might be your problem. That's what the error leads me to believe. If you can modify that line, restart apache and run an order through, I'm betting that error will go away.

 

I'm not an expert on Apache by any means, but I'll ask my host's support to help me make this change in the next day or so, and then I'll run a test charge. I think intuitively what you said makes sense. It seems likely that this is one of the strange side effects I've been seeing after having moved my site.

 

I went from shared hosting to a dedicated server, and though things are much faster, there are a few other minor errors like this which were unexpected and I'm just now sorting out. Luckily this is just unique to my circumstance and not relevant for other MaxMind users.

 

Thanks again for the help!

Share this post


Link to post
Share on other sites

No problem, let us know if it works.

 

Even though it wasn't a problem in the module itself, it can certainly happen to anyone running this module as it appears to be a prerequisite for everything in the module to work smoothly.

 

Glad to help. :thumbsup:


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 Noel,

 

I haven't had the chance yet to make that change to php.ini, but I thought I'd finally upgrade to MaxMind 3.4 and try out the new admin test page.

 

Unfortunately I got this error:

Warning: require(includes/template_top.php) [function.require]: failed to open stream: No such file or directory in /home/user/public_html/admin/maxmind_test_inputs.php on line 18

 

Fatal error: require() [function.require]: Failed opening required 'includes/template_top.php' (include_path='.:/opt/php52/lib/php') in /home/user/public_html/admin/maxmind_test_inputs.php on line 18

 

It looks like this code was written for a v2.3 or higher osCommerce shop. I'm still running 2.2RC2a, though with all the security upgrades, this is good enough for me.

 

Would you be able to slightly edit these files for older shops?

Share this post


Link to post
Share on other sites

Hi I have installed this into my store (CRE Loaded store) and it all works fine now, just a few points:

 

1) The above code that you advised longhorn1999 has not been updated in the maxmind.php file

 

2) In Step7, waht is the purpose of this line?

 

If ((tep_not_null($sql_data_array['cc_number'])) || (tep_not_null($HTTP_POST_VARS['cc_number_nh-dns'])) || (tep_not_null($HTTP_POST_VARS['cc_number_nh-dns'])))

 

I had to remove it, it was the only way to get it working on my store

 

3) In Step 3, it should be: require(DIR_WS_MODULES . 'maxmind/OrderTableAddition.php');

 

4) If you are installing this into a CRE Loaded store, In order to get the admin test files to work, some additional work is required to make them compatible i.e. lines that reference template_top and template_bottom need to be removed. Session links also need to be added, I didn't bother as I just ran the tests within store orders.

 

I hope that this information helps someone else who might get stuck :)

 

Great job of the mod by the way!

Hi Noel,

 

I haven't had the chance yet to make that change to php.ini, but I thought I'd finally upgrade to MaxMind 3.4 and try out the new admin test page.

 

Unfortunately I got this error:

 

 

It looks like this code was written for a v2.3 or higher osCommerce shop. I'm still running 2.2RC2a, though with all the security upgrades, this is good enough for me.

 

Would you be able to slightly edit these files for older shops?

 

I don't see why not.

 

Give me some time to get my development environment up and running, it was destroyed during the rebuild wars in the summer of '13.

 

I need to incorporate what Vsonline suggested into a released v3.5 as well.


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

I don't see why not.

 

Give me some time to get my development environment up and running, it was destroyed during the rebuild wars in the summer of '13.

 

I need to incorporate what Vsonline suggested into a released v3.5 as well.

 

I didn't forget about you guys, I had a server crash and I lost 6tb of data. I've spent the last few weeks just trying to get the network back up and running. This is still very much on my list, it just took second place to my internal network capabilities.


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

I didn't forget about you guys, I had a server crash and I lost 6tb of data. I've spent the last few weeks just trying to get the network back up and running. This is still very much on my list, it just took second place to my internal network capabilities.

 

No worries Noel.

 

Wow, that's a terrible mess you're having to deal with! I was out for 23 hours this past week thanks to the EIG/Hostgator/Bluehost/etc outage on Wednesday/Thursday, but this is orders of magnitude worse. Good luck!

Share this post


Link to post
Share on other sites

Any update on the missing Bank Info and Bin information. I am also running into this. 

 

My gateway is First Data Global Gateway

 

It does appear fine in the test page. Any idea where I may start looking?

Share this post


Link to post
Share on other sites

Any update on the missing Bank Info and Bin information. I am also running into this. 

 

My gateway is First Data Global Gateway

 

It does appear fine in the test page. Any idea where I may start looking?

 

Ok I ended up figuring it out. It was actually the fact that we had recently switched payment processors. The new Payment addin was not setting the first 6 digits of the credit card on the order.

 

Since maxmind.php actually uses the first 6 of the credit card for the bin query you can see that in maxmind.php at the line

 

$h["bin"] = $cc;

 

Unfortunately  I think this varies from payment system to payment system.

Share this post


Link to post
Share on other sites

I have been getting emails from maxmind that say 


Dear MaxMind Customer,

 

You are receiving this email because you use our deprecated /app/ws_ipaddr web service endpoint. This endpoint returns a list of IP addresses for use when making minFraud or GeoIP web service requests to MaxMind servers.

 

The endpoint /app/ws_ipaddr will be deactivated on April 28th, 2015. As a result, you need to take action in order to continue accessing MaxMind services. Please switch and make requests using theminfraud.maxmind.com hostname for minFraud web service requests and geoip.maxmind.com for GeoIP web
service requests.
 

If you use a minFraud client API provided by MaxMind, please update to the latest API, available on http://dev.maxmind.com/minfraud/. Our newest API versions use hostnames instead of /app/ws_ipaddr.

 

If you use a third-party plugin that makes requests to MaxMind web services, you may need to update it.

 

I have upgraded to the latest version of Maxmind and it appears the function  function readIpAddressFromWeb() in HTTPBase is still using http://www.maxmind.com/app/ws_ipaddrany plan to update this?

Share this post


Link to post
Share on other sites

I have been getting emails from maxmind that say 

 

 

Dear MaxMind Customer,

 

 

 

You are receiving this email because you use our deprecated /app/ws_ipaddr web service endpoint. This endpoint returns a list of IP addresses for use when making minFraud or GeoIP web service requests to MaxMind servers.

 

 

 

The endpoint /app/ws_ipaddr will be deactivated on April 28th, 2015. As a result, you need to take action in order to continue accessing MaxMind services. Please switch and make requests using theminfraud.maxmind.com hostname for minFraud web service requests and geoip.maxmind.com for GeoIP web

service requests.

 

 

If you use a minFraud client API provided by MaxMind, please update to the latest API, available on http://dev.maxmind.com/minfraud/. Our newest API versions use hostnames instead of /app/ws_ipaddr.

 

 

 

If you use a third-party plugin that makes requests to MaxMind web services, you may need to update it.

 

I have upgraded to the latest version of Maxmind and it appears the function  function readIpAddressFromWeb() in HTTPBase is still using http://www.maxmind.com/app/ws_ipaddrany plan to update this?

 

So I realize I am chatting with myself, but it may be of some help to others. It looks like there is all the logic there to use the DNS and the new minfraud servers. 

 

If you look at   HTTPBASE everything switches on   var $useDNS; however that is does not appear to be set anywhere. Setting it appears to resolve the issue. Atleast with the maxtest page. @@nrlatsha can you shed any light on this?

Share this post


Link to post
Share on other sites

Hi OSSamm, and thanks for the other notes too.  

 

I'm going to set everything back up and hopefully have an update out this weekend.  There are some other updates I haven't been too quick on and I'd like to address as much as I can this weekend.

 

Look for an update soon!


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

The update was just uploaded!

 

(1) Fixed Security Issue (Thanks OSSamm!)
(2) Updated API files


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

Longhorn1999,

 

I'm having a hard time getting a 2.2 store running.  It just seems to be one error after another.  Do you happen to have an extract of a working store I could use for development/testing?  

 

No worries Noel.

Wow, that's a terrible mess you're having to deal with! I was out for 23 hours this past week thanks to the EIG/Hostgator/Bluehost/etc outage on Wednesday/Thursday, but this is orders of magnitude worse. Good luck!


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

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

×