Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.
/ byte-payments Public archive

BytePayments is a self hosted crypto payment gateway for accepting crypto funds directly to your wallet. For now it only supports TRX

License

Notifications You must be signed in to change notification settings

thebytearray/byte-payments

Repository files navigation

Byte Payments

BytePayments is a self hosted crypto payment gateway for accepting crypto funds directly to your wallet. For now it only supports TRX.

Features :

  1. Accept TRX Payment.
  2. Create Payment.
  3. Cancel any created payment.
  4. List the available currencies (It's an array though but we have only trx for now, planned to add more in future).
  5. Check a created payment status (completed,pending,cancelled).
  6. Set the percentage of amount that is okay to be paid to mark the order as completed (eg : 95% payment marks the order as completed).
  7. Handle Overpaid and Underpaid senario.
  8. Send payment invoice directly to the users email after done.
  9. After payment done sweep the funds to your main master wallet (Gas Fees Auto Calculated).

Tech Stack :

  1. Go (the goat).
  2. Fiber (web framework based on fasthttp,net/http kinda slow)
  3. Gorm (ORM library).
  4. MySQL the OG DB.
  5. Swagger (for api docs).
  6. Air (for live reload)

API Documentation

The API documentation is available via Swagger UI and is automatically generated from the code comments.

Accessing Swagger UI

  • Development Mode: Swagger UI is available at http://localhost:8080/swagger/ when APP_ENV=development
  • Production Mode: Swagger UI is disabled for security reasons when APP_ENV=production

Environment Configuration

To enable Swagger UI, set the following in your .env file:

APP_ENV=development

For production, set:

APP_ENV=production

Regenerating Documentation

If you modify the API endpoints or add new ones, regenerate the Swagger documentation:

swag init -g cmd/main.go

Contributing Guide : Yeah it's open for contribution but for existing bug or security issue fix. We do not expect any major breaking change right now.For example a new currency, but if you want to do that first discuss in the issue thread.

Tip

For testing the gateway first change the enviroment to development APP_ENV=development and when switching to production APP_ENV=production. For testing we will use grpc.shasta.trongrid.io:50051 and if you want to get trx for testing first generate a wallet and go to here to refill with test trx funds (it's not real btw) shasta

Note

Please do not open a issue like this "Hey, the project not following x and y framework guidelines, best practices" cause we don't care as long as it's performance effecient and works. Always open to take suggestion related to performance improvement. Thanks

Caution

This project has been tested internally and currently in alpha. Use at your own risk cause this can cause fund loss. Also if Crypto Currency maybe banned or not recognized in your country so use it at your own risk, we are not responsible for any loss or legal drama.

About

BytePayments is a self hosted crypto payment gateway for accepting crypto funds directly to your wallet. For now it only supports TRX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published