Created
January 6, 2010 17:09
-
-
Save diabolo/270423 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.after_initialize do | |
MVOR::Gateway.use_3ds_test_gateway | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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