https://github.com/gsferreira/simple-payment-gateway
Exploration project using Event Sourcing, CQRS, MediatR and Hexagonal/Clean Architecture (.net core)
https://github.com/gsferreira/simple-payment-gateway
clean-architecture cqrs event-sourcing hexagonal-architecture mediatr
Last synced: 6 months ago
JSON representation
Exploration project using Event Sourcing, CQRS, MediatR and Hexagonal/Clean Architecture (.net core)
- Host: GitHub
- URL: https://github.com/gsferreira/simple-payment-gateway
- Owner: gsferreira
- License: mit
- Created: 2020-02-27T21:46:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:15:23.000Z (almost 3 years ago)
- Last Synced: 2025-03-26T09:44:53.353Z (6 months ago)
- Topics: clean-architecture, cqrs, event-sourcing, hexagonal-architecture, mediatr
- Language: C#
- Homepage:
- Size: 51.8 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Payment Gateway
Simple Payment Gateway is an example of how to approach a real-world problem using:
- Event Sourcing
- CQRS
- Mediator Pattern
- Hexagonal/Clean architectureThis is an exploration project. Please don't expect a production-ready code.
The solution includes a Payment Gateway Service and a Bank Simulator. The Bank Simulator is a Fake service for development purposes.
The system is currently storing the information in memory.
## Prerequisites
Before you begin, ensure you have met the following requirements:
* You have installed .net core 3.1
## Building
To build simple-payment-gateway, follow these steps:
Linux and macOS:
```
./build.sh
```Windows:
```
.\build.ps1
```## Using simple-payment-gateway
To use simple-payment-gateway, follow these steps:
1. Configure the FakeBank service endpoint at the PaymentGateway.Api `appsettings.json` file
2. Start the FakeBank Service
3. Start the PaymentGateway.Api Service
1. You can interact with it using the REST API or accessing the Swagger page at `/swagger`### Testing payments
Send a POST request to the endpoint `/api/Payments`.
JSON payload example:
```JSON
{
"amount": 200,
"currency": "EUR",
"card": {
"type": "VISA",
"name": "GF",
"number": "1111222233334444",
"expireMonth": 12,
"expireYear": 2020,
"cvv": 123
}
}
```## What's next / Improvement ideas
- Implement a Database
- Idempotency
- Logging
- Use Correlation Id for tracking requests
- Implement an enumeration with the accepted Card Types
- Unit tests - Implement the Builder pattern to simplify data initialization
- Implement Integration Tests
- Ensure that Personal Identifiable Information is anonymized