-
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
Ensure every gateway has individual settings object #8361
Conversation
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: 0 B Total Size: 1.27 MB ℹ️ View Unchanged
|
8820114
to
d940780
Compare
…into fix/gateway-individual-settings
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.
Thanks for this quick and neat fix. Does exactly what it says on the tin; cannot replicate any of the error messages or email spam as indicated in the original issue. LGTM.
Co-authored-by: Timur Karimov <[email protected]>
Closes #8349
Changes proposed in this Pull Request
A few weeks ago, we started to register all known payment methods in WooCommerce during plugin initialization. This was done for our system to work correctly as WooCommerce expects all gateways (even enabled ones) to be registered.
After that change, multiple third-party actors (WooCommerce and WooCommerce Blocks) started to behave differently, by introducing two new symptoms: spamming with emails after WooPayments plugin gets enabled, and spamming with incompatible payment methods in Blocks editor.
All this happens because we are now treating gateways separately, while still keeping settings for them in the centralized settings option.
This PR ensures that every gateway has its own settings object, which eventually resolves all the problems mentioned in #8349.
While this solution is the fix, the design of settings options still requires improvements, by e.g. ensuring the
enabled
property is in line with gateway's status and by e.g. removing the array with enabled UPE methods since we now have separate settings withenabled
flag. Those are improvements unrelated to #8349 and I'll make sure we act there as well, but separately.Testing instructions
Create a new JN site. As WooPayments plugin, use this version.
Pages
in the admin panel and make sure the warning about incompatible gateways (screenshot here) is not presentWooCommerce -> Settings -> Payments
), refresh the page and confirm the disablement status is still in placenpm 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