Active Merchant
This library is supposed to aid in creating e-commerce software in Ruby. In the future we want to support all “good” payment gateways.
This library is the foundation of commerce for www.shopify.com.
Please visit the ActiveMerchant homepage for more resources, tutorials and other information about this project.
Supported Direct Payment Gateways
-
Bogus – your trusty test gateway which does nothing. Great for testing your app!
Australia
Canada
United Kingdom
USA
-
TrustCommerce - Requires the tclink ruby library from www.trustcommerce.com/tclink.html. Otherwise it will not be loaded.
Supported Offsite Payment Gateways
Download
Currently this library is available with svn from:
activemerchant.googlecode.com/svn/trunk/active_merchant
Installation
From Subversion
You can check out the latest source from svn:
> svn co http://activemerchant.googlecode.com/svn/trunk/active_merchant
As a Rails plugin
ActiveMerchant includes an init.rb file. This means that Rails will automatically load ActiveMerchant on startup. Run the following command from the root directory of your Rails project to install ActiveMerchant as a Rails plugin:
> ./script/plugin install http://activemerchant.googlecode.com/svn/trunk/active_merchant
From Ruby Gems
Installation from RubyGems
> gem install activemerchant -y
Sample Usage
ten_dollars = Money.new(1000, 'USD')
credit_card = CreditCard.new(
:number => '4242424242424242',
:month => 8,
:year => 2006,
:name => 'Tobias Luetke',
:type => 'visa'
)
if creditcard.valid?
gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new(
:login => 'LOGIN_ID',
:password => 'TRANSACTION_KEY'
)
response = gateway.purchase(ten_dollars, credit_card)
if response.success?
...
else
raise StandardError.new( response.message )
end
end