w3CCheck validates a credit card number and returns the credit card type.
call w3CCCheck (Card.No, SW, CardType)
|
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:
Confirm the cc.CardType file is accessible
The credit card prefix was not found in the cc.CardType file. The first 4 characters of the credit card number are logged.
Any of the following: Fewer than 13 characters More than 19 characters Credit card checksum failed |
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)