Switch to full style
C# examples
Post a reply

Credit Card Fraud Prevention Using .NET Framework in C#

Tue Apr 12, 2016 7:22 pm

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;
     }
}




Post a reply
  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?     -  
 Which is the best PHP framework On CodeIgniter Sharing?     -  
 java(collection framework)     -  
 Writing a Windows Form Application For .NET Framework Using     -