Skip to main content
Chargeworx uses a layered architecture with clear separation of concerns across multiple projects.

Project structure

API layer

Chargeworx.Api
  • ASP.NET Core Web API with Swagger/OpenAPI documentation
  • OAuth2 client credentials flow via IdentityServer4
  • Scope-based authorization (AdminUIScope, PaymentScope)
  • Controllers organized by domain (Admin, Payment, Internal)
  • Request logging middleware and health checks
Chargeworx.Api.AdminClients
  • HTTP clients for admin operations
  • Typed clients for company, project, user, and transaction management
Chargeworx.Api.PaymentClients
  • HTTP clients for payment operations
  • Transaction processing and payment info management

Admin UI layer

Chargeworx.Admin
  • ASP.NET Core MVC admin portal with Razor views
  • Cookie-based authentication with optional MFA
  • Session management and user invitation system
  • Real-time notifications via SignalR
  • Report generation and data visualization
  • Background process monitoring

Domain layer

Chargeworx.Api.Domain
  • Business logic and orchestration
  • Managers for each domain entity
  • Integration with payment processors (CyberSource, PayPal/Payflow)
  • Anti-fraud service integration
  • Import/export services
  • Email notification services
Chargeworx.Api.Core
  • Domain models and DTOs
  • Enums and constants
  • Validation attributes
  • Request handlers (Admin, Payment)

Data layer

Chargeworx.Api.Data
  • Entity Framework Core contexts for 4 separate databases
  • Repository pattern via stores
  • Stored procedures for complex queries
  • Database migrations and seeding
  • Connection abstractions for multi-database support
Chargeworx.Api.Common
  • Shared configuration models
  • Encryption helpers (AES, RSA)
  • Cache management
  • AWS integration utilities

Payment processing

Chargeworx.PaymentProcessor
  • CyberSource SOAP/REST API integration
  • PayPal Payflow Pro integration
  • Account updater service
  • Chargeback and refund processing
  • Report download and parsing

Utilities

Chargeworx.ConsoleImporter
  • Console utility for data seeding
  • Bulk import of companies, projects, and keys
  • Migration tools
Chargeworx.Tests
  • Integration test harness
  • Test configuration and fixtures
Chargeworx.Common
  • Email sender service
  • Firebase push notifications
  • View rendering for emails
  • In-memory cache manager

Dependency flow

Chargeworx.Api → Chargeworx.Api.Domain → Chargeworx.Api.Data
                ↓                        ↓
        Chargeworx.Api.Core      Chargeworx.Api.Common

        Chargeworx.PaymentProcessor
Each layer depends only on layers below it, maintaining clean separation of concerns.