A backend API for a fintech wallet system built with ASP.NET Core and Entity Framework Core. The system allows users to register, create wallets, deposit and withdraw funds, transfer money, and fund wallets via Paystack payment gateway.
- User registration and login with secure password hashing
- JWT-based authentication
- Create and manage digital wallets
- Deposit and withdraw funds
- Transfer money between wallets
- Fund wallets via Paystack payment gateway
- Payment verification with automatic wallet crediting
- Transaction history
- Generic repository pattern
- RESTful API design with Swagger documentation
- Unit tests with xUnit and Moq
| Layer | Technology |
|---|---|
| Framework | ASP.NET Core (.NET 10) |
| Language | C# |
| Database | SQLite (via Entity Framework Core) |
| Authentication | JWT (JSON Web Token) |
| Payment | Paystack |
| Testing | xUnit, Moq |
| Documentation | Swagger / Swashbuckle |
The project follows a layered architecture with a factory pattern for payment processing.
Controller β Service β Repository β Database
β
PaymentFac β IPayment (Paystack)
- Controllers β handle HTTP requests and responses
- Services β contain business logic
- Repositories β generic data access via
IRepository<T> - Payments β payment gateway integration using factory pattern
- Models β domain entities and DTOs
FintechWallet/
β
βββ Controllers/
β βββ AuthController.cs # Registration & login endpoints
β βββ WalletController.cs # Wallet, transaction & payment endpoints
β
βββ Services/
β βββ IAuthService.cs # Auth service interface
β βββ AuthService.cs # JWT token generation, password hashing
β βββ IWalletService.cs # Wallet service interface
β βββ WalletService.cs # Deposit, withdraw, transfer logic
β
βββ Repositories/
β βββ IRepository.cs # Generic repository interface
β βββ Repository.cs # Generic repository implementation
β
βββ Payments/
β βββ IPayment.cs # Payment provider interface
β βββ PaymentFac.cs # Payment factory
β βββ Paystack/
β βββ PaystackPayment.cs # Paystack payment implementation
β
βββ Models/
β βββ User.cs # User entity
β βββ Wallet.cs # Wallet entity
β βββ Transaction.cs # Transaction entity & enum
β βββ Payment.cs # Payment request model
β βββ PaymentLog.cs # Payment audit log entity
β βββ Dtos.cs # Data transfer objects
β
βββ Data/
β βββ WalletDbContext.cs # EF Core database context
β
βββ Tests/
β βββ WalletServiceTests.cs # Unit tests for WalletService
β
βββ Program.cs # App configuration & DI setup
βββ appsettings.json # App settings & connection strings
βββ README.md
- .NET SDK 10 or later
- Visual Studio, VS Code, or Rider
# Clone the repository
git clone https://github.com/muisoft/fintech-wallet-dotnet.git
# Navigate to the project folder
cd fintech-wallet-dotnet
# Restore dependencies
dotnet restore
# Run the application
dotnet runThe API will be available at http://localhost:5000 with Swagger UI at /swagger.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register a new user |
| POST | /api/auth/login |
Login and receive JWT token |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/wallets |
Create a new wallet |
| GET | /api/wallets |
List all user wallets |
| GET | /api/wallets/{id} |
Get wallet details |
| POST | /api/wallets/{id}/deposit |
Deposit funds |
| POST | /api/wallets/withdraw |
Withdraw funds |
| POST | /api/wallets/transfer |
Transfer between wallets |
| GET | /api/wallets/{id}/transactions |
Get transaction history |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/wallets/fund-with-payment |
Initialize Paystack payment |
| POST | /api/wallets/verify-funding |
Verify payment & credit wallet |
The API uses JWT Bearer authentication. Include the token in the Authorization header:
Authorization: Bearer <your_token>
dotnet testThis project is licensed under the MIT License.
Muideen Adewale β Senior Software Engineer