Parent

Included Modules

Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::Gateway

Description

The Gateway class is the base class for all ActiveMerchant gateway implementations.

The standard list of gateway functions that most concrete gateway subclasses implement is:

Some gateways include features for recurring billing

Some gateways also support features for storing credit cards:

Gateway Options

The options hash consists of the following options:

The :billing_address, and :shipping_address hashes can have the following keys:

Implmenting new gateways

See the ActiveMerchant Guide to Contributing

Attributes

options[R]

Public Class Methods

card_brand(source) click to toggle source
# File lib/active_merchant/billing/gateway.rb, line 108
def self.card_brand(source)
  result = source.respond_to?(:brand) ? source.brand : source.type
  result.to_s.downcase
end
inherited(subclass) click to toggle source
# File lib/active_merchant/billing/gateway.rb, line 71
def self.inherited(subclass)
  super
  @@implementations << subclass
end
new(options = {}) click to toggle source

Initialize a new gateway.

See the documentation for the gateway you will be using to make sure there are no other required options.

# File lib/active_merchant/billing/gateway.rb, line 121
def initialize(options = {})
end
supports?(card_type) click to toggle source

Use this method to check if your gateway of interest supports a credit card of some type

# File lib/active_merchant/billing/gateway.rb, line 104
def self.supports?(card_type)
  supported_cardtypes.include?(card_type.to_sym)
end

Public Instance Methods

card_brand(source) click to toggle source
# File lib/active_merchant/billing/gateway.rb, line 113
def card_brand(source)
  self.class.card_brand(source)
end
test?() click to toggle source

Are we running in test mode?

# File lib/active_merchant/billing/gateway.rb, line 125
def test?
  Base.gateway_mode == :test
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.