From c86cbfdf5d753d087540a116257fc616fdc76a09 Mon Sep 17 00:00:00 2001 From: Adam Mueller Date: Wed, 7 Sep 2016 11:47:00 -0700 Subject: [PATCH] Register gateway with Solidus Otherwise, admins can't select this as a payment method. --- lib/solidus_paypal_braintree/engine.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/solidus_paypal_braintree/engine.rb b/lib/solidus_paypal_braintree/engine.rb index d0ebe85d..bf3b46dc 100644 --- a/lib/solidus_paypal_braintree/engine.rb +++ b/lib/solidus_paypal_braintree/engine.rb @@ -9,6 +9,10 @@ class Engine < Rails::Engine g.test_framework :rspec end + initializer "register_solidus_paypal_braintree_gateway", after: "spree.register.payment_methods" do |app| + app.config.spree.payment_methods << SolidusPaypalBraintree::Gateway + end + def self.activate Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c| Rails.configuration.cache_classes ? require(c) : load(c)