Sha256: f5332fc622ff4b3d061b1f9b3ff3bdfd57b01b490de607058295cbb541104f00

Contents?: true

Size: 825 Bytes

Versions: 3

Compression:

Stored size: 825 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"
    # else
    #   flash[:error] = "Error while creating external payment"
    end
    redirect_to account_timeline_path(external_payment.account_id)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kaui-0.1.0 app/controllers/kaui/external_payments_controller.rb
kaui-0.0.9 app/controllers/kaui/external_payments_controller.rb
kaui-0.0.8 app/controllers/kaui/external_payments_controller.rb