public CallCreditGetData(CT_searchapplicant searchApplicant) { try { apiProxy = InitializeApiProxy(); apiSD = InitializeApiRequest(searchApplicant); } catch (Exception e) { Console.WriteLine(e); //throw; } }
private static CT_searchapplicant InitializeUser() { CT_searchapplicant user = new CT_searchapplicant(); /*user.dob = new DateTime(1910, 01, 01); * user.title = "MISS"; * user.forename = "JULIA"; * user.othernames = ""; * user.surname = "AUDI"; * user.buildingno = "1"; * user.street = "TOP GEAR LANE"; * user.postcode = "X9 9LF";*/ /*user.dob = new DateTime(1960, 11, 05); * user.name[0].title = "MR"; * user.name[0].forename = "OSCAR"; * user.name[0].othernames = "TEST-PERSON"; * user.name[0].surname = "MANX"; * user.address[0].buildingno = "606"; * user.address[0].street1 = "ALLEY CAT LANE"; * user.address[0].postcode = "X9 9AA"; * user.tpoptout = 0; * user.tpoptoutSpecified = true; */ /* Create a new request applicant object and attach it to the credit request object. */ CT_searchapplicant apiApplicant = new CT_searchapplicant(); apiApplicant.dob = new DateTime(1960, 11, 05); apiApplicant.dobSpecified = true; apiApplicant.tpoptout = 0; apiApplicant.tpoptoutSpecified = true; /* Create a new name object and attach it to the request applicant object. */ CT_inputname apiName = new CT_inputname(); apiName.title = "MR"; apiName.forename = "OSCAR"; apiName.othernames = "TEST-PERSON"; apiName.surname = "MANX"; apiApplicant.name = new CT_inputname[] { apiName }; /* Create a new input current address object */ CT_inputaddress apiInputCurrentAddress = new CT_inputaddress(); apiInputCurrentAddress.buildingno = "606"; apiInputCurrentAddress.street1 = "ALLEY CAT LANE"; apiInputCurrentAddress.postcode = "X9 9AA"; apiApplicant.address = new CT_inputaddress[] { apiInputCurrentAddress }; return(apiApplicant); }
private CT_SearchDefinition InitializeApiRequest(UserInfo user) { CT_SearchDefinition searchDef = new CT_SearchDefinition(); CT_searchrequest srequest = new CT_searchrequest(); srequest.purpose = "DS"; srequest.score = 1; srequest.scoreSpecified = true; srequest.transient = 0; srequest.transientSpecified = true; srequest.schemaversion = "7.2"; srequest.datasets = 511; //srequest.credittype = this.cboCreditType.SelectedValue.ToString(); searchDef.creditrequest = srequest; /* Create a new request applicant object and attach it to the credit request object. */ CT_searchapplicant apiApplicant = new CT_searchapplicant(); apiApplicant.dob = user.dob; apiApplicant.dobSpecified = true; srequest.applicant = new CT_searchapplicant[] { apiApplicant }; /* Create a new name object and attach it to the request applicant object. */ CT_inputname apiName = new CT_inputname(); apiName.title = user.title; apiName.forename = user.forename; apiName.othernames = user.othernames; apiName.surname = user.surname; apiApplicant.name = new CT_inputname[] { apiName }; /* Create a new input current address object */ CT_inputaddress apiInputCurrentAddress = new CT_inputaddress(); apiInputCurrentAddress.buildingno = user.buildingno; apiInputCurrentAddress.street1 = user.street; apiInputCurrentAddress.postcode = user.postcode; apiApplicant.address = new CT_inputaddress[] { apiInputCurrentAddress }; return(searchDef); }
private static CT_SearchDefinition InitializeApiRequest(CT_searchapplicant searchApplicant) { CT_SearchDefinition searchDef = new CT_SearchDefinition(); CT_searchrequest srequest = new CT_searchrequest(); srequest.purpose = "BS"; srequest.score = 1; srequest.scoreSpecified = true; srequest.transient = 0; srequest.transientSpecified = true; srequest.schemaversion = "7.2"; srequest.datasets = 511; //srequest.credittype = this.cboCreditType.SelectedValue.ToString(); searchDef.creditrequest = srequest; srequest.applicant = new CT_searchapplicant[] { searchApplicant }; return(searchDef); }
} //GetServiceOutput private void GetCallCreditData(InputLocationDetailsUKLocation ukLocation, string firstName, string surname, DateTime?birthDate, string postcode, int customerId, int?directorId) { if (!CurrentValues.Instance.CallCreditEnabled) { Log.InfoFormat( "Not retrieving CallCredit data for customer {0} director {1}: CallCredit is disabled.", customerId, directorId ); return; } // if try { Log.InfoFormat("Retrieving CallCredit data for customer {0} director {1}", customerId, directorId); var searchRequest = new CT_searchapplicant { dob = birthDate ?? DateTime.UtcNow, dobSpecified = birthDate.HasValue, name = new[] { new CT_inputname { forename = firstName, surname = surname, } }, address = new[] { new CT_inputaddress { postcode = ukLocation.Postcode, street1 = ukLocation.Street, street2 = ukLocation.Street2, startdateSpecified = false, enddateSpecified = false, buildingname = ukLocation.HouseName, buildingno = ukLocation.HouseNumber, posttown = ukLocation.PostTown, } }, tpoptout = 0, tpoptoutSpecified = true }; CallCreditLib.CallCreditGetData callCreditGetData = new CallCreditGetData(searchRequest); CT_SearchResult searchResponse = callCreditGetData.GetSearch07a(); Log.InfoFormat( "Saving to ServiceLog CallCredit data fro customer {0} director {1}", customerId, directorId ); Utils.WriteLog( searchRequest, searchResponse, ExperianServiceType.CallCredit, customerId, directorId, firstName, surname, birthDate, postcode ); } catch (Exception ex) { Log.Error("Failed retrieve from data CallCredit", ex); } //try } //GetCallCreditData