have a transaction model similar to RailsCasts ActiveMerchant tutorial.
How can I create a fake response?
Tried something like the following but no luck.
response = @success=true, @params = {"ref" => "123"}, @authorization = "54321", ...
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