-
Notifications
You must be signed in to change notification settings - Fork 36
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
The cancelled date must occur after the last payment date. #667
Comments
Thanks for the report, @franmastromarino. This error is definitely possible but generally shouldn't happen, and I find that I am unable to replicate it (unless I take special steps to contrive it). Is there any other context we should know about, and can you or were you able to replicate this when only running WooCommerce Subscriptions alongside WooCommerce, and without any other plugins (except perhaps for a payment gateway)? |
Hello @barryhughes, I'm unable to intentionally reproduce this issue, but it continues to occur. I've reached out to their support team regarding this issue, but they haven't been able to resolve it. Let me know if you have any insights. |
This is the order notes record: Unable to change subscription status to “cancelled”. Exception: Subscription #261184: The cancelled date must occur after the last payment date. November 12, 2024 at 1:18 pm [Delete note] Order [#298717] created to record renewal. November 11, 2024 at 9:52 pm [Delete note] Subscription cancelled by the subscriber from their account page. October 4, 2024 at 10:46 am [Delete note] Status changed from Active to Pending Cancellation. October 4, 2024 at 10:46 am [Delete note] Subscription activated by paddle webhook. November 12, 2023 at 1:18 pm [Delete note] Status changed from Pending to Active. November 12, 2023 at 1:18 pm [Delete note] Status changed from Pending to Active. November 12, 2023 at 1:18 pm [Delete note] Payment status marked complete. November 12, 2023 at 1:18 pm [Delete note] Subscription created on Paddle. November 12, 2023 at 1:18 pm [Delete note] |
OK ... and, in case there's anything further you can share, is there any more information about that (did you find that deactivating it seems to solve the problem, or do you see something in their code that is a pretty strong hint)? Unfortunately, it doesn't seem to be openly available, so we can't see the code or do any testing around it ourselves. |
@franmastromarino: just checking back in! Did you get any further in your conversation with the Paddle team? Note to our future selves: regardless of the situation with Paddle, we should probably locate instances where this exception can be raised but is not caught, and add a try/catch structure to ensure elegant handling everywhere. |
Note
When an attempt is made to cancel a subscription, an exception may be raised with a message like:
Subscription #12345: The cancelled date must occur after the last payment date.
In some cases these are handled gracefully, but it seems there may be cases where we lack the protection of a try/catch block ... probably we should address those. Original report follows.
Describe the bug
When attempting to cancel a subscription, the system throws an error with the message: Subscription #254461: The cancelled date must occur after the last payment date. This issue prevents the subscription from being cancelled through the WooCommerce Subscriptions plugin.
To Reproduce
Go to the WooCommerce Subscriptions page in the WordPress admin panel.
Attempt to cancel a subscription (e.g., Subscription #254461).
Observe the error message that appears: The cancelled date must occur after the last payment date.
Expected behavior
The subscription should be cancelled without any errors as long as the cancellation date is set correctly.
Actual behavior
The system throws an error stating that the cancellation date must occur after the last payment date, even when this condition is met. This prevents the cancellation from being processed.
Product impact
Does this issue affect WooCommerce Subscriptions? Yes
Additional context
WooCommerce Subscriptions plugin version: 6.6.0
WordPress version: 6.6
System status report: Available upon request
`(
[message:protected] => Subscription #254461: The cancelled date must occur after the last payment date.
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => /home/1253731.cloudwaysapps.com/gqeuensvmq/public_html/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php
[line:protected] => 2581
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /home/1253731.cloudwaysapps.com/gqeuensvmq/public_html/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php
[line] => 1358
[function] => validate_date_updates
[class] => WC_Subscription
[type] => ->
)
The text was updated successfully, but these errors were encountered: