Updated PaymentMethods to register correctly

This commit is contained in:
Brian Quinn 2011-10-08 17:07:53 +01:00
parent 65a8b9d98d
commit ff443b2d93
1 changed files with 7 additions and 6 deletions

View File

@ -7,16 +7,17 @@ module SpreePaypalExpress
config.autoload_paths += %W(#{config.root}/lib)
def self.activate
#workaround for https://github.com/Shopify/active_merchant/issuesearch?state=open&q=paypal#issue/43
require 'active_merchant'
ActiveMerchant::Billing::PaypalExpressGateway
debugger
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
Rails.env.production? ? require(c) : load(c)
end
end
BillingIntegration::PaypalExpress.register
BillingIntegration::PaypalExpressUk.register
initializer "spree_paypal_express.register.payment_methods" do |app|
app.config.spree.payment_methods += [
BillingIntegration::PaypalExpress,
BillingIntegration::PaypalExpressUk
]
end
config.to_prepare &method(:activate).to_proc