Sha256: f3524b9592641117cb4d16b1589195e09b303fe1e982506beda22c4e19afc306

Contents?: true

Size: 1.05 KB

Versions: 23

Compression:

Stored size: 1.05 KB

Contents

module Killbill::Litle
  class Gateway
    def self.from_config(config)
      if config[:test]
        ActiveMerchant::Billing::Base.mode = :test
      end

      if config[:log_file]
        ActiveMerchant::Billing::LitleGateway.wiredump_device = File.open(config[:log_file], 'w')
        ActiveMerchant::Billing::LitleGateway.wiredump_device.sync = true
      end

      gateways = {}
      config[:merchant_id].each do |currency, mid|
        gateways[currency.upcase.to_sym] = Gateway.new(currency, config[:username], config[:password], mid)
      end
      gateways
    end

    def initialize(currency, user, password, merchant_id)
      @currency = currency
      @gateway = ActiveMerchant::Billing::LitleGateway.new({:user => user,
                                                            :password => password,
                                                            :merchant_id => merchant_id
                                                           })
    end

    def method_missing(m, *args, &block)
      @gateway.send(m, *args, &block)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
killbill-litle-1.10.0 lib/litle/litle/gateway.rb
killbill-litle-1.9.9 lib/litle/litle/gateway.rb
killbill-litle-1.9.8 lib/litle/litle/gateway.rb
killbill-litle-1.9.7 lib/litle/litle/gateway.rb
killbill-litle-1.9.6 lib/litle/litle/gateway.rb
killbill-litle-1.9.5 lib/litle/litle/gateway.rb
killbill-litle-1.9.4 lib/litle/litle/gateway.rb
killbill-litle-1.9.3 lib/litle/litle/gateway.rb
killbill-litle-1.9.2 lib/litle/litle/gateway.rb
killbill-litle-1.9.1 lib/litle/litle/gateway.rb
killbill-litle-1.9.0 lib/litle/litle/gateway.rb
killbill-litle-1.8.2 lib/litle/litle/gateway.rb
killbill-litle-1.8.1 lib/litle/litle/gateway.rb
killbill-litle-1.8.0 lib/litle/litle/gateway.rb
killbill-litle-1.7.1 lib/litle/litle/gateway.rb
killbill-litle-1.7.0 lib/litle/litle/gateway.rb
killbill-litle-1.6.0 lib/litle/litle/gateway.rb
killbill-litle-1.5.1 lib/litle/litle/gateway.rb
killbill-litle-1.5.0 lib/litle/litle/gateway.rb
killbill-litle-1.4.0 lib/litle/litle/gateway.rb