Posted By

Hexahow on 04/13/16


ip prevention tracking geolocation fraud

Versions (?)

Credit Card Fraud Prevention Using VB.NET

 / Published in: VB.NET


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.

  1. Imports IP2Location
  2. Private Sub Query(ByVal strIPAddress As String, billingCountry As String)
  3. Dim oIPResult As New IP2Location.IPResult
  4. Try
  5. If strIPAddress <> "" Then
  6. IP2Location.Component.IPDatabasePath = "C:\\Program Files\\IP2Location\\Database\\IP-COUNTRY.SAMPLE.BIN"
  7. oIPResult = IP2Location.Component.IPQuery(strIPAddress)
  8. Select Case oIPResult.Status
  9. Case "OK"
  10. If oIPResult.CountryShort = billingCountry Then
  11. ' buyer is from the same country by IP address
  12. Else
  13. ' buyer is from the different country by IP address
  14. End If
  16. Response.Write("IP Address cannot be blank.")
  18. Response.Write("Invalid IP Address.")
  19. Case "MISSING_FILE"
  20. Response.Write("Invalid Database Path.")
  21. End Select
  22. Else
  23. Response.Write("IP Address cannot be blank.")
  24. End If
  25. Catch ex As Exception
  26. Response.Write(ex.Message)
  27. Finally
  28. oIPResult = Nothing
  29. End Try
  30. End Sub

Report this snippet  

You need to login to post a comment.