Total members 11621 |It is currently Wed Mar 29, 2017 8:00 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka

All times are UTC [ DST ]



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




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     -  
 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     -  
 Fast Loan Offers Online At Sky Credit Loan     -  

All times are UTC [ DST ]









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team