Skip to content

Add organization billing webhooks bridge for Stripe events in new src/routes/billingWebhooks.ts #475

Description

@1nonlypiece

Add organization billing webhooks bridge for Stripe events in new src/routes/billingWebhooks.ts

Description

Enterprise tenants will eventually be billed externally and Stripe webhooks need a stable receiver that verifies the Stripe-Signature header, persists the event, and dispatches via the existing job queue. Add src/routes/billingWebhooks.ts mounted at POST /api/billing/webhooks with raw-body signature validation.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Use a per-route express.raw body parser
  • Persist events to a new billing_events table
  • Use idempotency from src/services/idempotency.ts
  • Add src/routes/billingWebhooks.test.ts
  • Update docs/enterprise.md

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/stripe-webhooks
  • Implement changes
    • Add route and migration
    • Add tests and docs
  • Test and commit
    • Run npm run migrate:latest && npm test
    • Include test output and notes

Example commit message

feat: Stripe billing webhook receiver

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programapiREST APIbackendDisciplr API serverintegrationCross-service integration

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions