Active Merchant is an extraction from the e-commerce system Shopify. Shopify's requirements for a simple and unified API to access dozens of different payment gateways with very different internal APIs was the chief principle in designing the library.

Active Merchant has been in production use since June 2006 and is now used in most modern Ruby applications which deal with financial transactions.

It was developed to for usage in Ruby on Rails web applications and integrates seamlessly as a plugin but it also works excellently as a stand alone library.

What does it look like?

creditcard = ActiveMerchant::Billing::CreditCard.new(
  :type       => 'visa',
  :number     => '4242424242424242',
  :month      => 8,
  :year       => 2009,
  :first_name => 'Bob',
  :last_name  => 'Bobsen'
)

if creditcard.valid?

  # Create a gateway object to the Authorize.net service
  gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new

  # Authorize for 10 dollars (1000 cents) 
  response = gateway.authorize(1000, creditcard)

  if response.success?

    # Capture the money right away
    gateway.capture(1000, response.authorization)
  else
    raise StandardError, response.message 
  end
end

How do I get it?

Rubygems

Rubygems.

gem install activemerchant

If you want to install this gem on a High Security setup you need to
gem cert --add gem-public_cert.pem

Ruby on Rails

Ruby on Rails plugin

./script/plugin install \   http://activemerchant.googlecode.com/svn/trunk/active_merchant

Ruby

Download Release

via Rubyforge

Ruby

Subversion checkout

via Google code

ActiveMerchant is a sponsored and made possible by constant development from jadedPixel technologies inc.