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)
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue