Perhaps, I'm late with the response, but I looked at your code, and it seems you've got the basic structure down. Regarding your issue with some valid visa cards being marked as invalid and some American Express cards not being recognized, it could be a problem with your if statements...