Hi

I'm using ActiveMerchant with Authorize.net and already setup 2 models
Order and Transaction. (http://railscasts.com/episodes/145-integrating-
active-merchant)

I would like to get error message from the transaction if error
occurred then output in flash message. Here is my code:

#models/order_transaction.rb

class OrderTransaction < ActiveRecord::Base
belongs_to :order
serialize :params

def response=(response)
self.success = response.success?
self.authorization = response.authorization
self.message = response.message
self.params = response.params
rescue ActiveMerchant::ActiveMerchantError => e
self.success = false
self.authorization = nil
self.message = e.message
self.params = {}
end
end

How do I get those data from OrderTransaction class such as message,
success... in order_controller?

Thank you!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 1, '11 at 2:36p
activeOct 1, '11 at 2:36p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Lam Nguyen: 1 post

People

Translate

site design / logo © 2021 Grokbase