Add payment lifecycle API with idempotent send support#21
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f49104ab4
ℹ️ 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".
| })(async (req, ctx) => { | ||
| const body = sendPaymentBodySchema.parse(await req.json()) | ||
|
|
||
| if (body.idempotency_key) { |
There was a problem hiding this comment.
Handle empty idempotency keys consistently
The replay guard uses a truthiness check (if (body.idempotency_key)), but the request schema allows idempotency_key: "" because it is z.string().optional(). In that case, the deduplication branch is skipped and repeated POST /payments/send calls with the same empty key create duplicate payments, which breaks the endpoint’s advertised idempotent retry behavior for this input.
Useful? React with 👍 / 👎.
Summary
send,list,get,complete, andcancelPOST /payments/sendto make retries safeValidation
bunis not installed./claim #1