module NitroPay

Constants

MAJOR
MINOR
PATCH
VERSION

Public Class Methods

app_id() click to toggle source
# File lib/nitro_pay.rb, line 43
def self.app_id
  @@app_id
end
app_id=(app_id) click to toggle source
# File lib/nitro_pay.rb, line 39
def self.app_id=(app_id)
  @@app_id = app_id
end
debug() click to toggle source
# File lib/nitro_pay.rb, line 63
def self.debug
  @@debug
end
debug=(debug) click to toggle source
# File lib/nitro_pay.rb, line 67
def self.debug=(debug)
  @@debug = debug
end
enum() click to toggle source
# File lib/nitro_pay.rb, line 76
def self.enum
  enum = {}
  return @@enum unless @@enum.nil?

  enum = enum.merge load_yml('brands.yml')
  enum = enum.merge load_yml('currencies.yml')
  enum = enum.merge load_yml('payment_methods.yml')
  enum = enum.merge load_yml('recurrence_periods.yml')
  enum = enum.merge load_yml('transaction_codes.yml')

  enum = enum.it_keys_to_sym
  @@enum = enum
end
get_proxy_from_yml() click to toggle source
# File lib/nitro_pay.rb, line 71
def self.get_proxy_from_yml
  yml = YAML::load_file(File.join(File.dirname(File.expand_path(__FILE__)), 'nitro_pay/config/proxy.yml'))
  !yml.nil? || yml.is_a?(Hash) ? yml.it_keys_to_sym : {} if yml
end
load_yml(file_name) click to toggle source
# File lib/nitro_pay.rb, line 90
def self.load_yml(file_name)
  YAML::load_file(File.join(File.dirname(File.expand_path(__FILE__)), 'nitro_pay/config/enums/' + file_name))
end
proxy() click to toggle source
# File lib/nitro_pay.rb, line 34
def self.proxy
  return nil if NitroPay.proxy_yml.nil? || NitroPay.proxy_yml.empty?
  "http://#{NitroPay.proxy_yml[:login]}:#{NitroPay.proxy_yml[:password]}@#{NitroPay.proxy_yml[:host]}:#{NitroPay.proxy_yml[:port]}/"
end
proxy_yml() click to toggle source
# File lib/nitro_pay.rb, line 29
def self.proxy_yml
  @@proxy_yml = NitroPay.get_proxy_from_yml if @@proxy_yml.nil?
  @@proxy_yml
end
secret_key() click to toggle source
# File lib/nitro_pay.rb, line 51
def self.secret_key
  @@secret_key
end
secret_key=(secret_key) click to toggle source
# File lib/nitro_pay.rb, line 47
def self.secret_key=(secret_key)
  @@secret_key = secret_key
end
test_env() click to toggle source
# File lib/nitro_pay.rb, line 55
def self.test_env
  @@test_env
end
test_env=(test_env) click to toggle source
# File lib/nitro_pay.rb, line 59
def self.test_env=(test_env)
  @@test_env = test_env
end