Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackData ¶
type CallbackData struct { ID int `json:"id"` OrderID string `json:"order_id"` Status string `json:"status"` Price string `json:"price"` Currency string `json:"currency"` ReceiveCurrency string `json:"receive_currency"` ReceiveAmount string `json:"receive_amount"` BtcAmount string `json:"btc_amount"` CreatedAt time.Time `json:"created_at"` }
CallbackData is a struct of POST fields which we receive as a callback from Coingate
type Coingate ¶
type Coingate struct {
// contains filtered or unexported fields
}
Coingate main class
func New ¶
New creates a new Coingate instance
It requires app data which you can get on https://coingate.com
func (*Coingate) CreateOrder ¶
func (c *Coingate) CreateOrder(d CreateOrderRequest) (Order, error)
CreateOrder creates new order with specified params
func (*Coingate) ListOrders ¶
func (c *Coingate) ListOrders(d ListOrdersRequest) (Orders, error)
ListOrders gets list of orders
func (*Coingate) ProcessCallback ¶
func (c *Coingate) ProcessCallback(r *http.Request) (CallbackData, error)
ProcessCallback gets a http.Request and parses POST fields to struct CallbackData
type CreateOrderRequest ¶
type CreateOrderRequest struct { OrderID string `json:"order_id"` Price string `json:"price"` Currency string `json:"currency"` ReceiveCurrency string `json:"receive_currency"` Title string `json:"title"` Description string `json:"description"` CallbackURL string `json:"callback_url"` CancelURL string `json:"cancel_url"` SuccessURL string `json:"success_url"` }
CreateOrderRequest is a struct with fields for creating order request
type ListOrdersRequest ¶
type ListOrdersRequest struct { PerPage int `json:"per_page"` Page int `json:"page"` Sort string `json:"sort"` }
ListOrdersRequest is a struct with GET parameters for ListOrders request
type Order ¶
type Order struct { ID int `json:"id"` Currency string `json:"currency"` BitcoinURI string `json:"bitcoin_uri"` Status string `json:"status"` Price string `json:"price"` BtcAmount string `json:"btc_amount"` CreatedAt time.Time `json:"created_at"` ExpireAt time.Time `json:"expire_at"` BitcoinAddress string `json:"bitcoin_address"` OrderID string `json:"order_id"` PaymentURL string `json:"payment_url"` }
Order is The Order
Click to show internal directories.
Click to hide internal directories.