FinanceHub - Financial Infrastructure Module
Multi-Currency Payment Infrastructure for Modern Applications
FinanceHub is SophiChain's comprehensive financial management module that enables applications to accept and manage payments in multiple currencies (fiat, crypto, and custom credit points), handle invoicing, manage digital wallets, and provide automated currency conversion.
π Quick Linksβ
- Business Overview & Capabilities) - What FinanceHub can do for your business
- Technical Architecture) - Complete implementation guide
- System Flowcharts) - Visual architecture and workflows
- API Reference (Coming Soon)
- Integration Guide (Coming Soon)
π― What is FinanceHub?β
FinanceHub is an open-source, modular payment infrastructure that enables ANY application to accept both fiat and cryptocurrency payments for invoices. Built on ABP Framework, it provides a complete financial platform that developers worldwide can integrate into their projects.
Key Featuresβ
β
Multi-Currency by Design - Fiat, Crypto, Credit Points
β
Multi-Gateway Support - Stripe, PayPal, ZarinPal, Parbad, Shaparak, and more
β
DeFi Integration - Direct blockchain payments via DEX swaps
β
Pluggable Architecture - Add your own gateways/providers via NuGet
β
Complete Invoice System - Ready-to-use invoice management
β
Wallet System - Built-in multi-currency wallet management
β
Gamification - Credit points and reward systems
β
Open Source - MIT License, community-driven development
π Quick Startβ
Installationβ
# Install FinanceHub NuGet package
dotnet add package SophiChain.FinanceHub
# Add module dependency in your module class
[DependsOn(typeof(FinanceHubModule))]
public class YourApplicationModule : AbpModule
{
// Module configuration
}
Basic Usageβ
// Inject the invoice service
public class OrderAppService : ApplicationService
{
private readonly IInvoiceAppService _invoiceAppService;
public async Task<PaymentResult> CheckoutAsync(CreateOrderDto input)
{
// Create invoice for order
var invoice = await _invoiceAppService.CreateAsync(new CreateInvoiceDto
{
ExternalReference = $"ORDER-{orderId}",
Items = input.Items.Select(item => new InvoiceLineItemDto
{
Description = item.ProductName,
Quantity = item.Quantity,
UnitPrice = item.Price
}).ToList()
});
// User can pay with ANY supported gateway
return await _paymentAppService.InitiateAsync(new InitiatePaymentDto
{
InvoiceId = invoice.Id,
GatewayId = input.PreferredGateway
});
}
}
For detailed integration steps, see Integration Guide (Coming Soon).
π Documentationβ
For Business Leaders & Stakeholdersβ
Start here to understand the business value and capabilities:
π Business Overview & Capabilities)
This document covers:
- Executive summary and value propositions
- Target audience and use cases
- Core capabilities explained in business terms
- 8 detailed user stories with business impact
- ROI and cost/benefit analysis
- Getting started roadmap
Perfect for: CEOs, Product Managers, Business Analysts, Decision Makers
For Technical Teams & Developersβ
Dive into the technical implementation:
ποΈ Technical Architecture)
This comprehensive document includes:
- Complete architectural approach (ABP-aligned, DDD)
- Bounded contexts and domain model design
- Domain services and repository patterns
- Application layer implementation
- Event-driven architecture with ABP Event Bus
- Pluggable provider architecture (Payment Gateways, Exchange Providers, DEX)
- UI architecture with Blazor
- Security and permissions
- Performance considerations
- Extensibility patterns
Perfect for: Software Architects, Backend Developers, Frontend Developers
Visual Architecture & Workflowsβ
Understand the system visually:
This document provides:
- Module architecture overview
- Complete payment flow (sequence diagram)
- Invoice creation & payment flow
- Wallet operations state diagram
- Currency conversion flow
- Exchange rate update flow
- Event-driven architecture visualization
- Pluggable provider architecture
- DeFi treasury auto-conversion
- Gamification reward flow
- Entity relationships
- Permission hierarchy
Perfect for: All technical roles, System Designers, QA Engineers
ποΈ Architecture Highlightsβ
Layered Architecture (ABP/DDD)β
βββββββββββββββββββββββββββββββββββββββ
β Blazor UI (Components) β
βββββββββββββββββββββββββββββββββββββββ€
β Application Services (DTOs) β
βββββββββββββββββββββββββββββββββββββββ€
β Domain Services & Aggregates β
βββββββββββββββββββββββββββββββββββββββ€
β Repository Interfaces (Domain) β
βββββββββββββββββββββββββββββββββββββββ€
β Infrastructure (MongoDB/Providers) β
βββββββββββββββββββββββββββββββββββββββ
Core Bounded Contextsβ
- Currencies - Multi-type currency management (Fiat, Crypto, Credit Points)
- Payments - Payment orchestration and gateway integration
- Wallets - Multi-currency digital wallets
- Invoices - Invoice lifecycle management
- Exchange Rates - Real-time currency conversion
- Gateways - Payment gateway configuration
- DeFi Treasury - Automated crypto treasury management
- Gamification - Reward rules and credit points
Pluggable Providersβ
FinanceHub uses a hexagonal architecture for external integrations:
Payment Gateways (Separate NuGet packages):
SophiChain.FinanceHub.PaymentGateways.StripeSophiChain.FinanceHub.PaymentGateways.PayPalSophiChain.FinanceHub.PaymentGateways.ZarinPalSophiChain.FinanceHub.PaymentGateways.ShaparakSophiChain.FinanceHub.PaymentGateways.Crypto
Exchange Rate Providers:
SophiChain.FinanceHub.ExchangeProviders.CoinGeckoSophiChain.FinanceHub.ExchangeProviders.CoinMarketCapSophiChain.FinanceHub.ExchangeProviders.Wallex(IRR pricing)SophiChain.FinanceHub.ExchangeProviders.Manual
DEX Providers (DeFi):
SophiChain.FinanceHub.DexProviders.PancakeSwapSophiChain.FinanceHub.DexProviders.1inchSophiChain.FinanceHub.DexProviders.UniSwap
πΌ Use Casesβ
E-Commerce Platformβ
Accept payments from global customers in their preferred currency, with automatic conversion to your base currency.
// Customer sees prices in EUR, you receive USD
var invoice = await _invoiceManager.CreateAsync(new CreateInvoiceDto
{
Currency = "EUR",
Items = products,
CustomerEmail = "customer@example.com"
});
// FinanceHub handles all currency conversion automatically
SaaS Subscription Billingβ
Automate recurring billing with flexible payment options.
// Create monthly invoice, customer can pay with any method
var subscription = await _subscriptionService.CreateAsync(new SubscriptionDto
{
PlanId = planId,
BillingCycle = BillingCycle.Monthly,
Amount = 99,
Currency = "USD"
});
Marketplace with Escrowβ
Hold payments in escrow until work is completed.
// Hold payment in escrow wallet
await _walletManager.CreateEscrowAsync(new EscrowDto
{
Amount = 500,
Currency = "USD",
ReleaseCondition = "work_approved"
});
Crypto Payment Integrationβ
Accept cryptocurrency payments with automatic conversion.
// Accept Bitcoin payment, convert to stablecoin
var payment = await _paymentOrchestrator.InitiateAsync(new PaymentRequest
{
Amount = 100,
Currency = "BTC",
AutoConvertTo = "USDT"
});
For more detailed use cases, see Business Capabilities Document).
π Implementation Guideβ
Phase 1: Setup (Week 1)β
- Install FinanceHub module
- Configure database connections
- Run migrations
- Set up basic currencies
Phase 2: Gateway Configuration (Week 2)β
- Install gateway provider packages
- Configure API keys and settings
- Test payment flows in sandbox
- Enable production gateways
Phase 3: Invoice Integration (Week 3)β
- Create invoice templates
- Integrate with your order system
- Configure email notifications
- Test invoice generation and payment
Phase 4: Advanced Features (Week 4+)β
- Set up wallet system for users
- Configure exchange rate providers
- Implement gamification rules
- Set up DeFi treasury (if using crypto)
For complete implementation details, see Technical Architecture).
π Available Integrationsβ
Payment Gatewaysβ
| Gateway | Region | Currencies | Status |
|---|---|---|---|
| Stripe | Global | USD, EUR, GBP, 135+ | β Available |
| PayPal | Global | 25+ currencies | β Available |
| ZarinPal | Iran | IRR | β Available |
| Shaparak | Iran | IRR | β Available |
| Parbad | Iran | IRR (Multi-bank) | β Available |
| Crypto Wallet | Global | BTC, ETH, BNB, USDT | π‘ Beta |
Exchange Rate Providersβ
| Provider | Data Source | Update Frequency | Status |
|---|---|---|---|
| CoinGecko | Crypto + Fiat | Every 5 min | β Available |
| CoinMarketCap | Crypto | Every 5 min | β Available |
| Wallex | IRR/Crypto | Every 1 min | β Available |
| Manual Entry | Admin input | On-demand | β Available |
DEX Integrationsβ
| DEX | Blockchain | Tokens | Status |
|---|---|---|---|
| PancakeSwap | BNB Chain | BEP-20 | π‘ Beta |
| 1inch | Multi-chain | 100+ | π΄ Planned |
| UniSwap | Ethereum | ERC-20 | π΄ Planned |
id: index
π‘οΈ Security & Complianceβ
Security Featuresβ
- β Multi-Tenant Isolation - Complete data separation between tenants
- β Role-Based Access Control - Granular permission system
- β Audit Logging - Every transaction tracked
- β Encrypted Storage - Sensitive data encrypted at rest
- β Secure API Keys - Never store private keys in application
- β PCI DSS Ready - Payment data handling best practices
Complianceβ
- β GDPR Ready - Data privacy and user rights
- β Financial Auditing - Complete transaction trails
- β Tax Reporting - Export data for tax filing
- β Multi-Currency Reporting - Handle complex FX scenarios
id: index
π Current Statusβ
Version: 1.0.0-alpha
Status: π‘ Active Development
What's Implemented β β
- β Multi-currency management (Fiat, Crypto, Credit Points)
- β Complete invoice system
- β Multi-currency wallet system
- β Exchange rate integration (5 providers)
- β Payment gateway framework
- β Gamification engine
- β DeFi treasury management
- β Event-driven architecture
- β Admin and user portals (Blazor)
In Progress π‘β
- π‘ Namespace reorganization (ABP best practices)
- π‘ Domain service extraction
- π‘ Event handler implementation
- π‘ UI component decomposition
- π‘ Comprehensive testing
- π‘ API documentation
Planned π΄β
- π΄ Additional payment gateway providers
- π΄ Advanced reporting and analytics
- π΄ Subscription management
- π΄ Recurring billing automation
- π΄ Multi-language support (UI)
- π΄ Mobile app integration
id: index
π€ Contributingβ
We welcome contributions to FinanceHub! Ways to contribute:
Provider Packagesβ
Create provider packages for:
- Regional payment gateways
- Exchange rate sources
- DEX integrations
- Blockchain networks
Core Featuresβ
- Bug fixes and improvements
- Performance optimizations
- New features and capabilities
- Documentation improvements
Testingβ
- Unit tests
- Integration tests
- Performance tests
- Security audits
See Contributing Guide (Coming Soon) for details.
id: index
π Supportβ
Documentationβ
- Business: Capabilities Document)
- Technical: Architecture)
- Visual: Flowcharts)
- API: API Reference (Coming Soon)
Communityβ
- GitHub Issues: Report bugs
- Discussions: Ask questions
- Discord: (Coming Soon)
Commercialβ
- Professional Services: Custom development and consulting
- Priority Support: SLA-backed support plans
- Training: Team training and workshops
Contact: info@sophilabs.ir
id: index
π Licenseβ
FinanceHub is part of SophiChain and is released under the MIT License.
This means you can:
- β Use commercially
- β Modify the source code
- β Distribute
- β Use privately
- β No warranty
id: index
π Built Withβ
- ABP Framework - Application framework and DDD infrastructure
- .NET 9 - Runtime and libraries
- MongoDB - Document database
- Blazor - Web UI framework
- MediatR - In-process messaging
- AutoMapper - Object mapping
id: index
πΊοΈ Roadmapβ
2026 Q1 - Alpha Release β β
- Core architecture complete
- Basic payment flows working
- Initial provider packages
- Alpha documentation
2026 Q2 - Beta Releaseβ
- π― Namespace refactor complete
- π― Domain services extracted
- π― Event-driven architecture implemented
- π― UI components refactored
- π― Comprehensive testing (80%+ coverage)
2026 Q3 - Version 1.0β
- π― Production-ready release
- π― Complete API documentation
- π― 5+ payment gateway providers
- π― Advanced reporting and analytics
- π― Subscription management
2026 Q4 - Ecosystem Growthβ
- π― Community provider marketplace
- π― Additional DEX integrations
- π― Mobile SDK
- π― Advanced gamification features
id: index
π Learn Moreβ
Next Stepsβ
- Business Leaders: Start with Capabilities Document)
- Developers: Read Technical Architecture)
- Visual Learners: Explore System Flowcharts)
- Get Started: Follow Integration Guide (Coming Soon)
Related Documentationβ
- SophiChain Overview
- AIHub Documentation (Coming Soon)
- CommHub Documentation (Coming Soon)
- Deployment Guide (Coming Soon)
id: index
Ready to revolutionize your payment infrastructure?
Start with the Business Capabilities Document) or dive into the Technical Architecture)!
id: index
Last Updated: October 7, 2025
Module Version: 1.0.0-alpha
Documentation Version: 1.0