Repository navigation
fix: prorate subscription upgrades in the local and e2e stores - #29
Merged
vitormattos merged 1 commit intoNov 14, 2026
Merged
Conversation
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
vitormattos
approved these changes
Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
The store does not prorate subscription switches (
woocommerce_subscriptions_apportion_recurring_priceisno), and the E2E seed mirrored that. An upgrade order is created with a total of 0, so a customer moves to a bigger plan, and gets its quota in Nextcloud, without paying anything until the next renewal. Combined with a downgrade before the renewal, the bigger plan can be used every cycle at the price of the smaller one.What changed
woocommerce-subscriptionsentry indocker-compose.override.ymlsetswoocommerce_subscriptions_apportion_recurring_pricetoyes-upgradein itspost_install_commands, so local environments and the E2E stack charge the prorated difference on upgrades.The production store needs the same setting (WooCommerce > Settings > Subscriptions > Prorate Recurring Payment: "Prorate upgrades").
How it was verified
saas-e2estack built from scratch: 14 passed.noon the same stack, the upgrade test fails on the new total assertion (received 0).Based on #28, which adds the
post_install_commandsofwoocommerce-subscriptionsthis option is set in.