Class: SpreePaypalAdaptivePayment::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/spree_paypal_adaptive_payment.rb

Class Method Summary collapse

Class Method Details

.activateObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/spree_paypal_adaptive_payment.rb', line 9

def self.activate
  # workaround for
  # https://github.com/Shopify/active_merchant/issuesearch?state=open&q=paypal#issue/43
  require 'active_merchant'
  ActiveMerchant::Billing::PaypalAdaptivePayment

  Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
    Rails.env.production? ? require(c) : load(c)
  end

  BillingIntegration::PaypalAdaptivePayment.register
end