Simple credit card generator/validator. Need a valid credit card number to sign up on a site but you don't want to use your real card? Need to validate your customers credit card?
- Generates a valid number (per country/type)
- Get information for a number
- Check validity of a number
gem install credy
credy generate --country au --type visa
credy infos 5108756163954799
credy validate 5108756163954799
options {
country: 'au',
type: 'mastercard'
}
Credy::CreditCard.generate options
Credy::CreditCard.infos '5108756163954799'
Credy::CreditCard.validate '5108756163954799'
At the moment, only a few types and countries are (partially) supported.
americanexpress
: American Expressbankcard
: Bankcardchina-unionpay
: China UnionPaydiners-club-carte-blanche
: Diners Club Carte Blanchediners-club-enroute
: Diners Club enRoutediners-club-international
: Diners Club Internationaldiners-club-us-ca
: Diners Club United States & Canadainstapayment
: InstaPaymentjcb
: JCBlaser
: Lasermaestro
: Maestromastercard
: Mastercardsolo
: Soloswitch
: Switchvisa
: Visavisa-electron
: Visa Electron
au
: Australiaca
: Canadafr
: Francepl
: Polandes
: Spainch
: Switzerlanduk
: United Kingdomus
: United States
- Add more data (see the Data source section)
- Remove luhn validation for China UnionPay and Diners Club enRoute
All data is coming from the Bank card number page and the now deleted List of Issuer Identification Numbers on Wikipedia. I do not assume the responsibility for wrong data.
Credy is released under the MIT License.