Skip to content

feat(webhooks): Implement outgoing webhook system for platform events#1

Open
devdianax wants to merge 2 commits intomainfrom
feature/cross-asset-payment-backend
Open

feat(webhooks): Implement outgoing webhook system for platform events#1
devdianax wants to merge 2 commits intomainfrom
feature/cross-asset-payment-backend

Conversation

@devdianax
Copy link
Copy Markdown
Owner

Summary

Implements an outgoing webhook system that allows organizations to subscribe to platform events.

Changes

  • Database Migration: Added webhook_subscriptions and webhook_delivery_logs tables
  • Webhook Service: Enhanced with multi-tenant support (organization_id), HMAC-SHA256 signature verification, and exponential backoff retry logic
  • Webhook Controller: Added authentication, organization isolation, and full CRUD + delivery logs endpoints
  • Event Integration: Added webhook dispatching to:
    • EmployeeService (employee.added, employee.updated, employee.deleted)
    • ClaimableBalanceService (claimable_balance.created, claimable_balance.claimed)

Events Supported

  • payment.completed, payment.failed
  • employee.added, employee.updated, employee.deleted
  • payroll_run.created, payroll_run.completed
  • claimable_balance.created, claimable_balance.claimed
  • contract.upgraded

Acceptance Criteria

  • Webhook subscription management API
  • Event dispatching with cryptographic signatures (HmacSHA256)
  • Retry logic with exponential backoff for failed deliveries

Closes Gildado#227

Implements backend pathfinding for cross-asset payments by:
- Adding crossAssetPaymentService with Horizon pathfinding API
- Adding /payments/pathfind endpoint in payment controller and routes
- Returns available conversion paths with rates, fees, and slippage

Closes Gildado#249
- Add database migration for webhook_subscriptions and webhook_delivery_logs
- Update webhook service with multi-tenant support (organization_id)
- Add HMAC-SHA256 signature verification for webhook payloads
- Implement exponential backoff retry logic for failed deliveries
- Add webhook dispatching to employee and payment services
- Include delivery logs tracking for debugging

Events supported:
- payment.completed, payment.failed
- employee.added, employee.updated, employee.deleted
- payroll_run.created, payroll_run.completed
- claimable_balance.created, claimable_balance.claimed
- contract.upgraded

Closes Gildado#227
@devdianax devdianax force-pushed the feature/cross-asset-payment-backend branch from 8192740 to b3c84f6 Compare March 24, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#048: Webhook System for Integrations

2 participants