mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add MiGS payment gateway
This commit is contained in:
19
app/models/spree/gateway/migs.rb
Normal file
19
app/models/spree/gateway/migs.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user