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

Site settings: allow site to be deleted if only purchases are non-refundable premium themes #27917

Merged
merged 4 commits into from
Oct 23, 2018

Conversation

bluefuton
Copy link
Contributor

@bluefuton bluefuton commented Oct 18, 2018

Changes proposed in this Pull Request

Currently, it is not possible to delete a site with any active purchases. We direct the user to their Purchases to cancel everything first.

Premium themes are a special case, in that it is not possible to cancel them after they're outside the refund period. Users with a premium theme therefore are unable to delete their site.

This PR allows users to delete a site if the only purchases attached to it are non-refundable premium themes.

Testing instructions

screen shot 2018-10-19 at 15 02 28

Visit http://calypso.localhost:3000/settings/general and test with sites that:

  • Only have premium themes that are not refundable. Verify that you can now proceed with site deletion.

  • Do not have any premium themes or purchases. You should still be able to proceed with site deletion.

  • Have purchases besides premium themes. Verify that you are shown the warning popover, and that it is not possible to delete the site.

screen shot 2018-10-19 at 15 02 32

Fixes #17012.

@matticbot
Copy link
Contributor

@bluefuton
Copy link
Contributor Author

Related PR dealing with the same scenario for account closure: #27411.

@ghost
Copy link

ghost commented Oct 18, 2018

That's a great PR description, thank you so much for your effort!

Generated by 🚫 dangerJS

@bluefuton bluefuton force-pushed the fix/delete-site-premium-themes branch from df75cf8 to 9d6d222 Compare October 19, 2018 01:51
@bluefuton bluefuton added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Oct 19, 2018
@bluefuton bluefuton requested review from westi, southp and KokkieH October 19, 2018 02:07
@KokkieH
Copy link
Contributor

KokkieH commented Oct 19, 2018

Tested using these steps:

Test 1

  1. Purchased a premium theme on a new site on a test account using PayPal so there's a refundable transaction
  2. Ran the branch locally and visited Purchases - Theme shows cancel and refund option
  3. Went to My Site ->Settings and click on Delete your site permanently

Saw an overlay prompting me to cancel my upgrades prior to deleting the site. After cancelling and refunding the theme I'm able to delete the site.

Test 2

  1. Purchased a premium theme using credits so the theme won't be refundable
  2. With this branch running, visited Purchases and confirmed theme does not show as refundable
  3. Went to My Site ->Settings and click on Delete your site permanently

I was able to successfully confirm and finish deleting the site without having to remove the theme.

Test 3

  1. Purchased the Personal Plan as well as a Premium Theme using credits.
  2. With this branch running, went to My Site ->Settings and attempt to delete the site.
  3. See overlay that I need to cancel my upgrades first.
  4. Visit Purchases and cancel the plan - theme is non-refundable and cannot be cancelled
  5. Go back to My Site ->Settings and attempt to delete the site.

I was able to successfully delete the site.

I'm also able to delete a site with no purchases as normal.

Summary: From what I can see the PR is working as intended.

Copy link
Contributor

@westi westi left a comment

Choose a reason for hiding this comment

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

LGTM and @KokkieH has very helpfully tested <3 🚀

@westi westi added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Oct 22, 2018
@bluefuton bluefuton merged commit b28e81b into master Oct 23, 2018
@bluefuton bluefuton deleted the fix/delete-site-premium-themes branch October 23, 2018 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Site settings: Allow site with premium theme to be deleted with proper warnings
5 participants