private static NameValueCollection GetFormattedDomesticVerifyRequeset(BlockScoreVerifyDomesticRequest request) { var formData = new NameValueCollection(); formData["name[first]"] = request.FirstName; formData["name[middle]"] = request.MiddleName; formData["name[last]"] = request.LastName; formData["date_of_birth"] = request.DateOfBirth; formData["type"] = request.CitizenshipType; formData["identification[ssn]"] = request.LastFourDigitsOfSSN; formData["address[street1]"] = request.Street1; formData["address[street2]"] = request.Street2; formData["address[city]"] = request.City; formData["address[state]"] = request.State; formData["address[postal_code]"] = request.PostalCode; formData["address[country_code]"] = BlockScoreVerifyDomesticRequest.CountryCode; return(formData); }
/* * Static values for a Domestic ID */ private static BlockScoreVerifyDomesticRequest GetBlockScoreDomesticRequest() { var blockScoreInternationlRequest = new BlockScoreVerifyDomesticRequest { FirstName = "John", MiddleName = "W", LastName = "Smith", LastFourDigitsOfSSN = "0000", DateOfBirth = "1980-10-10", Street1 = "123 Broadway Ave", Street2 = "", City = "New York", State = "NY", PostalCode = "10011" }; return blockScoreInternationlRequest; }
/* * Ouput Domestic ID Verification Request object to a string */ private string GetblockscoreDomesticRequestoutput(BlockScoreVerifyDomesticRequest blockscorerequest) { string strreturn = ""; strreturn += "LastFourDigitsOfSSN = " + blockscorerequest.LastFourDigitsOfSSN; strreturn += "<br/>CountryCode = US"; strreturn += "<br/>CitizenshipType = " + blockscorerequest.CitizenshipType; strreturn += "<br/>FirstName = " + blockscorerequest.FirstName; strreturn += "<br/>MiddleName = " + blockscorerequest.MiddleName; strreturn += "<br/>LastName = " + blockscorerequest.LastName; strreturn += "<br/>DateOfBirth = " + blockscorerequest.DateOfBirth; strreturn += "<br/>Street1 = " + blockscorerequest.Street1; strreturn += "<br/>Street2 = " + blockscorerequest.Street2; strreturn += "<br/>City = " + blockscorerequest.City; strreturn += "<br/>State = " + blockscorerequest.State; strreturn += "<br/>PostalCode = " + blockscorerequest.PostalCode; return strreturn; }
/* * Verify US ID */ private static BlockScoreResponse VerifyUs(BlockscoreAPI blockscore, BlockScoreVerifyDomesticRequest blockScoreVerifyInternationlRequest) { BlockScoreResponse verifyUsResult = null; try { verifyUsResult = blockscore.VerifyUs(blockScoreVerifyInternationlRequest); } catch (Exception e) { throw new Exception("Caught exception: " + e.Message + "\n"); } return verifyUsResult; }
private static NameValueCollection GetFormattedDomesticVerifyRequeset(BlockScoreVerifyDomesticRequest request) { var formData = new NameValueCollection(); formData["name[first]"] = request.FirstName; formData["name[middle]"] = request.MiddleName; formData["name[last]"] = request.LastName; formData["date_of_birth"] = request.DateOfBirth; formData["type"] = request.CitizenshipType; formData["identification[ssn]"] = request.LastFourDigitsOfSSN; formData["address[street1]"] = request.Street1; formData["address[street2]"] = request.Street2; formData["address[city]"] = request.City; formData["address[state]"] = request.State; formData["address[postal_code]"] = request.PostalCode; formData["address[country_code]"] = BlockScoreVerifyDomesticRequest.CountryCode; return formData; }
/** * Verify US * @param BlockScoreVerifyDomesticRequest All three names of consumer e.g. array('first'=>'Joe', 'middle'=>'', 'last'=>'Smith') * Date of birth in YYYY-MM-DD format * Last four digits of SSN * Full address of consumer e.g. 'street1'=>'20 Main', 'street2'=>'Ste 4', 'city'=>'Springfield', 'state'=>'IL', 'postal_code'=>'99999' * @throws Exception if request fails (see private function request() for details) * @return BlockScoreResponse */ public BlockScoreResponse VerifyUs(BlockScoreVerifyDomesticRequest request) { var formData = GetFormattedDomesticVerifyRequeset(request); return Request("POST","verifications", formData); }
/** * Verify US * @param BlockScoreVerifyDomesticRequest All three names of consumer e.g. array('first'=>'Joe', 'middle'=>'', 'last'=>'Smith') * Date of birth in YYYY-MM-DD format * Last four digits of SSN * Full address of consumer e.g. 'street1'=>'20 Main', 'street2'=>'Ste 4', 'city'=>'Springfield', 'state'=>'IL', 'postal_code'=>'99999' * @throws Exception if request fails (see private function request() for details) * @return BlockScoreResponse */ public BlockScoreResponse VerifyUs(BlockScoreVerifyDomesticRequest request) { var formData = GetFormattedDomesticVerifyRequeset(request); return(Request("POST", "verifications", formData)); }