Maximum Year in Expiry Date of Credit Card

前端 未结 10 889
情话喂你
情话喂你 2021-01-30 02:30

Various online services have different values for maximum year of expiry, when it comes to Credit Cards.

For instance:

  • Basecamp: +15 years (2025)
10条回答
  •  悲哀的现实
    2021-01-30 03:28

    As a theoretical upper limit, I propose that you do not need to consider more than the expected lifespan of the cardholder. Wikipedia does this in their editorial standards for biographies of living persons:

    Any individual born less than 115 years ago is covered by this policy unless a reliable source has confirmed the individual's death. People over 115 years old are presumed dead unless listed at oldest people.

    So, in your code, look up the current year, add 115, and use that as your theoretical upper limit to the credit card expiration date. You'll never have to touch that code again.

提交回复
热议问题