Stripe, one of the leading API-for-payments startup who in May of this year was in talks for new founding at a $5 billion valuation keeps their efforts to collaborate to the open source community. This time, we are introducing jQuery.payments, a general purpose library for building credit card forms, validating input, and formatting numbers. This library is behind a lot of the functionality in Stripe’s checkout page.
The small plugin was introduced to the community in early 2013, but the success of this library kept the community and the folks at Stripe motivated to keep this library up to date and in continuously development.
- $.fn.payment(‘formatCardNumber’) – Formats credit cards numbers
- $.fn.payment(‘formatCardExpiry’) – Formats credit card expiry
- $.fn.payment(‘formatCardCVC’) – Formats credit card CVC
- $.fn.payment(‘restrictNumeric’) – General numeric input restriction
- $.payment.validateCardNumber(number) – Validates a credit card number
- $.payment.validateCardExpiry(month, year) – Validates a credit card expiry
- $.payment.validateCardCVC(cvc, type) – Validates a credit card CVC
- $.payment.cardType(number) – Returns a credit card type
- $.fn.payment(‘cardExpiryVal’) – Parses a credit card expiry in the form of MM/YYYY, returning an object containing the month and year
If you are planning on adding some kind of payment functionality on your website and need to test credit card inputs, you can visit GetCreditCardNumbers.com and get unlimited valid credit card numbers for testing purposes.