Esempio n. 1
0
        public void TestAndrewMilburnBwa()
        {
            //real check
            var service = new IdHubService();
            var results = service.AccountVerification("Andrew", "JB", "Milburn", "M", new DateTime(1964, 12, 8), null, null, "3 Linford Close", "Rugeley", null, "WS15 4EF", "110730", "00742205", 1);

            Assert.That(!results.HasError);
        }
Esempio n. 2
0
        public void TestAdamPhilpottBwa()
        {
            //real check
            var service = new IdHubService();
            var results = service.AccountVerification("Adam", null, "Philpott", "M", new DateTime(1987, 12, 16), "33 North Court Close", "Rustington", null, "Littlehampton", null, "BN16 3HZ", "306782", "23356268", 1);

            Assert.That(!results.HasError);
        }
Esempio n. 3
0
        public void TestAndrewMilburnAMLA()
        {
            //real check
            var service = new IdHubService();
            var results = service.Authenticate("Andrew", "JB", "Milburn", "M", new DateTime(1964, 12, 8), null, null, "3 Linford Close", "Rugeley", null, "WS15 4EF", 1);

            Assert.That(!results.HasError);
        }
        protected AMLInfo GetAmlInfo(Customer customer)
        {
            var data = new AMLInfo
            {
                AMLResult = string.IsNullOrEmpty(customer.AMLResult)
                                        ? "Verification was not performed"
                                        : customer.AMLResult
            };

            try
            {
                var customerAddress = customer.AddressInfo.PersonalAddress.FirstOrDefault();
                if (customerAddress == null)
                {
                    return(data);
                }

                var srv    = new IdHubService();
                var result = srv.Authenticate(customer.PersonalInfo.FirstName, string.Empty, customer.PersonalInfo.Surname,
                                              customer.PersonalInfo.Gender.ToString(),
                                              customer.PersonalInfo.DateOfBirth ?? DateTime.UtcNow,
                                              customerAddress.Line1, customerAddress.Line2, customerAddress.Line3,
                                              customerAddress.Town, customerAddress.County, customerAddress.Postcode,
                                              customer.Id, true);
                if (null == result)
                {
                    return(data);
                }

                Log.DebugFormat("AML data for building model: {0} - {1}", result.AuthenticationIndex, result.AuthIndexText);
                data.HasAML              = true;
                data.AuthIndexText       = customer.AmlDescription;
                data.AuthenticationIndex = customer.AmlScore;
                data.NumPrimDataItems    = result.NumPrimDataItems;
                data.NumPrimDataSources  = result.NumPrimDataSources;
                data.NumSecDataItems     = result.NumSecDataItems;
                data.ReturnedHRPCount    = result.ReturnedHRPCount;
                data.StartDateOldestPrim = result.StartDateOldestPrim;
                data.StartDateOldestSec  = result.StartDateOldestSec;
            }
            catch (Exception ex)
            {
                Log.Warn("AppendAmlInfo failed", ex);
                Errors.Add("Failed to retrieve AML info");
            }
            return(data);
        }
        protected BankAccountVerificationInfo GetBavInfo(Customer customer)
        {
            var data = new BankAccountVerificationInfo
            {
                BankAccountVerificationResult = string.IsNullOrEmpty(customer.BWAResult)
                                        ? "Verification was not performed"
                                        : customer.BWAResult
            };

            try
            {
                var customerAddress = customer.AddressInfo.PersonalAddress.FirstOrDefault();
                if (customerAddress == null)
                {
                    return(data);
                }//if

                var srv         = new IdHubService();
                var bankAccount = customer.BankAccount;
                var result      = srv.AccountVerification(customer.PersonalInfo.FirstName, string.Empty,
                                                          customer.PersonalInfo.Surname,
                                                          customer.PersonalInfo.Gender.ToString(),
                                                          customer.PersonalInfo.DateOfBirth ?? DateTime.UtcNow,
                                                          customerAddress.Line1, customerAddress.Line2, customerAddress.Line3,
                                                          customerAddress.Town, customerAddress.County, customerAddress.Postcode,
                                                          bankAccount != null ? bankAccount.SortCode : "",
                                                          bankAccount != null ? bankAccount.AccountNumber : "",
                                                          customer.Id, true);
                if (null == result)
                {
                    return(data);
                }
                data.HasBWA             = true;
                data.AddressScore       = result.AddressScore;
                data.NameScore          = result.NameScore;
                data.AuthenticationText = result.AuthenticationText;
                data.AccountStatus      = result.AccountStatus;
            }
            catch (Exception ex)
            {
                Log.Warn("AppendBavInfo failed", ex);
                Errors.Add("Failed to retrieve BWA info");
            }

            return(data);
        }
