ValidateCard Method
Checks the card number and expiration date for validity.
Syntax
public void validateCard();
Remarks
This method performs several checks on customer information to determine if the card information submitted could be valid. This should be done before submitting an actual transaction for authorization. The tests performed are listed below:
Luhn Digit Check | The Global Transport Server checks the digits of the CardNumber to make sure that it could be a valid card number. The result of this check is stored in the DigitCheckPassed property. |
Card Type Check | The beginning digits of the CardNumber are compared to a BIN range by the Global Transport Server to determine if it is a valid card type. The result of this check is stored in the CardTypeDescription property. (the CardType is determined by the bean, not by Global Payments). |
Expiration Date Check | The date given in CardExpMonth and CardExpYear is checked by the Global Transport Server to make sure that the card is still valid. The DateCheckPassed property is populated with the result. |
Length Check | Indicates whether the CardNumber's length is appropriate for the card's prefix, and stores the results in the LengthCheckPassed property. |
This bean will query the Global Transport Server to perform the above checks. The UserId and Password is only required for the GetDebitNetworkInfo method, neither IsCommercialCard or ValidateCard require authentication to use. The first three checks made by the ValidateCard method may also be performed off-line by setting the ValidationMode configuration setting to "Local" instead of "Global". In this case, the mod-10 check will be computed mathematically by the bean, and the expiration date will be checked against the current system time. The CardTypeDescription will be computed using an internal set of rules, but do note that these will not be as up-to-date as the rules the Global Payments Server uses. The length check will only be performed when ValidationMode is set to "Global" mode.