Sha256: 028b30092fe2a370cb7a8547485cc9c7ec71a634dc5f31d6ef46063db59ee38b

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

module Jackpot 

  # Small adapter for Active Merchant gateways Jackpot supports
  class Gateway

    def initialize(gateway)
      @gateway = gateway
    end 

    def method_missing(meth, *args)
      if @gateway.respond_to?(meth)
        @gateway.send(meth, *args)
      else
        super
      end
    end

    # TODO: Remove this ugly hack and move to a lighterweight PORO decorator approach
    def capture(money, authorization, options = {})
      @gateway.capture(money, authorization, options) 
    end 

    def respond_to?(meth)
      @gateway.respond_to?(meth)
    end

  end 
end 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jackpot-0.0.3 app/models/jackpot/gateway.rb