/// 1. Create and populate a new ValidateCardDetailsRequest instance. var request = new ValidateCardDetailsRequest() { itemisationID = "User defined -> Branch id", reportString = "User defined -> User ID", CardDetails = new CardDetails() { PAN = "1234567890123456", CVV = "123", ValidUntil = new CardDate() { Month = 12, Year = 2012 } } }; /// 2. Create a new service proxy. Change the hostedServiceURL to the URL supplied
by Experian. { 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 validation. var response = hostedService.ValidateCardDetails(request); /// 5. How to check to see if there were errors. if (response.CardValidationResponse.CardCondition != null) { /// 6. Grab all the validation failure codes, severities and (optional) reasons. foreach (var CardCondition in response.CardValidationResponse.CardCondition) Console.WriteLine("Card validation failed with code: (0) Severity: (1) Reason: (6)") CardCondition.Code, CardCondition.Severity, CardCondition.Reason); } else { /// 7. Validation successful ~ process the returned data. if (response.CardValidationResponse.CardType.HasValue) Console.WriteLine("Card type => {0}", Enum.GetName(typeof(TypeOfCard), response.CardValidationResponse.CardType.Value)); if (response.CardValidationResponse.SubType.HasValue) Console.WriteLine("Card sub-type => {0}", Enum.GetName(typeof(SubTypeOfCard), response.CardValidationResponse.SubType.Value)); if (!string.IsNullOrEmpty(response.CardValidationResponse.IssuerName)) Console.WriteLine("Card issuer => {0}", response.CardValidationResponse.IssuerName); if (!string.IsNullOrEmpty(response.CardValidationResponse.SchemeName)) Console.WriteLine("Card scheme => {0}", response.CardValidationResponse.SchemeName); } } |