fix: preserve raw body bytes for Stripe webhook signature verification #85
No reviewers
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot!85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/webhook-raw-body-preservation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Buffer.from(arrayBuffer())instead ofc.req.text()in the webhook route to preserve exact raw bytes for Stripe HMAC signature verificationstripe.webhooks.constructEvent()checksCloses #78, closes #71. Unblocks #72 and #53 (payment flow).
Changes
packages/api/src/routes/billing.ts— raw body preservation viaarrayBuffer()packages/api/tests/e2e/webhook.test.ts— new test suite (7 test cases)Test plan
stripe trigger checkout.session.completed🤖 Generated with Claude Code
⚠️ No Test Suite Detected
Commit:
3b69196dNo
testscript found inpackage.json. Add a test script to enable automated testing.This is the surviving PR for the Stripe webhook raw body fix. Duplicate PRs #89, #81, #75 have been closed. Duplicate issues #83, #78, #71 have been closed in favor of #87.
Review summary:
c.req.text()) → closedThis PR correctly uses
Buffer.from(await c.req.arrayBuffer())to preserve exact raw bytes for HMAC verification, with 9 comprehensive tests.Closes #87