Skip to content
An easy to use payment gateway for Ruby. Payment is used to process credit cards and electronic cash through merchant accounts like Authorize.Net.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


== Welcome to Payment

Payment is used to process credit cards and electronic cash through merchant accounts.

To choose a gateway, require 'payment/gateway_name'. For example, if you want to use, do a require 'payment/authorize_net'. If you would like to use multiple gateways in the same code, simply do a require 'payment' and it will grab each gateway's code for you.

Payment was inspired by and has borrowed much of its infrastructure from the Business::OnlinePayment Perl module (

If you would like to loosely check the validity of a credit card without using a merchant account, look at the CreditCard module (

== Example

    require 'payment/authorize_net'

    transaction = (
                      :login       => 'username',
                      :password    => 'password',
                      :amount      => '49.95',
                      :card_number => '4012888818888',
                      :expiration  => '03/10',
                      :first_name  => 'John',
                      :last_name   => 'Doe'
      puts "Card processed successfully: #{transaction.authorization}"
      puts "Card was rejected: #{transaction.error_message}"

To set default values, setup a file called .payment.yml in the home directory of the user who will be using this library. An example file would be:

    username: my_account
    transaction_key: my_trans_key

That way there is no need to keep sensitive information in your application's code itself. To specify an alternative configuration file, add a :prefs => '/path/to/file.yml' to the initialization parameters.
== Currently Supported Gateways

* Authorize.Net (authorize_net) -

== Upcoming Gateways

* Moneris -
* Skipjack -

== Planned Support for the Following Gateways

* Trust Commerce -
* Verisign Payflow Pro -
* Cardstream -
* Beanstream -
* Vital -
* Merchant Commerce -
* iAuthorizer -
* Electronic Clearing House, Inc. -
* Bank of America eStores -
* Network1Financial -
* eSec -
* Ingenico OCV -
* St.George IPG -
* Jettis -
* PaymentsGateway.Net -
* PayConnect -
* Secure Hosting UPG -

== About

Author::    Lucas Carlson  (
Copyright:: Copyright (c) 2005 Lucas Carlson
License::   Distributes under the same terms as Ruby
Something went wrong with that request. Please try again.