Sha256: 83c9d3eead2246e27b85160fd47e978608e1ad5507d633bd0bb3eca1858eefcf
Contents?: true
Size: 1.4 KB
Versions: 3
Compression:
Stored size: 1.4 KB
Contents
class Kaui::RefundsController < Kaui::EngineController def show @payment_id = params[:id] if @payment_id.present? data = Kaui::KillbillHelper::get_refunds_for_payment(@payment_id) if data.present? @refund = Kaui::Refund.new(data) else Rails.logger.warn("Did not get back refunds for the payment id #{response_body}") end else flash[:notice] = "No payment id given" end end def new @payment_id = params[:payment_id] @invoice_id = params[:invoice_id] @account_id = params[:account_id] @refund = Kaui::Refund.new('adjusted' => true) @account = Kaui::KillbillHelper::get_account(@account_id) @payment = Kaui::KillbillHelper::get_payment(@invoice_id, @payment_id) @invoice = Kaui::KillbillHelper::get_invoice(@invoice_id) end def create payment_id = params[:payment_id] account_id = params[:account_id] refund = Kaui::Refund.new(params[:refund]) refund.adjusted = (refund.adjusted == "1") if refund.present? success = Kaui::KillbillHelper::create_refund(params[:payment_id], refund, current_user, params[:reason], params[:comment]) if success flash[:info] = "Refund created" else flash[:error] = "Error while processing refund" end else flash[:error] = "No refund to process" end redirect_to account_timeline_path(:id => params[:account_id]) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
kaui-0.1.0 | app/controllers/kaui/refunds_controller.rb |
kaui-0.0.9 | app/controllers/kaui/refunds_controller.rb |
kaui-0.0.8 | app/controllers/kaui/refunds_controller.rb |