Sha256: f8594339c2408252d903f9ce8f5901155d07422aeaa099035645c5d04ca9d7ef

Contents?: true

Size: 906 Bytes

Versions: 8

Compression:

Stored size: 906 Bytes

Contents

module Killbill
  module Plugin
    module ActiveMerchant
      require 'active_merchant'

      class Gateway
        def self.wrap(gateway_builder, config)
          if config[:test]
            ::ActiveMerchant::Billing::Base.mode = :test
          end

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

          Gateway.new(gateway_builder.call(config))
        end

        def initialize(am_gateway)
          @gateway = am_gateway
        end

        # Unfortunate name...
        def capture(money, authorization, options = {})
          @gateway.capture(money, authorization, options)
        end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
killbill-3.1.7 lib/killbill/helpers/active_merchant/gateway.rb
killbill-3.1.6 lib/killbill/helpers/active_merchant/gateway.rb
killbill-3.1.5 lib/killbill/helpers/active_merchant/gateway.rb
killbill-3.1.4 lib/killbill/helpers/active_merchant/gateway.rb
killbill-3.1.3 lib/killbill/helpers/active_merchant/gateway.rb
killbill-3.1.2 lib/killbill/helpers/active_merchant/gateway.rb
killbill-3.1.1 lib/killbill/helpers/active_merchant/gateway.rb
killbill-3.1.0 lib/killbill/helpers/active_merchant/gateway.rb