March 12, 2010, 10:28 am
Latest News
Test | Products | Services | About Us | Contact | Home
Consulting Overview
Phasellus poruce susipit varius mi. Cum snatoque
What is ZXValidator 2.0?

ZXValidator is a .NET library providing functionality for credit card numbers validation. It allows you also to get the credit card type from a given number and provides information (in text format) what was the error during the validation (if there was any) i, which you could display directly to the users. The new version 2.0 is the successor of the famous version 1, In this new version you could find utilities for bulk credit card numbers validation (there is a special new class called BulkValidator which is useful for doing this. Currently the following credit card types are supported: Visa, MasterCard, Diners Club, American Express, JCB, Discover/Novus, Carte Blanche, Australian BankCard


What do I get with the ZXValidator distribution package?

You get the ZXValidator library and a set of 3 useful examples which show you how to use the solution. In fact these are 3 solutions (a standalone application , a web service and a web application) which represent basic examples how ZXValidator could be integrated in various types of .NET software solutions.


How can I use the solution?

There are two main classes in the ZXValidator you may use for credit card numbers validation - SimpleValidator and BulkValidator.

ZXValidator.SimpleValidator

Example of usage of the SimpleValidator class:
/// Creation of the SimpleValidator object
/// which will be used to check if the provided
/// credit card number is valid
ZXValidator.SimpleValidator oSimpleValidator = 
new ZXValidator.SimpleValidator();

/// Set the credit card number to be validated
oSimpleValidator.CreditCardNumber = TextBoxCCNumber.Text;

/// Retrieve the credit card validation results
string validationResult =
	"Valid: " + oSimpleValidator.Valid
	+"Type: " + oSimpleValidator.Type
	+"Error: " + oSimpleValidator.Error
	;

ZXValidator.Bulkvalidator

Before presenting the BulkValidator class we need to introduce the ZXValidator.CreditCard object. The ZXValidator.CreditCard is a simple object which has the following public properties:
string Number - the credit card number
bool Valid - after performing the validation, contains TRUE if the credit card number is Valid and FALSE if the provided number is not valid
string ValidationError - the validation error (if there was any)
string Type - the type of the credit card (for example Visa or Mastercard)

The BulkValidator has one main static method called Validate which may be called with an ArrayList of CreditCard objects or with a single CreditCard object.

/// Example of usage of BulkValidator
ArrayList arrCreditCardNumbers = new ArrayList();

arrCreditCardNumbers.Add(new ZXValidator.CreditCard("2341234123"));
arrCreditCardNumbers.Add(new ZXValidator.CreditCard("2342234123"));

//Performs the credit card numbers validation
ZXValidator.BulkValidator.Validate(ref arrCreditCardNumbers);

//Now you can loop through the CreditCard objects 
//and check the properties of the CreditCard's

foreach(ZXValidator.CreditCard in arrCreditCardNumbers)
{
/// Retrieve information from the validation tests
...
	ZXValidator.CreditCard.Type 
	ZXValidator.CreditCard.Valid
	ZXValidator.CreditCard.Errors
..
}

Test | Products | Services | About Us | Contact | Home
YourCompany.Com © 2004 • Privacy PolicyTerms Of Use