-
Notifications
You must be signed in to change notification settings - Fork 69
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
Update Subscriptions with WooPayments eligibility as we move to deprecate this functionality #7238
Update Subscriptions with WooPayments eligibility as we move to deprecate this functionality #7238
Conversation
…cpay subscriptions
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: -1 B (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
* @see WC_Payments_Features::is_wcpay_subscriptions_eligible() for eligibility criteria. | ||
*/ | ||
public static function maybe_disable_wcpay_subscriptions_on_update() { | ||
if ( WC_Payments_Features::is_wcpay_subscriptions_enabled() && ! WC_Payments_Features::is_wcpay_subscriptions_eligible() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we need to change this to also disable this feature if the Woo Subscriptions plugin is active.
Imagine there's a site that has used WCPay Subscriptions in the past, installed Woo Subscriptions, if they deactivate Woo Subscriptions do we want them to automatically switch to using WCPay Subscriptions feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In line with the discussion here (p1695182789067919/1695179380.867469-slack-C055WHLA98D), Brent agrees and we'll disable the WCPay Subscriptions feature if its enabled and the Woo Subscriptions plugin is already active at the time of next WooPayments update.
… enabled at the time of next update
I ran through the following scenarios when testing this PR:
In terms of the impact of these changes. The result should be:
I'll need to see what impact this has on GlobalStep testing. I suspect this change might disable this feature preventing them from testing WCPay subscription flows in the critical flows. |
The critical flows testing instructions specially asks the tester to enable the WCPay subscriptions feature via the dev tools plugin: https://github.com/Automattic/woocommerce-payments/wiki/WC-Pay-Subscriptions-critical-flows-testing-instructions#enable-wc-pay-subscriptions This means that even though this setting is being removed and deprecated Global step can still access this feature for testing via dev tools. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 0e8dfb6 I've pushed up a change which moves the disabling of the legacy WCPay Subscriptions feature to the main payments class to fix an issue where if you had the legacy wcpay subscription feature enabled & Woo Subscriptions activated with no Stripe Billing subscriptions, the feature was not being disabled.
This was because this code was inside a class that was no longer loading.
On the latest changes I've ran through the following checks:
- WCPay subscriptions previously enabled
- Disabled for stores with no products or subscriptions.
- Left enabled for stores with at least 1 product.
- Left enabled for stores with at least 1 subscription.
- Disabled on sites with at least 1 Stripe Billing Subscription but Woo Subscriptions enabled.
- Disabled on sites with no Stripe Billing Subscriptions but Woo Subscriptions enabled.
- WCPay subscriptions previously disabled - no change.
Worth noting we also discussed hooking onto the Woo Subscriptions plugin activation and disabling the WCPay Subscriptions feature there as well however we couldn't find a clean way to hook onto that event so we're going to leave it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@james-allan as we discussed, I've moved the code which used the WooPayments updated hook to now be inside the main payments class and ran through all of the checks again to confirm we're turning off the legacy WCPay Subscriptions feature correctly.
Approving this to be merged.
Note
This PR reintroduces the changes made in #7117 that were reverted in #7194 when it was decided that deprecating the WCPay Subscriptions feature would come in the next release.
Fixes #6510
Changes proposed in this Pull Request
As part of the Subscriptions Primary Offering project, we need to deprecate the existing WCPay Subscriptions feature so that merchants can opt into the new subscriptions setting.
In this PR we are updating the eligibility of the WCPay Subscriptions so that we:
To meet these new requirements I've changed
is_wcpay_subscriptions_eligible()
to only return true when:Testing instructions
Testing this PR requires toggling the following:
_wcpay_subscription_id
metadata)With that information, here are the testing instructions to toggle through most of the new eligibility cases:
_wcpay_subscription_id
to something like_wcpay_subscription_id_test
_wcpay_subscription_id
meta.With these instructions I have tested the following cases:
__wcpay_subscriptions_id
meta (including pending, canceled, on-hold etc.)npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge