Can you check that your code is actually being called and verify what the
content of the error message is?
On Sep 5, 2013 1:00 PM, "Daniel Gerep" wrote:

Hey Michael, thanks for your time.

I have created the file under
app/overrides/checkout_controller_decorator.rb

Restarted the server and still getting the default message, any ideas of
what I did wrong?

Thanks.

Search Discussions

  • Daniel Gerep at Sep 5, 2013 at 6:09 pm
    This is the code, I've added a puts so I could see it on the console but it
    didn't work.

    module Spree
       CheckoutController.class_eval do
         def rescue_from_spree_gateway_error(error)
           puts "==========================================="
           flash[:error] = error.message
           render :edit
         end
       end
    end

    And this is the Response object returned from the gateway

    Erro na Gateway
       --- !ruby/object:ActiveMerchant::Billing::Response
    params:
       success: false
       order_status:
       message: Autoriza��o negada
       amount:
       order:
       transaction:
    message: Autoriza��o negada
    success: false
    test: false
    authorization:
    fraud_review:
    avs_result:
       code:
       message:
       street_match:
       postal_match:
    cvv_result:
       code:
       message:


    Simply adding the module it should work?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedSep 5, '13 at 5:43p
activeSep 5, '13 at 6:09p
posts2
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Daniel Gerep: 1 post Michael Sevestre: 1 post

People

Translate

site design / logo © 2022 Grokbase