active_merchant 0,6,1,1 travis-ci ruby Rubygems circleci

Active Merchant is a simple payment abstraction library extracted from Shopify. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gatew

Active Merchant

Build Status Code Climate

Active Merchant is an extraction from the ecommerce 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.

It was developed for usage in Ruby on Rails web applications and integrates seamlessly as a Rails plugin, but it also works excellently as a stand alone Ruby 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 is maintained by the Shopify and Spreedly teams, with much help from an ever-growing set of contributors.

See GettingStarted.md if you want to learn more about using Active Merchant in your applications.

If you’d like to contribute to Active Merchant, please start with our contribution guide.

Installation

From Git

You can check out the latest source from git:

git clone git://github.com/activemerchant/active_merchant.git

From RubyGems

Installation from RubyGems:

gem install activemerchant

Or, if you’re using Bundler, just add the following to your Gemfile:

gem 'activemerchant'

Usage

This simple example demonstrates how a purchase can be made using a person’s credit card details.

require 'active_merchant'

# Use the TrustCommerce test servers
ActiveMerchant::Billing::Base.mode = :test

gateway = ActiveMerchant::Billing::TrustCommerceGateway.new(
            :login => 'TestMerchant',
            :password => 'password')

# ActiveMerchant accepts all amounts as Integer values in cents
amount = 1000  # $10.00

# The card verification value is also known as CVV2, CVC2, or CID
credit_card = ActiveMerchant::Billing::CreditCard.new(
                :first_name         => 'Bob',
                :last_name          => 'Bobsen',
                :number             => '4242424242424242',
                :month              => '8',
                :year               => Time.now.year+1,
                :verification_value => '000')

# Validating the card automatically detects the card type
if credit_card.validate.empty?
  # Capture $10 from the credit card
  response = gateway.purchase(amount, credit_card)

  if response.success?
    puts "Successfully charged $#{sprintf("%.2f", amount / 100)} to the credit card #{credit_card.display_number}"
  else
    raise StandardError, response.message
  end
end

For more in-depth documentation and tutorials, see GettingStarted.md and the API documentation.

Supported Payment Gateways

The ActiveMerchant Wiki contains a table of features supported by each gateway.

API stability policy

Functionality or APIs that are deprecated will be marked as such. Deprecated functionality is removed on major version changes - for example, deprecations from 2.x are removed in 3.x.

Related Repositories

active_merchant

active_merchant

Active Merchant is a simple payment abstraction library extracted from Shopify. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gatew ...

active_merchant

active_merchant

Active Merchant is a simple payment abstraction library used in and sponsored by Shopify. It is written by Tobias Luetke, Cody Fauser, and contributors. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away ...

active_merchant

active_merchant

A fork of a fork of active_merchant to add repeat transations for Protx. ...

active_merchant

active_merchant

Fork of active_merchant with authenticate and repeat transactions added to protx. Also merged in 3d secure support from tekin. ...

active_merchant

active_merchant

Active Merchant is a simple payment abstraction library used in and sponsored by Shopify. It is written by Tobias Luetke, Cody Fauser, and contributors. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away ...


Top Contributors

ntalbott duff melari jduff Soleone bizla bslobodin girasquid justinplouffe wvanbergen davidsantoso andrewpaliga anellis curiousepic orenmazor odorcicd markabe j-mutter shasum rwdaigle mrezentes edward jnormore arthurnn BlakeMesdag aprofeit celsodantas jstorimer mutemule nagash

Releases

-   v1.60.0 zip tar
-   v1.59.0 zip tar
-   v1.58.0 zip tar
-   v1.57.0 zip tar
-   v1.56.0 zip tar
-   v1.55.0 zip tar
-   v1.54.0 zip tar
-   v1.53.0 zip tar
-   v1.52.0 zip tar
-   v1.51.0 zip tar
-   v1.50.0 zip tar
-   v1.49.0 zip tar
-   v1.48.0 zip tar
-   v1.47.0 zip tar
-   v1.46.0 zip tar
-   v1.45.0 zip tar
-   v1.44.1 zip tar
-   v1.44.0 zip tar
-   v1.43.3 zip tar
-   v1.43.1 zip tar
-   v1.43.0 zip tar
-   v1.42.9 zip tar
-   v1.42.8 zip tar
-   v1.42.7 zip tar
-   v1.42.6 zip tar
-   v1.42.5 zip tar
-   v1.42.4 zip tar
-   v1.42.3 zip tar
-   v1.42.2 zip tar
-   v1.42.1 zip tar