w3CCCheck

Syntax   Parameters   Example

w3CCheck validates a credit card number and returns the credit card type.

Syntax

call w3CCCheck (Card.No, SW, CardType)

Parameters

Card.No

In

Credit Card Number.

SW

Out

Holds the value 1 if the card number is valid. Other values indicate an invalid card number or internal error which is logged.

CardType

Out

If a valid Card Type, the first attribute is the item-id of the matching Credit Card entry in the "cc.CardType" file. The second attribute is the Credit Card name as found in the cc.CardType file.

 

If the CardType could not be validated, the CardType parameter contains any appropriate error messages:

  • Error opening cc.CardType file

Confirm the cc.CardType file is accessible

  • Invalid or unknown card type

The credit card prefix was not found in the cc.CardType file. The first 4 characters of the credit card number are logged.

  • Invalid credit card number

Any of the following:

Fewer than 13 characters

More than 19 characters

Credit card checksum failed

Example

          SW         = ""

          CardType   = ""

          call w3CCCheck(Card.No, SW, CardType)

          if SW = 1 then

             CRT "The card is a ":CardType<2>

          end                           

          call w3CCCheck(Card.No,SW,CardType)