CryptoPay

Decentralized crypto payment gateway built with Solidity + Next.js, inspired by Stripe & PayPal.

CryptoPay

Created At

ETHOnline 2025

Project Description

This project is a Web3 Crypto Payment Gateway DApp that bridges blockchain technology with real-world payments — delivering a decentralized alternative to traditional platforms like Stripe and PayPal.

It allows merchants to accept cryptocurrency payments directly into their wallets, ensuring full transparency, security, and self-custody of funds. Built with Solidity smart contracts and Next.js, the system offers a complete, production-grade payment infrastructure including transaction management, merchant dashboards, webhook events, and crypto-to-fiat conversions.

✨ Key Features

Crypto Payment Checkout: Accept native or ERC-20 token payments through a sleek, Stripe-style checkout page.

Merchant Dashboard: Track payments, settlements, transaction analytics, and withdrawals in real time.

Secure Smart Contracts: Non-custodial payments with role-based permissions and protocol fee control.

Event-Based Architecture: On-chain events mirrored to off-chain webhooks for notifications, receipts, and analytics.

Token Support: Native chain tokens and selected ERC-20s (configurable allowlist).

Multi-Chain Ready: Deployable on Ethereum, Polygon, or any EVM-compatible network.

Decentralized Treasury: Protocol and merchant funds securely managed via smart contracts.

Developer Friendly: Testnet-ready setup with .env-based configuration and CI/CD support.

The result is a fully decentralized payment gateway that empowers developers, businesses, and dApp creators to integrate Web3 payments with a user experience as fluid as traditional fintech systems.

How it's Made

The Web3 Crypto Payment Gateway DApp is organized into three core layers — Smart Contracts, Frontend DApp, and Backend Services — each designed for scalability, transparency, and optimal performance.

The Smart Contract layer, built using Solidity and Hardhat, handles all core payment functionality. The main contract, PaymentGateway.sol, manages charge creation, payment processing, refunds, and event emissions. Security is reinforced with OpenZeppelin libraries such as Ownable, ReentrancyGuard, and AccessControl, ensuring safe and controlled operations. Optional Chainlink price feeds provide crypto-to-fiat conversion support, while a UUPS proxy upgrade pattern allows future scalability without redeployment. Rigorous testing using Hardhat, Mocha, and Chai ensures the contract logic, event flow, and fee mechanisms function flawlessly and securely.

The Frontend, developed with Next.js 14, offers a clean, Stripe-inspired interface for users and merchants. It integrates Wagmi and RainbowKit for seamless wallet connectivity, while TailwindCSS and shadcn/ui deliver a refined, responsive design. React Hook Form paired with Zod ensures accurate, secure, and validated input handling. The DApp supports dynamic routing for key pages like merchant dashboards, charge creation, and payment confirmations, optimized for both performance and accessibility.

The Backend Services, powered by Next.js API Routes and Prisma ORM, manage all off-chain operations and synchronize blockchain data. A PostgreSQL database stores merchant profiles, charges, and transaction histories. A WebSocket listener captures and tracks on-chain events in real time, ensuring accurate data reflection in the dashboard. Webhooks with idempotent retry logic deliver reliable notifications to merchants, and all API routes are protected using API key-based authentication. Built-in analytics offer transaction summaries and insights, helping merchants track performance and settlements efficiently.

This streamlined architecture combines Web3’s trustless, decentralized core with Web2’s usability and efficiency, creating a secure, intuitive, and developer-friendly crypto payment gateway platform.

background image mobile

Join the mailing list

Get the latest news and updates