Sha256: e568de992650cf45e08f87c7495a6a9a57c01ebe14161213a354edf4228b6155

Contents?: true

Size: 750 Bytes

Versions: 2

Compression:

Stored size: 750 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 account_timeline_path(external_payment.account_id)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kaui-0.1.3 app/controllers/kaui/external_payments_controller.rb
kaui-0.1.2 app/controllers/kaui/external_payments_controller.rb