Sha256: ea3da222f47becee448bd93b60cd6de5700c240499c07bec45bc208ed8653c4c

Contents?: true

Size: 859 Bytes

Versions: 2

Compression:

Stored size: 859 Bytes

Contents

class Wepay::AuthorizeController < Wepay::ApplicationController
  def index
    #ref_id, code = if params[:refID].include?('?')
    #                 parts = params[:refID].split('?')
    #                 key,val = parts[1].split('=')
    #                 [parts[0], (key == 'code' ? val : '')]
    #               else
    #                 [params[:refID], params[:code]]
    #               end
    ref_id = session[:wepay_auth_code_ref_id]
    wepayable = wepayable_class.all(:conditions => ["#{wepayable_column} = ?", ref_id])[0]
    wepayable.update_attribute(wepayable_column.to_sym, params[:code])
    redirect_to WepayRails::Configuration.settings[:after_authorize_redirect_uri]
  rescue => e
    raise AuthorizationError.new("WepayRails was unable to find the record to save the auth code to. : #{e.message}") unless wepayable.present?


  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wepay-rails-0.1.112 app/controllers/wepay/authorize_controller.rb
wepay-rails-0.1.111 app/controllers/wepay/authorize_controller.rb