Sha256: c56dc2a4811bd6358ef59ef4e7b7e53899e45a6a39fcd04d7d0f9c78f6c225c0
Contents?: true
Size: 752 Bytes
Versions: 217
Compression:
Stored size: 752 Bytes
Contents
require_dependency "ishapi/application_controller" module Ishapi class InvoicesController < ApplicationController def search authorize! :open_permission, ::Ishapi begin i = Ish::Invoice.find_by( :number => params[:number] ) if i.email == params[:email] && i.amount == params[:amount].to_f && i.payments.count == 0 render :json => { :status => :ok } else render :status => 404, :json => {} # :json => { :status => 404, :code => 404, :message => 'Not Found1' } end rescue Mongoid::Errors::DocumentNotFound => e puts! e, 'e' render :status => 404, :json => {} # :json => { :status => 404, :code => 404, :message => 'Not Found1' } end end end end
Version data entries
217 entries across 217 versions & 1 rubygems