fix(rest/nodejs): stop copying client supplied omit members into the checkout response - #193
Merged
carolinerg1 merged 1 commit intoAug 20, 2026
Conversation
…checkout response The create handler builds the response by spreading the request body over the explicit keys. checkout.json marks continue_url, expires_at, messages and order as ucp_request omit, and none of the four has an explicit key, so a request that carried one saw its value come back in the 201 and persist into the stored session. The spread now drops all four, matching the handling the explicit keys already give ucp, id, status, totals, links and currency. Same defect class as the currency read fixed in Universal-Commerce-Protocol#156 and the id fixed in Universal-Commerce-Protocol#167 on the Python server.
damaz91
approved these changes
Aug 20, 2026
carolinerg1
approved these changes
Aug 20, 2026
carolinerg1
merged commit Aug 20, 2026
accfe4e
into
Universal-Commerce-Protocol:main
16 checks passed
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.
What
The create handler builds the response by spreading the request body over the explicit keys. checkout.json marks continue_url, expires_at, messages and order as ucp_request omit, and none of the four has an explicit key, so a request carrying one sees its value come back in the 201 and persist into the stored session:
and a later GET returns the same values. messages behaves the same way, and so does order: a request carrying a fabricated order object, id and permalink included, sees it come back in the 201 and persist. ucp, id, status, totals, links and currency are unaffected because explicit keys already overwrite them, which is the negative control.
Fix
The destructuring that already drops fulfillment before the spread now also drops continue_url, expires_at, messages and order, so every ucp_request omit member gets the same treatment the explicit keys give the rest.
Testing