Created
August 19, 2011 16:24
-
-
Save BDQ/1157250 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#### core/lib/spree_core/railtie.rb ##### | |
initializer "spree.environment" do |app| | |
app.config.spree = Spree::Environment.new | |
end | |
initializer "spree.register.payments" do |app| | |
app.config.spree.payment_methods = [ | |
Gateway::Bogus, | |
Gateway::AuthorizeNet, | |
Gateway::AuthorizeNetCim, | |
Gateway::Eway, | |
Gateway::Linkpoint, | |
Gateway::PayPal, | |
Gateway::SagePay, | |
Gateway::Beanstream, | |
Gateway::Braintree, | |
PaymentMethod::Check ] | |
end | |
#### core/lib/spree/environment.rb ##### | |
module Spree | |
class Environment | |
attr_accessor :calculators, :payment_methods | |
end | |
end | |
#### core/app/models/payment_methods ##### | |
def self.providers | |
Rails.application.config.spree.payment_methods | |
end | |
https://github.com/spree/spree/blob/master/core/lib/spree/core/engine.rb.
How are custom PaymentMethods added automatically to this?
Rails.application.config.spree.payment_methods
For me this did the trick http://blog.siyelo.com/active-merchant-and-spree
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
where did this go in Spree 1.1?