Skip to content

lowik/stripe.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Why?

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.

Available functions

  • cardType
  • formatCardNumber
  • formatExpiry
  • validateCardNumber
  • validateExpiry
  • validateCVC

See Stripe.js doc

Usage

import { cardType, formatCardNumber } from 'stripe.js';

const type = cardType('4242424242424242');
// type === 'visa'

const formattedCardNumber = formatCardNumber('4242424242424242');
// formattedCardNumber === '4242 4242 4242 4242'

Install

$ npm install stripe.js --save

About

Partially stripe.js (https://stripe.com/docs/stripe.js) node version

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors