Class: Caboose::InvoiceTransactionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/caboose/invoice_transactions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#add_ga_event, #admin_add, #admin_bulk_add, #admin_bulk_delete, #admin_bulk_update, #admin_delete, #admin_edit, #admin_index, #admin_json, #admin_json_single, #admin_update, #before_action, #before_before_action, #hashify_query_string, #init_cart, #logged_in?, #logged_in_user, #login_user, #logout_user, #parse_url_params, #reject_param, #under_construction_or_forwarding_domain?, #user_is_allowed, #user_is_allowed_to, #validate_cookie, #validate_token, #var, #verify_logged_in

Instance Method Details

#admin_captureObject


5
6
7
8
9
10
11
12
# File 'app/controllers/caboose/invoice_transactions_controller.rb', line 5

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

#admin_refundObject


15
16
17
18
19
20
21
22
# File 'app/controllers/caboose/invoice_transactions_controller.rb', line 15

def admin_refund
  return if !user_is_allowed('invoices', 'edit')

  it = InvoiceTransaction.find(params[:id])
  resp = it.refund 
  
  render :json => resp            
end

#admin_voidObject


25
26
27
28
29
30
31
32
# File 'app/controllers/caboose/invoice_transactions_controller.rb', line 25

def admin_void
  return if !user_is_allowed('invoices', 'edit')

  it = InvoiceTransaction.find(params[:id])
  resp = it.void 
  
  render :json => resp            
end