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