Documentation
¶
Index ¶
- Variables
- func UpdateVersion() error
- type Booking
- type Client
- func (c *Client) AddCard(num, month, year, cvc, zip string) error
- func (c *Client) Book(ticket *Ticket, amount int, promo *PromoCode) (*Booking, error)
- func (c *Client) Event(id int) (*Event, error)
- func (c *Client) HasCard() (existingCards bool, returnErr error)
- func (c *Client) Logon(pass string) error
- func (c *Client) Promo(ticketID int, code string) (*PromoCode, error)
- type Event
- type PromoCode
- type Ticket
Constants ¶
This section is empty.
Variables ¶
var ( // FixrVersion represents FIXR's web API version. FixrVersion = "1.34.0" // FixrPlatformVer represents the "platform" used to "browse" the site. FixrPlatformVer = "Chrome/51.0.2704.103" // UserAgent is the user agent passed to every API call. UserAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" )
Functions ¶
func UpdateVersion ¶
func UpdateVersion() error
UpdateVersion updates the FIXR API version used in the HTTP requests.
Types ¶
type Booking ¶
type Booking struct { Event Event `json:"event"` Name string `json:"user_full_name"` PDF string `json:"pdf"` State int `json:"state"` // contains filtered or unexported fields }
Booking contains the resultant booking information.
type Client ¶
type Client struct { Email string FirstName string `json:"first_name"` LastName string `json:"last_name"` MagicURL string `json:"magic_login_url"` AuthToken string `json:"auth_token"` StripeUser *stripeUser `json:"stripe_user"` // contains filtered or unexported fields }
Client provides access to the FIXR API methods.
func (*Client) AddCard ¶
AddCard saves a card to the user's FIXR account, given the card details. An error will be returned if encountered
func (*Client) Book ¶
Book books a ticket, given a *Ticket and an amout (with the option of a promo code). The booking details and an error, if encountered, will be returned.
func (*Client) Event ¶
Event returns the event information for a given event ID (integer). An error will be returned if one is encountered.
func (*Client) HasCard ¶
HasCard checks for the existence of a saved card in the user's FIXR account. The result and an error, if encountered, will be returned.
type Event ¶
type Event struct { ID int `json:"id"` Name string `json:"name"` Tickets []Ticket `json:"tickets"` Error string `json:"detail"` }
Event contains the event details for given event ID.
type PromoCode ¶
type PromoCode struct { Code string `json:"code"` Price float64 `json:"price"` BookingFee float64 `json:"booking_fee"` Currency string `json:"currency"` Max int `json:"max_per_user"` Remaining int `json:"remaining"` // contains filtered or unexported fields }
PromoCode contains the details of a specific promotional code.
type Ticket ¶
type Ticket struct { ID int `json:"id"` Name string `json:"name"` Type int `json:"type"` Currency string `json:"currency"` Price float64 `json:"price"` BookingFee float64 `json:"booking_fee"` Max int `json:"max_per_user"` SoldOut bool `json:"sold_out"` Expired bool `json:"expired"` Invalid bool `json:"not_yet_valid"` }
Ticket contains all the information pertaining to a specific ticket for an event.