Module: Tencentpay::Config

Defined in:
lib/tencentpay/config.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.bargainor_idObject (readonly)

Returns the value of attribute bargainor_id.



4
5
6
# File 'lib/tencentpay/config.rb', line 4

def bargainor_id
  @bargainor_id
end

.keyObject (readonly)

Returns the value of attribute key.



4
5
6
# File 'lib/tencentpay/config.rb', line 4

def key
  @key
end

Class Method Details

.load_configObject



6
7
8
9
10
11
# File 'lib/tencentpay/config.rb', line 6

def load_config
  filename = "#{Rails.root}/config/tencentpay.yml"
  config = YAML.load(File.open(filename))
  @bargainor_id, @key = config[RAILS_ENV]['bargainor_id'], config[RAILS_ENV]['key']
  raise "Please configure your Tencentpay settings in #{filename}." unless @@spid && @@key
end