Skip to content

[ING-422] Stop auto top-up failing when the refill exceeds the max limit - #5992

Open
aquinofb wants to merge 1 commit into
mainfrom
ing-422
Open

[ING-422] Stop auto top-up failing when the refill exceeds the max limit#5992
aquinofb wants to merge 1 commit into
mainfrom
ing-422

Conversation

@aquinofb

Copy link
Copy Markdown
Contributor

Context

When a wallet's automatic top-up needs to refill more than the wallet's maximum paid top-up amount, the refill was computed by the recurring rule and then rejected by the transaction creation step. Nothing was created and nothing was surfaced: no transaction, no invoice, no webhook. Auto top-up silently stopped, the wallet kept running dry, and the refill was retried and failed on every balance refresh.

The two rules contradicted each other: the recurring rule intentionally lets a target refill go past the max, because reaching the target balance matters most, but transaction creation re-checked the max and rejected the amount.

Changes

  • Threshold and interval refills now create the transaction with the limit check disabled. The recurring rule already computed the amount (it applies the minimum, and for target rules deliberately reaches past the maximum), so re-checking the limits there could only reject a refill that was meant to happen.
  • The interval flow now also honors the rule's ignore-limits setting, which it previously dropped.
  • A fixed rule configured with a paid amount outside the wallet limits is now rejected when the wallet is created, the same way the update path already rejects it, so the misconfiguration surfaces immediately instead of failing on every trigger.

@aquinofb
aquinofb marked this pull request as ready for review July 21, 2026 20:37
@aquinofb
aquinofb requested review from a team, lovrocolic and vincent-pochet and removed request for a team July 21, 2026 20:46
@aquinofb aquinofb self-assigned this Jul 21, 2026
## Context

When a wallet's automatic top-up needs to refill more than the wallet's
maximum paid top-up limit, the refill was computed by the recurring rule
and then rejected by the transaction creation step. Nothing was created
and nothing was surfaced to the customer, so auto top-up silently stopped
and the wallet ran dry, retrying and failing on every balance refresh.

## Description

Threshold and interval refills now pass ignore_paid_top_up_limits when
creating the transaction: the recurring rule already computed the amount
(applying the min per its own flag, and deliberately reaching past the
max to hit the target), so re-checking the limits there could only reject
a refill that was intended to happen. This also fixes interval top-ups
never honoring the rule's ignore-limits setting.

As a complement, a fixed rule configured with a paid amount outside the
wallet's top-up limits is now rejected when the wallet is created, the
same way the update path already rejects it, so the misconfiguration
surfaces immediately instead of failing on every trigger.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant