Sha256: 3e3892a7bfd23d20e4922013b98907a09e48a1de77a4c35b36e6656ca6fc43cd

Contents?: true

Size: 1.09 KB

Versions: 11

Compression:

Stored size: 1.09 KB

Contents

module SpreeMollieGateway
  class Engine < ::Rails::Engine
    require 'spree/core'
    require 'mollie-api-ruby'

    isolate_namespace SpreeMollieGateway

    config.autoload_paths += %W[#{config.root}/lib]

    # Use rspec for tests
    config.generators do |g|
      g.test_framework :rspec
    end

    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end

      ::Rails.application.config.spree.payment_methods << Spree::Gateway::MollieGateway
      Spree::PermittedAttributes.source_attributes << :payment_method_name
      Spree::PermittedAttributes.source_attributes << :issuer
      Spree::Api::ApiHelpers.payment_source_attributes << :payment_method_name
      Spree::Api::ApiHelpers.payment_source_attributes << :issuer
      Spree::Api::ApiHelpers.payment_source_attributes << :payment_url

      # Orders should be shippable whenever they're authorized
      Spree::Config[:auto_capture_on_dispatch] = true
    end

    config.to_prepare &method(:activate).to_proc
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spree_mollie_gateway-4.0.1 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-4.0.0 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.2.1 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.2.0 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.1.0 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.0.4 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.0.3 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.0.2 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.0.1 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.0.0 lib/spree_mollie_gateway/engine.rb
spree_mollie_gateway-3.0.0.pre.beta lib/spree_mollie_gateway/engine.rb