Class: Spree::PaymentMethod::Check

Inherits:
Spree::PaymentMethod show all
Defined in:
app/models/spree/payment_method/check.rb

Constant Summary

Constant Summary

Constants inherited from Spree::PaymentMethod

DISPLAY

Instance Method Summary (collapse)

Methods inherited from Spree::PaymentMethod

active?, #auto_capture?, available, #display_on, #display_on=, find_with_destroyed, #method_type, #payment_profiles_supported?, #payment_source_class, #provider_class, providers, #reusable_sources, #store_credit?, #supports?

Methods included from Spree::Preferences::StaticallyConfigurable

#preference_source=, #preferences, #preferences=

Methods inherited from Base

display_includes, #initialize_preference_defaults, page, preference

Methods included from Spree::Preferences::Preferable

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

Instance Method Details

- (Object) actions



3
4
5
# File 'app/models/spree/payment_method/check.rb', line 3

def actions
  %w{capture void}
end

- (Boolean) can_capture?(payment)

Indicates whether its possible to capture the payment

Returns:

  • (Boolean)


8
9
10
# File 'app/models/spree/payment_method/check.rb', line 8

def can_capture?(payment)
  ['checkout', 'pending'].include?(payment.state)
end

- (Boolean) can_void?(payment)

Indicates whether its possible to void the payment.

Returns:

  • (Boolean)


13
14
15
# File 'app/models/spree/payment_method/check.rb', line 13

def can_void?(payment)
  payment.state != 'void'
end

- (Object) cancel(response)



21
# File 'app/models/spree/payment_method/check.rb', line 21

def cancel(response); end

- (Object) capture(*_args)



17
18
19
# File 'app/models/spree/payment_method/check.rb', line 17

def capture(*_args)
  ActiveMerchant::Billing::Response.new(true, "", {}, {})
end

- (Boolean) source_required?

Returns:

  • (Boolean)


27
28
29
# File 'app/models/spree/payment_method/check.rb', line 27

def source_required?
  false
end

- (Object) void(*_args)



23
24
25
# File 'app/models/spree/payment_method/check.rb', line 23

def void(*_args)
  ActiveMerchant::Billing::Response.new(true, "", {}, {})
end