Skip to content

A Go wrapper for the Cryptomus API to simplify crypto payments, invoicing, and transaction tracking.

License

Notifications You must be signed in to change notification settings

itsjoniur/go-cryptomus

Repository files navigation

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:

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 file for details.

About

A Go wrapper for the Cryptomus API to simplify crypto payments, invoicing, and transaction tracking.

Topics

Resources

License

Stars

Watchers

Forks

Languages