Sync latest catalog-cli: checkout instruments, UCP messages, hardening - #6
Merged
Conversation
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.
Syncs the latest
catalog-cliskill from local development into the repo.Changes
complete_checkoutnow echoes real payment instrumentspaymentTokenflow with echoing back thepayment.instrumentsreturned bycreate_checkout.complete checkoutnow reads the create response (or a{"payment":{"instruments":[...]}}block) from stdin via--checkout-stdin, instead of--payment-token-stdin.selectInstrumentkeeps every field the merchant returned, marks itselected, and setscredential.tokento the instrument's own id — the instrument id IS the checkout payment token, so re-sending the exact id is what lets the merchant match the session (mirrors the reference simulator's_select_instrument).Surface UCP checkout
messages[]to the userrenderCheckoutMessageslifts UCP warnings/errors/disclosures (e.g.final_sale,prop65,age_restricted) out of the raw JSON into a clearly-labeled block, since the protocol requireswarning/disclosurecontent be shown to the user.checkout create/updatenow run throughrunCheckoutAction, which prints the messages block above the full JSON.Docs
SKILL.mdandreferences/direct-api.mdto match the new checkout completion flow.Verification
pnpm typecheck— passespnpm test— 59/59 passing