Payment Management System

Product sc
Product sc
Tech Stack
Core Backend
Java 24Spring Boot 3.5.xSpring SecuritySpring Data JPA / Hibernate
Database & Payments
PostgreSQLRazorpay SDK
Infra & Services
DockerCloudinaryREST APIs
System design
Core system design
Core System Design

When a merchant creates an order, the backend calls Razorpay and returns an order ID to the client. On payment completion, the client sends the payment ID and signature to the verify endpoint, which validates the cryptographic signature and persists the payment in PostgreSQL before responding immediately. Invoice PDF generation and Cloudinary upload run asynchronously in a background thread afterward, cutting confirmation latency from ~3s to under 750ms. Razorpay webhooks independently reconcile payment and refund events in case the client disconnects, with retry logic handling cases where the webhook arrives before the database write completes.

Deployment

FishPay follows a layered Controller → Service → Repository architecture on Spring Boot, containerized using a multi-stage Docker build. The first stage uses Maven with a full JDK to resolve dependencies and compile the project into a jar; the second stage discards Maven and the build toolchain entirely, copying over only the compiled jar into a fresh runtime image, keeping the final image free of build-time dependencies. The backend is deployed on Render, PostgreSQL is hosted separately on Neon, and generated invoice PDFs are stored on Cloudinary.