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
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 ⇒ Object
- #credit ⇒ Object
- #simulated_successful_billing_response ⇒ Object
- #source_required? ⇒ Boolean
- #void ⇒ Object (also: #try_void)
Methods inherited from Spree::PaymentMethod
active?, #auto_capture?, available, const_missing, #deprecated_method_type_override, #display_on, #display_on=, find_with_destroyed, #gateway, #method_type, model_name, #options, #partial_name, #payment_profiles_supported?, #payment_source_class, providers, #reusable_sources, #store_credit?, #supports?
Methods included from Spree::Preferences::StaticallyConfigurable
#preference_source=, #preferences, #preferences=
Methods inherited from Base
display_includes, page, preference, #preferences
Methods included from Core::Permalinks
#generate_permalink, #save_permalink
Instance Method Details
#actions ⇒ Object
5 6 7 |
# File 'app/models/spree/payment_method/check.rb', line 5 def actions %w{capture void credit} end |
#can_capture?(payment) ⇒ Boolean
Indicates whether its possible to capture the payment
10 11 12 |
# File 'app/models/spree/payment_method/check.rb', line 10 def can_capture?(payment) ['checkout', 'pending'].include?(payment.state) end |
#can_void?(payment) ⇒ Boolean
Indicates whether its possible to void the payment.
15 16 17 |
# File 'app/models/spree/payment_method/check.rb', line 15 def can_void?(payment) payment.state != 'void' end |
#capture ⇒ Object
19 20 21 |
# File 'app/models/spree/payment_method/check.rb', line 19 def capture(*) simulated_successful_billing_response end |
#credit ⇒ Object
28 29 30 |
# File 'app/models/spree/payment_method/check.rb', line 28 def credit(*) simulated_successful_billing_response end |
#simulated_successful_billing_response ⇒ Object
36 37 38 |
# File 'app/models/spree/payment_method/check.rb', line 36 def simulated_successful_billing_response ActiveMerchant::Billing::Response.new(true, "", {}, {}) end |
#source_required? ⇒ Boolean
32 33 34 |
# File 'app/models/spree/payment_method/check.rb', line 32 def source_required? false end |
#void ⇒ Object Also known as: try_void
23 24 25 |
# File 'app/models/spree/payment_method/check.rb', line 23 def void(*) simulated_successful_billing_response end |