feat(types): echo checkout_session_id on PayResult#105
Merged
Conversation
Add an optional checkout_session_id to PayResult so a payment that settled a checkout carries the join key back to that checkout. When an agent drives a purchase as two steps (codespar_shop to ready_for_payment, then the payment tool to settle the pix_copia_e_cola), the result it gets back today says nothing about which checkout it belongs to. Echoing the checkout id lets a caller correlate the two calls without reaching into server-internal state. The field is additive and optional under the v0 additive-compatibility rule: existing consumers that ignore it are unaffected, and a direct payment with no originating checkout leaves it unset. The merchant pix_copia_e_cola the checkout carried is deliberately NOT echoed -- it is a payable bearer instrument and is kept out of results and logs. PayResult is TypeScript-only today (no Python dataclass mirror), so this is a TS-types + backend-route change; documents the codespar_pay correlation in the contract doc and notes Python parity as follow-up. typecheck + tests green in packages/types.
dangazineu
marked this pull request as ready for review
June 28, 2026 14:25
dangazineu
added a commit
that referenced
this pull request
Jun 28, 2026
Bump @codespar/types to 0.10.13 to publish the additive PayResult.checkout_session_id field merged in #105. 0.10.12 is already on the registry, so the field ships in the next patch. Tagging v0.10.13 after merge triggers the publish workflow (OIDC trusted publishing).
dangazineu
added a commit
that referenced
this pull request
Jun 28, 2026
Single release of @codespar/types at the next free version, 0.10.13. Consolidates two additive changes already on main, plus the manifest bump they require: - PayResult.checkout_session_id (merged in #105) - the payment-failure-triage demo scenarios + DEMO_SCENARIO_MANIFEST (merged in #103) 0.10.12 was published in parallel by unrelated work and predates both, so this ships at 0.10.13. Bumps packages/types/package.json AND DEMO_SCENARIO_MANIFEST.version in lockstep (the manifest self-test enforces equality with the package version — a package-only bump like #106 would fail it). Supersedes #106. After merge, tagging v0.10.13 publishes the package; the example (#104) and the managed parity test (#402) pin 0.10.13.
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
Add an optional
checkout_session_idtoPayResult(@codespar/types), and document thecodespar_paycorrelation in the contract doc.When an agent drives a purchase as two steps —
codespar_shopto reachready_for_payment, then the payment tool to settle thepix_copia_e_cola— thePayResultit gets back today says nothing about which checkout it settled. Echoing thecheckout_session_idgives a caller the join key to correlate the two calls without reaching into server-internal state.Shape
Why it's safe (additive, v0 rule)
pix_copia_e_colathe checkout carried is deliberately NOT echoed here — it is a payable bearer instrument and is kept out of results and logs (PII / Pix log-redaction).Scope note (3-way edit)
PayResultis TypeScript-only today (no Python dataclass mirror intypes.py), so this is a TS-types + backend-route change. Bringingcodespar_pay's types to the TS/Python parity the shop types already have is tracked as separate follow-up work.Verification
npm run typecheckandnpm testgreen inpackages/types(82 tests).Draft pending the consuming backend change and a
@codespar/typespublish.