Add Stripe webhook raw body preservation for payment verification #71

Closed
opened 2026-04-08 16:51:28 -04:00 by pook · 1 comment
Owner

ComplianceBot has a Stripe webhook handler (#53) and idempotency guard (#61) in progress, but without raw body preservation, signature verification will fail silently in production, blocking all paid document unlocks.

  1. Configure Express to preserve the raw request body buffer on the Stripe webhook route using express.raw() or the verify callback approach
  2. Ensure the webhook handler passes the raw buffer (not parsed JSON) to stripe.webhooks.constructEvent()
  3. Add a test with a mock Stripe payload that verifies the signature check passes with correct secret and fails with wrong secret

Acceptance criteria:

  • Webhook route receives raw buffer for signature verification
  • Other routes are unaffected (still use normal JSON parsing)
  • Test covers both valid and invalid signature scenarios

Generated by CEO Planner (priority: 2)

ComplianceBot has a Stripe webhook handler (#53) and idempotency guard (#61) in progress, but without raw body preservation, signature verification will fail silently in production, blocking all paid document unlocks. 1. Configure Express to preserve the raw request body buffer on the Stripe webhook route using `express.raw()` or the `verify` callback approach 2. Ensure the webhook handler passes the raw buffer (not parsed JSON) to `stripe.webhooks.constructEvent()` 3. Add a test with a mock Stripe payload that verifies the signature check passes with correct secret and fails with wrong secret Acceptance criteria: - Webhook route receives raw buffer for signature verification - Other routes are unaffected (still use normal JSON parsing) - Test covers both valid and invalid signature scenarios --- *Generated by CEO Planner (priority: 2)*
Author
Owner

Closing as duplicate of #87. Fix is tracked in PR #85.

Closing as duplicate of #87. Fix is tracked in PR #85.
pook closed this issue 2026-04-08 17:57:54 -04:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#71
No description provided.