Class: Spree::Refund

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/refund.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

page

Methods included from Preferences::Preferable

#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Class Method Details

.total_amount_reimbursed_for(reimbursement) ⇒ Object


28
29
30
# File 'app/models/spree/refund.rb', line 28

def total_amount_reimbursed_for(reimbursement)
  reimbursement.refunds.to_a.sum(&:amount)
end

Instance Method Details

#descriptionObject


33
34
35
# File 'app/models/spree/refund.rb', line 33

def description
  payment.payment_method.name
end

#moneyObject Also known as: display_amount


22
23
24
# File 'app/models/spree/refund.rb', line 22

def money
  Spree::Money.new(amount, { currency: payment.currency })
end