feat: support for WooPayments as a payment gateway #3494
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:
Adds support for payment gateways beyond Stripe in the Reader Revenue > Payment Methods dashboard page. This PR adds WooPayments as a first-party payment gateway option and upgrades this plugin to Newspack's list of "managed" plugins that can be auto-installed in one click.
Because the Transaction Fee options apply to both Stripe and WooPayments gateways, these options have been moved outside of the Stripe component, as well as the data payload for Stripe, and into its own component/endpoints.
This PR also updates the UI shown under "Reader Revenue" during the setup wizard. Previously, this component showed the Donation amounts UI, plus the UI to input Stripe API keys. Now, this component will show the platform selector plus the Donation amounts UI (this is so we can at least show something—otherwise if you get to the screen and you hadn't already installed Woo and Woo Subscriptions plugins, this component would be totally empty).
Lastly, this PR removes the plugin installer component shown if the required payment gateway plugin isn't installed or active on your site. Since our handler to enable plugin gateways will automatically install and activate the required plugin if it's missing, this is an unnecessary UI step.
How to test the changes in this Pull Request:
Other information: