-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.go
60 lines (51 loc) · 1.4 KB
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package ptcpayclient
//***********************************************
//* Copyright (c) 2021 Ulbora Labs LLC
//* Copyright (c) 2021 Ken Williamson
//***********************************************
const (
userAgent = "Ulbora btyPayClient"
)
// go mod init github.com/Ulbora/BTCPayClient
//Headers Headers
type Headers struct {
headers map[string]string
//mu sync.Mutex
}
//Set Set
func (h *Headers) Set(key string, value string) {
//h.mu.Lock()
//defer h.mu.Unlock()
if h.headers == nil {
h.headers = make(map[string]string)
}
h.headers[key] = value
}
//PairClientResponse PairClientResponse
type PairClientResponse struct {
Merchant string `json:"merchant"`
}
//TokenRequest TokenRequest
type TokenRequest struct {
ID string `json:"id"`
Facade string `json:"facade"`
Label string `json:"label"`
PairingCode string `json:"pairingCode"`
}
//TokenResponse TokenResponse
type TokenResponse struct {
Data []TokenData `json:"data"`
Code int64 `json:"code"`
}
//Client Client
type Client interface {
GetClientID() string
Token(req *TokenRequest) *TokenResponse
PairClient(code string) *TokenResponse
GetPairingCodeRequest(code string) string
GetRates(currencyPairs []string, storeID string) *RateResponse
CreateInvoice(inv *InvoiceReq) *InvoiceResponse
GetInvoice(invoiceID string) *InvoiceResponse
GetInvoices(args *InvoiceArgs) *InvoiceListResponse
SetLogLevel(level int)
}