Sha256: e3036e58ba6a6c5778f193d560f4e683874db5b24a446876bf48728319ba1005

Contents?: true

Size: 584 Bytes

Versions: 1

Compression:

Stored size: 584 Bytes

Contents

class Wepay::IpnController < Wepay::ApplicationController
  def index

    log = File.open('/tmp/ipn.log','a')

    record = WepayCheckoutRecord.find_by_checkout_id(params[:checkout_id])

    log.puts record.inspect

    if record.present?
      wepay_gateway.access_token(record.auth_code)
      checkout = wepay_gateway.lookup_checkout(record.checkout_id)
      log.puts checkout.inspect
      record.update_attributes(checkout)
    else
      raise StandardError.new("Wepay IPN: No record found for checkout_id #{params[:checkout_id]}")
    end

    render :text => 'ok'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wepay-rails-0.1.82 app/controllers/wepay/ipn_controller.rb