Documentation ¶
Index ¶
- type BTCPayClient
- func (a *BTCPayClient) CreateInvoice(inv *InvoiceReq) *InvoiceResponse
- func (a *BTCPayClient) GetClientID() string
- func (a *BTCPayClient) GetInvoice(invoiceID string) *InvoiceResponse
- func (a *BTCPayClient) GetInvoices(args *InvoiceArgs) *InvoiceListResponse
- func (a *BTCPayClient) GetPairingCodeRequest(code string) string
- func (a *BTCPayClient) GetRates(currencyPairs []string, storeID string) *RateResponse
- func (a *BTCPayClient) New(host string, kp *ecdsa.PrivateKey, token string) Client
- func (a *BTCPayClient) OverrideProxy(proxy px.Proxy)
- func (a *BTCPayClient) PairClient(code string) *TokenResponse
- func (a *BTCPayClient) SetHeader(head Headers)
- func (a *BTCPayClient) SetLogLevel(level int)
- func (a *BTCPayClient) Token(req *TokenRequest) *TokenResponse
- type Buyer
- type BuyerFields
- type Client
- type Crypto
- type CryptoCode
- type Cryptography
- func (c *Cryptography) GenerateKeyPair(ec elliptic.Curve) *ecdsa.PrivateKey
- func (c *Cryptography) GetPublicKey(kp *ecdsa.PrivateKey) string
- func (c *Cryptography) GetSinFromKey(kp *ecdsa.PrivateKey) string
- func (c *Cryptography) LoadKeyPair(privateKey string, ec elliptic.Curve) *ecdsa.PrivateKey
- func (c *Cryptography) New() Crypto
- func (c *Cryptography) Sign(hash []byte, kp *ecdsa.PrivateKey) ([]byte, error)
- type Erate
- type Headers
- type InvFlags
- type Invoice
- type InvoiceArgs
- type InvoiceListResponse
- type InvoiceReq
- type InvoiceResponse
- type MinerFee
- type PairClientResponse
- type PayURLs
- type Payload
- type Payment
- type Policy
- type Rate
- type RateResponse
- type TokenData
- type TokenRequest
- type TokenResponse
- type TranCurStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BTCPayClient ¶
type BTCPayClient struct {
// contains filtered or unexported fields
}
BTCPayClient BTCPayClient
func (*BTCPayClient) CreateInvoice ¶
func (a *BTCPayClient) CreateInvoice(inv *InvoiceReq) *InvoiceResponse
CreateInvoice CreateInvoice
func (*BTCPayClient) GetClientID ¶
func (a *BTCPayClient) GetClientID() string
GetClientID GetClientID
func (*BTCPayClient) GetInvoice ¶
func (a *BTCPayClient) GetInvoice(invoiceID string) *InvoiceResponse
GetInvoice GetInvoice
func (*BTCPayClient) GetInvoices ¶
func (a *BTCPayClient) GetInvoices(args *InvoiceArgs) *InvoiceListResponse
GetInvoices GetInvoices
func (*BTCPayClient) GetPairingCodeRequest ¶
func (a *BTCPayClient) GetPairingCodeRequest(code string) string
GetPairingCodeRequest GetPairingCodeRequest
func (*BTCPayClient) GetRates ¶
func (a *BTCPayClient) GetRates(currencyPairs []string, storeID string) *RateResponse
GetRates GetRates
func (*BTCPayClient) New ¶
func (a *BTCPayClient) New(host string, kp *ecdsa.PrivateKey, token string) Client
New New
func (*BTCPayClient) OverrideProxy ¶
func (a *BTCPayClient) OverrideProxy(proxy px.Proxy)
OverrideProxy OverrideProxy
func (*BTCPayClient) PairClient ¶
func (a *BTCPayClient) PairClient(code string) *TokenResponse
PairClient PairClient
func (*BTCPayClient) SetLogLevel ¶
func (a *BTCPayClient) SetLogLevel(level int)
SetLogLevel SetLogLevel
func (*BTCPayClient) Token ¶
func (a *BTCPayClient) Token(req *TokenRequest) *TokenResponse
Token Token
type Buyer ¶
type Buyer struct { Name string `json:"name"` Address1 string `json:"address1"` Address2 string `json:"address2"` City string `json:"city"` Locality string `json:"locality"` Region string `json:"region"` PostalCode string `json:"postalCode"` State string `json:"state"` Zip string `json:"zip"` Country string `json:"country"` Phone string `json:"phone"` Notify bool `json:"notify"` Email string `json:"email"` }
Buyer Buyer
type BuyerFields ¶
type BuyerFields struct { BuyerName string `json:"buyerName"` BuyerAddress1 string `json:"buyerAddress1"` BuyerAddress2 string `json:"buyerAddress2"` BuyerCity string `json:"buyerCity"` BuyerState string `json:"buyerState"` BuyerZip string `json:"buyerZip"` BuyerCountry string `json:"buyerCountry"` BuyerPhone string `json:"buyerPhone"` BuyerNotify bool `json:"buyerNotify"` BuyerEmail string `json:"buyerEmail"` }
BuyerFields BuyerFields
type 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) }
Client Client
type Crypto ¶
type Crypto interface { GenerateKeyPair(ec elliptic.Curve) *ecdsa.PrivateKey LoadKeyPair(privateKey string, ec elliptic.Curve) *ecdsa.PrivateKey GetSinFromKey(kp *ecdsa.PrivateKey) string Sign(hash []byte, kp *ecdsa.PrivateKey) ([]byte, error) GetPublicKey(kp *ecdsa.PrivateKey) string }
Crypto Crypto
type CryptoCode ¶
type CryptoCode struct { CryptoCode string `json:"cryptoCode"` PaymentType string `json:"paymentType"` Rate float64 `json:"rate"` ExRates map[string]float64 `json:"exRates"` Paid string `json:"paid"` Price string `json:"price"` Due string `json:"due"` PaymentUrls map[string]string `json:"paymentUrls"` Address string `json:"address"` URL string `json:"url"` TotalDue string `json:"totalDue"` NetworkFee string `json:"networkFee"` TxCount int64 `json:"txCount"` CryptoPaid string `json:"cryptoPaid"` Payments []Payment `json:"payments"` }
CryptoCode CryptoCode
type Cryptography ¶
type Cryptography struct { }
Cryptography Cryptography
func (*Cryptography) GenerateKeyPair ¶
func (c *Cryptography) GenerateKeyPair(ec elliptic.Curve) *ecdsa.PrivateKey
GenerateKeyPair GenerateKeyPair
func (*Cryptography) GetPublicKey ¶
func (c *Cryptography) GetPublicKey(kp *ecdsa.PrivateKey) string
GetPublicKey GetPublicKey
func (*Cryptography) GetSinFromKey ¶
func (c *Cryptography) GetSinFromKey(kp *ecdsa.PrivateKey) string
GetSinFromKey GetSinFromKey
func (*Cryptography) LoadKeyPair ¶
func (c *Cryptography) LoadKeyPair(privateKey string, ec elliptic.Curve) *ecdsa.PrivateKey
LoadKeyPair LoadKeyPair
func (*Cryptography) Sign ¶
func (c *Cryptography) Sign(hash []byte, kp *ecdsa.PrivateKey) ([]byte, error)
Sign Sign
type Invoice ¶
type Invoice struct { GUID string `json:"guid"` ID string `json:"id"` URL string `json:"url"` BtcPrice string `json:"btcPrice"` BtcDue string `json:"btcDue"` CryptoInfo []CryptoCode `json:"cryptoInfo"` ExRates map[string]float64 `json:"exRates"` BuyerTotalBtcAmount string `json:"buyerTotalBtcAmount"` InvoiceTime int64 `json:"invoiceTime"` CurrentTime int64 `json:"currentTime"` LowFeeDetected bool `json:"lowFeeDetected"` BtcPaid string `json:"btcPaid"` Rate float64 `json:"rate"` ExceptionStatus interface{} `json:"exceptionStatus"` PaymentUrls PayURLs `json:"paymentUrls"` RefundAddressRequestPending bool `json:"refundAddressRequestPending"` BuyerPaidBtcMinerFee string `json:"buyerPaidBtcMinerFee"` BitcoinAddress string `json:"bitcoinAddress"` Flags InvFlags `json:"flags"` PaymentSubtotals map[string]float64 `json:"paymentSubtotals"` PaymentTotals map[string]float64 `json:"paymentTotals"` AmountPaid float64 `json:"amountPaid"` MinerFees map[string]MinerFee `json:"minerFees"` ExchangeRates map[string]map[string]float64 `json:"exchangeRates"` Addresses map[string]string `json:"addresses"` PaymentCodes map[string]map[string]string `json:"paymentCodes"` Currency string `json:"currency"` Price float64 `json:"price"` OrderID string `json:"orderId"` ExpirationTime int64 `json:"expirationTime"` ItemDesc string `json:"itemDesc"` ItemCode string `json:"itemCode"` PosData string `json:"posData"` Status string `json:"status"` //RedirectURL string `json:"redirectURL"` //TransactionSpeed string `json:"transactionSpeed"` //Physical bool `json:"physical"` SupportedTransactionCurrencies map[string]TranCurStatus `json:"supportedTransactionCurrencies"` //Refundable bool `json:"refundable"` TaxIncluded float64 `json:"taxIncluded"` Token string `json:"token"` RedirectAutomatically bool `json:"redirectAutomatically"` NotificationEmail string `json:"notificationEmail"` NotificationURL string `json:"notificationURL"` ExtendedNotifications bool `json:"extendedNotifications"` FullNotifications bool `json:"fullNotifications"` //BuyerFields BuyerFields `json:"buyerFields"` Buyer Buyer `json:"buyer"` }
Invoice Invoice
type InvoiceArgs ¶
type InvoiceArgs struct { Status string `json:"status"` OrderID string `json:"orderId"` ItemCode string `json:"itemCode"` DateStart string `json:"dateStart"` DateEnd string `json:"dateEnd"` Limit string `json:"limit"` Offset string `json:"offset"` }
InvoiceArgs InvoiceArgs
type InvoiceListResponse ¶
type InvoiceListResponse struct {
Data []Invoice `json:"data"`
}
InvoiceListResponse InvoiceListResponse
type InvoiceReq ¶
type InvoiceReq struct { Currency string `json:"currency"` Price float64 `json:"price"` OrderID string `json:"orderId"` //ExpirationTime int64 `json:"expirationTime"` ItemDesc string `json:"itemDesc"` ItemCode string `json:"itemCode"` PosData string `json:"posData"` Status string `json:"status"` RedirectURL string `json:"redirectURL"` TransactionSpeed string `json:"transactionSpeed"` Physical bool `json:"physical"` SupportedTransactionCurrencies map[string]TranCurStatus `json:"supportedTransactionCurrencies"` Refundable bool `json:"refundable"` TaxIncluded float64 `json:"taxIncluded"` Token string `json:"token"` RedirectAutomatically bool `json:"redirectAutomatically"` NotificationEmail string `json:"notificationEmail"` NotificationURL string `json:"notificationURL"` ExtendedNotifications bool `json:"extendedNotifications"` FullNotifications bool `json:"fullNotifications"` Buyer Buyer `json:"buyer"` }
InvoiceReq InvoiceReq
type InvoiceResponse ¶
type InvoiceResponse struct {
Data Invoice `json:"data"`
}
InvoiceResponse InvoiceResponse
type MinerFee ¶
type MinerFee struct { SatoshisPerByte float64 `json:"satoshisPerByte"` TotalFee float64 `json:"totalFee"` }
MinerFee MinerFee
type PairClientResponse ¶
type PairClientResponse struct {
Merchant string `json:"merchant"`
}
PairClientResponse PairClientResponse
type PayURLs ¶
type PayURLs struct { BIP21 string `json:"BIP21"` BIP72 string `json:"BIP72"` BIP72b string `json:"BIP72b"` BIP73 string `json:"BIP73"` BOLT11 string `json:"BOLT11"` }
PayURLs PayURLs
type Payment ¶
type Payment struct { ID string `json:"id"` ReceivedDate string `json:"receivedDate"` Value float64 `json:"value"` Fee float64 `json:"fee"` PaymentType string `json:"paymentType"` Confirmed bool `json:"confirmed"` Completed bool `json:"completed"` Destination string `json:"destination"` }
Payment Payment
type Policy ¶
type Policy struct { Policy string `json:"policy"` Method string `json:"method"` Params []string `json:"params"` }
Policy Policy
type Rate ¶
type Rate struct { Name string `json:"name"` CryptoCode string `json:"cryptoCode"` CurrencyPair string `json:"currencyPair"` Code string `json:"code"` Rate float64 `json:"rate"` }
Rate Rate
type RateResponse ¶
type RateResponse struct {
Data []Rate `json:"data"`
}
RateResponse RateResponse
type TokenData ¶
type TokenData struct { Policies []Policy `json:"policies"` Token string `json:"token"` Facade string `json:"facade"` CreateDate int64 `json:"dateCreated"` PairingExpiration int64 `json:"pairingExpiration"` ParingCode string `json:"pairingCode"` }
TokenData TokenData
type TokenRequest ¶
type TokenRequest struct { ID string `json:"id"` Facade string `json:"facade"` Label string `json:"label"` PairingCode string `json:"pairingCode"` }
TokenRequest TokenRequest
type TokenResponse ¶
TokenResponse TokenResponse
type TranCurStatus ¶
TranCurStatus TranCurStatus