How onesch/event-driven-payment-service works
This repository is an asynchronous payment API. Clients submit and retrieve payments; the API validates request data, delegates to payment service logic, and persists or looks up records while enforcing idempotency. The source also configures an async database session and payment model. Project metadata describes RabbitMQ, a transactional outbox, retries, and dead-letter queues, but no corresponding worker or messaging implementation appears in the supplied tree, so those capabilities are shown only as unverified scope. The README documents database setup, not runtime wiring.
Main entry points: v1/payment.py Payment Routes · service/payment.py Payment Service · db_service/payment.py Payment DB Access · database.py Async DB Sessions
Components 13
HTTP API
- FastAPI App
src/payment_service/main.py - Payment Routes
src/payment_service/api/v1/payment.py
Payment Logic
- Payment Schemas
src/payment_service/schemas/payment.py - Payment Service
src/payment_service/service/payment.py - Messaging Features
src/payment_service
Persistence
- Payment DB Access
src/payment_service/db_service/payment.py - Async DB Sessions
src/database/database.py - DB Configuration
src/settings.py - Payment Model
src/payment_service/models/payment.py - ORM Base
src/database/models/base.py
Other components
- API Client
- PostgreSQL
- RabbitMQ
Connections 12
- API Client → FastAPI App: sends requests
src/payment_service/main.py - FastAPI App → Payment Routes: registers router
src/payment_service/main.py - Payment Routes → Payment Service: calls
src/payment_service/api/v1/payment.py - Payment Routes → Payment Schemas: validates and formats
src/payment_service/api/v1/payment.py - Payment Service → Payment Schemas: accepts input
src/payment_service/service/payment.py - Payment Service → Payment DB Access: calls lookups and create
src/payment_service/service/payment.py - Payment DB Access → Async DB Sessions: opens sessions
src/payment_service/db_service/payment.py - Payment DB Access → Payment Model: queries and creates
src/payment_service/db_service/payment.py - Payment Model → ORM Base: inherits
src/payment_service/models/payment.py - Async DB Sessions → DB Configuration: reads URL
src/database/database.py - Async DB Sessions → PostgreSQL: connects to
- Messaging Features → RabbitMQ: described integration