Eventbrite Discounts

Figure 1. Instantiate Discounts
//user type
$discount = eden('eventbrite')->discount($_SESSION['ebtoken']);
//personal type
$discount = eden('eventbrite')->discount('[USER_KEY]', '[APP_SECRET]');
Figure 2. Usage: Creating a Discount
$discount
	->setCode('membersonly')		//required
	->amountOff(12)					//required either amount off or percent off not both
	->percentOff(0)					//required either amount off or percent off not both
	->setTickets()					//optional comma separated ticket IDs, leave blank for all
	->setQuantity(50)				//optional
	->setStart(time()+3600)			//required unix time or date format
	->setEnd(time()+7200)			//required unix time or date format
	->create(123);					//event ID
Figure 3. Usage: Updating a Discount
$discount
	->setCode('membersonly')		//required
	->amountOff(12)					//required either amount off or percent off not both
	->percentOff(0)					//required either amount off or percent off not both
	->setTickets()					//optional comma separated ticket IDs, leave blank for all
	->setQuantity(50)				//optional
	->setStart(time()+3600)			//required unix time or date format
	->setEnd(time()+7200)			//required unix time or date format
	->update(123);					//discount ID
Figure 4. Discount Methods
Method Arguments Returns Description
$discount->create($event);
  1. int
  2. - the event id
array Creates the discount
$discount->setAmountOff($amount);
  1. float|int
Eden_Eventbrite_Discount Sets the discount amount
$discount->setCode($code);
  1. string
Eden_Eventbrite_Discount Sets the discount code
$discount->setEnd($end);
  1. string|int
Eden_Eventbrite_Discount Set the end time
$discount->setPercentOff($percent);
  1. float|int
Eden_Eventbrite_Discount Sets the discount percent
$discount->setQuantity($quantity);
  1. int
Eden_Eventbrite_Discount Set quantity
$discount->setStart($start);
  1. int|string
Eden_Eventbrite_Discount Set the start time
$discount->setTickets($tickets);
  1. string|array
Eden_Eventbrite_Discount Set ticket ID or a list of ticket IDs
$discount->update($id);
  1. int
  2. - the discount id
array Creates the discount

© 2012 Openovate Labs. All rights reserved.