Sample C# code for calling FraudSmack
This sample only shows how to access the values returned by a call to the FraudSmack
service. Members can download a small sample application that shows example logic
for how to process your sale with FraudSmack.
protected void cmdSubmit_Click(object sender, EventArgs e)
{ //Declare FraudSmack objects
com.fraudsmack.service.FraudSmackService fs = new com.fraudsmack.service.FraudSmackService();
com.fraudsmack.service.DetailedRiskScore drs; //Call FraudSmack service
drs = fs.GetDetailedRiskScore("myUserName",
"myPassword", "24.24.24.255", "123 Main St, Greensboro, NC, 27401, US", "sample@sample.com",
"3232", "189", "2", "10", "myTransID");
//look at the values returned by FraudSmack
bool IsAnonProxy = drs.o_AnonProxy; //user hiding behind proxy
bool IsCentralISP = drs.o_CentralISP; //user is from AOL or other large ISP
bool CountriesNotMatch = drs.o_CountryNoMatch; //ie: US card used by someone in VN
bool CountryOnlyMatch = drs.o_CountryOnlyMatch; //not that big a deal, but better if states match
bool CountryAndRegionMatch = drs.o_CountryRegionMatch; //very good
decimal DistKm = drs.o_Distance_Km; //distance from CC address to IP address location
decimal DistMi = drs.o_Distance_Miles; //for those of us more familiar with Miles
string IPCountry = drs.o_Point1_CountryCode; //Country of the IP address
decimal IPLatitude = drs.o_Point1_Lat; //latitude of IP address
decimal IPLongitude = drs.o_Point1_Long; //longitude of IP address
string IPRegion = drs.o_Point1_Region; //region/state of IP address
string CCCountry = drs.o_Point2_CountryCode; //Country of credit card
decimal CCLatitude = drs.o_Point2_Lat; //latitude of credit card
decimal CCLongitude = drs.o_Point2_Long; //longitude of credit card
string CCRegion = drs.o_Point2_Region; //region/state of credit card
//***** The main results *****//
string OResult = drs.o_Result; //"ACCEPT", "WARN", "DENY", "ERROR"
decimal Points = drs.o_TotalPoints; //sum of points from all RiskFactors
bool IsBlacklisted = drs.o_BlackListed; //at least one of the parameters flagged as blacklisted
bool IsWhitelisted = drs.o_Whitelisted; //at least one of the parameters flagged as whitelisted
//You can also get the details about the individual RiskFactors that go into determinining
// the overall score and the final result, and you can see which items were blacklisted or
// whitelisted, by looping through the RiskFactors as follows.
for (int i = 0; i < drs.RiskFactors.Length; i++) //looking at each RiskFactor
{
com.fraudsmack.service.RiskFactor rf = (com.fraudsmack.service.RiskFactor)drs.RiskFactors[i];
string Name = rf.Name.ToString();
decimal PointVal = rf.Points;
bool InUse = rf.InUse;
bool IsBlkLst = rf.BlackListed;
bool Is WhtLst = rf.WhiteListed;
}
}