Class: Gateway::AuthorizeNet

Inherits:
Gateway show all
Defined in:
app/models/gateway/authorize_net.rb

Constant Summary

Constants inherited from PaymentMethod

PaymentMethod::DISPLAY

Instance Method Summary collapse

Methods inherited from Gateway

current, #method_missing, #method_type, #payment_profiles_supported?, #payment_source_class, #provider

Methods inherited from PaymentMethod

active?, available, current, #destroy, find_with_destroyed, #method_type, #payment_profiles_supported?, #payment_source_class, providers, register, #source_required?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Gateway

Instance Method Details

#optionsObject



9
10
11
12
13
14
15
16
17
18
# File 'app/models/gateway/authorize_net.rb', line 9

def options
  # add :test key in the options hash, as that is what the ActiveMerchant::Billing::AuthorizeNetGateway expects
  if self.prefers? :test_mode
    self.class.default_preferences[:test] = true
  else
    self.class.default_preferences.delete(:test)
  end

  super
end

#provider_classObject



5
6
7
# File 'app/models/gateway/authorize_net.rb', line 5

def provider_class
  ActiveMerchant::Billing::AuthorizeNetGateway
end