Skip to content

chekalsky/go-coingate

Repository files navigation

Coingate.com Go API client

GoDoc Go Report Card Build Status Coverage Status

Usage is very simple:

package main

import (
	"log"
	"github.com/chekalskiy/go-coingate"
)

func main() {
    Coingate := coingate.New(1234, "Key", "Secret", false)
    
    order, err := Coingate.CreateOrder(coingate.OrderRequest{
        Price: "10.00",
        Currency: "USD",
        ReceiveCurrency: "BTC",
    })
    
    if err != nil {
        log.Fatalln(err)
    }
    
    log.Println(order)
}

Callbacks

When order status is changing, Coingate sends you a callback on URL which you specified when created the order.

You can see here how to handle it. You can get CallbackData struct with callback data.