Class: CheckPayment
- Defined in:
- app/models/payments/check_payment.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#check_number ⇒ Object
Returns the value of attribute check_number.
-
#customer ⇒ Object
Returns the value of attribute customer.
Attributes inherited from Payment
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ CheckPayment
constructor
A new instance of CheckPayment.
- #per_item_processing_charge ⇒ Object
- #refund ⇒ Object
- #requires_authorization? ⇒ Boolean
- #requires_settlement? ⇒ Boolean
- #transaction_id ⇒ Object
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
#amount ⇒ Object
Returns the value of attribute amount.
3 4 5 |
# File 'app/models/payments/check_payment.rb', line 3 def amount @amount end |
#check_number ⇒ Object
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 |
#customer ⇒ Object
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_charge ⇒ Object
26 27 28 |
# File 'app/models/payments/check_payment.rb', line 26 def per_item_processing_charge lambda { |item| 0 } end |
#refund ⇒ Object
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
13 14 15 |
# File 'app/models/payments/check_payment.rb', line 13 def false end |
#requires_settlement? ⇒ Boolean
22 23 24 |
# File 'app/models/payments/check_payment.rb', line 22 def requires_settlement? false end |
#transaction_id ⇒ Object
30 31 32 |
# File 'app/models/payments/check_payment.rb', line 30 def transaction_id nil end |