17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'app/controllers/gemgento/checkout/confirm_controller.rb', line 17
def update
@quote.payment.update(session[:payment_data]) if @quote.payment && session[:payment_data]
respond_to do |format|
if @quote.convert(request.remote_ip)
session[:order_increment_id] = @quote.order_increment_id
session.delete :payment_data
if !@quote.payment.is_redirecting_payment_method?('confirm_after')
format.html { redirect_to checkout_thank_you_path }
format.json { render json: { result: true, order: @quote.order } }
else
format.html { redirect_to confirm_after_redirect_url }
format.json { render json: { result: true, payment_redirect_url: confirm_after_redirect_url } }
end
else
@shipping_method = get_magento_shipping_method
format.html { render 'show' }
format.json { render json: { result: false, errors: @quote.errors }, status: 422 }
end
end
end
|