Skip to content
This repository has been archived by the owner on Feb 16, 2018. It is now read-only.

tent/zebra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Zebra

magnetic_stripe_prototype

An alternative to Stripe.js for card validation and token creation.

Heavily based off of stripe/jquery.payment.

This library uses CORS for the token creation.

Usage

Zebra.formatCardNumber("4242424242424242") //=> "4242 4242 4242 4242"
Zebra.cardType("4242 4242 4242 4242") //=> "visa"
Zebra.cardName("4242 4242 4242 4242") //=> "Visa"
Zebra.validateCardNumber("4242 4242 4242 4242") //=> true
Zebra.validateCardExpiry("12", "2050") //=> true
Zebra.validateCardExpiry("12", "50") //=> true
Zebra.validateCardExpiry("14", "2050") //=> false
Zebra.validateCardCVC("123") //=> true
Zebra.validateCardCVC("123", "amex") //=> true
Zebra.validateCardCVC("1234", "amex") //=> true
Zebra.validateCardCVC("12345") //=> false
Zebra.createToken({
	api_key: "YOUR_SECRET_KEY",
	number: "4242 4242 4242 4242",
	exp_month: "12",
	exp_year: "2050",
	cvc: "123",
	name: "Alex Smith" // name is optional
}, function (res, xhr) {});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published