Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credit card validation #422

Closed
jnordberg opened this issue Sep 7, 2014 · 5 comments
Closed

Credit card validation #422

jnordberg opened this issue Sep 7, 2014 · 5 comments
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@jnordberg
Copy link

Credit card validation is one of those things where regex does not quite cut it. joi.string().creditcard() perhaps?

References:

http://en.wikipedia.org/wiki/Luhn_algorithm
http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=39698

@arb
Copy link
Contributor

arb commented Sep 16, 2014

How do you envision this working? Is the use case "Make sure this number is really a Visa" or is it more along the lines of "Is the number a real credit card number"?

@jnordberg
Copy link
Author

I was initially just thinking a luhn check on the card number string. But maybe allowing the .creditcard() to accept an optional array of valid card types could be useful.

https://github.com/observing/creditcard/blob/master/docs/README.md

@hueniverse
Copy link
Contributor

I will take a simple and dependency free pull request, but this is such a special case feature that I don't want to go out of my way to support it. There is so much more to validating CCs.

@Marsup
Copy link
Collaborator

Marsup commented Nov 3, 2014

Fixed by #469.

@Marsup Marsup closed this as completed Nov 3, 2014
@hueniverse hueniverse added this to the 4.8.0 milestone Nov 3, 2014
@hueniverse hueniverse added feature New functionality or improvement and removed request labels Sep 19, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

4 participants