Sha256: e825aa4096c2a37e96dcd6e90b4b56f5ef6700e7676863f923b53b59c808d11d

Contents?: true

Size: 644 Bytes

Versions: 29

Compression:

Stored size: 644 Bytes

Contents

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

Version data entries

29 entries across 29 versions & 6 rubygems

Version Path
spree_core-0.70.7 app/models/billing_integration.rb
spree_core-0.70.6 app/models/billing_integration.rb
apispree_core-0.0.0 app/models/billing_integration.rb
My-Commerce_core-1.1.0 app/models/billing_integration.rb
My-Commerce_core-1.0.0 app/models/billing_integration.rb
MyCommerceapi-1.0.0 core/app/models/billing_integration.rb
MyCommerce-0.0.3 core/app/models/billing_integration.rb
rfcommerce_core-0.0.3 app/models/billing_integration.rb
spree_core-0.60.6 app/models/billing_integration.rb
spree_core-0.70.5 app/models/billing_integration.rb
spree_core-0.70.4 app/models/billing_integration.rb
spree_core-0.60.5 app/models/billing_integration.rb
spree_core-0.70.3 app/models/billing_integration.rb
spree_core-0.70.2 app/models/billing_integration.rb
spree_core-0.50.4 app/models/billing_integration.rb
spree_core-0.60.4 app/models/billing_integration.rb
spree_core-0.50.3 app/models/billing_integration.rb
spree_core-0.60.3 app/models/billing_integration.rb
spree_core-0.70.1 app/models/billing_integration.rb
spree_core-0.70.0 app/models/billing_integration.rb