Return to Snippet

Revision: 70557
at April 13, 2016 05:18 by Hexahow


Initial Code
Imports IP2Location
Private Sub Query(ByVal strIPAddress As String, billingCountry As String)
    Dim oIPResult As New IP2Location.IPResult
    Try
       If strIPAddress <> "" Then
          IP2Location.Component.IPDatabasePath = "C:\\Program Files\\IP2Location\\Database\\IP-COUNTRY.SAMPLE.BIN"
          oIPResult = IP2Location.Component.IPQuery(strIPAddress)
          Select Case oIPResult.Status
          Case "OK"
             If oIPResult.CountryShort = billingCountry Then
               ' buyer is from the same country by IP address
             Else
               ' buyer is from the different country by IP address
             End If
          Case "EMPTY_IP_ADDRESS"
               Response.Write("IP Address cannot be blank.")
          Case "INVALID_IP_ADDRESS"
               Response.Write("Invalid IP Address.")
          Case "MISSING_FILE"
               Response.Write("Invalid Database Path.")
          End Select
       Else
          Response.Write("IP Address cannot be blank.")
       End If
    Catch ex As Exception
            Response.Write(ex.Message)
    Finally
            oIPResult = Nothing
    End Try
End Sub

Initial URL
http://www.ip2location.com/tutorials/credit-card-fraud-prevention-using-dot-net-framework-in-c-or-vb-net

Initial Description
Checking customer's IP address if is match with billing address is one of the simple steps in order to prevent fraud. If you are looking for sample codes to validate that the transaction is being requested by the real cardholder, see below.

Initial Title
Credit Card Fraud Prevention Using VB.NET

Initial Tags
ip

Initial Language
VB.NET