Skip to content

Instantly share code, notes, and snippets.

@BDQ
Created August 19, 2011 16:24
Show Gist options
  • Save BDQ/1157250 to your computer and use it in GitHub Desktop.
Save BDQ/1157250 to your computer and use it in GitHub Desktop.
#### 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
@westonplatter
Copy link

where did this go in Spree 1.1?

@westonplatter
Copy link

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

@rodrigomes
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment