[Fix] Onchain polling expired payments - #249
Open
talvasconcelos wants to merge 5 commits into
Open
Conversation
Introduce TposPaymentStatus enum and a status column on tpos.payments, with a migration backfilling paid rows as 'paid'. Terminal statuses (expired/underpaid/abandoned) are defined so polling can stop instead of relying on paid = false.
Only poll payments whose status is still 'pending', and transition expired/failed invoices with zero or partial balance into terminal states (expired/underpaid/abandoned). A paid standalone invoice is now handled directly instead of re-settling. Improve the polling warning to include payment identity and exception type.
Return the payment status for expired/underpaid/abandoned onchain payments so the client can stop polling and prompt manual reconciliation, while preserving the existing paid response shape.
Close the invoice dialog and notify the merchant when an onchain payment reaches a terminal state, with a specific message for underpaid invoices that require manual reconciliation.
Add parametrized coverage for expired, underpaid, abandoned and still-pending onchain payments, asserting the terminal states stop polling while pending/zero-conf cases keep polling.
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.
Mark expired payments and stop polling.
Closes #244