Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.

Unify purchase receipt payment outcomes#5

Merged
GsCommand merged 1 commit into
mainfrom
codex/fix-payment-outcome-vocabulary-and-add-payment_proof
Mar 19, 2026
Merged

Unify purchase receipt payment outcomes#5
GsCommand merged 1 commit into
mainfrom
codex/fix-payment-outcome-vocabulary-and-add-payment_proof

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Remove semantic drift between checkout.receipt and purchase.receipt by standardizing payment outcome vocabulary to payment-native values captured / failed / pending.
  • Ensure one-step (x402) purchase receipts carry the same evidence as checkout receipts by surfacing payment_proof for successful settlements.
  • Preserve minimal, targeted scope: converge purchase toward the existing checkout model without broad schema changes.

Description

  • Updated purchase.receipt status enum from accepted/rejected/pending to captured/failed/pending in schemas/v1.1.0/commercial/purchase/purchase.receipt.schema.json.
  • Reused checkout's x402 proof shape by adding the x402_proof $defs and a payment_proof property to purchase.receipt, and required payment_proof when top-level status is captured via conditional allOf rules.
  • Kept existing reason conditional for non-settled outcomes (failed/pending) so error reasoning remains required in those cases.
  • Updated examples to match the new model: examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json now uses status: "captured" and includes an x402 payment_proof, and examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json was adjusted to exercise the missing-proof failure path.
  • Files edited: schemas/v1.1.0/commercial/purchase/purchase.receipt.schema.json, examples/v1.1.0/commercial/purchase/valid/900-purchase.receipt.valid.json, and examples/v1.1.0/commercial/purchase/invalid/900-purchase.receipt.invalid.json.

Testing

  • Ran npm run validate and the full schema validation suite, which completed successfully.
  • Ran npm run validate:examples and all example sets validated, including the updated purchase examples.
  • Example validation confirms the valid captured receipt requires payment_proof and the invalid fixture remains invalid for the intended missing-proof case.

Codex Task

@GsCommand GsCommand merged commit b65911c into main Mar 19, 2026
1 check failed
@GsCommand GsCommand deleted the codex/fix-payment-outcome-vocabulary-and-add-payment_proof branch March 20, 2026 01:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant