HQCreditCheck
 HQCardCheck v2.5

Properties	Methods	Events

Unit

HQCreditCheck

Description

The HQCreditCheck component will verify credit card entries. If you need to take credit card orders from your application or you need to verify credit card numbers and types, this component is the best of its kind. HQCreditCheck checks credit card number validity, credit card types against the number, and credit card length against the type. HQCreditCheck also checks the expiration date.

HQCreditCheck is Year 2000 compliant.

HQCreditCheck can validate Visa, MasterCard, American Express, Discover and Diners.

If you want HQCreditCheck to check for more cards, please send details about the card to delphi@misoftware.com.

Shareware

Please note that this component is shareware. You can try it to see if it fits your needs but you can't sell nor use it in commercial programs. The component will only work while Delphi is running.

The registration fee is US$25 (US$39.95 with FULL source).

http://www.misoftware.com/delphi/

HQCreditCheck is Royalty Free.

Check for updates on the web, you can also find out how to register this component at http://www.misoftware.com/delphi/

E-mail address is delphi@misoftware.com.


Properties

CardNumber	CardType

ExprMonth	ExprYear


Methods

CheckCreditCard


Events

OnExpired	OnInvalidNumber

OnValid	OnInvalidType


CardNumber

Declaration

property CardNumber: String;

Description

This is the actual card number that will be validated. Note that you can pass any string to CardNumber, but it will ignore any non numeric characters.

Example

CCEdit.Text = '5432-1235-1251-1512';

HQCreditCheck1.CardNumber := CCEdit.Text;

ShowMessage(HQCreditCheck1.CardNumber);

The message will show: 5432123512511512


CardType

Declaration

property CardType: TCardType;

Description

You can select from five different credit card types:

cctVisa 	(Visa)

cctMastercard 	(MasterCard)

cctAmex 	(Amex)

cctDiscover 	(Discover)

cctDiners 	(Diners)


ExprMonth

Declaration

property ExprMonth: Integer;

Description

This is the expiration month for the credit card.


ExprYear

Declaration

property ExprYear: Integer;

Description

This is the expiration year for the credit card.

Example

HQCreditCheck1.ExprYear := 99;

Result would be 1999

OR

HQCreditCheck1.ExprYear := 02;

Result would be 2002

OR you may enter the full date e.g. HQCreditCheck1.ExprYear := 2002;


CheckCreditCard

Declaration

function CheckCreditCard: Boolean;

Description

This function is used to verify the credit card information. This brings back and True if the card passed the validation or False if it did not.

Example

if HQCreditCheck1.CheckCreditCard then

   ShowMessage('Card Passed')

else

   ShowMessage('Card Failed');

Note: Before True of False is returned, an Event is triggered.


OnExpired

Declaration

property OnExpired: TNotifyEvent;

Description

This event will be called after running 'CheckCreditCard' and the card has expired.


OnInvalidNumber

Declaration

property OnInvalidNumber : TNotifyEvent;

Description

This event will be called after running 'CheckCreditCard' and the card number was invalid.


OnValid

Declaration

property OnValid: TNotifyEvent;

Description

This event will be called after running 'CheckCreditCard' and all the credit card information was valid.


OnInvalidType

Declaration

property OnInvalidType: TNotifyEvent;

Description

This event will be called after running 'CheckCreditCard' and the card type does not match the card number specifications.