modulepackage
0.0.0-20241221161519-925c129219a4
Repository: https://github.com/ngenohkevin/paybutton.git
Documentation: pkg.go.dev
# README
Bitcoin Payment Button
The Bitcoin Payment Button is a simple Go-based backend application that generates a dynamic Bitcoin address and corresponding QR code for accepting payments. It integrates with a chosen Bitcoin payment processing system to facilitate seamless transactions.
Features
- Generates a unique Bitcoin address for each payment request
- Creates a QR code for easy scanning of the Bitcoin address
- Integrates with a chosen Bitcoin payment processing system
- Provides an API endpoint for retrieving the payment details and QR code URL
Prerequisites
- Go 1.16 or later
- Dependencies managed using Go modules
Installation
- Clone the repository:
git clone https://github.com/ngenohkevin/paybutton.git
cd paybutton
- Install the required dependencies:
go mod download
Configuration
- Create a
.env
file. - Name it to
BLOCKONOMICS_API_KEY=
- Save the file.
Usage
- Start the Go server:
go run main.go
- The server will be running on
http://localhost:8080
by default.
API Endpoints
Generate Payment
- URL:
/payment
- Method:
POST
- Request Body:
{
"email": "[email protected]",
"price": 100.0
}
- Response:
{
"address": "bc1qnmhyc7kqu4tlzfmtkwhtjlg2zfzl95fkgc2p29",
"qrCodeURL": "/bc1qnmhyc7kqu4tlzfmtkwhtjlg2zfzl95fkgc2p29.png",
"email": "[email protected]",
"priceInBTC": 0.0037451640569115133,
"priceInUSD": 100
}
Dependencies
- github.com/gin-gonic/gin: HTTP web framework
- github.com/skip2/go-qrcode: QR code generation library
Contributing
Contributions to the Bitcoin Payment project are welcome! If you find a bug or have suggestions for improvement, please feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License.
# Structs
No description provided by the author