module ActiveMerchant::Billing::Base

Constants

GATEWAY_MODE_DEPRECATION_MESSAGE

Public Class Methods

gateway(name) click to toggle source

Return the matching gateway for the provider

# File lib/active_merchant/billing/base.rb, line 30
def self.gateway(name)
  name_str = name.to_s.strip.downcase

  raise(ArgumentError, 'A gateway provider must be specified') if name_str.blank?

  begin
    Billing.const_get("#{name_str}_gateway".camelize)
  rescue
    raise ArgumentError, "The specified gateway is not valid (#{name_str})"
  end
end
gateway_mode() click to toggle source
# File lib/active_merchant/billing/base.rb, line 16
def self.gateway_mode
  ActiveMerchant.deprecated(GATEWAY_MODE_DEPRECATION_MESSAGE)
  @@mode
end
gateway_mode=(mode) click to toggle source
# File lib/active_merchant/billing/base.rb, line 11
def self.gateway_mode=(mode)
  ActiveMerchant.deprecated(GATEWAY_MODE_DEPRECATION_MESSAGE)
  @@mode = mode
end
integration(name) click to toggle source

Return the matching integration module You can then get the notification from the module

# File lib/active_merchant/billing/base.rb, line 51
def self.integration(name)
  Billing::Integrations.const_get(name.to_s.downcase.camelize)
end
test?() click to toggle source

A check to see if we're in test mode

# File lib/active_merchant/billing/base.rb, line 56
def self.test?
  mode == :test
end