Class: CheckoutsController

Inherits:
Spree::BaseController show all
Includes:
ActionView::Helpers::NumberHelper
Defined in:
app/controllers/checkouts_controller.rb

Instance Method Summary collapse

Methods inherited from Spree::BaseController

#access_forbidden, #default_title, #find_order, #initialize_extension_partials, #set_title, #title

Methods inherited from ApplicationController

#admin_created?

Methods included from EasyRoleRequirementSystem

included

Methods included from EasyRoleRequirementSystem::InstanceMethods

#included

Methods included from RoleRequirementSystem

included

Instance Method Details

#rc_updateObject

alias original r_c method so we can handle any (gateway) exceptions that might be thrown



13
# File 'app/controllers/checkouts_controller.rb', line 13

alias :rc_update :update

#updateObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/checkouts_controller.rb', line 14

def update 
  begin
    rc_update
  rescue Spree::GatewayError => ge
    flash[:error] = t("unable_to_authorize_credit_card") + ": #{ge.message}"
    redirect_to edit_object_url and return
  rescue Exception => oe
    flash[:error] = t("unable_to_authorize_credit_card") + ": #{oe.message}"
    logger.unknown "#{flash[:error]}  #{oe.backtrace.join("\n")}"
    redirect_to edit_object_url and return
  end
end