Sha256: 6bd3068b626b5742be967f1c596ffe07503f754bc2f4c24972598eeead8d323e

Contents?: true

Size: 992 Bytes

Versions: 249

Compression:

Stored size: 992 Bytes

Contents

module Caboose
  class InvoiceTransactionsController < Caboose::ApplicationController
    
    # @route GET /admin/invoices/:invoice_id/transactions/:id/capture
    def admin_capture
      return if !user_is_allowed('invoices', 'edit')
    
      it = InvoiceTransaction.find(params[:id])
      resp = params[:amount] ? it.capture(params[:amount].to_f) : it.capture 
      
      render :json => resp            
    end
        
    # @route GET /admin/invoices/:invoice_id/transactions/:id/refund
    def admin_refund
      return if !user_is_allowed('invoices', 'edit')
    
      it = InvoiceTransaction.find(params[:id])
      resp = it.refund 
      
      render :json => resp            
    end
    
    # @route GET /admin/invoices/:invoice_id/transactions/:id/void
    def admin_void
      return if !user_is_allowed('invoices', 'edit')
    
      it = InvoiceTransaction.find(params[:id])
      resp = it.void 
      
      render :json => resp            
    end
    
  end
end

Version data entries

249 entries across 249 versions & 1 rubygems

Version Path
caboose-cms-0.9.229 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-1.0.2 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-1.0.1 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.228 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.227 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.226 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.225 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.224 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.223 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.222 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.221 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.220 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.219 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.218 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.217 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.216 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.215 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.214 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.213 app/controllers/caboose/invoice_transactions_controller.rb
caboose-cms-0.9.212 app/controllers/caboose/invoice_transactions_controller.rb