Skip to content

feat: add purchaseTickets() for MPP-powered ticket purchases#3

Open
zruss11 wants to merge 1 commit intomainfrom
feat/mpp-purchase-tickets
Open

feat: add purchaseTickets() for MPP-powered ticket purchases#3
zruss11 wants to merge 1 commit intomainfrom
feat/mpp-purchase-tickets

Conversation

@zruss11
Copy link
Contributor

@zruss11 zruss11 commented Mar 18, 2026

Adds purchaseTickets() for MPP-powered ticket purchases. See commit message for details.

Adds purchaseTickets() method to TixBitClient that POSTs to /api/purchase.
Returns a PurchasePaymentRequired (402 challenge), PurchaseResult (success),
or PurchaseError. Agent runtimes with mppx/client handle 402 automatically.

New types: PurchaseParams, PurchasePaymentRequired, PurchaseResult, PurchaseError
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7f8a42b1f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +287 to +289
try {
const res = await fetch(url, {
method: "POST",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return structured errors when purchase fetch fails

purchaseTickets advertises a discriminated union return (success / payment_required / error), but await fetch(...) can still reject on timeout aborts or network failures, which throws out of the method instead of returning status: "error". In practice, transient network issues will bypass the documented result.status flow and force consumers into unexpected exception handling paths.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant