class UsersController < ApplicationController
  def show
    @user = User.find params[:id]

    redirect_to new_user_session_path unless user_signed_in? and can?(:read, @user)
  end

  def edit
    if user_signed_in?
      @user = User.find params[:id]
      authorize! :update, @user

      render :text => '', :layout => "mercury"
    else
      redirect_to new_user_session_path
    end
  end

  def update
    if user_signed_in?
      @user = User.find params[:id]
      authorize! :update, @user

      user_hash         = params[:content]
      @user.description = user_hash[:user_description][:value]
      @user.icon        = user_hash[:user_icon][:attributes][:src]

      if @user.save
        render :text => ""
      else
        respond_error_to_mercury [ @user ]
      end
    else
      redirect_to new_user_session_path
    end
  end

  def specify_paypal
    if user_signed_in?
      @user = User.find params[:id]
      authorize! :update, @user
    else
      render :template => "devise/sessions/new"
    end
  end
end

class UsersController < ApplicationController
  def show
    @user = User.find params[:id]

    redirect_to new_user_session_path unless user_signed_in? and can?(:read, @user)
  end

  def edit
    if user_signed_in?
      @user = User.find params[:id]
      authorize! :update, @user

      render :text => '', :layout => "mercury"
    else
      redirect_to new_user_session_path
    end
  end

  def update
    if user_signed_in?
      @user = User.find params[:id]
      authorize! :update, @user

      user_hash         = params[:content]
      @user.description = user_hash[:user_description][:value]
      @user.icon        = user_hash[:user_icon][:attributes][:src]

      if @user.save
        render :text => ""
      else
        respond_error_to_mercury [ @user ]
      end
    else
      redirect_to new_user_session_path
    end
  end

  def specify_paypal
    if user_signed_in?
      @user = User.find params[:id]
      authorize! :update, @user
    else
      render :template => "devise/sessions/new"
    end
  end

  def verify_paypal
    if user_signed_in?
      @user = User.find params[:id]
      authorize! :update, @user

      if (payment_email = params[:payment_email]).blank?
        flash[:error] = "You must specify a valid email address"
        render :specify_paypal
      else
        if PaypalProcessor.is_verified?(payment_email)
          @user.payment_email = payment_email
          @user.save
        else
          flash[:error] = "Email not verified - please visit PayPal to verify"
          render :specify_paypal
        end
      end
    else
      render :template => "devise/sessions/new"
    end

    flash.discard
  end
end

Update the Users Controller for verify_paypal
Update the Users Controller for verify_paypal

Add the verify_paypal action to the Users controller to verify the
User-specified PayPal email address (check if it is a VERIFIED account).
