A simple and secure Spring Boot based payment transfer service that allows users to transfer funds between accounts within a digital banking platform. This service includes robust error handling and transaction logging to ensure data integrity and traceability.
-
Secure Transfers: Enables users to move funds from one internal account to another.
-
Validation: Ensures the source account has sufficient funds and prevents illogical transactions (e.g., same-source and destination).
-
Transaction Recording: All transfers are logged for compliance, reporting, and audit purposes.
-
Error Handling: Graceful and consistent error messages.
- Backend Framework: Spring Boot (v 3.5.3)
- Language: Java 17+
- Data Layer: Spring Data JPA
- Database: H2 In-Memory Database
- Build Tool: Maven
Endpoint: POST /transfer Sample Request:
{
"sourceAccountId": 1,
"destinationAccountId": 2,
"amount": 20
}Typical Responses:
200 OK:Transaction successful404 Not Found:Account does not exist400 Bad Request:Invalid input (e.g. negative amount)406 Not Acceptable:Insufficient funds
src/
├── configuration/ # Global configs, interceptors, and filters
├── controller/ # REST controllers
├── service/ # Business logic
├── repository/ # Spring Data repositories
└── model/ # Entity definitionsRun the Application:
git clone https://github.com/your-username/payment-transfer-system.git
cd payment-transfer-system
mvn spring-boot:runApplication will start at URL: http://localhost:8080