Next.js · Razorpay · Payments
Real money in a Next.js marketplace: Razorpay, wallets and a ledger
By Rohan Mondal · · 1 min read

FreeEarnHub lets businesses pay many people for small online tasks. That means money moves in three directions: businesses fund wallets, workers earn per approved task, and admins approve withdrawals. Every step has to stay correct even when a browser closes in the middle of a payment.
Three roles, three dashboards
The app is built on the Next.js App Router with NextAuth sessions and role-based routing. Users, businesses and admins each get their own flows, and the server decides what each role can see and do.
Funding wallets through Razorpay
Businesses top up their wallet with Razorpay. The server creates the payment order, and when the payment completes it verifies Razorpay's signature on the server, never trusting the browser to say a payment succeeded.
If the customer closes the tab before the confirmation reaches the app, a Razorpay webhook settles the payment anyway. Settlement is idempotent: processing the same payment twice can't credit the wallet twice.
A ledger entry for every rupee
Wallet balances aren't a number that gets overwritten. Every credit and debit is written as a ledger entry, double-entry style, inside an atomic database transaction. The balance can always be explained, line by line, which is what you want the day someone asks where their money went.
Tasks, reviews and withdrawals
- Businesses post tasks; workers submit proof
- Submissions are reviewed before any money moves
- Approved work credits the worker's wallet through the ledger
- Withdrawals go through admin approval, with a treasury view of all funds
Prisma models the wallets, ledger, tasks, submissions and payment orders on Neon PostgreSQL, with uploads stored on Cloudinary.
Related services: Web App & SaaS Development
Want something like this built?
Share a few details and within 24 hours I'll send ideas, a timeline and a free, fixed quote.