Skip to content

fix(tips): source the minimum tip from the dedicated preset, not the lowest tier#1147

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/tip-minimum-preset
Jul 24, 2026
Merged

fix(tips): source the minimum tip from the dedicated preset, not the lowest tier#1147
bmc08gt merged 1 commit into
code/cashfrom
fix/tip-minimum-preset

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

What

The "minimum tip" surfaced by the amount entry was derived from the lowest preset tier (low) via tipPresets.minOrNull(). The server tip presets carry a dedicated minimum field that is distinct from — and typically below — the low tier. This PR sources minTipAmount from that dedicated field.

Changes

  • Region-match the server presets once into a private ResolvedPresets(minimum, tiers), shared by both tipPresets (the low/medium/high chips) and minTipAmount so the two stay consistent.
  • minTipAmount now reads the presets' dedicated minimum rather than the lowest tier.
  • The built-in fallback (used when the server sends no presets) gains a $1 default minimum below its $5 / $10 / $20 tiers; USD-localization is folded into a shared helper.

Tests

Added coverage to TipPaymentDelegateTest (all 7 pass):

  • minTipAmount is the dedicated minimum (1.0), not the lowest tier (2.0)
  • tipPresets are the low/medium/high tiers only, excluding the minimum
  • fallback yields a $1 minimum + $5/$10/$20 tiers when the server provides no presets

…lowest tier

Resolve the server tip presets once into a ResolvedPresets (minimum +
low/medium/high tiers) shared by tipPresets and minTipAmount so they stay
consistent. minTipAmount now uses the presets' dedicated `minimum` field
rather than the lowest tier, which typically sits above it. The built-in
fallback gains a $1 minimum below its $5/$10/$20 tiers.
@github-actions github-actions Bot added area: payments Payments, transfers, intents, billing type: fix Bug fix labels Jul 24, 2026
@bmc08gt
bmc08gt merged commit b50adbb into code/cash Jul 24, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the fix/tip-minimum-preset branch July 24, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: payments Payments, transfers, intents, billing type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant