Skip to content

Extract Stripe Domain Models and Simplify Webhook Handling #34

@frogr

Description

@frogr

Problem

Stripe webhook handling is spread across multiple services with mixed responsibilities.

Tasks

  • Create domain models for Stripe events (e.g., StripeEvent, CheckoutSession, SubscriptionEvent)
  • Extract event handlers into separate command objects
  • Implement event factory pattern
  • Simplify StripeWebhookService to only orchestrate

Acceptance Criteria

  • Create app/models/stripe/ directory with domain models
  • Each webhook event type has its own command class
  • StripeWebhookService reduced to <50 lines
  • All existing webhook specs pass
  • Add unit tests for new domain models
  • Integration tests remain unchanged

Files to modify

  • app/services/stripe_webhook_service.rb
  • app/services/stripe_signature_verification_service.rb
  • Create new files in app/models/stripe/
  • Update spec/services/stripe_webhook_service_spec.rb

Phase: 2 (Domain)
Priority: High

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions