jquery.cardswipe icon indicating copy to clipboard operation
jquery.cardswipe copied to clipboard

Name format on the creditcard

Open mansi-rezdy opened this issue 9 years ago • 1 comments

  • Creditcard with dot in Name (LINCOLN/ABRAHAM J.)
  • Creditcard with only a full name (A. J. LINCOLN) - Name not separated by /

mansi-rezdy avatar Dec 16 '15 02:12 mansi-rezdy

I had the same issue. I changed the RegExp patterns a bit.

This is pattern for VISA, but it's same part that parses the name that goes for all, allowing commas and periods inside the name:

var pattern = new RegExp("^%B(4[0-9]{12,18})\^([a-zA-Z0-9,. ]+)/([a-zA-Z0-9,. ]+)\^([0-9]{2})([0-9]{2})");

Periods are not enough, as there are names like "James S. Johnson, III", meaning "The Third" that comes with a comma, so those must be allowed in. It's not completely horrible to allow all alpha-numberics in along with commas and periods. Should cover all scenarios.

antonskv avatar Jun 01 '17 17:06 antonskv