Card Number Validation

How are credit cards validated?

How does Card Detection work?

Zen Cart uses the standard Luhn Mod10 algorithm combined with the list of accepted cards you have configured in Admin > Configuration > Credit Cards. If the number fails validation or is a card-type that is not accepted based on your settings, it will be rejected with a “we do not accept that kind of card” error.

Wikipedia gives a good summary of the anatomy of credit card numbers.

My customers get the error “Credit card not entered correctly”

For some payment modules, Zen Cart evaluates the credit card number to see if they match the settings you have enabled in the Admin > Config > Credit Cards settings. This will reject disabled card-types before even sending to the merchant gateway.

So, if you enter a MasterCard number, but have MasterCard turned off (in the Admin), then it will tell the customer “we don’t accept that kind of card”.


  1. Review your merchant account settings (ie: with your bank). Find out what credit card types you are allowed to process.

  2. Then turn those on in Zen Cart under Admin > Configuration > Credit Cards

The error “We do not accept that kind of card” should be handled the same way.

Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified August 29, 2020 by Scott C Wilson (8de0edc).