PayPal Buttons giving 1 day less than 1 year (probably due to leap year)

I use PayPal Buttons (for both new members and renewals) that include the following shortcode:

rp=“1” rt=“Y” rr=“BN”
(i.e. Buy Now buttons for a 1 year membership)

However, recently these have started giving 1 day less than 1 year. So, for example, if a new member purchases a 1 year membership on (say) 04/03/2019 at 1pm, then their EOT will be 03/03/2020 at 1pm.

I’m guessing that this is due to the fact that next year is a leap year (i.e. with a leap day on 29/02/2020). In other words, it appears that the button (or PayPal) assumes that 1 year = 365 days, which gives an incorrect EOT when this period includes a leap day.

At the moment I’m having to manually adjust every new membership (or renewal), which is a pain. I’m guessing that a temporary fix would be for me to change the above button to the following:

rp=“366” rt=“D” rr=“BN”

However, this wouldn’t be a great solution, as it would mean that the opposite problem would occur next year when we get past the leap day (i.e. members would start getting 1 day more than 1 year, etc).

Any ideas whether this problem is with s2Member or PayPal? If the former, any chance that there might be a fix soon please?

Thanks,
Steve

Hi Steve.

Yeah, this would be my guess as well. It’d be an issue with PayPal, not s2. The “Y” value is theirs, not calculated by s2. You could contact PayPal and tell them about this, maybe they’ll fix it in their system.

My workaround for this would be to add another day, either as you said, or in the Grace Time setting for the EOT. WP Admin > s2Member > PayPal Options > Auto EOT Behavior > EOT Grace Time

Next year you can change it back, or just leave it; letting the user have one more day would usually not be a problem.

:slight_smile:

Thanks - that’s very helpful.

1 Like