The cardvalidate statement verifies that a number is a valid credit card number.
This statement has two parameters:
cardnumber – the credit card number to check. This number can contain spaces or punctuation, which will be ignored.
result – Name of field or variable that will contain the result, which will be either
This statement verifies that a number is a valid credit card number. Credit cards have an internal checksum that allows a number to be validated for simple data entry errors (for example missing or transposed digits). Here is an example that checks to make sure that a number is a valid credit card number.
local cardNumber,cardStatus gettext "Card Number:",cardNumber cardvalidate cardNumber,cardStatus if cardStatus <> "Ok" stop endif ... continue with credit card processing.
Of course the statement cannot tell whether this card number has actually been issued, or what the credit limit is or any other financial information about the card. It simply provides a basic check for missing or transposed digits. (Basically, if this function says that the number is in error you know for sure that the number is wrong, but if this function says the number is valid you would still need to check with the issuer to determine if this is a valid card.)
|10.0||Updated||Carried over from Panorama 6.0, but now ignores embedded dashes and other punctuation.|