feat: add payment send/list API#34
Open
tungnguyentu wants to merge 2 commits into
Open
Conversation
Adds a /payments/send POST endpoint that creates and immediately marks a payment as sent, and a /payments/list GET endpoint with optional filtering by recipient_email and status. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace redaxios with ky in the test fixture and all test files. ky is already used in template-api-fake and is the preferred HTTP client across the tscircuit template ecosystem.
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.
Summary
Adds a fake payment API with two endpoints:
POST /payments/sendrecipient_email,amount_usd, and optionalnotestatus: "pending"then immediately marks it"sent"(simulating Algora's async send)payment_id,sent_at, andstatusGET /payments/list?recipient_email=and?status=query filtersSchema changes (
lib/db/schema.ts+lib/db/db-client.ts):paymentSchemawithpayment_id,recipient_email,amount_usd,note,status,created_at,sent_ataddPaymentandupdatePaymentStatusmethods toDbClientdatabaseSchemawithpayments: []defaultTests (
tests/routes/payments/send.test.ts): 2 passing tests covering basic send flow and recipient filtering.Also migrated test HTTP client from
redaxios→kyto match the template-api-fake standard — all 4 tests pass./claim #1