app/models/ticket.rb
# Register the discount code with Eventbrite.
Register the discount code with Eventbrite.
Register the discount code with Eventbrite .
def register_discount_code
    self.registering_code!
    if self.class.disable_register_code
      self.registered_code!
      return false
    end
    return false unless valid_secrets?
    status, message = Eventbrite.new_discount_code(self.discount_code, self.ticket_kind.eventbrite_ticket_id)
    status ? self.registered_code! : self.failed_to_register_code!
    self.update_attribute :report, message
    return status
  end
def register_discount_code self . registering_code! if self . class . disable_register_code self . registered_code! return false end return false unless valid_secrets? status , message = Eventbrite . new_discount_code ( self . discount_code , self . ticket_kind . eventbrite_ticket_id ) status ? self . registered_code! : self . failed_to_register_code! self . update_attribute :report , message return status end
Register the discount code with Eventbrite.
Register the discount code with Eventbrite .