Repository navigation
Fix invoice state management and validation issues - #987
Open
Johnero542 wants to merge 1 commit into
Open
Johnero542 wants to merge 1 commit into
Johnero542 wants to merge 1 commit into
Conversation
Addresses four invoice lifecycle bugs: - Prevent paid invoices from reverting to pending (WHEELBACK#872) Add state validation to reject cancel_invoiced action on Paid invoices Ensures paid invoices remain in paid/refund states only - Prevent payment on cancelled invoices (WHEELBACK#871) Add validation check to reject request_refund on Cancelled invoices Returns 409 error when attempting to pay cancelled invoice - Prevent payment on expired invoices (WHEELBACK#873) Check invoice expiration against due_date before allowing request_refund Compares current time to stored due_date from invoice record Rejects payment on invoices past their due date - Include due_date in invoice detail response (WHEELBACK#875) Modified GET /invoices/:id to return actual status from contract Added due_date field (Unix timestamp) to invoice detail response Fetches invoice record from database for complete invoice metadata All invoice state transitions now validate against current status and expiration. Closes WHEELBACK#871, WHEELBACK#872, WHEELBACK#873, WHEELBACK#875
|
@Johnero542 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! 🚀 |
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.
Addresses four invoice lifecycle bugs:
Prevent paid invoices from reverting to pending (SAMPLE 026: Paid invoice can transition back to pending #872) Add state validation to reject cancel_invoiced action on Paid invoices Ensures paid invoices remain in paid/refund states only
Prevent payment on cancelled invoices (SAMPLE 025: Cancelled invoice remains payable through the contract flow #871) Add validation check to reject request_refund on Cancelled invoices Returns 409 error when attempting to pay cancelled invoice
Prevent payment on expired invoices (SAMPLE 027: Expired invoice is shown as payable in the merchant interface #873) Check invoice expiration against due_date before allowing request_refund Compares current time to stored due_date from invoice record Rejects payment on invoices past their due date
Include due_date in invoice detail response (SAMPLE 029: Invoice detail response omits the configured due date #875) Modified GET /invoices/:id to return actual status from contract Added due_date field (Unix timestamp) to invoice detail response Fetches invoice record from database for complete invoice metadata
All invoice state transitions now validate against current status and expiration.
Closes #871
Closes #872
Closes #873
Closes #875
Pull Request
Summary
Checklist
abis/andCOMEBACKHERE-contracts/)Notes
make check-abi-snapshots.