# Bitcoin Payment Checker Bitcoin Payment Checker is a modern Go application designed to facilitate Bitcoin payments for orders. It provides a seamless interface for clients to pay the Bitcoin equivalent of an order amount, offering a wallet address for payment and tracking the payment status in real-time. ## Features - **Real-time Bitcoin Conversion**: Automatically calculates the Bitcoin equivalent of the order amount using current market rates. - **Order Tracking**: Monitors the payment status from initiation to completion, ensuring transparency and reliability. - **Notification System**: Alerts via email when payments are processed or if there are any issues. - **Secure and Scalable**: Designed with security and scalability in mind, making it suitable for businesses of all sizes. - **Grafana Monitoring**: Supports integration with Grafana for advanced monitoring and analytics of payment transactions. ## Getting Started ### Prerequisites - Go (1.15 or later) - Docker and Docker Compose (for containerization and services) - MongoDB (for database) - An SMTP server (for email notifications) - Grafana (for monitoring, optional) ### Installation 1- **Clone the Repository** ```bash git clone https://github.com/yourusername/btcpaychecker.git cd btcpaychecker ``` 2- **Environment Configuration** Configure your application by setting the necessary environment variables. You can find a template in .env.example. Rename this to .env and fill in the details accordingly. 3- **Build and Run** - Without Docker: If you prefer to run the application directly on your machine: ```bash go run cmd/btcpaychecker/main.go ``` - With Docker: To containerize your application, use the following commands: ```bash docker build -t btcpaychecker . docker-compose up ``` ## Environment Variables The application can be configured using the following environment variables: - **DB_ADDRESS**: MongoDB address. - **DB_NAME**: Database name. - **ORDERS_COLLECTION**: Collection for orders. - **CONVERSOR_API**: API for currency conversion. - **RPC_HOST, RPC_AUTH, RPC_ZMQ, WALLET_ADDRESS**: Bitcoin service configuration. - **MAIL_USER, MAIL_PASSWORD, MAIL_HOST, MAIL_PORT, MAIL_FROM**: SMTP configuration for email notifications. - **WEBHOOK_URL**: (Optional) For POST callbacks upon payment completion. ## Dependencies List of Go modules and external packages used: - gofiber/fiber/v2: For HTTP server and routing. - go.mongodb.org/mongo-driver/mongo: MongoDB driver. - net/smtp: For sending emails. ## Dockerization A Dockerfile is provided for easy application containerization, allowing for straightforward deployment and scalability. Refer to the Dockerfile for more details. ## Contributing Contributions are welcome! Please refer to the CONTRIBUTING.md file for guidelines on how to contribute to this project. ## License This project is licensed under the MIT License - see the LICENSE file for details. ## Demo You can try it **[here on bitcoin testnet](https://btcpaychecker.com)**