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

Card validation method does not work properly #8

Open
petrnohejl opened this issue Apr 22, 2014 · 2 comments
Open

Card validation method does not work properly #8

petrnohejl opened this issue Apr 22, 2014 · 2 comments

Comments

@petrnohejl
Copy link

Method Card.isValid() does not work:

  • If I set expiration month to 13, it returns true
  • If I set expiration year to some past value, e.g. 2012, it returns true
@petrnohejl
Copy link
Author

Method Card.isExpired() seems to be wrong.

This code makes no sense:

if (expirationMonth > 12 || expirationYear < 1) { return false; }

Probably should be:

if(expirationMonth > 12 || expirationMonth < 1) return true; // true means invalid/expired

Btw, second line in following code is useless, because Calendar.getInstance() returns current date.

Calendar cal = Calendar.getInstance();
cal.setTime(new Date()); // this is useless

@remear
Copy link
Contributor

remear commented Apr 22, 2014

@petrnohejl Yes. it should return true. Would you like to open a pull request to make these changes?

ezekielbuchheit pushed a commit to ezekielbuchheit/balanced-android that referenced this issue Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants