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 date validation #572

Closed
emidev98 opened this issue Dec 3, 2020 · 2 comments
Closed

Credit Card date validation #572

emidev98 opened this issue Dec 3, 2020 · 2 comments
Assignees

Comments

@emidev98
Copy link

emidev98 commented Dec 3, 2020

Describe the bug
Dear Adyen Team, we spotted that it's possible to use a invalid date for the date field and it returns that it's valid.
image

Additional context
The library version is 3.17

@sponglord
Copy link
Contributor

sponglord commented Dec 7, 2020

Hi emidev98,
This is, in fact, correct behaviour. The credit card issuer's state that a credit card that is out of date can still be valid as long as it is not too far out of date.
In checkout we check that the expiry date isn't more than 30 years in the future (15 years prior to release v3.8.1) and isn't more than 3 months in the past. This is the short answer.
The long answer is that the expiry date can actually be 3, to almost 4, months in the past:

  • For the past we look at full months, disregarding the current, incomplete month.
    So if, for example, the date is March 29: the month is not yet over - so we count 3 months from, and including, the previous full month. So February, January & December 2019.
    This means that on March 29, 2020 you could type an expiry date of 12/19 and it would be considered valid. This is almost 4 months in the past.
    By April 1, 2020 however when we count 3 full months in the past (March, February, January) then an expiry date of 01/20 will be valid and anything before that won't. This is only 3 months in the past.

@emidev98 emidev98 closed this as completed Dec 7, 2020
@emidev98
Copy link
Author

emidev98 commented Dec 7, 2020

Thank you very much for the clarifications!

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