marconi-prog
fintech-payment-api
Java

Event-driven payment API built with Spring Boot, RabbitMQ, PostgreSQL and Docker.

Last updated Jun 25, 2026
35
Stars
2
Forks
0
Issues
0
Stars/day
Attention Score
60
Language breakdown
Java 100.0%
โ–ธ Files click to expand
README

Fintech Payment API

A Payment API built with Spring Boot, using PostgreSQL, RabbitMQ, and Docker.

This project demonstrates an Event-Driven Architecture (EDA) where order creation generates events that are sent to a message broker and processed asynchronously.


Technologies

  • Java 21
  • Spring Boot 3
  • Spring Data JPA
  • PostgreSQL
  • RabbitMQ
  • Docker
  • Swagger / OpenAPI
  • Lombok
  • Maven

Architecture

The system follows an Event-Driven Architecture using RabbitMQ for asynchronous communication.

It also follows a layered architecture, separating responsibilities into:

  • Controllers
  • Services
  • Repositories
Project structure:
src/main/java/com/pay/payment_api
โ”œโ”€โ”€ controller
โ”œโ”€โ”€ service
โ”œโ”€โ”€ repository
โ”œโ”€โ”€ dto
โ”œโ”€โ”€ mapper
โ”œโ”€โ”€ entity
โ”œโ”€โ”€ event
โ”œโ”€โ”€ consume
โ””โ”€โ”€ exception

Application Flow

  • Client sends a request to create an order
  • The order is stored in PostgreSQL
  • An OrderCreatedEvent is published to RabbitMQ
  • A consumer receives and processes the event
Simplified flow:
Client โ†’ API โ†’ Database
              โ†“
           RabbitMQ
              โ†“
           Consumer

Features

  • Create orders
  • List orders
  • Update order status
  • Publish events to RabbitMQ
  • Consume events asynchronously
  • Global exception handling
  • API documentation with Swagger
  • Running the Project
1 Clone the repository
git clone https://github.com/marconi-prog/fintech-payment-api.git
cd fintech-payment-api

2 Start containers

docker compose up -d
This will start:

  • PostgreSQL
  • RabbitMQ
3 Run the application
mvn spring-boot:run

API Documentation

Swagger UI available at:

http://localhost:8080/swagger-ui/index.html

Endpoints Create Order

POST /orders

Request body:

{   "customerId": "UUID",   "amount": 100.50 }
List Orders

GET /orders

Update Order Status

PATCH /orders/{id}/status

Available status values:

PENDING

PAYMENT_PROCESSING

PAYMENT_APPROVED

PAYMENT_FAILED

Error Handling

The application includes a Global Exception Handler to standardize error responses.

Example response:

{   "message": "Order not found",   "status": 400,   "timestamp": "2026-03-05T03:40:00" }

Author

Marconi Farias Backend Developer

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท marconi-prog/fintech-payment-api ยท Updated daily from GitHub