This repository contains an unofficial Go wrapper for the Cryptomus API, a crypto payment gateway. This wrapper simplifies the process of integrating Cryptomus functionality into your Go projects.
- Easy-to-use Go interface for Cryptomus API
- Supports payment and payout operations
- Handles static wallet functionalities
- Supports refund operations
- Supports resending and testing webhook requests
- Supports verifying signature
- Provides strongly typed responses
To install the Cryptomus API Go wrapper, use go get
:
go get github.com/itsjoniur/go-cryptomus
Here's a quick example of how to use the wrapper:
import (
"fmt"
"github.com/itsjoniur/go-cryptomus"
)
func main() {
httpClient := http.DefaultClient
client := cryptomus.New(httpClient, "your-merchant-id", "your-payment-api-key", "your-payout-api-key")
// Create an invoice
invoiceReq := &cryptomus.InvoiceRequest{
Amount: "10",
Currency: "USD",
OrderId: "your-order-id",
InvoiceRequestOptions: &cryptomus.invoiceRequestOptions{
Network: "tron",
UrlCallback: "https://yourdomain.com/callback"
},
}
invoice, err := cryptomus.CreateInvoice(invoiceReq)
if err != nil {
// Handle error
}
fmt.Printf("Invoice created: %+v\n", invoice)
}
This wrapper currently supports the following Cryptomus API functionalities:
- Payment operations
- Static wallet operations
- Refund operations
- Resending webhook requests
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.