Skip to content

Commit

Permalink
Clean up payments controller
Browse files Browse the repository at this point in the history
  • Loading branch information
kpuputti committed Aug 17, 2016
1 parent 0c7944c commit 6474721
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 40 deletions.
26 changes: 0 additions & 26 deletions app/controllers/payments_controller.rb
Expand Up @@ -26,32 +26,6 @@ def new
end
end

def choose_method

end

def done
@payment = Payment.find(params[:id])
@payment_gateway = @current_community.payment_gateway

check = @payment_gateway.check_payment(@payment, { :params => params, :mock =>@current_community.settings["mock_cf_payments"]})

if check.nil? || check[:status].blank?
flash[:error] = t("layouts.notifications.error_in_payment")
elsif check[:status] == "paid"
@payment.paid!
MarketplaceService::Transaction::Command.transition_to(@payment.tx.id, "paid")
@payment_gateway.handle_paid_payment(@payment)
flash[:notice] = check[:notice]
else # not yet paid
flash[:notice] = check[:notice]
flash[:warning] = check[:warning]
flash[:error] = check[:error]
end

redirect_to person_transaction_path(:id => params[:message_id])
end

private

def payment_can_be_conducted
Expand Down
Empty file.
9 changes: 0 additions & 9 deletions app/views/payments/new.haml

This file was deleted.

6 changes: 1 addition & 5 deletions config/routes.rb
Expand Up @@ -403,11 +403,7 @@
put :skip
end
end
resources :payments do
member do
get :done
end
end
resources :payments
resources :braintree_payments
end
resource :paypal_account, only: [:index] do
Expand Down

0 comments on commit 6474721

Please sign in to comment.