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

Minimum cancellation date is always +1 day from what you set it to #177

Closed
seand7565 opened this issue Dec 11, 2020 · 1 comment
Closed

Comments

@seand7565
Copy link
Contributor

# app/models/solidus_subscriptions/subscription.rb

(actionable_date - SolidusSubscriptions.configuration.minimum_cancellation_notice).future?

If your minimum_cancellation_notice is set to one day, I would expect to not be able to cancel on the same day as the actionable_date, but I should be able to cancel the day before. However, because of the above code, I can't cancel on the day the subscription processes or the day before, effectively making the minimum cancellation notice 2 days, even though it's set as one.

(Date.tomorrow - 1.day).future?
# => false

Additionally, if you don't want a minimum_cancellation_notice, you would expect to be able to set it to 0.days. However, that still gives you a one day minimum cancellation notice.

(Date.today - 0.days).future?
# => false

Instead of checking if the date is in the future, it should also return true if the date is today.

seand7565 added a commit to seand7565/solidus_subscriptions that referenced this issue Dec 11, 2020
Previously, the cancel method would add one day to your
minimum_cancellation_date. This updates that! More info here:
solidusio#177
@seand7565
Copy link
Contributor Author

Fixed with #178

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

1 participant