Skip to content

feat: billing tab for platform#16755

Merged
ThyMinimalDev merged 12 commits intomainfrom
billing-upgrades-for-platform
Sep 23, 2024
Merged

feat: billing tab for platform#16755
ThyMinimalDev merged 12 commits intomainfrom
billing-upgrades-for-platform

Conversation

@Ryukemeister
Copy link
Copy Markdown
Contributor

@Ryukemeister Ryukemeister commented Sep 22, 2024

What does this PR do?

  • Adds billing tab for platform user to upgrade or downgrade their plans, update their stripe billing info and collect invoices
Screen.Recording.2024-09-23.at.12.13.01.PM.mov
Screen.Recording.2024-09-23.at.12.20.19.PM.mov

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have added a Docs issue here if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

This can be tested in the web app, go to /settings/platform and click the billing tab and try to upgrade or downgrade your plans or update billing info.

@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Sep 22, 2024
@Ryukemeister Ryukemeister marked this pull request as ready for review September 23, 2024 06:51
@graphite-app graphite-app Bot requested a review from a team September 23, 2024 06:51
@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 23, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Sep 23, 2024 8:15am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Sep 23, 2024 8:15am

@dosubot dosubot Bot added billing area: billing, stripe, payments, paypal, get paid ✨ feature New feature or request labels Sep 23, 2024
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Sep 23, 2024

Graphite Automations

"Add platform team as reviewer" took an action on this PR • (09/23/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add ready-for-e2e label" took an action on this PR • (09/23/24)

1 label was added to this PR based on Keith Williams's automation.

@github-actions
Copy link
Copy Markdown
Contributor

E2E results are ready!

@ThyMinimalDev ThyMinimalDev self-requested a review September 23, 2024 10:21
@ThyMinimalDev
Copy link
Copy Markdown
Contributor

checking that everything is working before merge

Copy link
Copy Markdown
Contributor

@ThyMinimalDev ThyMinimalDev left a comment

Choose a reason for hiding this comment

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

LGTM, some refactor to do in follow up pr

@@ -43,12 +49,9 @@ export class BillingService implements OnModuleDestroy {

async createSubscriptionForTeam(teamId: number, plan: PlatformPlan) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in follow up pr, let's refactor this in 2 different functions doing only one thing

  • createTeamBilling, which just returns the customerId or the whole platforBillingEntity
  • redirectToSubscribeCheckout, which returns the url

Comment on lines +71 to 72
const { action, url } = await this.billingService.createSubscriptionForTeam(teamId, input.plan);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in a follow up pr call the two newly created functions one after the other

const customerId = await createTeamBilling
const url = await redirectToSubscribeCheckout(customerId)

...

@ThyMinimalDev ThyMinimalDev merged commit 3371602 into main Sep 23, 2024
@ThyMinimalDev ThyMinimalDev deleted the billing-upgrades-for-platform branch September 23, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

billing area: billing, stripe, payments, paypal, get paid core area: core, team members only ✨ feature New feature or request platform Anything related to our platform plan ready-for-e2e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants