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)
}
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.