Class: CompPayment

Inherits:
Payment show all
Defined in:
app/models/payments/comp_payment.rb

Overview

This class is used to encapsulate a comp made through a payment interface (the box office)

Comping from producer screens doesn’t use this class

Instance Attribute Summary collapse

Attributes inherited from Payment

#customer, #user_agreement

Instance Method Summary collapse

Methods inherited from Payment

#authorize, #build_address_from, #build_customer_from, #capture, create, payment_method, #payment_phone_number, #purchase, #void

Constructor Details

#initialize(params) ⇒ CompPayment

benefactor is the user that is doing the comping (current_user) person is the person record receiving the comp. It must have the id set



9
10
11
12
13
14
15
# File 'app/models/payments/comp_payment.rb', line 9

def initialize(params)
  params = params.is_a?(Array) ? params[0] : params
  self.benefactor = params[:benefactor]
  self.customer   ||= Person.new
  build_customer_from(params)
  build_address_from(params)
end

Instance Attribute Details

#benefactorObject

Returns the value of attribute benefactor.



5
6
7
# File 'app/models/payments/comp_payment.rb', line 5

def benefactor
  @benefactor
end

Instance Method Details

#amountObject



38
39
40
# File 'app/models/payments/comp_payment.rb', line 38

def amount
  0
end

#amount=(amount) ⇒ Object



34
35
36
# File 'app/models/payments/comp_payment.rb', line 34

def amount=(amount)
  0
end

#per_item_processing_chargeObject



46
47
48
# File 'app/models/payments/comp_payment.rb', line 46

def per_item_processing_charge
  lambda { |item| 0 }
end

#reduce_amount_by(amount_in_cents) ⇒ Object



42
43
44
# File 'app/models/payments/comp_payment.rb', line 42

def reduce_amount_by(amount_in_cents)
  0
end

#refundObject



25
26
27
28
# File 'app/models/payments/comp_payment.rb', line 25

def refund
  self.errors.add(:base, "Comp orders cannot be refunded.  Please return the tickets to inventory instead.")
  false
end

#refundable?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/models/payments/comp_payment.rb', line 21

def refundable?
  false
end

#requires_authorization?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/models/payments/comp_payment.rb', line 17

def requires_authorization?
  false
end

#requires_settlement?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'app/models/payments/comp_payment.rb', line 30

def requires_settlement?
  false
end

#transaction_idObject

DEBT: Because Orders are creating Orders for record keeping, the transaction ID is stored.



52
53
54
# File 'app/models/payments/comp_payment.rb', line 52

def transaction_id
  nil
end