Skip to content

Improve Coinbase Payments transfer webhook normalization#312

Merged
GsCommand merged 1 commit into
mainfrom
codex/improve-coinbase-webhook-normalization-for-transfers
May 23, 2026
Merged

Improve Coinbase Payments transfer webhook normalization#312
GsCommand merged 1 commit into
mainfrom
codex/improve-coinbase-webhook-normalization-for-transfers

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Coinbase payments.transfers.* webhook events were normalized with poor subject mapping and fell back to the event id, losing transfer-specific context.
  • Produce CLAS receipts that surface transfer IDs, status, asset, amount and network so downstream consumers can reliably interpret payment transfer events.

Description

  • Detect payments.transfers.* events in normalizeReceipt and map subject.type to "payment_transfer" for those events.
  • Set subject.id by preference: data.id, then data.transfer_id, then data.payment_id, then the event id fallback, while keeping existing transaction-hash behavior for non-transfer events.
  • Populate output.observation with accepted: true, provider: 'coinbase_cdp', event_type, and transfer-specific fields: transfer_status (derived from the event suffix), plus optional transfer_id, asset, amount, and network when present.
  • Add transfer fields into metadata.trace.tags (provider, event_type, transfer_status, and optional transfer_id) and preserve existing HMAC verification, signing logic, and handling for other event types.

Testing

  • Added tests in tests/api-coinbase-webhook.test.js for payments.transfers.completed (checks subject mapping, observation fields and local receipt verification), payments.transfers.failed (checks transfer_status), and unknown-event fallback to event id.
  • Ran npm test and all tests passed (97 passed, 0 failed), including the new transfer-related tests.

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
commandlayer-commandlayer-org Ready Ready Preview, Comment May 23, 2026 10:29pm
commandlayer-org Ready Ready Preview, Comment May 23, 2026 10:29pm
commandlayer-org111 Ready Ready Preview, Comment May 23, 2026 10:29pm

Request Review

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant