-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Billing controller excludes WorkspaceInstances which are already included in previous invoices #10937
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
Comments
Manually configured staging environment to send |
Stripe signing secret is now loaded into staging/production with https://github.com/gitpod-io/ops/pull/3974 |
A WIP for finalizing invoices. Currently, the finalization event doens't tell us which AttributionID it is for. It only gives us the Invoice ID. We'll need to link the InvoiceID to the attribution ID used for the invoice. Likely, this will need to come from the subscription when it is made originally. This currently contains the |
We won't be going with this approach. Instead we'll approach it with #12741 |
The billing controller will need to be given the full set of WorkspaceInstances (which the UsageController fetched) to perform it's run. This is because in a given billing period (May 1 - May 31), a user can have potentially a large number of subscriptions (not in parallel) - create then cancel and repeat. For the cancelled subscriptions, they will of course need to settle it but we must not charge them for any usage from a cancelled subscription (but within that month). And the Billing Controller is the only component which should have access to Stripe to retrieve this data.
In practice, the controller will need to exclude all WorkspaceInstances which match previously already billed WorkspaceInstances.
Architecture
System architecture:
Interactions with Stripe and the
content-service
:Tasks
Done
billInstancesAfter
config setting #11882billInstancesAfter
#11883Webhook registration
public-api
pod.Implement
FinalizeInvoice
RPCFinalizeInvoice
RPC onusage
that the public api will invoke from the webhook handler. ([UBP] Add placeholder implementation ofFinalizeInvoice
#11949)FinalizeInvoice
RPC when aninvoice.finalized
event is received. ([UBP] Connect Stripe webhook toFinalizeInvoice
RPC #11987)d_b_billed_sessions
in the server and related object models in the BillingService #11867setBilledSession
(for Chargebee) in the Billing Service #11884Other
Notes
The text was updated successfully, but these errors were encountered: