Skip to content
CAI
Software that uses CAICheck a score

activemerchant/active_merchant

42.2

Weak · 14 November 2026

72.5k

lines of production code

Ruby

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

ActiveMerchant is a Ruby library that provides a unified interface for processing payments through a wide variety of third-party gateways. It supports standard financial operations such as authorizations, purchases, captures, refunds, and voids, while also handling complex requirements like recurring billing, network tokenization for digital wallets, and 3D Secure authentication. The system manages the underlying communication protocols, including REST, XML, and SOAP, and ensures secure connectivity via configurable SSL/TLS settings and centralized certificate management.

How it got here

2007 — Gateway modernization and legacy cleanup

25 changes.

This period focused on modernizing the ActiveMerchant codebase by replacing legacy Rubigen generators with Thor and introducing structured objects for AVS, CVV, and network tokenization. Significant effort was dedicated to removing obsolete offsite integration modules, deprecated PayPal recurring billing methods, and outdated test infrastructure. The work also included updating SSL certificates, refactoring gateway response parsing, and enhancing developer tooling for gateway inspection and verification.

2008–2017 — Gateway expansion and infrastructure modernization

11 changes.

This period focused on significantly expanding the library's payment gateway coverage by implementing new integrations for Beanstream, MiGS, and QuickPay, while refactoring existing gateways like Braintree and Orbital to support modern features such as tokenization and multi-currency transactions. Concurrently, the project modernized its technical foundation by establishing a formal dependency manifest, upgrading SSL/TLS security standards, and enhancing test coverage through comprehensive schema validation and unit tests for major providers like PayPal and CyberSource.

2018–2024 — payment gateway expansion and dependency management

4 changes.

This period focused on expanding payment gateway support by introducing implementations for Cecabank and FirstPay, featuring dual XML and JSON API capabilities with wallet and encryption support. Concurrently, the project maintained robust testing infrastructure by adding schema fixtures for Orbital transactions and explicitly pinning ActiveSupport versions across a wide range of Rails releases.

Features

Add MiGS Gateway support

Introduces the MiGS payment gateway by adding a new file defining transaction response codes, issuer response codes, and 3D Secure verification statuses, along with a mapping of supported credit card types (Visa, Mastercard, Amex, etc.) for use with the gateway.

_lib/active\merchant/billing/gateways/migs · high confidence

Add QuickPay v10 API gateway

Introduces a new QuickpayV10Gateway class that implements the QuickPay v10 REST API, replacing the legacy XML-based v4–v7 implementation with a JSON-based protocol. This new gateway supports standard payment operations (purchase, authorize, capture, refund, void) as well as card storage (store/unstore) and verification, and includes built-in scrubbing for sensitive data in logs.

_lib/active\merchant/billing/gateways/quickpay · high confidence

Add REST JSON and XML gateway implementations for FirstPay

Introduces two new payment gateway classes for FirstPay: \FirstPayJsonGateway\, which communicates via a REST JSON API supporting standard transactions (purchase, authorize, capture, refund, void) and network tokenization wallets like Apple Pay and Google Pay, and \FirstPayXmlGateway\, which uses an XML-based endpoint for similar transaction types. Both implementations share common configuration such as supported countries (US), currencies (USD), and card types, and include logic to scrub sensitive data from transaction transcripts.

_lib/active\_merchant/billing/gateways/first\pay · high confidence

Add support for additional currencies and soft descriptors in Orbital Gateway

The Orbital Gateway now supports a broader range of currencies by introducing a comprehensive mapping of ISO currency codes to their corresponding Orbital numeric codes and decimal exponents, allowing transactions in many more global currencies. Additionally, support for Tampa PNS Soft Descriptors has been added, enabling merchants processing through Chase Paymentech Canada to customize the merchant name, phone, city, URL, and email displayed on cardholder statements, with built-in validation for field lengths and phone formats.

_lib/active\merchant/billing/gateways/orbital · high confidence

Initial Beanstream gateway implementation

Introduces the Beanstream payment gateway, enabling merchants to process credit card transactions (authorization, purchase, capture, refund, void) and recurring billing. The implementation supports Visa, Mastercard, American Express, Discover, Diners Club, and JCB, with default currency set to CAD and support for merchants in Canada and the US. It includes features for mapping ISO province codes for US and CA addresses, sending customer IP for fraud management, and handling secure profiles.

_lib/active\merchant/billing/gateways/beanstream · high confidence

Introduce Cecabank payment gateway with XML and JSON REST API support

Adds a new Cecabank gateway implementation supporting both legacy XML and modern JSON REST APIs. The JSON REST gateway (\CecabankJsonGateway\) enables purchases, authorizations, captures, voids, and refunds, with specific support for Apple Pay and Google Pay wallet transactions, 3D Secure authentication, and sensitive data encryption. The legacy XML gateway (\CecabankXmlGateway\) continues to support basic purchase and refund operations. Both implementations include scrubbing capabilities to mask sensitive card data in logs.

_lib/active\merchant/billing/gateways/cecabank · high confidence

New Thor-based gateway generator with verify and scrubbing support

The gateway scaffolding tool has been rewritten to use Thor instead of Rubigen, providing a more robust way to generate new payment gateway implementations. The generated gateway class now includes a \verify\ method (which authorizes and immediately voids a transaction) and a \scrub\ method for sanitizing sensitive data in test transcripts. Additionally, the generated unit and remote tests include assertions for the new \error\_code\ field on responses and verify that sensitive information like credit card numbers and passwords are properly scrubbed.

generators · high confidence

New support utilities for gateway inspection, SSL verification, and TLS version testing

Added four new classes in lib/support to help inspect and validate payment gateways: GatewaySupport lists all available gateways and their supported actions (purchase, authorize, etc.) and provides formatted output (text, markdown, etc.); OutboundHosts scans the codebase to list outbound hosts with ports used by gateways; SSLVerify tests live SSL certificates for all gateways, reporting successes, failures, errors, and those with ssl\_strict disabled; SSLVersion tests gateways against a minimum TLS version (default TLS 1.1), reporting which gateways succeed, fail, or error on protocol negotiation. These tools are for internal development and validation, not part of the core payment processing logic.

lib/support · high confidence

Removals

Chronopay integration files removed

The Chronopay integration helper and notification classes have been deleted from the codebase. This removes the ability to generate Chronopay payment forms and process their post-payment notifications, effectively removing Chronopay as a supported payment method.

_lib/active\_merchant/billing/integrations/chronopay, lib/active\_merchant/billing/integrations/gestpay, lib/active\merchant/billing/integrations/nochex · high confidence

Removal of core library modules

The Country, PostsData, RequiresParameters, and Validateable modules have been removed from the library. This eliminates the built-in country code validation, the legacy SSL POST helper, the parameter requirement checker, and the validation framework with its error handling classes.

_lib/active\merchant/lib · high confidence

Removal of integration scaffolding generator

The \IntegrationGenerator\ and its associated ERB templates (helper, integration, notification, and their tests) have been removed from the project. This eliminates the ability to use the command-line generator to scaffold new payment integration modules, meaning developers must now create integration classes, helpers, and notification handlers manually rather than relying on this automated template-based setup.

script/generator/generators/integration · high confidence

Removal of legacy PayPal integration files

The \helper.rb\ and \notification.rb\ files for the PayPal integration have been removed from the codebase. This eliminates the legacy Website Payments Standard helper class and the corresponding Instant Payment Notification (IPN) parser, indicating that these specific integration components are no longer supported or maintained in this version.

_lib/active\merchant/billing/integrations/paypal · high confidence

Removal of legacy offsite payment integration modules

The \lib/active\_merchant/billing/integrations\ directory has been removed, eliminating the legacy offsite payment integration helpers and modules (including ActionViewHelper, base Helper, Notification, and specific integrations like PayPal, Nochex, Chronopay, and Gestpay). Users relying on these deprecated offsite payment flows will no longer have access to these classes within the ActiveMerchant library.

_lib/active\merchant/billing/integrations · high confidence

Removal of legacy script/generator infrastructure

The legacy code generation tools located in the \script/generator\ directory have been removed. This includes the deletion of \base.rb\, \generator.rb\, and \manifest.rb\, which previously provided the \script/generate\ command for creating payment gateways and integration files. Users can no longer use this specific script-based generator to scaffold new components.

script/generator · high confidence

Removed CI build notification task

The \lib/tasks/cia.rb\ file has been deleted, removing the Rake task that previously monitored SVN repository changes and sent email notifications when build failures occurred. Users will no longer receive automated build failure alerts via this mechanism.

lib/tasks · high confidence

Removed Trust Commerce example script

The example script demonstrating how to use the Trust Commerce gateway with the Active Merchant library has been removed from the references directory.

references · high confidence

Removed gateway generator scaffolding

The \script/generator/generators/gateway\ directory and its associated generator class and templates have been removed. This eliminates the ability to automatically scaffold new gateway implementations and their corresponding unit and remote test files via the generator command.

script/generator/generators/gateway · high confidence

Behavioural changes

4190 commits (529 fixes) modifying lib/active\_merchant/billing/gateways

A change to existing behaviour in lib/active\_merchant/billing/gateways — 4190 commits (529 fixs), 243 files.

_(repo-wide), lib/active\merchant/billing/gateways · low confidence · unverified

ActiveMerchant 1.138.0 release with connection and security improvements

This release updates ActiveMerchant to version 1.138.0. It introduces a new Connection class that supports configurable SSL/TLS versions (defaulting to TLS 1.1 for PCI DSS compliance), proxy settings with user/password, and retry logic for network errors. The release also adds support for OAuth responses, handles network tokenization options for CyberSource, maps ECI values for 3DS, and includes various bug fixes and RuboCop style updates.

_lib/active\merchant · high confidence

Braintree gateway refactoring and new tokenization capabilities

The Braintree gateway implementation has been restructured to improve maintainability and expand supported payment methods. A new \BraintreeCommon\ module centralizes static configuration, including the addition of Diners Club and Maestro to the supported card types list, an updated list of supported countries, and a unified scrubbing mechanism for sensitive data like credit card numbers and cryptograms. Additionally, a new \TokenNonce\ class enables server-side tokenization for both credit cards and ACH bank accounts (US), allowing users to generate payment method nonces programmatically via GraphQL, with support for optional billing addresses and specific ACH mandates.

_lib/active\merchant/billing/gateways/braintree · high confidence

Introduce structured AVS and CVV result objects and network tokenization support

The library now returns dedicated \AVSResult\ and \CVVResult\ objects in the \Response\ instead of raw hashes, providing standardized \street\_match\ and \postal\_match\ codes for Address Verification and clear messages for Card Verification Value checks. A new \NetworkTokenizationCreditCard\ class and \ApplePayPaymentToken\ model enable handling of EMV network tokens (e.g., Apple Pay), while the \CreditCard\ class now relies on lambda-based brand detection for improved accuracy. Additionally, the \Base\ module consolidates mode configuration into a single \mode\ accessor, deprecating the separate \gateway\_mode\ and \integration\_mode\ settings.

_lib/active\merchant/billing · high confidence

PayPal gateway deprecates recurring billing and adds API signature support

The PayPal gateway now requires an API Signature (or PEM certificate) for authentication, introducing an \:auth\_signature\ option and removing the bundled \api\_cert\_chain.crt\ file. Recurring payment methods (create, update, cancel, etc.) are deprecated and emit warnings when used. The gateway also adds support for MassPay transfers, full and partial refunds, reauthorizations, and exposes additional response details such as payer phone number, shipping options, and checkout status.

_lib/active\merchant/billing/gateways/paypal · high confidence

Payflow gateway response parsing and API structure updates

The Payflow gateway now provides richer response data and uses a more robust parsing backend. A new PayflowResponse class exposes profile\_id and payment\_history for recurring billing scenarios. The underlying XML parser has been swapped from REXML to Nokogiri for better compatibility. PayflowExpress responses now correctly map shipping details (SHIPTONAME, SHIPTOSTREET2) and include phone numbers in the address object. Additionally, the gateway supports separate vendor and user credentials via the :user option, allowing more flexible authentication configurations.

_lib/active\merchant/billing/gateways/payflow · high confidence

Refactored library loading and consolidated deprecation handling

The library entry point now explicitly requires specific ActiveSupport core extensions and standard library modules (such as securerandom and socket) instead of relying on implicit load paths or gem auto-loading, ensuring compatibility with newer Rails versions. Additionally, a centralized deprecation method has been added to the ActiveMerchant module to log warnings consistently, and the legacy Bogus integration helper and notification files have been removed.

lib · high confidence

Rewrite generate script to use Thor

The script/generate command has been rewritten to use the Thor library instead of the previous Rubigen-based generator. This change updates the underlying tooling for generating new gateways, registering the 'gateway' command via Thor's class-based interface, and dynamically loading generator files from the generators directory.

script · high confidence

Update bundled CA root certificates

The bundled CA root certificate file (cacert.pem) has been updated to the current Mozilla root store (as of October 2026). This ensures that SSL/TLS connections made by the library continue to trust valid certificates from major Certificate Authorities and reject expired or untrusted ones, maintaining secure connectivity for all gateways that rely on this bundle.

lib/certs · high confidence

Test coverage

3047 commits adding/updating tests in test/unit/gateways; Added CyberSource XSD schema validation tests; Added Orbital request schema test fixtures for PTI77, PTI83, and PTI95; Added PayPal XSD schema files for test validation; Added XSD schemas for FirstData E4 gateway versions 11 and 27; Added unit tests for PayPal Common API gateway; Expanded unit test coverage for core payment and connection components; Modernize test infrastructure and remove legacy debugging tools; Removal of legacy integration unit tests; Removed remote integration tests for multiple payment gateways; Removed unit tests for Chronopay, Gestpay, Nochex, PayPal, and base notification integrations; Removed unit tests for payment integration helpers.

Dependencies

Add explicit ActiveSupport version constraints for Rails 4.2 through 7.2

The gemfiles directory now includes dedicated configuration files for testing against specific Rails versions (4.2, 5.0, 5.1, 5.2, 6.0, and master/7.2.1). Each file explicitly pins the \activesupport\ gem to the corresponding version range (e.g., \\~\> 4.2.0\, \\~\> 7.2.1\) while evaluating the base Gemfile, ensuring that the library is tested against the exact ActiveSupport versions associated with each Rails release.

gemfiles · high confidence

Initial dependency manifest and gemspec setup

The project now includes a Gemfile and activemerchant.gemspec to manage dependencies. The gemspec defines runtime requirements for activesupport (\>= 4.2), builder, i18n, nokogiri (\~\> 1.4), and rexml (\~\> 3.3, \>= 3.3.8), while specifying a minimum Ruby version of 3.1. Development dependencies include mocha, pry, pry-byebug, rake, test-unit, and thor. The Gemfile adds rubocop (\~\> 1.26.0) for linting and groups test-specific gems like braintree (\>= 4.26.0), concurrent-ruby, jose, jwe, mechanize, and timecop.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 45 → 42 (-3.3)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 63 → 59 (-4.3)
  • Architecture 69 → 78 (+9.0)
  • Maturity 54 → 54 (+0.0)
  • Readiness 64 → 70 (+5.7)
  • Security 30 → 23 (-7.5)

Resolved (7)

  • Duplicated block (5 lines × 3) (lib/active_merchant/billing/gateways/jetpay.rb)
  • Duplicated block (6 lines × 2) (lib/active_merchant/billing/gateways/jetpay.rb)
  • Duplicated block (8 lines × 2) (lib/active_merchant/billing/gateways/cyber_source.rb)
  • Duplicated block (9 lines × 2) (lib/active_merchant/billing/gateways/commerce_hub.rb)
  • Leaked secret: hardcoded-credential (lib/active_merchant/billing/gateways/pay_junction.rb)
  • Off-boarding risk: anonymized user #1
  • Projects may be oversized for their cohesion

New (177)

  • Duplicated block (5 lines × 3) (lib/active_merchant/billing/gateways/jetpay.rb)
  • Edited copies of one member (3 members, 10+ corresponding lines) (lib/active_merchant/billing/gateways/elavon.rb)
  • Edited copies of one member (3 members, 10+ corresponding lines) (lib/active_merchant/billing/gateways/realex.rb)
  • Edited copies of one member (3 members, 11+ corresponding lines) (lib/active_merchant/billing/gateways/authorize_net_arb.rb)
  • Edited copies of one member (3 members, 11+ corresponding lines) (lib/active_merchant/billing/gateways/safe_charge.rb)
  • Edited copies of one member (3 members, 12+ corresponding lines) (lib/active_merchant/billing/gateways/cyber_source.rb)
  • Edited copies of one member (3 members, 12+ corresponding lines) (lib/active_merchant/billing/gateways/redsys_rest.rb)
  • Edited copies of one member (3 members, 12+ corresponding lines) (lib/active_merchant/billing/gateways/vantiv_express.rb)
  • Edited copies of one member (3 members, 13+ corresponding lines) (lib/active_merchant/billing/gateways/bambora_apac.rb)
  • Edited copies of one member (3 members, 13+ corresponding lines) (lib/active_merchant/billing/gateways/ipg.rb)
  • Edited copies of one member (3 members, 14+ corresponding lines) (lib/active_merchant/billing/gateways/element.rb)
  • Edited copies of one member (3 members, 14+ corresponding lines) (lib/active_merchant/billing/gateways/vpos.rb)
  • Edited copies of one member (3 members, 15+ corresponding lines) (lib/active_merchant/billing/gateways/commerce_hub.rb)
  • Edited copies of one member (3 members, 16+ corresponding lines) (lib/active_merchant/billing/gateways/culqi.rb)
  • Edited copies of one member (3 members, 16+ corresponding lines) (lib/active_merchant/billing/gateways/latitude19.rb)
  • Edited copies of one member (3 members, 19+ corresponding lines) (lib/active_merchant/billing/gateways/data_cash.rb)
  • Edited copies of one member (3 members, 19+ corresponding lines) (lib/active_merchant/billing/gateways/metrics_global.rb)
  • Edited copies of one member (3 members, 4+ corresponding lines) (lib/active_merchant/billing/gateways/bank_frick.rb)
  • Edited copies of one member (3 members, 4+ corresponding lines) (lib/active_merchant/billing/gateways/bpoint.rb)
  • Edited copies of one member (3 members, 4+ corresponding lines) (lib/active_merchant/billing/gateways/cardprocess.rb)
  • …and 157 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

activemerchant/active_merchant was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a0214be588f12b03ca2cf5b6cf989730f5baa227 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-36d4cd83012f.