News for hackers. Stuff that matters.
Re:jQuery.payment by mey on Thursday February 07, 2013 @02:54PM (#5184157)
There are several incorrect assumptions about this library

  Cards can be up to 19 digits
  Bin ranges are constantly updated, so cardType in static code is a broken concept.
  I expect in the future American Express will issues cards longer then 15 digits.
  Minimun card length is 13 digits not 10
I don't feel like validating the luhn check, but historically I've seen systems that don't correctly handle the luhn check of variable sizes.

Edit: Reference material http://en.wikipedia.org/wiki/Bank_card_number If you are actually getting into credit card processing, please talk to your acquirer about data feeds of this type of info on bin ranges.

Edit 2: Wikipedia claims Maestro has 12 digit cards, but I've never seen one in the wild, I could be wrong about 13, but it's the assumption we've made processing international payments.

Re:jQuery.payment by pc on Thursday February 07, 2013 @03:00PM (#5184190)
(I work at Stripe.)

Thanks. I don't think these are so much incorrect assumptions so much as things we should change if the world changes.

19-digit IINs are found on UnionPay, Maestro, and other international cards that Stripe doesn't support today. We might add support for them in the future.

As to the others (e.g. American Express cards with more than 15 digits): we'll certainly add support if this changes.

Re:jQuery.payment by mey on Thursday February 07, 2013 @04:38PM (#5184660)
I took the goal of the library as general purpose, not stripe purpose. Sorry for my personal incorrect assumption.
Re:jQuery.payment by pc on Thursday February 07, 2013 @06:35PM (#5185251)
No problem. The goal is to be general purpose, though, and to that end we just added support for UnionPay, Maestro, and Laser: https://github.com/stripe/jquery.payment/pull/5.
Re:jQuery.payment by mey on Thursday February 07, 2013 @07:43PM (#5185555)
Awesome :)
Re:jQuery.payment by maccman on Thursday February 07, 2013 @03:06PM (#5184221)
We'll get UnionPay & Maestro support added shortly.
Re:jQuery.payment by badgar on Thursday February 07, 2013 @04:03PM (#5184487)
> Thanks. I don't think these are so much incorrect assumptions so much as things we should change if the world changes.

Is that not the definition of an assumption? Something you rely on being true and not changing, and which if it does change, requires reaction?

These are incorrect assumptions. It's okay to have them, you don't have to be perfect, but don't redefine "assumption" because you're embarrassed.

Re:jQuery.payment by cwp on Thursday February 07, 2013 @04:27PM (#5184594)
Gimme a break. The assumptions are correct, for now. If they become incorrect, Stripe will update the software accordingly. This is exactly how good software is written and managed. Patrick has nothing to be embarrassed about.
Re:jQuery.payment by Skywing on Thursday February 07, 2013 @04:22PM (#5184562)
> These are incorrect assumptions. It's okay to have them, you don't have to be perfect, but don't redefine "assumption" because you're embarrassed.

What is there to be embarrassed about? Seriously.

Re:jQuery.payment by wilsaj on Thursday February 07, 2013 @04:26PM (#5184585)
It's not a redefinition of "assumption" but rather a justification as to why these assumptions should not be qualified as "incorrect".
Re:jQuery.payment by danielweber on Thursday February 07, 2013 @03:23PM (#5184286)
I do give them credit for accepting credit card numbers with spaces in them. It seems 99% of websites cannot handle spaces.
Re:jQuery.payment by jonknee on Thursday February 07, 2013 @04:18PM (#5184541)
I have had this discussion a few times and at least for me it's usually sticking to ridiculous TOS from the payment gateway and less in programming competency. If your gateway says you're not allowed to change anything in the input and the gateway does not accept spaces you can either break your contract or not allow spaces.
Re:jQuery.payment by pbreit on Thursday February 07, 2013 @06:54PM (#5185309)
> not allowed to change anything in the input

I've never seen such a term. Have any examples?

Re:jQuery.payment by asimeqi on Thursday February 07, 2013 @05:07PM (#5184833)
I worked for a gift card company and wrote and maintained some client side card validation code. My suggestion for client side card validation is "don't do it". As your client gets used more and more you will see a wild variety of cards. The minimum card length I have seen is 5. The maximum is 22. Some cards have correct checksum and some don't have checksum at all. Some cards have only numbers and some cards have letters and numbers. At the end we stripped all our fancy validation code and left only a check that card length was 3 or more.

All card validation must be server side.

Re:jQuery.payment by ceejayoz on Thursday February 07, 2013 @05:17PM (#5184884)
Gift cards aren't credit cards. The docs say "a general purpose library for building credit card forms", not "a general purpose library for building payment forms".
Re:jQuery.payment by jfoster on Thursday February 07, 2013 @11:28PM (#5186283)
How does it become easier to do such validation server-side?
Re:jQuery.payment by cj on Thursday February 07, 2013 @11:42PM (#5186332)
You can attempt to process it through your payment gateway (ie. stripe) and check for a success or failure.
Re:jQuery.payment by jimktrains2 on Saturday February 09, 2013 @11:15AM (#5192909)
That becomes expensive. The more you can do on your own, the less in fee's you'll accumulate.
Re:jQuery.payment by ux-app on Thursday February 07, 2013 @05:22PM (#5184914)
This is the reason why I don't like doing any client side validation of card data (beyond the basic check for empty fields).

I would much rather incur a 2-3sec browser roundtrip by posting raw payment details to my bank/gateway and allowing them to do the validation (they're presumably much better at it than I am).

Doing client side validation is too error prone, and considering that accepting card data is done so rarely, the (minimal) performance gain of JS validation isn't worth the risk of rejecting good data by accident.

Re:jQuery.payment by alttab on Thursday February 07, 2013 @06:08PM (#5185131)
You, but whatabout a laymen user who doesnt care ehat your justifications are? They want people to build snappy mobile web apps. This creates competition and legitimacy for them
Re:jQuery.payment by ux-app on Thursday February 07, 2013 @09:43PM (#5186007)
Not really sure what point you're making. Validating on the server will incur a 2-10sec penalty once when entering payment data... the rest of your app is unaffected.
Re:jQuery.payment by reaclmbs on Thursday February 07, 2013 @10:27PM (#5186128)
You have to pay for failed authorization attempts
Re:jQuery.payment by ux-app on Thursday February 07, 2013 @10:49PM (#5186190)
Do you mean pay money for each auth attempt?? I've never heard of such a charge. Maybe time for a new gateway/bank?
Re:jQuery.payment by saikat on Friday February 08, 2013 @01:03PM (#5189175)
You actually don't pay for failed auth attempts with Stripe, but you do with most other gateways.
Re:jQuery.payment by jimktrains2 on Saturday February 09, 2013 @11:13AM (#5192901)
I wrote a blog post about credit card numbers and how they're processed for a quick intro to the topic: http://jimkeener.com/posts/everyday-numbers-1