Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsjoniur/go-cryptomus
A Go wrapper for the Cryptomus API to simplify crypto payments, invoicing, and transaction tracking.
https://github.com/itsjoniur/go-cryptomus
api cryptomus cryptomus-api golang wrapper
Last synced: about 2 months ago
JSON representation
A Go wrapper for the Cryptomus API to simplify crypto payments, invoicing, and transaction tracking.
- Host: GitHub
- URL: https://github.com/itsjoniur/go-cryptomus
- Owner: itsjoniur
- License: mit
- Created: 2023-11-24T13:24:59.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-28T07:50:39.000Z (3 months ago)
- Last Synced: 2024-10-12T09:43:13.003Z (2 months ago)
- Topics: api, cryptomus, cryptomus-api, golang, wrapper
- Language: Go
- Homepage:
- Size: 34.2 KB
- Stars: 12
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cryptomus API Go Wrapper
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.
## Features
- 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## Installation
To install the Cryptomus API Go wrapper, use `go get`:
```
go get github.com/itsjoniur/go-cryptomus
```## Usage
Here's a quick example of how to use the wrapper:
```go
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)
}
```## API Coverage
This wrapper currently supports the following Cryptomus API functionalities:
- Payment operations
- Static wallet operations
- Refund operations
- Resending webhook requests## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.