Esempio n. 6
0
        public JsonResult IdHubCustomAddress(int id)
        {
            var customer = _customers.Get(id);

            var model = new IdHubCustomAddressModel
            {
                Id          = id,
                Firstname   = customer.PersonalInfo.FirstName ?? string.Empty,
                MiddleName  = customer.PersonalInfo.MiddleInitial ?? string.Empty,
                Surname     = customer.PersonalInfo.Surname ?? string.Empty,
                FullName    = customer.PersonalInfo.Fullname ?? string.Empty,
                Gender      = customer.PersonalInfo.Gender.ToString(),
                DateOfBirth = customer.PersonalInfo.DateOfBirth.HasValue ? customer.PersonalInfo.DateOfBirth.Value.ToShortDateString() : string.Empty,
                BankAccount = string.Empty,
                SortCode    = string.Empty
            };

            if (customer.BankAccount != null)
            {
                model.BankAccount = customer.BankAccount.AccountNumber;
                model.SortCode    = customer.BankAccount.SortCode;
            }

            var customerMainAddress = customer.AddressInfo.PersonalAddress.FirstOrDefault();

            if (customerMainAddress != null)
            {
                model.CurAddressIsManual = customerMainAddress.Id.StartsWith("MANUAL");
                model.CurAddressLine1    = customerMainAddress.Line1 ?? string.Empty;
                model.CurAddressLine2    = customerMainAddress.Line2 ?? string.Empty;
                model.CurAddressLine3    = customerMainAddress.Line3 ?? string.Empty;
                model.CurAddressTown     = customerMainAddress.Town ?? string.Empty;
                model.CurAddressCounty   = customerMainAddress.County ?? string.Empty;
                model.CurAddressPostcode = customerMainAddress.Postcode ?? string.Empty;
                model.CurAddressCountry  = customerMainAddress.Country ?? string.Empty;
            }

            var customerPrevAddress = customer.AddressInfo.PrevPersonAddresses.FirstOrDefault();

            if (customerPrevAddress != null)
            {
                model.PrevAddressIsManual = customerPrevAddress.Id.StartsWith("MANUAL");
                model.PrevAddressLine1    = customerPrevAddress.Line1 ?? string.Empty;
                model.PrevAddressLine2    = customerPrevAddress.Line2 ?? string.Empty;
                model.PrevAddressLine3    = customerPrevAddress.Line3 ?? string.Empty;
                model.PrevAddressTown     = customerPrevAddress.Town ?? string.Empty;
                model.PrevAddressCounty   = customerPrevAddress.County ?? string.Empty;
                model.PrevAddressPostcode = customerPrevAddress.Postcode ?? string.Empty;
                model.PrevAddressCountry  = customerPrevAddress.Country ?? string.Empty;
            }

            var service       = new IdHubService();
            var parsedAddress = service.FillAddress(model.CurAddressLine1, model.CurAddressLine2, model.CurAddressLine3,
                                                    model.CurAddressTown, model.CurAddressCounty,
                                                    model.CurAddressPostcode);

            if (parsedAddress != null)
            {
                model.IdHubAddressHouseNumber = parsedAddress.AddressDetail.HouseNumber ?? string.Empty;
                model.IdHubAddressHouseName   = parsedAddress.AddressDetail.HouseName ?? string.Empty;
                model.IdHubAddressStreet      = parsedAddress.AddressDetail.Address1 ?? string.Empty;
                model.IdHubAddressDistrict    = parsedAddress.AddressDetail.Address2 ?? string.Empty;
                model.IdHubAddressTown        = parsedAddress.AddressDetail.Address3 ?? string.Empty;
                model.IdHubAddressCounty      = parsedAddress.AddressDetail.Address4 ?? string.Empty;
                model.IdHubAddressPostcode    = parsedAddress.AddressDetail.PostCode ?? string.Empty;
                model.IdHubAddressCountry     = parsedAddress.AddressDetail.Country ?? string.Empty;
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
 public void SetUp()
 {
     _service = new IdHubService(new ExperianBankCacheRepositoryFake());
 }