Class: Pippin::App

Inherits:
Object
  • Object
show all
Defined in:
lib/pippin/app.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pippin/app.rb', line 4

def call(env)
  request = Rack::Request.new(env)
  ipn     = Pippin::IPN.new request.params, request.body.read

  if ipn.valid?
    instrument 'received.ipn',                  :ipn => ipn
    instrument "#{ipn.params['txn_type']}.ipn", :ipn => ipn

    [200, {}, [' ']]
  else
    [400, {}, [' ']]
  end
end