Inspiration
As cryptocurrency adoption grows, many merchants face challenges in accepting Bitcoin payments easily and accurately. Existing tools are often complex or limited to specific currencies. I wanted to build a straightforward, user-friendly solution that allows merchants to generate Bitcoin payment invoices in multiple fiat currencies, share them instantly, and track invoice validity — all in one clean interface.
What it does
BitMerchant is a simple yet powerful tool that enables merchants to generate Bitcoin payment invoices quickly and easily. It allows you to: Enter an amount in your preferred fiat currency (USD, INR, EUR, and more). Automatically converts the entered amount to its equivalent Bitcoin (BTC) value using live exchange rates. Generates a Bitcoin payment invoice string with the correct BTC amount and merchant address. Creates and displays a QR code for the invoice that customers can scan to pay instantly. Provides options to download the QR code image for sharing or printing. Offers convenient sharing buttons to send the invoice via WhatsApp or email. Allows copying the invoice string to the clipboard with one click. Shows a countdown timer indicating invoice expiry for security and accuracy. In short, BitMerchant streamlines the process of accepting Bitcoin payments by creating accurate, shareable, and easy-to-use payment invoices that work with multiple fiat currencies.
How we built it
Backend: Built a Spring Boot REST API that fetches live Bitcoin prices against multiple fiat currencies from the CoinGecko API. The API generates an invoice string with the BTC amount and creates QR code images dynamically. Frontend: Used Thymeleaf to render a clean, responsive HTML page. Added JavaScript to call backend endpoints, show modals with QR codes and invoice details, and provide sharing & clipboard functionalities. Styling: Applied dark mode styling with flexible CSS for mobile responsiveness. Added a header with a logo and neat buttons for download and sharing, including WhatsApp and email icons. Enhancements: Added invoice expiration timers, smooth modal animations, and error handling for network requests.
Challenges we ran into
Handling multiple currencies: CoinGecko's API requires specifying currency codes accurately. I had to adjust API calls dynamically and validate currency input. Dynamic QR code generation: Generating QR codes on the backend and streaming them as images required integrating a third-party library and ensuring proper response headers. UI polish: Making the modal appear centered on all screen sizes and ensuring buttons/icons look consistent without stretching took several CSS tweaks. Clipboard and sharing features: Managing browser permissions for clipboard access and crafting share URLs that work reliably across devices took some trial and error.
What we learned
Integrating live cryptocurrency price APIs to convert fiat currencies (USD, INR, EUR, etc.) to BTC in real-time. Spring Boot REST API development for backend logic, including handling multiple currencies and dynamic invoice generation. Thymeleaf templating with JavaScript for responsive, interactive frontend design with modal popups. QR code generation on the fly using Java libraries and serving images from REST endpoints. Implementing copy-to-clipboard, sharing via WhatsApp and Email, and download features to improve usability. Managing UI/UX details like modal centering, responsive layouts, and consistent dark mode styling.
What's next for BitMerchant
Secure Merchant Accounts: Add authentication so merchants can manage their own invoices and settings. Database Integration: Store invoice history, transaction status, and customer metadata securely. Merchant Dashboard: Build an admin interface with analytics, daily summaries, and exportable reports. More Currency Support: Add support for more fiat currencies and altcoins beyond BTC. Lightning Network Integration: Allow faster, lower-fee payments using the Bitcoin Lightning Network. Mobile Optimization: Build a mobile-first responsive UI or even a progressive web app (PWA). PDF Receipt Generation: Enable merchants and customers to download PDF receipts for each invoice. AI Price Optimization (future): Recommend pricing or BTC timing based on market trends. Multi-language Support: Translate the UI to make it accessible for global merchants.
Built With
- apachehttpclient
- coingecko
- css
- github
- html
- intellij-idea
- jackson
- java
- javascript
- maven
- springboot
- springinitalizer
- thymeleaf
Log in or sign up for Devpost to join the conversation.