Module: TBK

Defined in:
lib/tbk/keys.rb,
lib/tbk/config.rb,
lib/tbk/errors.rb,
lib/tbk/version.rb,
lib/tbk/commerce.rb,
lib/tbk/webpay/logger.rb,
lib/tbk/webpay/payment.rb,
lib/tbk/webpay/encryption.rb,
lib/tbk/webpay/confirmation.rb,
lib/tbk/webpay/logger/base_logger.rb,
lib/tbk/webpay/logger/null_logger.rb,
lib/tbk/webpay/logger/official_logger.rb

Defined Under Namespace

Modules: VERSION, Webpay Classes: Commerce, CommerceError, Config, Error

Class Method Summary collapse

Class Method Details

.configTBK::Config

Returns the configuration object

Returns:



31
32
33
# File 'lib/tbk/config.rb', line 31

def self.config
  @config ||= Config.new
end

.configure {|TBK::Config| ... } ⇒ Object

Configure the app defaults simply by doing

TBK.configure do |config|
  config.commerce_id 123456
  config.commerce_key File.read(COMMERCE_KEY_PATH)
end

Yields:



43
44
45
46
# File 'lib/tbk/config.rb', line 43

def self.configure(&block)
  yield(self.config)
  nil
end

.parse_key(name) ⇒ Object



2
3
4
# File 'lib/tbk/keys.rb', line 2

def self.parse_key(name)
  OpenSSL::PKey::RSA.new( File.read(File.expand_path("../keys/#{name}.pem",__FILE__)) )
end