Sha256: 3aa7c9f7f6cd3f73cbddef0d8d9b4f2e4a666dc7df56448c698665fbb139c35a

Contents?: true

Size: 762 Bytes

Versions: 3

Compression:

Stored size: 762 Bytes

Contents

class Kaui::ExternalPaymentsController < Kaui::EngineController
  def new
    invoice_id = params[:invoice_id]
    @account_id = params[:account_id]

    @external_payment = Kaui::ExternalPayment.new("invoiceId" => invoice_id, "accountId" => @account_id)

    @account = Kaui::KillbillHelper::get_account(@account_id)
    @invoice = Kaui::KillbillHelper::get_invoice(invoice_id)
  end

  def create
    external_payment = Kaui::ExternalPayment.new(params[:external_payment])

    success = Kaui::KillbillHelper::create_external_payment(external_payment, current_user, params[:reason], params[:comment])
    if success
      flash[:info] = "External Payment created"
    end
    redirect_to kaui_engine.account_timeline_path(external_payment.account_id)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kaui-0.1.6 app/controllers/kaui/external_payments_controller.rb
kaui-0.1.5 app/controllers/kaui/external_payments_controller.rb
kaui-0.1.4 app/controllers/kaui/external_payments_controller.rb