Skip to content

fix: prorate subscription upgrades in the local and e2e stores - #29

Merged
vitormattos merged 1 commit into
fix/pin-cloned-sourcesfrom
fix/prorate-subscription-upgrades
Nov 14, 2026
Merged

vitormattos merged 1 commit into
fix/pin-cloned-sourcesfrom
fix/prorate-subscription-upgrades

Conversation

@YvesCesar

Copy link
Copy Markdown
Member

What was wrong

The store does not prorate subscription switches (woocommerce_subscriptions_apportion_recurring_price is no), 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

  • The woocommerce-subscriptions entry in docker-compose.override.yml sets woocommerce_subscriptions_apportion_recurring_price to yes-upgrade in its post_install_commands, so local environments and the E2E stack charge the prorated difference on upgrades.
  • The E2E seed no longer sets the option, so the stack uses the value from the override.
  • The upgrade test checks that the switch order total is greater than zero before checking the subscription and the Nextcloud quota.

The production store needs the same setting (WooCommerce > Settings > Subscriptions > Prorate Recurring Payment: "Prorate upgrades").

How it was verified

  • Playwright suite on the saas-e2e stack built from scratch: 14 passed.
  • With the option set back to no on the same stack, the upgrade test fails on the new total assertion (received 0).

Based on #28, which adds the post_install_commands of woocommerce-subscriptions this option is set in.

Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
@vitormattos
vitormattos merged commit b75de1f into fix/pin-cloned-sources Nov 14, 2026
2 checks passed
@vitormattos
vitormattos deleted the fix/prorate-subscription-upgrades branch November 14, 2026 16:32
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

Successfully merging this pull request may close these issues.

2 participants