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
feat: Billing Service #14756
feat: Billing Service #14756
Conversation
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
Graphite Automations"Add foundation team as reviewer" took an action on this PR • (04/25/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add platform team as reviewer" took an action on this PR • (04/25/24)1 reviewer was added to this PR based on Keith Williams's automation. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 315 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 04/30/2024 08:01:01pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: edfe409 Started: 04/30/2024 07:57:15pm UTC
|
|
2 Test Cases Affected |
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Event Types tests -- future user Different Locations Tests Can add Link Meeting as location and book with it
Retry 1 • Initial Attempt |
0.42% (1)1 / 236 runfailed over last 7 days |
3.81% (9)9 / 236 runsflaked over last 7 days |
Event Types tests -- legacy user Different Locations Tests Can remove location from multiple locations that are saved
Retry 1 • Initial Attempt |
0% (0)0 / 190 runsfailed over last 7 days |
21.05% (40)40 / 190 runsflaked over last 7 days |
📄 apps/web/playwright/eventType/limit-tab.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Limits Tab - Event Type Check the functionalities of the Limits Tab
Retry 1 • Initial Attempt |
0% (0)0 / 191 runsfailed over last 7 days |
3.14% (6)6 / 191 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/preview.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Preview Preview - embed-core should load
Retry 1 • Initial Attempt |
0% (0)0 / 222 runsfailed over last 7 days |
39.64% (88)88 / 222 runsflaked over last 7 days |
📄 packages/embeds/embed-react/playwright/tests/basic.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
React Embed Element Click Popup should verify that the iframe got created with correct URL - namespaced
Retry 1 • Initial Attempt |
13.33% (30)30 / 225 runsfailed over last 7 days |
45.78% (103)103 / 225 runsflaked over last 7 days |
async subscribeTeamToStripe( | ||
@Param("teamId") teamId: number, | ||
@Body() input: SubscribeToPlanInput | ||
): Promise<SubscribeTeamToBillingResponseDto> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main goal is to force a standard on the shape of api responses
and so that that the DTO only targets the actual data sent back
Promise<ApiResponse < DTO> >
apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/oauth-clients.controller.ts
Outdated
Show resolved
Hide resolved
apps/web/lib/hooks/settings/organizations/platform/oauth-clients/usePersistOAuthClient.ts
Outdated
Show resolved
Hide resolved
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is an install script?Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts. Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
|
||
return { | ||
status: "success", | ||
data: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be able to return an empty data, Promise<ApiResponse<SubscribeTeamToBillingResponseDto | undefined>>
…to chore/platform-billing
What does this PR do?
Introduces a new Billing Service to Platform API. For now, it is used to automate billing and usage for platform-enabled teams.
Relies upon Stripe for handling subscriptions.
How to Test
config/stripe.config.json
for the plans you need to teststripe listen --events customer.subscription.created,customer.subscription.updated --forward-to localhost:5555/api/v2/billing/webhook
POST
tolocalhost:5555/api/v2/billing/{{your team id}}/subscribe
. The body needs to have the desired plan, eg"plan": "STARTER"
. You will get a redirect URI, which you need to visit` and run through the subscribe flow. This will trigger a webhook call which will update your team with the required billing data on Prisma.