Class: Spree::BillingIntegration

Inherits:
PaymentMethod show all
Defined in:
app/models/spree/billing_integration.rb

Instance Method Summary collapse

Methods inherited from PaymentMethod

active?, #auto_capture?, available, #deprecated_method_type_override, #display_on, #display_on=, find_with_destroyed, #method_type, model_name, #partial_name, #payment_profiles_supported?, #payment_source_class, providers, #reusable_sources, #source_required?, #store_credit?, #supports?, #try_void

Methods included from Preferences::StaticallyConfigurable

#preference_source=, #preferences, #preferences=

Methods included from ParanoiaDeprecations

#paranoia_delete, #paranoia_destroy

Methods inherited from Base

display_includes, #initialize_preference_defaults, page, preference

Methods included from Preferences::Preferable

#admin_form_preference_names, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Instance Method Details

#gatewayObject



10
11
12
13
14
15
# File 'app/models/spree/billing_integration.rb', line 10

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

#optionsObject



17
18
19
20
21
# File 'app/models/spree/billing_integration.rb', line 17

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