Jump to content

Customer IP?


Recommended Posts

Hi guys,
Due to selling virtual goods.
There is some risk of fraudlent payments (already experienced one).
Is there any module or tool I can use to detect customer's IP when the purchase made?
Appreciate your time and help.
Thanks.

Link to comment
Share on other sites

The user's IP address is available everywhere, you don't need a module or to pay anyone to develop it for you.

   function getVisitorIP(){
       $ip = $_SERVER["REMOTE_ADDR"];
       $proxy = $_SERVER["HTTP_X_FORWARDED_FOR"];
       if(ereg("^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$",$proxy))
               $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
       return $ip;
   }



Or the simpler way

$ip = $_SERVER["REMOTE_ADDR"];

Link to comment
Share on other sites

Thanks,
They are probably nice tips. However I am not sure how I can implment them in order to detect IPs for made purchases.
I have noticed some free module on PresoChange with geotool. Can it be useful for this occasion?

Link to comment
Share on other sites

  • 1 month later...

You can't detect the IP for made purchases unless you save them somewhere when the order is made, you can add the code above in the mail alert module so you will get the IP with every new order notification.

You could also save it in the database, but it will require more work.

Link to comment
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
×
×
  • Create New...