Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.