Source Code: Credit card number validation (Israeli Visa)
Usually, it’s enough, yet sometimes a client demand or a product demand is to create a more sophisticated validation, using known credit card algorithm that the CreditCard company issues from time to time.
I had just that need a while back.
So, I created the validation and I decided to share it with you here. First, let’s create a helper for checking wether a number is an even or an odd number. this will be used later in the validation process.