Sha256: d57df3eec99b3c43209180990409eae053f075c73b56f48b5d55bcba7effafbd

Contents?: true

Size: 698 Bytes

Versions: 37

Compression:

Stored size: 698 Bytes

Contents

module Spree
  class BillingIntegration < PaymentMethod
    validates :name, :presence => true

    preference :server, :string, :default => 'test'
    preference :test_mode, :boolean, :default => true

    def provider
      integration_options = options
      ActiveMerchant::Billing::Base.integration_mode = integration_options[:server].to_sym
      integration_options = options
      integration_options[:test] = true if integration_options[:test_mode]
      @provider ||= provider_class.new(integration_options)
    end

    def options
      options_hash = {}
      self.preferences.each do |key,value|
        options_hash[key.to_sym] = value
      end
      options_hash
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
spree_core-1.3.5 app/models/spree/billing_integration.rb
spree_core-1.3.4 app/models/spree/billing_integration.rb
spree_core-1.3.3 app/models/spree/billing_integration.rb
spree_core-1.2.5 app/models/spree/billing_integration.rb
spree_core-1.1.6 app/models/spree/billing_integration.rb
spree_core-1.1.5 app/models/spree/billing_integration.rb
spree_core-1.2.4 app/models/spree/billing_integration.rb
spree_core-1.3.2 app/models/spree/billing_integration.rb
spree_core-1.0.7 app/models/spree/billing_integration.rb
spree_core-1.2.3 app/models/spree/billing_integration.rb
spree_core-1.3.1 app/models/spree/billing_integration.rb
spree_core-1.3.0 app/models/spree/billing_integration.rb
spree_core-1.3.0.rc2 app/models/spree/billing_integration.rb
dup_spree_core-1.3.0.rc1 app/models/spree/billing_integration.rb
spree_core-1.3.0.rc1 app/models/spree/billing_integration.rb
spree_core-1.2.2 app/models/spree/billing_integration.rb
spree_core-1.1.4 app/models/spree/billing_integration.rb
spree_core-1.2.0 app/models/spree/billing_integration.rb
spree_core-1.2.0.rc2 app/models/spree/billing_integration.rb
spree_core-1.2.0.rc1 app/models/spree/billing_integration.rb