Skip to content

[UBP] When receiving a Stripe invoice finalization webhook, also update the Stripe CostCenter billing cycle dates #14992

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

Closed
2 tasks
Tracked by #14969
jankeromnes opened this issue Nov 28, 2022 · 0 comments · Fixed by #15172
Assignees
Labels
team: webapp Issue belongs to the WebApp team

Comments

@jankeromnes
Copy link
Contributor

jankeromnes commented Nov 28, 2022

Is your feature request related to a problem? Please describe

Follow-up from #14705 (comment):

Also, the ResetJob doesn't touch any Stripe CostCenters, so the value in https://github.com/gitpod-io/gitpod/pull/14705/files#diff-3d0d7f3b128d2677bfd96f23f31f3f8935756b31537aad113d58eb08ac654cb1R190 will be out of date after the first subscription to stripe.

Aha, interesting, I assumed that it would create a new Stripe CostCenter. If not, this sounds like a good follow-up issue. 💡

This was by design at that time, because the Stripe Invoice webhook is what triggers a spending limit reset and the CostCenter was meant to remain the same. Nothing stops us from creating a new CostCenter, but it should happen in response to the Stripe invoice, rather than when the billing period "ends" in our system.

Describe the behaviour you'd like

When a Stripe CostCenter reaches the end of its billing cycle, and Stripe issues + finalizes an invoice, we should also update the CostCenter's billing cycle dates:

  • Update Stripe CostCenter billingCycleStart on Stripe webhook
  • Update Stripe CostCenter nextBillingTime on Stripe webhook

Describe alternatives you've considered

Additional context

@jankeromnes jankeromnes added the team: webapp Issue belongs to the WebApp team label Nov 28, 2022
@jankeromnes jankeromnes moved this to Scheduled in 🍎 WebApp Team Nov 28, 2022
@svenefftinge svenefftinge changed the title When receiving a Stripe invoice finalization webhook, also update the Stripe CostCenter billing cycle dates [UBP] When receiving a Stripe invoice finalization webhook, also update the Stripe CostCenter billing cycle dates Dec 5, 2022
@svenefftinge svenefftinge moved this from Scheduled to In Progress in 🍎 WebApp Team Dec 5, 2022
@svenefftinge svenefftinge self-assigned this Dec 5, 2022
Repository owner moved this from In Progress to In Validation in 🍎 WebApp Team Dec 6, 2022
@jldec jldec moved this from In Validation to Done in 🍎 WebApp Team Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: webapp Issue belongs to the WebApp team
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants