TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why do credit card forms ask for Visa, Mastercard, etc.?

120 pointsby jackhammer2022over 11 years ago

18 comments

wcfieldsover 11 years ago
Could someone who deals with PCI compliance please explain some other nuances of credit cards that I&#x27;ve been curious about:<p>* Fault&#x2F;Decline Codes returned from processors like CyberSource. How are these factored? How do processors do Regex on names&#x2F;addresses? [1][2]<p>* CVV numbers and what they mean&#x2F;how they are treated in the system? If CVV number is included does this increase chargeback protection?<p>* How CHIP cards work differently in the processing system, if at all?<p>* Do &quot;knuckle-busters&quot; (carbon copy physical imprints) follow any sort of compliance anymore?<p>[1] <a href="http://apps.cybersource.com/library/documentation/dev_guides/Reporting_Developers_Guide/reporting_dg.pdf" rel="nofollow">http:&#x2F;&#x2F;apps.cybersource.com&#x2F;library&#x2F;documentation&#x2F;dev_guides...</a> [2] <a href="http://apps.cybersource.com/library/documentation/dev_guides/AFS_IG/20050726_AFS_IG.pdf" rel="nofollow">http:&#x2F;&#x2F;apps.cybersource.com&#x2F;library&#x2F;documentation&#x2F;dev_guides...</a>
评论 #7159990 未加载
评论 #7158977 未加载
评论 #7160850 未加载
评论 #7159557 未加载
jonnathansonover 11 years ago
It&#x27;s certainly not necessary, but my guess is that it follows from the &quot;Don&#x27;t Make Me Think&quot; school of UX design. If a majority of consumers have been conditioned to expect a credit-card-selection menu (or series of clickable icons), then the absence of such might confuse them and cause measurable drop-offs in the purchase completion funnel. It seems a little farfetched, but I&#x27;m sure at least someone has done the tests and proven this to be the case. (And if not, then there is truly no reason for the continued presence of these menus.)<p>Anecdotally, I&#x27;ve noticed that more and more sites are using autodetect features based on the first 4 digits entered. It certainly didn&#x27;t put me off as a shopper; in fact, I found it a lot more elegant. But I&#x27;m an unusual guy, as are most people who work in tech. We can&#x27;t assume that what&#x27;s appealing or efficient to us is necessarily the same for the broader masses.
评论 #7159470 未加载
notdonspauldingover 11 years ago
If you only accept the 4 biggest card issuers, you can get away with some dead-simple code to indicate to the user what card type their number indicates they are.<p>Personally, I bind an onkeyup event handler to fade in the appropriate icon based on the first digit of the number. This is not safe if you accept more than these 4 card types, (we don&#x27;t).<p><pre><code> function detect_cc_type(number){ return { &#x27;3&#x27;: &#x27;american_express&#x27;, &#x27;4&#x27;: &#x27;visa&#x27;, &#x27;5&#x27;: &#x27;mastercard&#x27;, &#x27;6&#x27;: &#x27;discover&#x27; }[number[0]]; }</code></pre>
评论 #7159202 未加载
评论 #7159347 未加载
pbreitover 11 years ago
I think it was just a convention and made people feel better about having entered the form correctly. It makes sense to tell a merchant what type of card you are using even though someone &quot;in the know&quot; might know that it can be sussed from the digits.<p>Most payment gateways still require it even though it&#x27;s probably superfluous.<p>I&#x27;ve also wondered why forms ask for name on card even though I&#x27;m pretty sure it&#x27;s not checked by most&#x2F;all processors and would never lead to a decline. Worse is that hardly any merchants pre-fill it if they&#x27;ve already collected your name.
评论 #7159010 未加载
评论 #7158984 未加载
Domenic_Sover 11 years ago
I&#x27;d like to see an A&#x2F;B test between the 2 options. It sounds plausible that a less-sophisticated buyer might see the Visa logo light up after they&#x27;ve typed the first digit of their card and get confused (&quot;WHAT WITCHCRAFT IS THIS&quot;).
评论 #7159206 未加载
评论 #7160317 未加载
评论 #7160380 未加载
评论 #7159263 未加载
marcusrover 11 years ago
Why do credit card forms ask you to enter the credit card number without spaces between the clusters of digits, when it&#x27;s simple for the machine to parse with or without them?
评论 #7158986 未加载
评论 #7159188 未加载
评论 #7158985 未加载
评论 #7159217 未加载
评论 #7159005 未加载
评论 #7159015 未加载
danmanstxover 11 years ago
Working for nonprofits and church&#x27;s, I know we do it because AMEX and others charge higher rates per transaction than say VISA, thus some clients only take VISA and giving a select list of options, lets the user know to use that type of card.
评论 #7158991 未加载
frankusover 11 years ago
For a good example of how to do this right, see skeuocard:<p><a href="http://kenkeiter.com/skeuocard/" rel="nofollow">http:&#x2F;&#x2F;kenkeiter.com&#x2F;skeuocard&#x2F;</a>
评论 #7159835 未加载
评论 #7161567 未加载
评论 #7159224 未加载
wil421over 11 years ago
Worked in restaurants for years while I was in college. All but 1 restaurant I worked at had systems that asked for the type of card.<p>I dont think this is limited to web forms.
评论 #7159640 未加载
excitomover 11 years ago
This has always been a pet peeve of mine, it&#x27;s totally unnecessary to ask for the card type.<p>Also, it bothers me that I can&#x27;t type in my card number <i>exactly</i> as it appears on the card, with embedded spaces for readability. Stupid form! Don&#x27;t tell me the number is invalid since it has spaces in it! If you don&#x27;t like my spaces, take them out!
1337Coderover 11 years ago
If anyone is curious about the luhn algorithm, here is one I made in C# from the example in the question:<p>static bool IsValidLuhn(string numbers) { if (numbers == null) throw new ArgumentNullException(&quot;number&quot;, &quot;number must have a value.&quot;);<p>var allNumbers = numbers .Where((c) =&gt; c &gt;= &#x27;0&#x27; &amp;&amp; c &lt;= &#x27;9&#x27;) .Reverse() .Select((c, i) =&gt; (i % 2 == 1) ? ((Convert.ToInt32(c) - 48) * 2).ToString() : c.ToString());<p>return allNumbers.Count() &gt; 0 ? allNumbers.Aggregate((x, y) =&gt; x + y).Sum((c) =&gt; Convert.ToInt32(c) - 48) % 10 == 0 : false; }<p>Edit: Can sum one link me to HackerNews markdown?
评论 #7160636 未加载
评论 #7161266 未加载
ahallockover 11 years ago
I think it&#x27;s one of those things where convenience for those looking at the underlying data has bled over into the UI. While you can deduce the type from the number, it&#x27;s not easy for humans to do that at glance while looking over SQL query results. I could be wrong, but often, we ask users for more input than we need to because elegant UIs take lots of work.
评论 #7159308 未加载
robotcookiesover 11 years ago
Might also be that some people will try to enter an amex or discover card number if you don&#x27;t do this. Even if you state that only visa or mc can be used, people don&#x27;t always read it. Having to select an option is how you can be sure that they are aware of it. Kind of like having to check off the &quot;I agree to the terms&quot; checkbox.
mastersk3over 11 years ago
I wonder if this was used to discourage AmEX cards(Higher processing fee), as to my knowledge these forms have originated in pre-checkout JS era and have just been copied thereafter. Would be helpful if we could get a look at the processing rates 6-7 years back.
ansimionescuover 11 years ago
<a href="http://creditcardjs.com/" rel="nofollow">http:&#x2F;&#x2F;creditcardjs.com&#x2F;</a>
kogirover 11 years ago
The same reason forms make your enter your phone number in a particular format.<p>It&#x27;s easier to make the user do all the work, and lazy developers can&#x27;t be bothered to do simple things like strip all non-digits from a phone number.
the_mitsuhikoover 11 years ago
Mostly it&#x27;s because of PCI DSS and dinosaurs in the market leaving very little customizability of the iframes they provide.
dschiptsovover 11 years ago
<p><pre><code> if (strcmp($POST[&#x27;cardtype&#x27;], &quot;mastercard&quot;)) { $Processor = $PaymentProcessorFactory.InstantiateByType(&quot;mastercard&quot;); $Processor = $PaymentProcessorFactory.InstantiateByType(&quot;visa&quot;); } $Processor.process($POST);</code></pre> Sorry, cannot simulate &quot;real-world&quot; (lame enough) PHP OO code, but you got the idea.)