Skip to content

Add fake payment API#36

Open
Vinzz2303 wants to merge 1 commit into
tscircuit:mainfrom
Vinzz2303:vinzz/payment-api-idempotency
Open

Add fake payment API#36
Vinzz2303 wants to merge 1 commit into
tscircuit:mainfrom
Vinzz2303:vinzz/payment-api-idempotency

Conversation

@Vinzz2303
Copy link
Copy Markdown

@Vinzz2303 Vinzz2303 commented May 15, 2026

/claim #1

Summary:

  • add a Winterspec fake payments API with send/list/get/complete/cancel/fail routes
  • persist in-memory payment records with recipient, amount, currency, bounty URL, status, timestamps, and optional idempotency key
  • make /payments/send retry-safe by replaying the original payment for duplicate idempotency keys
  • add status transition guards so final payments are not mutated again
  • add route tests for send/list, idempotent replay, and completion guard behavior
  • document the payment endpoints in the README

Verification:

  • npx.cmd --yes bun test tests/routes/payments.test.ts
  • npx.cmd --yes @biomejs/[email protected] check lib\db\schema.ts lib\db\db-client.ts routes\payments tests\routes\payments.test.ts README.md
  • git diff --check

@Vinzz2303
Copy link
Copy Markdown
Author

Vinzz2303 commented May 16, 2026

Validation update for PR #36:

npx.cmd --yes bun test tests/routes/payments.test.ts
# 3 pass, 0 fail

npx.cmd --yes @biomejs/biome@1.8.3 check lib\db\schema.ts lib\db\db-client.ts routes\payments tests\routes\payments.test.ts README.md
# Checked 10 files. No fixes applied.

git diff --check
# no output

This confirms the focused payment route tests, Biome check, and whitespace check pass on the current PR branch.

@Vinzz2303
Copy link
Copy Markdown
Author

Friendly follow-up: validation for this PR is attached above (�un test, Biome check, and git diff --check all passed). This stays narrowly scoped to the fake payment API/payment route slice for issue #1. Happy to adjust anything if there is a preferred review direction.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant