Created
March 20, 2015 15:54
-
-
Save dmons/483ecbf7915a4c168df4 to your computer and use it in GitHub Desktop.
Refactor controller's code.
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 update | |
if params[:credit_card] | |
#process order | |
response = @order.process(params) | |
if response[:status] == "success" | |
render :template => "orders/show" | |
else | |
render :json => response | |
end | |
else | |
if params[:shipping_contact].size > 0 && params[:shipping_address].size > 0 | |
@order.create_shipping_contact(params[:shipping_contact],params[:shipping_address]) | |
end | |
render :template => "orders/show" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment