Credit Card Numbers
The
Protector stage library includes the following category functions for credit card
numbers. You can use these functions only in stages included in the Protector stage
library.
- CREDIT_CARD:type()
- Returns the type of credit card that the number represents:
AMERICAN_EXPRESS
,MASTERCARD
, orVISA
. - CREDIT_CARD:firstGroup()
- Returns the first numeric group of the credit card number.
- CREDIT_CARD:secondGroup()
- Returns the second numeric group of the credit card number.
- CREDIT_CARD:thirdGroup()
- Returns the third numeric group of the credit card number.
- CREDIT_CARD:fourthGroup()
- Returns the fourth numeric group of the credit card number. When a credit card number does not include a fourth numeric group - such as American Express numbers, which only have three groups - this function returns an empty string.
- CREDIT_CARD:lastPart()
- Returns the last group of the credit card number. For Mastercard and Visa numbers, returns the last four digits. For American Express numbers, returns the last five digits.
- CREDIT_CARD:std()
- Returns credit card numbers in their standard digit groups, separated by hyphens.