MozillaFoundation / donate-wagtail

[Legacy] - Wagtail based donation stack
Mozilla Public License 2.0
43 stars 22 forks source link

added new feature flag for enabling upsell view #1725

Closed danielfmiranda closed 1 year ago

danielfmiranda commented 1 year ago

Closes #1724

Description

This PR introduces a new feature flag titled enable_upsell_view which is used in the get_success_url methods for both the CardPaymentView and the PaypalPaymentView.

If the transaction was a one-time payment and the enable_upsell_view flag is set to true, then we return the upsell view to the user.

If set to false, then we return the Newsletter Signup thank you page.

This PR also adds tests for both cases (enabled/disabled) for both Card payments and Paypal.

Steps to test

  1. Check this branch out and run inv new-db or inv migrate to apply the migration related to the FeatureFlags.
  2. Make a one-time payment > $20 USD using either the Credit Card form and the test card details below, or through Paypal using the credentials found in 1Password.
  3. Once your payment has been submitted, the site should redirect you to the newsletter sign up page.
  4. Log into http://localhost:8000/admin/, click "Settings", and then "Feature Flags".
  5. Check the "Enable the upsell view" box.
  6. Make another one-time donation > $20 USD using one of the methods from step 2.
  7. Once your payment has been submitted, the site should now redirect you to the Upsell view.
  8. If everything is working as expected, testing is complete!

Test Card Details

Card Number: 4111 1111 1111 1111 EXP: 11/23 CVV: 123

tbrlpld commented 1 year ago

Also: love that you moved this into a feature flag! Easy to reactivate if it comes up 👌