A lightweight Payment Gateway Sandbox built with ASP.NET Core 8, Blazor Server, and Clean Architecture.
The goal of this project is to provide a realistic payment gateway simulator that developers can integrate with during development and testing without requiring access to a real bank or payment service provider.
- Create Payment
- Update Payment Status
- Successful
- Failed
- Cancelled
- Verify Payment
- Payment Page
- Payment Result Page
- Callback Redirect
- Responsive Layout
- CSS Isolation
Application
│
▼
Create Payment
│
▼
Redirect User
│
▼
Payment Gateway
│
▼
User Action
│
├──────── Success
├──────── Failed
└──────── Cancelled
│
▼
Redirect To Callback
│
▼
Verify Payment
- Clean Architecture
- REST API
- Blazor Server UI
- Swagger
- In-Memory Storage
- Callback Support
- Payment Verification
- Reference Number Generation
- Payment Timestamp
- Payment Status Management
PaymentTestGateway
│
├── src
│ ├── PaymentTestGateway.Web
│ │
│ ├── PaymentTestGateway.Application
│ │
│ ├── PaymentTestGateway.Domain
│ │
│ └── PaymentTestGateway.Infrastructure
│
├── docs
│
├── samples
│
└── assets
Presentation
│
▼
Application
│
▼
Domain
│
▼
Infrastructure
POST /api/payment/create
Request
{
"amount": 400,
"description": "Test Payment",
"callbackUrl": "https://your-app.com/payment/callback"
}Response
{
"paymentId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"paymentUrl": "/pay/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}POST /api/payment/{paymentId}/success
POST /api/payment/{paymentId}/failed
POST /api/payment/{paymentId}/cancel
POST /api/payment/verify
Request
{
"paymentId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}Successful Response
{
"paymentId": "...",
"status": 1,
"amount": 400,
"referenceNumber": "204988438307",
"paidAt": "2026-07-13T12:20:00Z",
"isSuccessful": true
}/pay/{paymentId}
Displays
- Payment Id
- Amount
- Description
Actions
- Successful Payment
- Failed Payment
- Cancel Payment
/payment-result/{paymentId}
Displays
- Current Status
- Payment Id
- Amount
- Description
- Return To Application
Clone repository
git clone https://github.com/peymanpro/PaymentTestGateway.gitGo to project
cd PaymentTestGatewayRun application
dotnet run --project src/PaymentTestGateway.WebSwagger
http://localhost:5031/swagger
v1.0.0
This version provides a complete MVP payment gateway simulation suitable for local development and integration testing.
Business Rules
- Prevent duplicate payment
- Payment expiration
- Better error codes
- Idempotent payment operations
Persistence
- Entity Framework Core
- PostgreSQL
- Payment Repository
- Migration Support
Quality
- Unit Tests
- Integration Tests
- GitHub Actions
- Code Coverage
Operations
- Docker
- Docker Compose
- Health Checks
- Structured Logging
Advanced Gateway Features
- Webhook Notifications
- Merchant Management
- JWT Authentication
- Rate Limiting
- OpenTelemetry
- Metrics
- Admin Dashboard
This project is planned to be used by other repositories in this portfolio.
Enterprise Portfolio
PaymentTestGateway
▲
│
│
Enterprise Microservices Shop
│
├── Identity Service
├── Order Service
├── Inventory Service
├── Payment Service
└── Notification Service
RabbitMQ Saga Demo
GraphQL API
ML.NET Recommendation Engine
- Clean Architecture
- SOLID Principles
- Enterprise-ready Design
- Reusable Components
- Simple Integration
- Developer Friendly
MIT License
Issues, discussions, feature requests and pull requests are welcome.
If this project helps you, consider giving it a ⭐ on GitHub.