Documentation ¶
Overview ¶
Package justin is a client library and higher-level wrapper around the JustGiving API (https://api.justgiving.com/docs)
Index ¶
- type APIKeyContext
- type Env
- type Service
- func (svc *Service) AccountAvailabilityCheck(account mail.Address) (avail bool, err error)
- func (svc *Service) AccountRegistration(account models.Account) (err error)
- func (svc *Service) FundraisingPageURLCheck(pageShortName string) (avail bool, suggestions []string, err error)
- func (svc *Service) IsValidCountry(name string) (bool, error)
- func (svc *Service) IsValidCurrencyCode(code string) (bool, error)
- func (svc *Service) RegisterFundraisingPageForEvent(account mail.Address, password string, page models.FundraisingPageForEvent) (pageURL *url.URL, signOnURL *url.URL, err error)
- func (svc *Service) RequestPasswordReminder(account mail.Address) error
- func (svc *Service) Validate(account mail.Address, password string) (valid bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyContext ¶
APIKeyContext contains settings for creating a justin Service with an API Key.
HTTPLogger is an optional implementation of the Logger interface, if not provided no logging will be carried out
type Env ¶
type Env int
Env represents a JustGiving Environment
const ( // Version is the current release Version = "1.0.0" // UserAgent is set to identify justin requests UserAgent = "justin " + Version // TODO cache from Sandbox using https://github.com/homemade/ersatz? Local Env = iota // Sandbox represents the JustGiving sandbox environment (https://api.sandbox.justgiving.com) Sandbox // Live represents the JustGiving production environment (https://api.justgiving.com) Live )
type Service ¶
type Service struct { // APIKeyContext used to create this service APIKeyContext // BasePath for the JustGiving API endpoint - based on the Env BasePath string // contains filtered or unexported fields }
Service provides a client library and higher-level wrapper around the JustGiving API (https://api.justgiving.com/docs)
func CreateWithAPIKey ¶
func CreateWithAPIKey(api APIKeyContext) (svc *Service, err error)
CreateWithAPIKey instantiates the Service using an APIKey for authentication
func (*Service) AccountAvailabilityCheck ¶
AccountAvailabilityCheck checks the availability of a JustGiving account by email address
func (*Service) AccountRegistration ¶
AccountRegistration registers a new user account with JustGiving
func (*Service) FundraisingPageURLCheck ¶
func (svc *Service) FundraisingPageURLCheck(pageShortName string) (avail bool, suggestions []string, err error)
FundraisingPageURLCheck checks the availability of a JustGiving fundraising page
func (*Service) IsValidCountry ¶
IsValidCountry checks the Country used by models.Account is in the published JustGiving countries list
func (*Service) IsValidCurrencyCode ¶
IsValidCurrencyCode checks the CurrencyCode used by models.FundraisingPageForEvent is in the published JustGiving currency code list
func (*Service) RegisterFundraisingPageForEvent ¶
func (svc *Service) RegisterFundraisingPageForEvent(account mail.Address, password string, page models.FundraisingPageForEvent) (pageURL *url.URL, signOnURL *url.URL, err error)
RegisterFundraisingPageForEvent registers a fundraising page on the JustGiving website
func (*Service) RequestPasswordReminder ¶
RequestPasswordReminder requests JustGiving to send a password reset email