Skip to content
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

feat(reader-revenue): make NYP and Stripe Gateway optional #2866

Merged
merged 11 commits into from
Feb 6, 2024

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Jan 19, 2024

All Submissions:

Changes proposed in this Pull Request:

Along with Automattic/newspack-blocks#1645, removes requirements for both WooCommerce Name Your Price and WooCommerce Gateway Stripe plugins. The Newspack Reader Revenue platform and Donation/Checkout Button blocks can now be used without these plugins, as long as all products have a set price and at least one payment gateway valid for subscriptions is enabled.

Closes 1206098184615535/1206328415142056.

How to test the changes in this Pull Request:

  1. Before checking out this branch, make sure you have Reader Revenue fully set up with the Newspack platform and a page containing several Donate blocks:
  • Frequency-based Donate block, not manually configured
  • Frequency-based Donate block, manually configured and set to show tiered suggestions
  • Tiers-based Donate block
  1. Check out this branch and feat(reader-revenue): make NYP and Stripe Gateway optional newspack-blocks#1645. Before doing anything else, smoke test Reader Revenue wizard pages and the Donate blocks in both the editor and on the front-end—all should function as usual.
  2. Deactivate the WooCommerce Name Your Price and WooCommerce Gateway Stripe plugins.
  3. In WP admin, visit Newspack > Reader Revenue. Confirm that in the Platform, Stripe Gateway, and Donation platforms, you no longer see a plugin requirement message for these plugins. Make sure Stripe remains disabled in Stripe Gateway. Note: you may want to enable another non-Stripe payment gateway in WooCommerce > Settings > Payments so that you can still complete test transactions. "Check" payments will work in a pinch.
  4. In The Donations page, confirm that the settings page no longer allows you to choose between Tiered and Untiered mode, and that the settings are locked in Untiered mode (no NYP = no tiers because basic Woo can't modify the product pricing on the fly like with NYP).
  5. Update the suggested values here and hit "Save Settings". Visit the Products admin page and confirm that the set prices for each Donate product are updated according to your settings (this isn't the case in master, but is important when not using NYP as all products must have set prices in order to be purchasable without NYP).
  6. Edit the page containing your Donate blocks from step 1. Confirm that:
  • The Tiers-based block has reverted to a frequency-based layout
  • All blocks no longer have the "Configure Manually" option or sub-options (manual settings are not applicable when NYP isn't available)
  • The manually-configured block has reverted to the same settings and prices as the non-manual block
  • The inputs are no longer editable but simply display as static/flat prices, e.g.:
Screenshot 2024-01-19 at 12 33 13 PM
  1. View the page on the front-end and confirm that the front-end blocks look the same as in the editor.
  2. Test all three block styles (Default, Alternate, and Minimal) and confirm they all work in both the editor and on the front-end.
  3. On the front-end, complete a donation using one of the blocks. Note that you won't be able to purchase subscriptions unless you enable one of the supported payment gateways, but you should be able to complete a one-time purchase with a Check payment.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo added the [Status] Needs Review The issue or pull request needs to be reviewed label Jan 19, 2024
@dkoo dkoo self-assigned this Jan 19, 2024
@dkoo dkoo requested a review from a team as a code owner January 19, 2024 20:59
@dkoo dkoo changed the title Fix/optional nyp stripe gateway feat(reader-revenue): make NYP and Stripe Gateway optional Jan 19, 2024
Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested well on my local instance and on a fresh JN site.

Non-blocking, it would be nice to have a message in the "Stripe settings" tab if the Stripe gateway is not enabled. Possibly even disable the form, since it's not an available feature without the gateway plugin.

There's also a failing test that appeared after rebasing.

@dkoo dkoo requested a review from a team January 26, 2024 21:37
@chickenn00dle chickenn00dle self-requested a review January 26, 2024 22:24
Copy link
Contributor

@chickenn00dle chickenn00dle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and looks good @dkoo

Just one observation that is not a blocker. Now that stripe is no longer a required plugin, I'm wondering why we need to keep the stripe settings menu in the RR wizard?

Screenshot 2024-01-29 at 15 17 57

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Jan 29, 2024
@dkoo
Copy link
Contributor Author

dkoo commented Jan 29, 2024

Thanks, @chickenn00dle!

Now that stripe is no longer a required plugin, I'm wondering why we need to keep the stripe settings menu in the RR wizard?

Great question! Stripe in this context actually means the Stripe payment gateway for WooCommerce. Since it's still the overwhelmingly dominant payment processor for Woo sites, we offer some important settings for it here. This might be relabelled and moved for clarity in a future project to reorganize the admin screens.

@dkoo dkoo merged commit fcfa88c into master Feb 6, 2024
6 checks passed
@dkoo dkoo deleted the fix/optional-nyp-stripe-gateway branch February 6, 2024 20:08
matticbot pushed a commit that referenced this pull request Feb 8, 2024
# [3.1.0-alpha.1](v3.0.3...v3.1.0-alpha.1) (2024-02-08)

### Bug Fixes

* **engagement-wizard:** handle error when retrieving subscription lists ([e85c108](e85c108))
* **ras:** only sync spend total and last payment amounts for completed orders ([#2886](#2886)) ([68aaf39](68aaf39))
* redirect to origin from magic link ([9f41947](9f41947))
* typescript errors ([dc27973](dc27973))
* TypeScript usage; add to CI ([#2884](#2884)) ([6f5e7a6](6f5e7a6))
* update newsletter scroll appearance in Sign Up modal ([#2897](#2897)) ([496723a](496723a))

### Features

* **ci:** add epic/* release workflow and rename `master` to `trunk` ([#2895](#2895)) ([ea02075](ea02075)), closes [#2897](#2897) [#2886](#2886)
* **reader-revenue:** make NYP and Stripe Gateway optional ([#2866](#2866)) ([fcfa88c](fcfa88c))
* remove new tab default on image credits ([#2880](#2880)) ([3c996b1](3c996b1))
* **wc:** override cart, checkout, and my-account page templates ([#2893](#2893)) ([68b1836](68b1836))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.1.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.1.0-epic-ras-acc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Feb 20, 2024
# [3.1.0](v3.0.5...v3.1.0) (2024-02-20)

### Bug Fixes

* add frequency tab options for donations, even when tiers are disabled ([#2930](#2930)) ([cb7eb7b](cb7eb7b))
* **categories:** fix pager urls ([#2913](#2913)) ([bb7e534](bb7e534))
* **categories:** fix pager urls ([#2913](#2913)) ([c851bb6](c851bb6))
* **engagement-wizard:** handle error when retrieving subscription lists ([e85c108](e85c108))
* **ras:** only sync spend total and last payment amounts for completed orders ([#2886](#2886)) ([68aaf39](68aaf39))
* redirect to origin from magic link ([9f41947](9f41947))
* typescript errors ([dc27973](dc27973))
* TypeScript usage; add to CI ([#2884](#2884)) ([6f5e7a6](6f5e7a6))
* update newsletter scroll appearance in Sign Up modal ([#2897](#2897)) ([496723a](496723a))
* update path to wide template file ([#2918](#2918)) ([fdd6b69](fdd6b69))

### Features

* **ci:** add epic/* release workflow and rename `master` to `trunk` ([#2895](#2895)) ([ea02075](ea02075)), closes [#2897](#2897) [#2886](#2886)
* **reader-revenue:** make NYP and Stripe Gateway optional ([#2866](#2866)) ([fcfa88c](fcfa88c))
* remove new tab default on image credits ([#2880](#2880)) ([3c996b1](3c996b1))
* **wc:** override cart, checkout, and my-account page templates ([#2893](#2893)) ([68b1836](68b1836))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dkoo dkoo mentioned this pull request Feb 28, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released on @epic/ras-acc released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants