#bin number lookup in c#
The first six digits of a credit card (BIN) indicate the issuing bank and country. You can use
this to assist in fraud detection, or determine what country a customer is from – although
people do sometimes carry foreign cards.
Here is an example from NeutrinoAPI that allows you look up a card BIN number in c# – you’ll need your own username and key
[HttpGet]
public ActionResult CheckBinNumber(string binNumber)
{
var strUrl = “https://neutrinoapi.com/bin-lookup?”;
strUrl += “bin-number={0}”;
strUrl += “&customer-ip=8.8.8.8”; // Google’s IP address.
strUrl += “&user-id={{your username}}”;
strUrl += “&api-key={{your key}}”;
strUrl = string.Format(strUrl, binNumber);
var wc = new WebClient();
var strRaw = wc.DownloadString(strUrl);
return Content(strRaw, “application/json”);
}
…. and you get the following json
{
“country”:“IRELAND”,
“country-code”:“IE”,
“card-brand”:“MASTERCARD”,
“ip-city”:“Mountain View”,
“ip-blocklists”:[
“dshield”
],
“ip-country”:“United States”,
“issuer”:“BANK OF IRELAND”,
“issuer-website”:“http://www.bankofireland.com/contact-us/”,
“ip-region”:“California”,
“valid”:true,
“card-type”:“CREDIT”,
“ip-blocklisted”:true,
“card-category”:“”,
“issuer-phone”:“1890 365 100 OR 353 1 404 4001”,
“ip-matches-bin”:false,
“ip-country-code”:“US”
}
Thank you very much! It save my life.
LikeLike