-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[stripe] Finalized invoce debits, do not set credits to negative when updating #12787
Conversation
@@ -118,7 +108,8 @@ func (s *BillingService) FinalizeInvoice(ctx context.Context, in *v1.FinalizeInv | |||
ID: uuid.New(), | |||
AttributionID: attributionID, | |||
Description: fmt.Sprintf("Invoice %s finalized in Stripe", invoice.ID), | |||
CreditCents: db.NewCreditCents(float64(creditsOnInvoice)), | |||
// Apply negative value of credits to reduce accrued credit usage | |||
CreditCents: db.NewCreditCents(float64(-creditsOnInvoice)), |
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.
Ideally we'd do it the otherway around. Maybe we can create a PR with a migration that negates all credits and changes the respective code as well?
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.
Actually thinking about it again, it might be fine as is. After all the table is called usage so positive means used negative means gained. 🤷
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 can still make the change and drop the usage records manually
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.
Spoke directly, we'll be keeping it as is to more closely align with Stripe which also doesn't want negative credits, but positive credits for usage
/hold for discussion |
27f05d9
to
8bf8561
Compare
/unhold |
Description
Related Issue(s)
How to test
Release Notes
Documentation
Werft options: