Skip to content

Conversation

lucasdotvin
Copy link
Owner

This pull request introduces a fix to the renew method in the Subscription model to handle cases where the expirationDate is null, and adds new test cases to ensure the behavior is correctly validated. The changes improve the robustness of subscription renewal logic, particularly for plans with grace days but no periodicity.

Fix to subscription renewal logic:

  • src/Models/Subscription.php: Updated the renew method to include a conditional check ensuring that grace days are only calculated if an expirationDate is provided. This prevents potential errors when the expirationDate is null.

New test cases for subscription renewal:

@lucasdotvin lucasdotvin self-assigned this Jul 24, 2025
@lucasdotvin lucasdotvin added the bug Something isn't working label Jul 24, 2025
@lucasdotvin lucasdotvin merged commit 55c47f7 into main Jul 24, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant