Sha256: 49b8d80dff56f76e88e4ad178e11254d496f1b4964e43b8c5fc614fc9358bd65
Contents?: true
Size: 1.08 KB
Versions: 3
Compression:
Stored size: 1.08 KB
Contents
class Kaui::CreditsController < Kaui::EngineController def show @account_id = params[:account_id] @invoice_id = params[:invoice_id] if params.has_key?(:account_id) # invoice id can be nil for account level credit data = Kaui::KillbillHelper::get_credits(@account_id, @invoice_id) if data.present? @credit = Kaui::Credit.new(data) else Rails.logger.warn("Did not get back external payments #{response_body}") end else flash[:notice] = "No id given" end end def new @account_id = params[:account_id] @invoice_id = params[:invoice_id] @credit = Kaui::Credit.new(:invoice_id => @invoice_id, :account_id => @account_id) @account = Kaui::KillbillHelper::get_account(@account_id) @invoice = Kaui::KillbillHelper::get_invoice(@invoice_id) end def create credit = Kaui::Credit.new(params[:credit]) # TODO: read credit object from post params #Kaui::KillbillHelper::create_credit(@payment_id) redirect_to account_timeline_path(:id => credit.account_id) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
kaui-0.0.7 | app/controllers/kaui/credits_controller.rb |
kaui-0.0.6 | app/controllers/kaui/credits_controller.rb |
kaui-0.0.5 | app/controllers/kaui/credits_controller.rb |