-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix(wcs): expire manual subscriptions after on-hold duration #3681
fix(wcs): expire manual subscriptions after on-hold duration #3681
Conversation
cd01202
to
5ad8924
Compare
2e0a4a7
to
3e0061b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as described.
I tested one other thing I'm not sure if there's an issue there or not.
While the subscription is on hold, and there's a scheduled action to expire it, if an admin manually sets the subscription as Active again it won't delete the scheduled action.
However, when that action runs, it won't expire the subscription because it's active, so no idea if it's a problem or not. thoughts? But if it goes to on hold again, then it will be expired...
Also, the expiration date is set to 7 days + on hold duration + the next payment date. So if I process a renewal but they still have 15 paid days, there will be an extra 15 days there... All good, just highlighting because it was different from the testing instructions
Thanks for the review on this one as well @leogermani!
Yeah. I purposefully made the scheduled action do nothing if the subscription is not on-hold to account for any scenarios where the admin wants to handle a subscription manually. I also am only removing the scheduled action only when a successful payment is made to account for any strange situations where an admin changes a subscriptions status multiple times with the final change being on-hold. My assumption here is, if a payment isn't made and the subscription is on-hold by the time we reach the end of the total grace period, we should expire. WDYT?
Ah. I think what you've written here is the expected behavior. My bad. The reader should not lose any time on their subscription when it is renewed early. |
LGTM |
Hey @chickenn00dle, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
# [5.13.0-alpha.1](v5.12.2...v5.13.0-alpha.1) (2025-01-23) ### Bug Fixes * add supported gateways check ([#3650](#3650)) ([74f7773](74f7773)) * **corrections:** replace deprecated sanitize method ([#3694](#3694)) ([ce50e24](ce50e24)) * remove support for legacy form checkout ([#3691](#3691)) ([46a3c16](46a3c16)) * **wcs:** expire manual subscriptions after on-hold duration ([#3681](#3681)) ([658416c](658416c)) ### Features * add custom bylines ([#3667](#3667)) ([3f45a6f](3f45a6f)) * rate limit checkout attempts ([#3678](#3678)) ([d275524](d275524))
🎉 This PR is included in version 5.13.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Part of https://app.asana.com/0/1200550061930446/1209066781737999/f
This PR adds a new scheduled action to expire manual subscriptions after the specified on-hold duration:
How to test the changes in this Pull Request:
newspack_expire_manual_subscription
events that are scheduled to run X days after the next payment date, where X is what you have set as your site's on-hold duration (WooCommerce > Settings > Subscriptions > On-hold Duration) plus 7 daysnewspack_expire_manual_subscription
actionOther information: