Created
April 4, 2014 16:23
-
-
Save barek2k2/9978144 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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