labdao / plex

Platform for running comp bio applications on distributed compute and storage infrastructure
https://lab.bio
MIT License
55 stars 14 forks source link

Stripe Cancel + UI #1010

Closed supraja-968 closed 2 months ago

supraja-968 commented 2 months ago

What type of PR is this?

Description

This PR introduces stripe cancellation feature, with 2 UI pages: /subscribe - if you are new and yet to subscribe, /subscription/manage for when you are subscribed and want to check your usage, edit payment method, cancel subscription, and review your subscribed plan.

Note to dev: In addition to this, the price ID is being updated in the backend env variables and secrets. Now the price (in test, yet to be changed in prod) is 5$ flat fee + 0.01$ overage. Only 2 tiers, as opposed to the current payment method set in prod (with 3 tiers). This will be updated in prod as well.

/subscribe page:

image

/subscription/manage page:

Scenario 1: when you are subscribed and the plan is set to auto renew:

image

Scenario 2: when you have canceled your plan:

image

Menu:

image image

Related Tickets & Documents

Reference as needed.

Steps to Test

Good to note/test:

  1. the subtext under your plan, renewal information and the buttons in the billing & payment box change dynamically between subscribed (set to auto renew) and canceled states.
  2. the menu shows 'Subscribe' vs 'Manage Subscription' based on the subscription status.
  3. if you navigate manually to the /subscribe page when you are a subscriber, it redirects to the /subscription/manage page and vice versa.
  4. After checkout, landing page is now /subscription/manage page instead of /checkout/success.
  5. You will now be redirected from the experiment submission page to the /subscribe page, instead of direct stripe checkout. This also means you can subscribe at any point manually by navigating to /subscribe, not necessarily only when you hit the threshold and are redirected from the experiment submission.
vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **docs** | ⬜️ Ignored ([Inspect](https://vercel.com/convexitylabs/docs/68ceU8bEmUdmg1ZsCUnVsVTpk4ib)) | [Visit Preview](https://docs-git-stripecancel-convexitylabs.vercel.app) | | Aug 2, 2024 3:57pm |