Skip to content

Instantly share code, notes, and snippets.

@barek2k2
Created April 4, 2014 16:23
Show Gist options
  • Save barek2k2/9978144 to your computer and use it in GitHub Desktop.
Save barek2k2/9978144 to your computer and use it in GitHub Desktop.
def confirm
@request_order = RequestOrder.find(params[:id])
if current_user
begin
invoice = @quickbooks_client.create_invoice(@request_order.total_amount, @request_order.package.name)
@request_order.update_attributes({
step: 'dashboard',
redirect_after_login_url: dashboard_request_order_url(@request_order),
invoice_id: invoice.id
})
redirect_to dashboard_request_order_path(@request_order)
rescue Exception => e
raise e.backtrace.inspect
render :edit
end
else
session[:user_return_to] = dashboard_request_order_path(@request_order)
redirect_to new_user_session_path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment