Class: CheckPayment

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

Instance Attribute Summary collapse

Attributes inherited from Payment

#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, #reduce_amount_by, #refundable?, #void

Constructor Details

#initialize(params = {}) ⇒ CheckPayment

Returns a new instance of CheckPayment.



5
6
7
8
9
10
11
# File 'app/models/payments/check_payment.rb', line 5

def initialize(params = {})
  @amount       = params[:amount]
  @check_number = params[:check].try(:[], :number)
  self.customer       ||= Person.new
  build_customer_from(params)
  build_address_from(params)
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



3
4
5
# File 'app/models/payments/check_payment.rb', line 3

def amount
  @amount
end

#check_numberObject

Returns the value of attribute check_number.



3
4
5
# File 'app/models/payments/check_payment.rb', line 3

def check_number
  @check_number
end

#customerObject

Returns the value of attribute customer.



3
4
5
# File 'app/models/payments/check_payment.rb', line 3

def customer
  @customer
end

Instance Method Details

#per_item_processing_chargeObject



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

def per_item_processing_charge
  lambda { |item| 0 }
end

#refundObject



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

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

#requires_authorization?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/models/payments/check_payment.rb', line 13

def requires_authorization?
  false
end

#requires_settlement?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/models/payments/check_payment.rb', line 22

def requires_settlement?
  false
end

#transaction_idObject



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

def transaction_id
  nil
end