Class: Jackpot::Gateway

Inherits:
Object
  • Object
show all
Defined in:
app/models/jackpot/gateway.rb

Overview

Small adapter for Active Merchant gateways Jackpot supports

Instance Method Summary collapse

Constructor Details

#initialize(gateway) ⇒ Gateway

Returns a new instance of Gateway.



6
7
8
# File 'app/models/jackpot/gateway.rb', line 6

def initialize(gateway)
  @gateway = gateway
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



10
11
12
13
14
15
16
# File 'app/models/jackpot/gateway.rb', line 10

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

Instance Method Details

#capture(money, authorization, options = {}) ⇒ Object

TODO: Remove this ugly hack and move to a lighterweight PORO decorator approach



19
20
21
# File 'app/models/jackpot/gateway.rb', line 19

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

#respond_to?(meth) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/models/jackpot/gateway.rb', line 23

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