Validate if card number is Visa card. Update the first digit to make it Master card.
http://premiumpig.com