Skip to content

[FEATURE] Create Credit Card Validator  #24

@rubemfsv

Description

@rubemfsv

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:

  1. Confirming that the provided input is a valid credit card number.
  2. Verifying that the credit card number complies with the format rules of major credit card networks (e.g., Visa, MasterCard, American Express).
  3. Applying the Luhn algorithm (modulus-10) to check the validity of the credit card number's checksum.
  4. Detecting and handling common credit card number formats and separators (spaces, dashes) to enhance user convenience.
  5. Returning a clear validation result, indicating whether the provided credit card number is valid or invalid.
  6. 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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions