This is the initial work on the project to create a new section of calypso for site-level payments management, as opposed to the currently-available user-level payments management under /me/purchases. This also creates the sidebar menu for that section, which replaces the current “Plans” link in the my-sites sidebar.
These new pages will be available under the /purchases route for the currently active site. This PR implements just the first page of these changes, /purchases/subscriptions, which is a site-level view of the subscriptions list currently available in the first tab of /me/purchases.
The new route will be available only with the feature flag site-level-billing, which is enabled for development and horizon only.
Each of the subscriptions in the list currently links to the existing subscription details page under /me/purchases, which is not ideal since the sidebar and the on-page “back” button will not work as one would expect. However, building a subscription details page is a big enough task that it has its own task at #45679 There should be little risk deploying this change first since it’s behind a feature flag.
The current account-level purchases page also includes an upsell banner for Concierge, but this PR does not include that banner for site-level purchases. We may want to add it back in the future, but that is under discussion. See p9jf6J-28S-p2 and p1600284783464400-slack-C0117V2PCAE
Note that the /purchases route already existed as an alias for /me/purchases (and all sub-routes, like /me/purchases/billing/:receiptId), so when this feature flag is removed, we may break some previously-available URLs for the sections of the old route if we aren’t careful about creating appropriate redirects!
Visit /purchases and verify that you see the “Plan” menu in the sidebar, that it shows the currently active plan (unless it’s a Jetpack site, where the active plan will be empty), and that its submenu includes “Plans” and “Billing”.
Verify that the URL changes to /purchases/subscriptions.
If you have multiple sites, verify that you see a site picker and that picking a site adds the site slug to the URL.
Verify that if you have no purchases on that site, you see the “Upgrade now” upsell.
Verify that if you have purchases on that site, you see them all listed (note that clicking on them will bring you to /me/purchases; that will be changed in a later PR).
Verify that the bottom of the page shows links to /me/purchases routes. Try them out and verify that they each visit a page that matches the text of the link (note that “receipts” and “payment methods” go to the same page because they are both on one page right now).
Verify that clicking “Plans” in the “Plan” sidebar submenu brings you to the plans page for that site.
Disable the site-level-billing feature flag by adding ?flags=-site-level-billing to the URL.
Visit /purchases and /purchases/billing/:receiptId (the latter for a real receipt) and be sure that you are redirected to the correct page under /me/purchases.
Unfortunately, no screenshots were provided by the developer.