Class: PaymentMethod

Inherits:
ActiveRecord::Base show all
Includes:
Permalink::Builder
Defined in:
app/models/payment_method.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Permalink::Builder

#set_permalink, #to_param

Class Method Details

.currentObject



35
36
37
# File 'app/models/payment_method.rb', line 35

def self.current
  self.first
end

.partializeObject



21
22
23
# File 'app/models/payment_method.rb', line 21

def self.partialize
  name.gsub("PaymentMethod::","").underscore
end

Instance Method Details

#demodulized_underscoreObject



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

def demodulized_underscore
  self.class.name.demodulize.underscore
end

#live_mode?Boolean

return true if payment method is running in live mode

Returns:

  • (Boolean)


26
27
28
# File 'app/models/payment_method.rb', line 26

def live_mode?
  !test_mode?
end

#test_mode?Boolean

return true if payment method is running in test mode

Returns:

  • (Boolean)


31
32
33
# File 'app/models/payment_method.rb', line 31

def test_mode?
  self.mode == 'test'
end

#use_ssl?Boolean

By default payment_method does not require that application must use SSL. Individual payment method should override this method.

Returns:

  • (Boolean)


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

def use_ssl?
  false
end