How activemerchant/active_merchant works
Active Merchant is a Ruby payment integration library that gives applications a common interface to many payment gateways. The README’s example shows the principal flow: configure a gateway, construct and validate card details, submit a purchase, then inspect the response. The tree also documents gateway-specific extensions for stored customer profiles and recurring billing, alongside shared payment, response, and transport components. Many gateway implementations are unsampled, so their individual internal calls and protocol details are not mapped; optional processor links are shown as unverified.
Main entry points: gateway.rb Gateway API · authorize_net.rb Authorize.Net · authorize_net_cim.rb Customer profiles · authorize_net_arb.rb Recurring billing
Components 17
Billing API
- Billing base
lib/active_merchant/billing/base.rb - Gateway API
lib/active_merchant/billing/gateway.rb
Payment Data
- Credit card
lib/active_merchant/billing/credit_card.rb - Card validation
lib/active_merchant/billing/credit_card_methods.rb - Payment tokens
lib/active_merchant/billing/payment_token.rb - Network tokens
lib/active_merchant/billing/network_tokenization_credit_card.rb - Transaction response
lib/active_merchant/billing/response.rb - Country codes
lib/active_merchant/country.rb
Gateway Adapters
- Authorize.Net
lib/active_merchant/billing/gateways/authorize_net.rb - Customer profiles
lib/active_merchant/billing/gateways/authorize_net_cim.rb - Recurring billing
lib/active_merchant/billing/gateways/authorize_net_arb.rb - Other gateway adapters
lib/active_merchant/billing/gateways
Shared Infrastructure
- HTTP connection
lib/active_merchant/connection.rb - SSL transport
lib/active_merchant/net_http_ssl_connection.rb - Connection retries
lib/active_merchant/network_connection_retries.rb
Other components
- Ruby application
- Payment processor
Connections 9
- Ruby application → Credit card: constructs and validates
README.md - Ruby application → Gateway API: configures gateway
README.md - Ruby application → Gateway API: submits purchase
README.md - Ruby application → Transaction response: checks result
README.md - Gateway API → Authorize.Net: selects adapter
- Gateway API → Other gateway adapters: selects adapter
- Authorize.Net → Payment processor: sends transaction
- Customer profiles → Payment processor: manages profiles
- Recurring billing → Payment processor: manages subscriptions