SimpliPay is a simplified payment service provider (PSP) that facilitates electronic payment transactions between various parties, such as customers, companies and banks. It provides credit card and debit card payments.
- Payment Gateway API: A RESTful API that allows customers to make payments using credit or debit cards.
- Payment Processor Worker: A message queue that processes payments asynchronously.
- HTTP API interface
- Topic-based message queue for processing payments
- ApiKey-based authentication
- Rate limiting
- Handling errors and exceptions globally
- Unit and integration tests
- Dockerized application
- POST /api/v1/payments: Create a payment
- GET /api/v1/payments/{id} : Get payment details by id
- GET /api/v1/payments: Get all payments details
- GET /api/v1/balances: Get the balance summary of all payments
- .NET Core 8.0
- Docker/Docker Compose
- PostgreSQL
- Kafka
- MassTransit
- xUnit
If you want to run the application locally, you need to have the following tools installed on your machine:
- .NET SDK >= 8.0.0
- Docker Engine >= 24.0.0 With Docker Compose
Or you can run the application using the Dev Container feature of Visual Studio Code or the GitHub Codespaces feature.
- Clone this repository to your local machine
git clone https://github.com/leoguilen/simplipay.git
- Go to the project root folder
cd simplipay
- Run the following command which will deploy the environment
docker compose -f ./deploy/docker/compose.yaml up -d --build
- Wait for the command to finish and access the following services with the URLs below:
- Payment Gateway API: http://localhost:8080/swagger
- Kafka UI (kafdrop): http://localhost:19000
- For testing the application, you can use any of the following ApiKeys:
<!eC8>8nYmKfJnT;B%EJH:J[f{WR5P]o
o56nS@{7Kio?9[Dh:sx*U@g^:Eiu4(I+
bmUOa*LOGR]beu8MUDs)+PM5f^3|lqBj
);3:KT0OF]My$r}W-i,uQI|%o6k6z^X3
$Uai9oyi>6e*4L$zDxCQL1X-9A9ABA9l
- For make a payment request, you can use the following payload:
{
"amount": {
"value": 9.90,
"currency": "BRL"
},
"card": {
"number": "5278460298233958",
"holderName": "Sylvester Stallone",
"expiryDate": "2025-02-24",
"cvv": "879"
},
"paymentMethod": 1, // 1 - CreditCard, 2 - DebitCard
"description": "Machine Gun",
"date": "2024-04-24T00:00:00"
}
- To stop the environment, run the following command:
docker compose -f ./deploy/docker/compose.yaml down
- To run the automated tests, run the following command:
dotnet test