-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstore.go
39 lines (35 loc) · 1.29 KB
/
store.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
package btcpay
import (
"net/http"
)
type Store interface {
CheckInvoiceAuth() error
CreateInvoice(req *InvoiceRequest) (*Invoice, error)
CreatePaymentRequest(req *PaymentRequestRequest) (*PaymentRequest, error)
GetInvoice(id string) (*Invoice, error)
GetPaymentRequest(id string) (*PaymentRequest, error)
GetServerStatus() (*ServerStatus, error)
InvoiceCheckoutLink(id string) string
InvoiceCheckoutLinkPreferOnion(id string) string
PaymentRequestLink(id string) string
PaymentRequestLinkPreferOnion(id string) string
ProcessWebhook(req *http.Request) (*InvoiceEvent, error)
}
type ServerStatus struct {
Version string `json:"version"`
Onion string `json:"onion"`
SupportedPaymentMethods []string `json:"supportedPaymentMethods"`
FullySynched bool `json:"fullySynched"`
SyncStatuses []SyncStatus `json:"syncStatus"`
}
type SyncStatus struct {
PaymentMethodID string `json:"paymentMethodId"`
NodeInformation struct {
Headers int `json:"headers"`
Blocks int `json:"blocks"`
VerificationProgress float64 `json:"verificationProgress"`
} `json:"nodeInformation"`
ChainHeight int `json:"chainHeight"`
SyncHeight int `json:"syncHeight"`
Available bool `json:"available"`
}