CARDCHECK COMPONENT
HOME

 
 

About CardCheck

CardCheck provides developers with a way to validate credit card numbers. It can be used with any programming language that supports COM: Scripting languages (VBScript, JavaScript), Visual Basic (Versions 4 and up), VBA (Word, Excel, Access ...), VC++, BC++, Delphi, Power Builder to name only a few.

Supported Credit Cards are: VISA, Master Card - Eurocard, Discover - Novus, American Express, JCB and En Route.

NOTE: The evaluation version of CardCheck recognizes VISA cards ONLY.

CardCheck Installation

Installation of the component is very simple using the provided installation utility. Two files cardcheck.dll and cardcheck.tlb are copied to the system directory (like \winnt\system32 for NT or \windows\system for Win95). However if you with to move the files to another directory remember to register the component using the resgsrv32 program.

Change to the directory where you copied the DLL and type:

regsvr32 cardcheck.dll

If you get an error message at the end of the installation procedure "cannot register...", some of your system files might need to be updated to the latest version.

If you need to update your system download download the latest version of MFC libraries for Windows 9x/NT.
When the download is complete, open the cab file, extract it's contents and run the setup file.

Credit Card validation Example

Using the component is as simple as

  1. Creating the object
  2. Calling the Validate method

The following code demonstrates how to use CardCheck from VBScript. In this example we'll validate a fake credit card number: 3454 54564 54564.

Set CC = CreateObject("CardCheck.CreditCard")
If CC.Validate("3454 54564 54564","02/2002") = False Then
    Response.Write "Sorry your Credit Card appears to be invalid."
    Response.Write "<BR>" & CC.InvalidReason
else
    Response.Write "Your Credit Card was accepted. Thank you for your business."
end if

By reading the value of the InvalidReason property we can determine why the credit card was not valid..

Samples

ASP - VBScript: This sample demonstrates the use of CardCheck in an ASP page. After downloading the source code unzip the file to a directory and configure IIS or Personal Web Server so that the ASP page can be executed. If you need help on this refer to the IIS documentation.

Visual Basic:

Access:

About Upgrades

  1. Users can upgrade for free for minor version changes. For example, upgrades from version 1.00 to 1.99 are free. The upgrade from 1.99 to 2.0 may carry an additional license fee.
  2. The latest version of the components are always available at http://www.donia.com/products.htm. If a fee is associated with obtaining the upgrade it will be noted on that page.

Upgrade Instructions

To upgrade the component from a previous version please follow these steps:

  1. Stop all programs using the component. If you are using it in ASP stop IIS related services such as Gopher, FTP and W3SVC..
  2. Install the update using the provided setup utility.
  3. Don't forget to run regsvr32 as described above if you choose to move the DLL to another directory.
  4. Restart the necessary programs / services.

Technical Support

If you require technical support please send complete details about the problem you are having to support@donia.com. Include the version of CardCheck you are using, any error messages, sample code snippets that demonstrate the problem (most problems are scripting errors), information about the hosting environment etc. For example, if you are using ASP to host the component please let me know what version of IIS and ASP you are running (and if you have installed any of the HotFixes). The more information you can provide in your request for help, the faster your problems can be resolved.

CardCheck Properties

Property Description
AllowTestNumbers Set this property to True to allow Test credit card numbers to be accepted as valid.

Default value: False

Supported test numbesr are:

  • AMEX : 3111-1111-1111-1117
  • VISA: 4111-1111-1111-1111
  • MASTERCARD: 5111-1111-1111-1118
  •  DISCOVER: 6111-1111-1111-1116
InvalidReason If any of the Validate or GetCardType methods return FALSE this property will hold a String explaining why FALSE was returned.

Example:

CC.InvalidReason = "Invalid credit card number"

Note:

This property is read only

 

CardCheck Methods

Method Parameters Return Value Description
Validate CardNumber,[ExpiryDate],[CardType]

String value of the card number to verify. The string doesn't  have to be in any specific format.

Optional string value representing the expiration date

Optional Card type integer representing the selected card type.

True/False based upon success or failure. Validates credit card numbers and returns a TRUE or FALSE value.

If the ExpiryDate is provided it is checked against the system clock.

If a Card Type value is provided it is checked against the card number. As you will see in the GetCardType  method credit card numbers and credit card types are related.

Example:

isCardValid = Validate("354- 6544-54564","02/2002",4)

GetCardType CardNumber

String value of the card number. The string doesn't need to have a specific format.

CardType

Constant defined in CardTypes

Returns the credit card type provided a valid credit card number.

Example:

CardType = GetCardType ("354 6544 54564")

About None   Use this method to check if you are running an Evaluation version or a Full version.

 

Copyright 1998 - 1999 Hassan Fekih. All Rights Reserved.