Versions in this module Expand all Collapse all v1 v1.0.1 Sep 28, 2026 Changes in this version + var ErrEncryptedDataTooShort = fmt.Errorf("invalid encrypted data: too short") + var ErrNoDestinations = fmt.Errorf("Payment has no destinations") + var ErrNoPaymentReturned = fmt.Errorf("No payment returned from server") + var ErrNonZkDestinationInStrictMode = fmt.Errorf(...) + var ErrPrivacyModeViolation = fmt.Errorf(...) + var ErrTampered = fmt.Errorf(...) + var ErrUnauthorized = fmt.Errorf("Unauthorized") + func Decrypt(encryptedValue, secret string) (string, error) + func Encrypt(value, secret string, deterministicNonce bool) (string, error) + func IsArk(value string) bool + func IsBolt11(value string) bool + func IsSilentPayment(value string) bool + func ToNormalizedHash(value string) string + func ToURLFragment(keys *orderedKeys) string + type AESEncryption interface + Decrypt func(encryptedValue, secret string) (string, error) + Encrypt func(value, secret string, deterministicNonce bool) (string, error) + type AESEncryptionService struct + func (AESEncryptionService) Decrypt(encryptedValue, secret string) (string, error) + func (AESEncryptionService) Encrypt(value, secret string, deterministicNonce bool) (string, error) + type AddPaymentResult struct + Payment Payment + Secret string + VerifyURL string + type BrantaClient struct + func NewBrantaClient(defaultOptions BrantaClientOptions) *BrantaClient + func (c *BrantaClient) GetPayments(ctx context.Context, destinationValue string, options *BrantaClientOptions) ([]Payment, error) + func (c *BrantaClient) IsAPIKeyValid(ctx context.Context, options *BrantaClientOptions) (bool, error) + func (c *BrantaClient) PostPayment(ctx context.Context, payment Payment, options *BrantaClientOptions) (*Payment, error) + type BrantaClientOptions struct + BaseURL BrantaServerBaseURL + DefaultAPIKey string + HMACSecret string + Privacy PrivacyMode + func NewBrantaClientOptions(baseURL BrantaServerBaseURL) BrantaClientOptions + func (o BrantaClientOptions) GetAPIKey(overrides *BrantaClientOptions) string + func (o BrantaClientOptions) GetBaseURL(overrides *BrantaClientOptions) string + func (o BrantaClientOptions) GetHMACSecret(overrides *BrantaClientOptions) string + func (o BrantaClientOptions) GetPrivacy(overrides *BrantaClientOptions) PrivacyMode + type BrantaServerBaseURL int + const Localhost + const Production + const Staging + func (u BrantaServerBaseURL) URL() string + type BrantaService struct + func NewBrantaService(defaultOptions BrantaClientOptions) *BrantaService + func NewBrantaServiceWithDeps(defaultOptions BrantaClientOptions, client Client, aes AESEncryption, ...) *BrantaService + func (s *BrantaService) AddPayment(ctx context.Context, payment Payment, options *BrantaClientOptions) (AddPaymentResult, error) + func (s *BrantaService) GetPayments(ctx context.Context, destinationValue, destinationEncryptionKey string, ...) (PaymentsResult, error) + func (s *BrantaService) GetPaymentsByQRCode(ctx context.Context, qrText string, options *BrantaClientOptions) (PaymentsResult, error) + func (s *BrantaService) IsAPIKeyValid(ctx context.Context, options *BrantaClientOptions) (bool, error) + type Client interface + GetPayments func(ctx context.Context, destinationValue string, options *BrantaClientOptions) ([]Payment, error) + IsAPIKeyValid func(ctx context.Context, options *BrantaClientOptions) (bool, error) + PostPayment func(ctx context.Context, payment Payment, options *BrantaClientOptions) (*Payment, error) + type DecryptionError struct + Err error + func (e *DecryptionError) Error() string + func (e *DecryptionError) Unwrap() error + type Destination struct + EncryptedDEK string + IsEncrypted bool + IsPrimary bool + IsZk bool + Type DestinationType + Value string + ZkID string + func NewDestination(value string, destType DestinationType) Destination + type DestinationType string + const ArkAddress + const BitcoinAddress + const Bolt11 + const Bolt12 + const LnAddress + const LnUrl + const SilentPayment + const TetherAddress + func HashZkType(value string) DestinationType + type EncryptionError struct + Err error + func (e *EncryptionError) Error() string + func (e *EncryptionError) Unwrap() error + type GuidSecretGenerator struct + func (GuidSecretGenerator) DeterministicNonce() bool + func (GuidSecretGenerator) Generate() string + type LogoURLDomainMismatchError struct + Field string + func (e *LogoURLDomainMismatchError) Error() string + type Payment struct + BtcPayServerPluginVersion string + ChildPlatform *Platform + CreatedAt string + Description string + Destinations []Destination + IsMetadataDecrypted bool + Metadata string + ParentPlatform *Platform + Platform string + PlatformLogoLightURL string + PlatformLogoURL string + TTL int + func (p Payment) DefaultValue() (string, error) + func (p Payment) MarshalJSON() ([]byte, error) + type PaymentBuilder struct + func NewPaymentBuilder() *PaymentBuilder + func (b *PaymentBuilder) AddDestination(address string, destType DestinationType) *PaymentBuilder + func (b *PaymentBuilder) AddMetadata(key, value string) *PaymentBuilder + func (b *PaymentBuilder) Build() Payment + func (b *PaymentBuilder) SetChildPlatform(name, logoURL, logoLightURL string) *PaymentBuilder + func (b *PaymentBuilder) SetDescription(description string) *PaymentBuilder + func (b *PaymentBuilder) SetPlatformLogoURL(platformLogoURL string) *PaymentBuilder + func (b *PaymentBuilder) SetTTL(ttl int) *PaymentBuilder + func (b *PaymentBuilder) SetZk() *PaymentBuilder + type PaymentsResult struct + Payments []Payment + VerifyURL string + type Platform struct + LogoLightURL string + LogoURL string + Name string + type PrivacyMode int + const PrivacyLoose + const PrivacyStrict + type QRDestination struct + Type DestinationType + Value string + type QRParser struct + Destinations []QRDestination + OnChainEncryptionSecret string + OnChainEncryptionText string + func NewQRParser(qrText string) QRParser + func (p QRParser) Destination() (string, bool) + func (p QRParser) DestinationType() DestinationType + func (p QRParser) IsOnChainZk() bool + type RequestFailedError struct + Status int + func (e *RequestFailedError) Error() string + type SecretGenerator interface + DeterministicNonce func() bool + Generate func() string + type UnsupportedZkDestinationTypeError struct + Type DestinationType + func (e *UnsupportedZkDestinationTypeError) Error() string