private static string GetBwaScoreInfo(BankAccountVerificationInfo info) { return (string.Format("{0}, {1}, {2}", info.NameScore, info.AddressScore, string.IsNullOrEmpty(info.AccountStatus) ? "-" : info.AccountStatus)); }
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); }