Skip to content

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

@jankeromnes

Description

@jankeromnes

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

Metadata

Metadata

Assignees

Labels

team: webappIssue belongs to the WebApp team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions