Documentation ¶
Index ¶
- Constants
- func CancelObjectiveTxs(transactions librefund.TransactionStorer, obj *librefund.Objective) ([]librefund.Transaction, error)
- func ClaimObjectiveTxs(transactions librefund.TransactionStorer, obj *librefund.Objective, ...) ([]librefund.Transaction, error)
- func TransferMethodFor(cfg *librefund.Config, curCode string) (string, error)
- type Contribution
- type ContributionReq
- type Email
- type PaymentStarted
- type PaymentStore
- type QuotePricer
- type SMTPNotifier
- type ScheduledFunc
- type Scheduler
- type Service
- func (s *Service) CancelObjective(projName string, objName string) error
- func (s *Service) ClaimObjective(projName string, objName string) error
- func (s *Service) Contribute(project string, objVersion librefund.Version, fullfillmentURL *string, ...) (*Contribution, error)
- func (s *Service) ContributeBitcoin(paymentID string) (*bitcoin.PaymentInfo, error)
- func (s *Service) CreateQRCode(address string) ([]byte, error)
- func (s *Service) GetObjective(project string, name string) (*librefund.Objective, error)
- func (s *Service) GetObjectiveByVersion(version librefund.Version) (*librefund.Objective, error)
- func (s *Service) GetProject(name string) (*librefund.Project, error)
- func (s *Service) GetProjectContributions(project string, count, offset int) ([]*librefund.Contribution, error)
- func (s *Service) GetProjectContributionsTotal(name string) (int, error)
- func (s *Service) GetProjectUpdates(name string, count, offset int) ([]librefund.Update, error)
- func (s *Service) GetProjectUpdatesTotal(name string) (int, error)
- func (s *Service) GetTermsAndConditions() (string, error)
- func (s *Service) GetTransaction(txID librefund.TransactionID) (*librefund.Transaction, error)
- func (s *Service) ListObjectives(name string) ([]*librefund.Objective, error)
- func (s *Service) Projects(name string) (*librefund.Project, bool)
- func (s *Service) QuotePrice(curCode string, base *librefund.Money) (*librefund.Money, error)
- func (s *Service) SetLogger(log librefund.Logger)
- func (s *Service) Start() error
- func (s *Service) Stop()
Constants ¶
View Source
const ConfigPath = "etc/librefund.yaml"
Variables ¶
This section is empty.
Functions ¶
func CancelObjectiveTxs ¶
func CancelObjectiveTxs( transactions librefund.TransactionStorer, obj *librefund.Objective, ) ([]librefund.Transaction, error)
func ClaimObjectiveTxs ¶
func ClaimObjectiveTxs( transactions librefund.TransactionStorer, obj *librefund.Objective, maintainerAccount string, ) ([]librefund.Transaction, error)
Types ¶
type Contribution ¶
type ContributionReq ¶
type ContributionReq struct { AgreeToTerms bool Amount string Bitcoin *bitcoin.TransferInfo TransferMethod string }
type Email ¶
type PaymentStarted ¶
type PaymentStarted struct { Event string `json:"event"` CreatedAt time.Time `json:"createdAt"` PaymentID string `json:"paymentId"` ObjVersion librefund.Version `json:"objVersion"` Method string `json:"method"` }
func (*PaymentStarted) Name ¶
func (s *PaymentStarted) Name() string
func (*PaymentStarted) New ¶
func (s *PaymentStarted) New() interface{}
type PaymentStore ¶
type PaymentStore struct {
// contains filtered or unexported fields
}
func NewPaymentStore ¶
func NewPaymentStore( eventLog *librefund.EventLog, ) *PaymentStore
func (*PaymentStore) GetObjVersion ¶
func (s *PaymentStore) GetObjVersion(paymentID string) (librefund.Version, bool)
func (*PaymentStore) GetTransferMethod ¶
func (s *PaymentStore) GetTransferMethod(paymentID string) (string, bool)
type QuotePricer ¶
type QuotePricer interface {
QuotePrice(curCode string, base *librefund.Money) (*librefund.Money, error)
}
QuotePricer returns the conversion amount of a given currency amount.
type SMTPNotifier ¶
func NewSMTPNotifier ¶
func NewSMTPNotifier(cfg *librefund.Config) (*SMTPNotifier, error)
func (*SMTPNotifier) NotifyContribution ¶
func (s *SMTPNotifier) NotifyContribution( tx *librefund.Transaction, obj *librefund.Objective, ) error
NotifyContribution emails configured recipients about a new contribution.
type ScheduledFunc ¶
type ScheduledFunc func()
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func (*Scheduler) RunEvery ¶
func (s *Scheduler) RunEvery( dur time.Duration, run ScheduledFunc)
type Service ¶
func (*Service) CancelObjective ¶
func (*Service) ClaimObjective ¶
TODO: Ensure ClaimObjective is idempotent
func (*Service) Contribute ¶
func (s *Service) Contribute( project string, objVersion librefund.Version, fullfillmentURL *string, details ContributionReq, ) (*Contribution, error)
func (*Service) ContributeBitcoin ¶
func (s *Service) ContributeBitcoin( paymentID string, ) (*bitcoin.PaymentInfo, error)
func (*Service) CreateQRCode ¶
CreateQRCode writes a QR code for Bitcoin Addresses to the given output.
func (*Service) GetObjective ¶
func (*Service) GetObjectiveByVersion ¶
func (*Service) GetProjectContributions ¶
func (*Service) GetProjectContributionsTotal ¶
func (*Service) GetProjectUpdates ¶
func (*Service) GetProjectUpdatesTotal ¶
func (*Service) GetTransaction ¶
func (s *Service) GetTransaction( txID librefund.TransactionID, ) (*librefund.Transaction, error)
func (*Service) ListObjectives ¶
func (*Service) QuotePrice ¶
QuotePrice returns the last known quoted conversion amount to the given currency.
Click to show internal directories.
Click to hide internal directories.