Skip to content

fix(refund): suspend deadline-based refunds while invoices are under dispute#254

Open
johnsaviour56-ship-it wants to merge 2 commits into
Stellar-split:mainfrom
johnsaviour56-ship-it:freeze-deadline-during-dispute
Open

fix(refund): suspend deadline-based refunds while invoices are under dispute#254
johnsaviour56-ship-it wants to merge 2 commits into
Stellar-split:mainfrom
johnsaviour56-ship-it:freeze-deadline-during-dispute

Conversation

@johnsaviour56-ship-it

Copy link
Copy Markdown
Contributor

Summary

This PR prevents automatic refunds from being processed while an invoice is actively under dispute, ensuring that arbitration takes precedence over deadline-based refund logic.

Changes

  • Updated refund() to check the invoice's dispute status before evaluating deadline eligibility.
  • Blocked refunds for invoices marked as disputed, returning an "invoice under dispute" error instead of processing the refund.
  • Preserved existing deadline-based refund behavior for invoices that are not under dispute.
  • Allowed refunds to proceed immediately after the dispute is resolved and the disputed flag is cleared.
  • Added tests covering disputed and non-disputed refund scenarios.

Testing

Added coverage for:

  • Refund attempts on disputed invoices after the deadline
  • Successful refunds once a dispute has been resolved
  • Unchanged behavior for non-disputed invoices
  • Regression tests for existing refund logic

Acceptance Criteria

  • refund() rejects disputed invoices, even after the deadline has passed
  • Refund eligibility resumes immediately after dispute resolution
  • Non-disputed invoice behavior remains unchanged
  • Added test covering dispute resolution and subsequent refund
  • All existing tests pass
  • cargo clippy passes with zero warnings

Result

Deadline-based refunds are now safely suspended during active disputes, preventing premature fund distribution while arbitration is in progress and preserving the expected refund workflow once disputes are resolved.

Closes #225

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@johnsaviour56-ship-it Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Implement invoice deadline soft-lock during active dispute

1 participant