Class: Spree::PaymentMethod::Check
- Inherits:
-
Spree::PaymentMethod
- Object
- ActiveRecord::Base
- Base
- Spree::PaymentMethod
- Spree::PaymentMethod::Check
- Defined in:
- app/models/spree/payment_method/check.rb
Constant Summary
Constants inherited from Spree::PaymentMethod
Instance Method Summary collapse
- #actions ⇒ Object
-
#can_capture?(payment) ⇒ Boolean
Indicates whether its possible to capture the payment.
-
#can_void?(payment) ⇒ Boolean
Indicates whether its possible to void the payment.
- #capture(*args) ⇒ Object
- #source_required? ⇒ Boolean
- #void(*args) ⇒ Object
Methods inherited from Spree::PaymentMethod
active?, #auto_capture?, available, find_with_destroyed, #method_type, #payment_profiles_supported?, #payment_source_class, #provider_class, providers, #reusable_sources, #supports?
Methods inherited from Base
Methods included from Spree::Preferences::Preferable
#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Instance Method Details
#actions ⇒ Object
3 4 5 |
# File 'app/models/spree/payment_method/check.rb', line 3 def actions %w{capture void} end |
#can_capture?(payment) ⇒ Boolean
Indicates whether its possible to capture the payment
8 9 10 |
# File 'app/models/spree/payment_method/check.rb', line 8 def can_capture?(payment) ['checkout', 'pending'].include?(payment.state) end |
#can_void?(payment) ⇒ Boolean
Indicates whether its possible to void the payment.
13 14 15 |
# File 'app/models/spree/payment_method/check.rb', line 13 def can_void?(payment) payment.state != 'void' end |
#capture(*args) ⇒ Object
17 18 19 |
# File 'app/models/spree/payment_method/check.rb', line 17 def capture(*args) ActiveMerchant::Billing::Response.new(true, "", {}, {}) end |
#source_required? ⇒ Boolean
25 26 27 |
# File 'app/models/spree/payment_method/check.rb', line 25 def source_required? false end |
#void(*args) ⇒ Object
21 22 23 |
# File 'app/models/spree/payment_method/check.rb', line 21 def void(*args) ActiveMerchant::Billing::Response.new(true, "", {}, {}) end |