This project, bmb.payment
, is the payment microservice for a fast food application. It provides a simple API that allows users to create payments and integrates with various payment service providers to handle payment creation and receive payment status notifications. Additionally, it integrates with other domain microservices through messaging using MassTransit.
- Payment Creation: Easily create payments through a simple API.
- Payment Integration: Integrates with MercadoPago payment service provider.
- Payment Notifications: Receives and processes payment status notifications.
- Microservice Communication: Uses MassTransit for messaging between domain microservices.
It uses DynamoDB as database to store payment information, taking advanatge on nosql databases so onboarding new payment providers will need less overthinking due to its schema flexibility.
It uses Masstransit to manage communication between services. Masstransit automatically creates Topics, Queues and Subscriptions.
- .NET Core
- MassTransit
- Docker (optional, for containerization)
- Clone the repository:
git clone https://github.com/soat-fiap/bmb.payment.git
- Navigate to the project directory:
cd bmb.payment
- Restore dependencies:
dotnet restore
To run the application locally, use the following command:
dotnet run
To run the application in a Docker container:
- Build the Docker image:
docker build -t bmb.payment .
- Run the Docker container:
docker run -d -p 5000:80 bmb.payment
- Create Payment:
POST /api/payments
- Get Payment Status:
GET /api/payments/{id}/status
- Docker with Minikube configured
- webhook.site token
whcli forward --token=f513d4a6-4dbd-4e32-93f5-b35376f33c89 --target=http://localhost/api/notifications/mercadopago
curl -X POST "https://yourapiurl/api/payments" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"amount\": 100.0, \"currency\": \"USD\", \"paymentMethod\": \"CreditCard\" }"