ING-107 fix(wallet credits): Calculate granted credits the same way we calculate paid credits#5525
Open
rinasergeeva wants to merge 1 commit into
Open
ING-107 fix(wallet credits): Calculate granted credits the same way we calculate paid credits#5525rinasergeeva wants to merge 1 commit into
rinasergeeva wants to merge 1 commit into
Conversation
e4ec813 to
a141e7e
Compare
groyoh
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
During top-up, paid credits go through a lossy conversion: credits → amount (rounded to cents) → credits. This keeps the transaction credits as close as possible to
amount/rateand limits the drift between wallet balance and credit balance.Granted credits skip this conversion and keep arbitrary decimals as-is. A single granted transaction can drift -0.00342 credits — 342× larger than the typical paid-credit drift (~0.00001).
Fix
For new transactions, apply the paid-credits conversion to the granted credits.
Impact
Non-breaking. Only affects new granted transactions. Existing transactions unchanged.