Class: PaypalController

Inherits:
CheckoutController
  • Object
show all
Defined in:
app/controllers/paypal_controller.rb

Instance Method Summary collapse

Instance Method Details

#confirmObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/paypal_controller.rb', line 5

def confirm
  # XXX It works!
  #redirect_to checkout_state_path("confirm")
  # but we want this:
  unless current_order
    redirect_to root_path
  else
    order = current_order
    while order.state != "complete"
       order.next
       state_callback(:after)
    end
    #order.finalize!
    flash[:notice] = I18n.t(:order_processed_successfully)
    flash[:commerce_tracking] = "nothing special"
    redirect_to order_path(current_order)
  end
end