I can initially do a check to identify if I have a valid Payment Card Number by performing Luhn check algorithm.
But then I need to identify if it is a Credit card or a Debit card to perform the next task accordingly. I understand this depends on the first four characters, but I'm not sure about the exact ranges.
If someone can explain or provide with a link which explains this would be great. Thanks.
Edits...
In both these stackoverflow Links I don't see my question is answered. Therefore this can not be a duplicate for any of these.
In my case it doen't read the card using a card reader and instead using the card number, CVV and exp date to get the payment done(User insert these things).
Also "yes" I can do a check to identify if it is a Visa card, Master Card or an American Express card. But no way to find if its a Credit
or a Debit
card.(For example if the card is a Visa card then how will I get to know that Visa card is a "credit card" or a "debit card". That's the exact question).