using System; using System.Collections.Generic; using Experian.Payments.BankWizardHosted; ... /// 1. Create and populate a new VerifyRequest instance. ValidateRequest validationRequest = new VerifyRequest(); { language = "en", itemisationID = "User defined -> Branch id", reportString = "User defined -> User ID", /// 1.1 Account information: sort code, account number, check context, setup date, account type and customer account type. accountInformation = new VerifyAccountRequestType() { sortCode = "070116", accountNumber = "00003036", rollNumber = null, checkContext = CheckContextType.DirectCredit, accountVerification = new VerifyBankAccountRequestType() { accountSetupDate = new AccountDateType() { year = "2007", month = "4" }, accountTypeInformation = new AccountTypeInformation() { accountType = AccountType.Current, customerAccountType = CustomerAccountType.Personal } } }, /// 1.2 Personal information includes first name, surname, date of birth, address and owner type. personalInformation = new VerifyPersonalRequestType() { personal = newPersonalDetails() { firstName = "Ashley", surname = "Marma", dob = new DateTime(1972, 1, 13), dobSpecified = true }, address = new Address() { deliveryPoint = new DeliveryPoint[] { newDeliveryPoint() { deliveryType = DeliveryPointType.houseNumber, Value = "1" } }, postalPoint = new PostalPoint[] { newPostalPoint() { postalType = PostalPointType.street, Value = "Acacia Avenue" }, new PostalPoint() { postalType = PostalPointType.postcode, Value = "NE9 6EH" } } }, ownerType = OwnerType.Single, ownerTypeSpecified = true } }; /// 2. Create a new service proxy. Change the hostedServiceURL to the URL supplied by Experian. using (BankWizard_v1_0_Service hostedService = new BankWizard_v1_0_Service()) { hostedService.Url = "bankwizardhosted url"; hostedService.Timeout = 5000; /// 3. To access
the SoapContext see the files provided in Service\src. hostedService.RequestSoapContext.Security.Tokens.Add(new WASPToken(token)); hostedService.RequestSoapContext.Security.MustUnderstand = false; /// 4. Perform verification. VerifyResponse verifyResponse = hostedService.Verify(verifyRequest); /// 5. How to check to see if there were any errors. List<Condition> conditions = new List<Condition>(verifyResponse.conditions); if (!conditions.Exists(c => c.severity == ConditionSeverity.error)) { /// 6. Check the match scores. Console.WriteLine("Account verification status : " + verifyResponse.accountInformation.accountVerificationStatus); Console.WriteLine("Account Bacs code : " + verifyResponse.accountInformation.bacsCode); Console.WriteLine("Account owner match : " + verifyResponse.personalInformation.accountOwnerMatch); Console.WriteLine("Account setup date : " + verifyResponse.personalInformation.accountSetupDateMatch); } else { /// 7. What errors were generated during the validation call? conditions.ForEach(c => { if (c.severity == ConditionSeverity.error) Console.WriteLine(c.severity + "[" + c.code + "] " + c.Value); }); } } |