Stripe is an amazing payment solution.
Stripe.js can be used to collect credit card details easily. But Stripe.js also has built-in validators to check the format of credit card, CVC, bank account, and routing numbers, as well as a card's type and expiration. However, Stripe.js is only available for the browser with script tag inclusion (and as global variable "Stripe").
The projet stripe-node is the Stripe API wrapper for node.js but do not export the Stripe.js usefull functions. It's the goal of this project.
This project only export some usefull jquery.payment functions. If you use jquery, you can use jquery.payment directly. See related thread stripe/stripe-node#228 for more details.
- cardType
- formatCardNumber
- formatExpiry
- validateCardNumber
- validateExpiry
- validateCVC
See Stripe.js doc
import { cardType, formatCardNumber } from 'stripe.js';
const type = cardType('4242424242424242');
// type === 'visa'
const formattedCardNumber = formatCardNumber('4242424242424242');
// formattedCardNumber === '4242 4242 4242 4242'
$ npm install stripe.js --save