feat: filter and parse crypto payment_intent events#51
Merged
geminimir merged 1 commit intogeminimir:mainfrom Mar 13, 2026
Merged
Conversation
Add event processor that filters verified Stripe webhooks to only process crypto payment_intent events (succeeded, processing, failed). Extracts amount (converted to microUSDC), currency, chain hint, and token hint from metadata. Duplicate event IDs are silently dropped for idempotency. Closes geminimir#7 Made-with: Cursor
76021f2 to
43c9f93
Compare
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
After signature verification, filter Stripe webhook events to only process crypto payment method types (
payment_intent.succeeded,payment_intent.processing,payment_intent.payment_failed). Extract chain, token, amount, and address metadata, converting Stripe cents to microUSDC for storage in thestripe_payment_eventstable.Changes
event-store.ts—EventStoreinterface withinsertEvent/eventExistsfor DB abstractionevent-processor.ts—processStripeEvent()that filters by event type, checks for crypto payment method, rejects duplicates by event ID, parses amount (cents → microUSDC), currency, chain hint, and token hint from metadatawebhook.ts— callprocessStripeEvent()after signature verification when anEventStoreis providedHow to Test
npm cinpm run typechecknpm testTests
npm test) — 11 tests across 2 suitesnpm run lint)npm run typecheck)npm run format:check) — all warnings are pre-existing, no issues in changed filesChecklist
Related Issues
Closes #7
Made with Cursor