public override void Parse(ProcessConfigResponseType response)
        {
            base.Parse(response);

            var errors = new StringBuilder();

            Utils.TryRead(() => AuthenticationIndex = Convert.ToInt32(response.ProcessConfigResultsBlock.EIAResultBlock.AuthenticationIndex), "AuthenticationIndex", errors);
            Utils.TryRead(() => AuthIndexText       = response.ProcessConfigResultsBlock.EIAResultBlock.AuthIndexText, "AuthIndexText", errors);
            Utils.TryRead(() => NumPrimDataItems    = Convert.ToDecimal(response.ProcessConfigResultsBlock.EIAResultBlock.EIAResults.IDandLocDataAtCL.NumPrimDataItems), "NumPrimDataItems", errors);
            Utils.TryRead(() => NumPrimDataSources  = Convert.ToDecimal(response.ProcessConfigResultsBlock.EIAResultBlock.EIAResults.IDandLocDataAtCL.NumPrimDataSources), "NumPrimDataSources", errors);
            Utils.TryRead(() => NumSecDataItems     = Convert.ToDecimal(response.ProcessConfigResultsBlock.EIAResultBlock.EIAResults.IDandLocDataAtCL.NumSecDataItems), "NumSecDataItems", errors);
            Utils.TryRead(() => StartDateOldestPrim = response.ProcessConfigResultsBlock.EIAResultBlock.EIAResults.IDandLocDataAtCL.StartDateOldestPrim, "StartDateOldestPrim", errors);
            Utils.TryRead(() => StartDateOldestSec  = response.ProcessConfigResultsBlock.EIAResultBlock.EIAResults.IDandLocDataAtCL.StartDateOldestSec, "StartDateOldestSec", errors);
            Utils.TryRead(() => ReturnedHRPCount    = Convert.ToDecimal(response.ProcessConfigResultsBlock.EIAResultBlock.EIAResults.ReturnedHRPCount), "ReturnedHRPCount", errors);
            Utils.TryRead(() => ReturnedHRP         = response.ProcessConfigResultsBlock.EIAResultBlock.EIAResults.ReturnedHRP, "ReturnedHRP", errors);
            if (ReturnedHRP == null)
            {
                ReturnedHRP = new ReturnedHRPType[0];
            }

            if (string.IsNullOrEmpty(Error) && (errors.Length > 0))
            {
                Error = errors.ToString();
            }
        }
示例#2
0
 public virtual void Parse(ProcessConfigResponseType response)
 {
     AuthenticationDecision = response.DecisionHeader.AuthenticationDecision.ToString();
     if (response.DecisionHeader.AuthenticationDecision != AuthenticationDecisionType.Authenticated)
     {
         Error = String.Format("AuthenticationDecision is '{0}', AuthenticationText is '{1}'", response.DecisionHeader.AuthenticationDecision, response.DecisionHeader.AuthenticationText);
     }
 }
示例#3
0
        public AuthenticationResults ParseAndSave_ForBackfill(string xml, long serviceLogId, DateTime serviceLogInsertDate, string key)
        {
            var result = new AuthenticationResults();
            ProcessConfigResponseType r = GetRequestFromXml(xml);

            result.Parse(r);

            SaveAmlData(key, serviceLogId, serviceLogInsertDate, result);

            return(result);
        }
示例#4
0
        //-----------------------------------------------------------------------------------
        public override void Parse(ProcessConfigResponseType response)
        {
            base.Parse(response);

            var errors = new StringBuilder();

            Utils.TryRead(() => AuthenticationText = response.DecisionHeader.AuthenticationText, "AuthenticationText", errors);
            Utils.TryRead(() => AccountStatus      = response.ProcessConfigResultsBlock.BWAResultBlock.AccountStatus, "AccountStatus", errors);
            Utils.TryRead(() => NameScore          = Convert.ToDecimal(response.ProcessConfigResultsBlock.BWAResultBlock.NameScore), "NameScore", errors);
            Utils.TryRead(() => AddressScore       = Convert.ToDecimal(response.ProcessConfigResultsBlock.BWAResultBlock.AddressScore), "AddressScore", errors);

            if (string.IsNullOrEmpty(Error) && (errors.Length > 0))
            {
                Error = errors.ToString();
            }
        }
示例#5
0
        //-----------------------------------------------------------------------------------
        public AuthenticationResults AuthenticateForcedWithCustomAddress(string foreName, string middleName, string surname, string gender, DateTime birth,
                                                                         string houseNumber, string houseName, string street, string district,
                                                                         string town, string county, string postCode, int customerId, string xmlForDebug = "")
        {
            var result = new AuthenticationResults();

            string key = string.Format("{0}_{1}_{2}_{3}", foreName, middleName, surname, postCode);

            Log.DebugFormat("Request AML A service for key '{0}'", key);
            var address = new AddressType
            {
                AddressStatus = AddressStatusType.Current,
                TypeOfAddress = TypeOfAddressType.UK,
                AddressDetail = new AddressDetailType
                {
                    PostCode    = postCode,
                    HouseNumber = houseNumber,
                    HouseName   = houseName,
                    Address1    = street,
                    Address2    = district,
                    Address3    = town,
                    Address4    = county,
                    Country     = "GB"
                }
            };

            //AML A
            var execRequest = new ExecuteRequestType
            {
                EIHHeader = new EIHHeaderType
                {
                    ClientUser  = "******",
                    ReferenceId = "1234"
                },
                ResponseType           = ResponseType.Detail,
                ProcessConfigReference = new ProcessConfigReferenceType {
                    ItemElementName = ItemChoiceType.ProcessConfigName, Item = "AML A"
                },
                Consent      = ConsentType.Yes,
                PersonalData = new PersonalDataType
                {
                    Name = new NameType
                    {
                        Forename   = foreName,
                        MiddleName = middleName,
                        Surname    = surname
                    },
                    BirthDate          = birth,
                    BirthDateSpecified = true,
                    GenderSpecified    = true
                },
                Addresses = new[] { address }
            };

            execRequest.PersonalData.Gender = gender == "M" ? GenderType.Male : GenderType.Female;

            bool hadException           = false;
            ProcessConfigResponseType r = null;

            try
            {
                if (string.IsNullOrEmpty(xmlForDebug))
                {
                    try
                    {
                        r = MakeRequest(execRequest);
                    }
                    catch (AuthenticationException exception)
                    {
                        result.Error = exception.Message;
                        return(result);
                    }
                }
                else
                {
                    r = GetRequestFromXml(xmlForDebug);
                }
            }
            catch (Exception exception)
            {
                hadException = true;
                Log.Error(exception);
                result.Error = exception.Message;
            }

            try
            {
                if (hadException)
                {
                    Utils.WriteLog(execRequest, string.Format("Excecption: {0}", result.Error), ExperianServiceType.Aml, customerId);
                }
                else
                {
                    var writelog = Utils.WriteLog(execRequest, r, ExperianServiceType.Aml, customerId);

                    result.Parse(r);

                    SaveAmlData(key, writelog.ServiceLog.Id, writelog.ServiceLog.InsertDate, result);
                }
            }
            catch (Exception e)
            {
                Log.ErrorFormat("Exception while saving aml data: {0}", e);
            }

            return(result);
        }