feat: add cli command to fix stripe covered fees #2848
Merged
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.
All Submissions:
Changes proposed in this Pull Request:
Since #2820 we use an actual woocommerce Fee to add the Stripe fee to the order. Before that, we would manually add the fee to the order total if a metadata was present.
We didn't take into account the need to update existing subscriptions so that renewal orders will also get the fee added. (we assumed they would copy from the Sub's parent order, but they don't).
This PR adds a CLI command to migrate the subscriptions that had fees added the old way to the new way.
It's a CLI command because it should affect few subscriptions in a few sites.
How to test the changes in this Pull Request:
git checkout v2.12.0
wp newspack-woocommerce list_subscriptions_missing_fee
should list the subscriptionwp newspack-woocommerce fix_subscriptions_missing_fee --dry-run
should output what the fix will look likewp newspack-woocommerce fix_subscriptions_missing_fee
should fix itOther information: