Description
Checks credit card numbers for validity based on algorithms or by making test transactions (usually in a test environment).
Expected Behavior
The credit card validator should accurately validate credit card numbers by:
- Confirming that the provided input is a valid credit card number.
- Verifying that the credit card number complies with the format rules of major credit card networks (e.g., Visa, MasterCard, American Express).
- Applying the Luhn algorithm (modulus-10) to check the validity of the credit card number's checksum.
- Detecting and handling common credit card number formats and separators (spaces, dashes) to enhance user convenience.
- Returning a clear validation result, indicating whether the provided credit card number is valid or invalid.
- Providing additional information if applicable, such as the type of credit card network (Visa, MasterCard, etc.) detected.
This behavior ensures the credit card validator accurately assesses the legitimacy of credit card numbers, aiding in the prevention of erroneous or fraudulent card data being accepted within the system.
Additional Information
Consider implementing this validator along with a corresponding unit test in the "validators" directory, alongside the existing validators.
Description
Checks credit card numbers for validity based on algorithms or by making test transactions (usually in a test environment).
Expected Behavior
The credit card validator should accurately validate credit card numbers by:
This behavior ensures the credit card validator accurately assesses the legitimacy of credit card numbers, aiding in the prevention of erroneous or fraudulent card data being accepted within the system.
Additional Information
Consider implementing this validator along with a corresponding unit test in the "validators" directory, alongside the existing validators.