Total members 11890 |It is currently Tue Apr 23, 2024 5:50 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





One of the steps for merchant in order to prevent fraud is to check if the customer's IP address is same as what his or her billing address. In short, to check if the transaction is being requested by the real cardholder.

If you are looking for the C# sample code for IP address - billing country checking, see below.

Code:
Using IP2Location;
private void Query(string strIPAddress, string billingCountry)
{
  IPResult oIPResult = new IP2Location.IPResult();
  try
  {
    if (strIPAddress != "")
     {
      IP2Location.Component.IPDatabasePath = "C:\\Program Files\\IP2Location\\Database\\IP-COUNTRY.SAMPLE.BIN";
      oIPResult = IP2Location.Component.IPQuery(strIPAddress);
       switch(oIPResult.Status.ToString())
        {
          case "OK":
            if (oIPResult.CountryShort == billingCountry) {
              // buyer is from the same country by IP address
              } else {
              // buyer is from the different country by IP address
              }
          break;
           case "EMPTY_IP_ADDRESS":
                Response.Write("IP Address cannot be blank.");
                break;
           case "INVALID_IP_ADDRESS":
                Response.Write("Invalid IP Address.");
                break;
           case "MISSING_FILE":
                Response.Write("Invalid Database Path.");
                break;
           }
       }
       else
       {
        Response.Write("IP Address cannot be blank.");
       }
   }
    catch(Exception ex)
     {
      Response.Write(ex.Message);
     }
    finally
     {
      oIPResult = null;
     }
}





Author:
Newbie
User avatar Posts: 4
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Credit Card Fraud Prevention Using .NET Framework in C#
 php online fraud's security steps     -  
 Access mobile sim card from PC connected in cable     -  
 Do you have bad credit     -  
 Do you have bad credit     -  
 Do you have bad credit     -  
 Which framework is best for beginners in PHP and Why?     -  
 java(collection framework)     -  
 Which is the best PHP framework On CodeIgniter Sharing?     -  
 Writing a Windows Form Application For .NET Framework Using     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com