jQuery.payment
stripe.com
stripe.com
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.
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.
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.
What is there to be embarrassed about? Seriously.
I've never seen such a term. Have any examples?
All card validation must be server side.
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.
Original Message: The card number is not linked to the CVV length:
343725117665768 is a valid american express number (generated from http://www.getcreditcardnumbers.com/)
Their CVV numbers are 4 digits, yet the inputs
343725117665768
12 / 21
123
seems to pass ...EDIT: filed issue: https://github.com/stripe/jquery.payment/issues/1
$.validateCardCVC('1234', 'amex');
More at https://github.com/stripe/jquery.payment.(I'm aware I can use jQuery on the server-side, but why load jQuery only for a credit card number validation library?)
Other than that, this looks good. :)
As long as your customer problems are not about low fees or ACH, that is.
Secondly, remember this is for credit card expirations and not normal dates. You can probably make an assumption that 11/30 (November 2030) isn't currently valid input either. I have never seen an expiration date further than 10 years in the future. Although more research on the topic would be needed to figure out the true restrictions.
Failed to load resource: the server responded with a status of 403 (Forbidden) https://raw.github.com/stripe/jquery.payment/master/lib/jquery.payment.js
Uncaught TypeError: Object [object Object] has no method 'formatCardNumber' jquery-payment:50I don't immediately how much is just how that form was constructed vs. what's done in the JS lib.