Validate cart mint quotes server-side - #534
Open
GautamBytes wants to merge 1 commit into
Open
GautamBytes wants to merge 1 commit into
GautamBytes wants to merge 1 commit into
Conversation
GautamBytes
marked this pull request as ready for review
June 10, 2026 10:24
Contributor
Author
|
@calvadev ready for review! |
|
This pull request has been automatically marked as stale because it has not had recent activity for 45 days. |
|
This pull request has been automatically marked as stale because it has not had recent activity for 45 days. |
This branch has not been deployed
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.
Summary
This PR closes the remaining payment validation gaps around cart checkout and MCP order creation.
create-orderso non-sat listing totals are converted to sats before creating Lightning quotes or checking Cashu token amounts.Note
The new
/api/cart/mint-quoteroute treats the request body as untrusted runtime input. It validates cart order type, pickup preference, item shape, selected variants, discount-code map shape, listing availability, stock, expiration, and quantity before calling the mint.This PR intentionally does not change direct browser Cashu-token checkout; that path does not create a mint quote. It should still get a separate server-validated amount/totals follow-up, but it is separate from the Lightning/NWC quote-manipulation issue.
Coordination
This complements #449, which validates single-listing Lightning/NWC mint quotes server-side. So ideally should merge after that.