Add MiGS payment gateway

This commit is contained in:
Rohan Mitchell
2013-04-29 15:37:48 +10:00
parent e20e4950bb
commit 234b2d26e9
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
module Spree
class Gateway::Migs < Gateway
preference :login, :string
preference :password, :string
attr_accessible :preferred_login, :preferred_password
def provider_class
ActiveMerchant::Billing::MigsGateway
end
def options_with_test_preference
options_without_test_preference.merge(:test => self.preferred_test_mode)
end
alias_method_chain :options, :test_preference
end
end

View File

@@ -37,6 +37,10 @@ module Openfoodweb
OpenFoodWeb::Calculator::Weight]
end
# Register Spree payment methods
initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app|
app.config.spree.payment_methods << Spree::Gateway::Migs
end
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers