Skip to content

Conversation

@a-lider
Copy link
Contributor

@a-lider a-lider commented Oct 2, 2025

Changes

Proxy for billing switch plan API: https://github.com/PostHog/billing/pull/1519

@a-lider a-lider requested review from a team and removed request for a team October 2, 2025 17:58
Copy link
Contributor

@yasen-posthog yasen-posthog left a comment

Choose a reason for hiding this comment

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

This proxy-like endpoint looks good overall, just needs some validation.

Also a couple of other stuff:

  • Do we want a couple of simple tests, it's billing after all, so we need to have safety nets?
  • The PR is in Draft, you may want to change that.

def subscription_switch_plan(self, request: Request, *args: Any, **kwargs: Any) -> HttpResponse:
organization = self._get_org_required()
billing_manager = self.get_billing_manager()
res = billing_manager.switch_plan(organization, request.data)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a validation here, similar to this?

@a-lider
Copy link
Contributor Author

a-lider commented Oct 7, 2025

This proxy-like endpoint looks good overall, just needs some validation.

Also a couple of other stuff:

  • Do we want a couple of simple tests, it's billing after all, so we need to have safety nets?
  • The PR is in Draft, you may want to change that.

Main validation and tests are in billing repo, this one's just a proxy. I don't think it requires tests, but I'll check how it works for other billing endpoints.

@a-lider
Copy link
Contributor Author

a-lider commented Oct 7, 2025

Gonna close this PR, decided to merge it together with the UI, so it's easier to test locally:
#39131

@a-lider a-lider closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants