Credit Card Verification at Zurb Foundation with Abide

I am trying to create a quick prototype with the Zurb Foundation. Which works great. I had one question I'm trying to figure out and their documentation didn't help me.

When checking the field as a credit card. I want to use the ability to detect the card type and display the corresponding card image in the postfix. Any advice on how to do this, or should I give it up for a prototype? Be aware that this does not need to be used in a real web application. You just need to fake it for testing.

Thanks in advance for your help!

+3


source to share


2 answers


You don't need to run the entire credit card number on the server side to determine the card type. Visa card numbers start at 4, MasterCard starts at 51-55, and Amex starts at 34 or 37.

You can use RegEx and JavaScript to define the map type.



See this related question for regular expressions for different types of cards: How do you determine a credit card type based on a number?

+1


source


I want to use the ability to detect the map type and display the corresponding map image in postfix

I think you are wrong about Foundation with PHP (add the other server side if needed), Foundation is certainly more than capable of doing this, but without any server side work, Foundation has no idea which map is irrelevant how to display different images depending on the type of card used. You will need to write some kind of server side script to determine which card is being used and save all possible options, and only then will I worry about what Zurb might do to you.



On the side of the note, I'm sure the bank or someone out there will create an Api to allow card detection for you as I think this is probably more work in it than you think.

+1


source







All Articles