Sha256: 79ddb7c3113bbf8569ea7d65355f8ca3c668bd0995493f20f3bf1706c8b20ef3
Contents?: true
Size: 1.02 KB
Versions: 16
Compression:
Stored size: 1.02 KB
Contents
class Kaui::ChargesController < Kaui::EngineController def new @account_id = params[:account_id] @invoice_id = params[:invoice_id] begin @account = Kaui::KillbillHelper::get_account(@account_id) if @invoice_id.present? @invoice = Kaui::KillbillHelper::get_invoice(@invoice_id) @charge = Kaui::Charge.new("accountId" => @account_id, "invoiceId" => @invoice_id) else @charge = Kaui::Charge.new("accountId" => @account_id) end rescue => e flash[:error] = "Error while creating a charge: #{as_string(e)}" end end def create charge = Kaui::Charge.new(params[:charge]) if charge.present? begin Kaui::KillbillHelper::create_charge(charge, params[:requested_date], current_user, nil, params[:comment]) flash[:info] = "Charge created" redirect_to kaui_engine.account_timeline_path(:id => charge.account_id) rescue => e flash[:error] = "Error while creating a charge: #{as_string(e)}" end end end end
Version data entries
16 entries across 16 versions & 1 rubygems