-
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
Detect multiple enabled payment methods of the same type #8513
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: +487 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
349854f
to
f3de0a6
Compare
1343fda
to
d0854b0
Compare
…into add/duplicates-detection
82a59a6
to
18d0e08
Compare
18d0e08
to
5e1741a
Compare
@mdmoore I added an optimization in e6a5165 which allows to share the state of dismissed notices between |
934dfbd
to
e6a5165
Compare
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.
This all LGTM! Only one minor comment about an unused useState
hook which GH pointed out.
✅ Navigate to Payments settings and confirm there's an inline notice under credit card payment method. Review extensions should open the WooCommerce payment settings page
✅ Enable any other payment method from APMs list. You can use Klarna gateway to check with Klarna or Stripe for any other payment method.
Confirm that the notice appears.
✅ Test the scenario when a payment method is enabled in three different places, including WooPayments. At this point, you will see the notice. However, if we disable payment method by WooPayments, the notice should disappear, although it's still enabled by two other plugins. The goal is to show the notice only if WooPayments is part of the plugins group that introduce a duplicate.
✅ Check Apple Pay/Google Pay by enabling them e.g. under Stripe gateway and checking if the notice appears. Stripe gateway allows PRBs to be enabled with both disabled and enabled CC, and both use-cases should be covered by this PR.
✅ Dismiss any notice and confirm that it's not shown after closing. Refresh the page and confirm no notice is present.
✅ Confirm that notice is handled separately, meaning that only part of the notices can be dismissed. After such action, the rest should still be present on the page.
All is testing well and I have no critiques here. 🚢
Closes #8384
Changes proposed in this Pull Request
This PR is the first iteration of the feature which should help merchants identify payment methods of the same type that are enabled by multiple plugins. It implements the simple solution mentioned in paJDYF-ck0-p2. The inline notice pops up under the payment method and can be dismissed. Once dismissed, it won't appear again upon page refresh.
For testing steps outlined below, you can use multiple plugins. During development, I used WooPayments, Mollie, Stripe and Klarna). If you'd like to quickly setup Mollie, contact @timur27 for test API keys which hopefully will save you a bit of time. For more inspiration on which plugins you could use, please see paJDYF-ck0-p2#comment-23134 which refers the duplicates data.
Testing instructions
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