Class: Spree::PaymentMethod::Check
Constant Summary
DISPLAY
Instance Method Summary
collapse
active?, #auto_capture?, available, #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?
#preference_source=, #preferences, #preferences=
Methods inherited from Base
display_includes, #initialize_preference_defaults, page, preference
#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 credit}
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
|
#cancel ⇒ Object
21
|
# File 'app/models/spree/payment_method/check.rb', line 21
def cancel(*); end
|
#capture ⇒ Object
17
18
19
|
# File 'app/models/spree/payment_method/check.rb', line 17
def capture(*)
simulated_successful_billing_response
end
|
#credit ⇒ Object
27
28
29
|
# File 'app/models/spree/payment_method/check.rb', line 27
def credit(*)
simulated_successful_billing_response
end
|
#simulated_successful_billing_response ⇒ Object
35
36
37
|
# File 'app/models/spree/payment_method/check.rb', line 35
def simulated_successful_billing_response
ActiveMerchant::Billing::Response.new(true, "", {}, {})
end
|
#source_required? ⇒ Boolean
31
32
33
|
# File 'app/models/spree/payment_method/check.rb', line 31
def source_required?
false
end
|
#void ⇒ Object
23
24
25
|
# File 'app/models/spree/payment_method/check.rb', line 23
def void(*)
simulated_successful_billing_response
end
|