Skip to content

Instantly share code, notes, and snippets.

@diabolo
Created January 6, 2010 17:09
Show Gist options
  • Save diabolo/270423 to your computer and use it in GitHub Desktop.
Save diabolo/270423 to your computer and use it in GitHub Desktop.
config.after_initialize do
MVOR::Gateway.use_3ds_test_gateway
end
# config/initializers/mvor.rb
module MVOR
module Gateway
def self.use_non_3ds_test_gateway
Payment.gateway = ActiveMerchant::Billing::AxiarGateway.new(:login => 'test', :password => 'test', :mode => self.gateway_mode)
end
end
end
class Payment < ActiveRecord::Base
belongs_to :order
belongs_to :card
delegate :scheme, :to => :card, :allow_nil => true
cattr_accessor :gateway
# ...
private
def get_gateway_response
raise MVOR::Exception::GatewayNotConfigured, "Gateway has not been set" unless @@gateway
#...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment