Class: Spree::StoreCreditEvent
Constant Summary
collapse
- NON_EXPOSED_ACTIONS =
[Spree::StoreCredit::ELIGIBLE_ACTION, Spree::StoreCredit::AUTHORIZE_ACTION]
Instance Method Summary
collapse
#paranoia_delete, #paranoia_destroy
Methods inherited from Base
display_includes, #initialize_preference_defaults, page, preference
#admin_form_preference_names, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Instance Method Details
#action_requires_reason? ⇒ Boolean
#authorization_action? ⇒ Boolean
#capture_action? ⇒ Boolean
#display_action ⇒ Object
57
58
59
60
|
# File 'app/models/spree/store_credit_event.rb', line 57
def display_action
return if NON_EXPOSED_ACTIONS.include?(action)
I18n.t("spree.store_credit.display_action.#{action}")
end
|
#display_amount ⇒ Object
41
42
43
|
# File 'app/models/spree/store_credit_event.rb', line 41
def display_amount
Spree::Money.new(amount, { currency: currency })
end
|
#display_event_date ⇒ Object
53
54
55
|
# File 'app/models/spree/store_credit_event.rb', line 53
def display_event_date
I18n.l(created_at.to_date, format: :long)
end
|
#display_remaining_amount ⇒ Object
49
50
51
|
# File 'app/models/spree/store_credit_event.rb', line 49
def display_remaining_amount
Spree::Money.new(amount_remaining, { currency: currency })
end
|
#display_user_total_amount ⇒ Object
45
46
47
|
# File 'app/models/spree/store_credit_event.rb', line 45
def display_user_total_amount
Spree::Money.new(user_total_amount, { currency: currency })
end
|
#order ⇒ Object
62
63
64
|
# File 'app/models/spree/store_credit_event.rb', line 62
def order
Spree::Payment.find_by(response_code: authorization_code).try(:order)
end
|