stripe/stripe-ruby
64.2
Adequate · 19 September 2026
138k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
This system is the official Stripe Ruby SDK, serving as a client library that enables applications to interact with the Stripe API. It provides generated resource models, service classes, and type signatures for a wide range of financial operations, including payments, billing, identity verification, and treasury management. The library supports both the legacy API and the newer v2 event notification system, while also offering tools for deterministic testing and static type checking via Sorbet.
How it got here
2011–2013 — SDK architecture rewrite and modernization
9 changes.
The project underwent a major library rewrite, replacing the monolithic structure with a modular StripeClient architecture and standardizing API operations. This period also focused on modernizing the development environment through strict code style enforcement, updated dependencies, and migrating test infrastructure to stripe-mock.
2018–2022 — API resource expansion and regeneration
11 changes.
This period focused on expanding the SDK's coverage by adding new resource classes for emerging Stripe products such as Treasury, Financial Connections, Identity, and Apps. Concurrently, core resources were regenerated from updated OpenAPI specifications to align with the latest API versions, ensuring accurate data structures and precise handling of monetary values.
2023–2024 — API expansion and type safety
9 changes.
The project expanded its library coverage by adding resource models and service classes for new Stripe APIs, including Tax, Climate, and v2 Billing. Concurrently, it introduced Sorbet static type-checking and generated strongly typed V2 event classes to improve code reliability. The period also involved standardizing the service layer and reorganizing project structure for executables and examples.
2025 — Stripe API v2 support
4 changes.
The project added comprehensive support for the Stripe API v2, introducing new resource classes for core entities, deleted objects, and event notifications. Type signatures and parameter definitions were regenerated to align with the latest API schema, ensuring static type checking and request handling reflect the updated interface.
Features
Add Secret Store resource for Stripe Apps
Stripe Apps developers can now securely persist secrets for use by UI Extensions and app backends using the new Secret Store resource. This change introduces the \Stripe::Apps::Secret\ class, which supports creating, listing, finding, and deleting secrets. Secrets are scoped to either the account (shared by all Dashboard users and the app backend) or a specific user, allowing for flexible permission control over sensitive data like third-party API keys or per-user OAuth tokens.
lib/stripe/resources/apps · high confidence
Add Stripe Climate API resources for Orders, Products, and Suppliers
New resource classes have been added to the Stripe Climate module: \Order\, \Product\, and \Supplier\. The \Order\ resource supports creating, listing, updating, and canceling carbon removal orders, including nested \Beneficiary\ and \DeliveryDetail\ objects. The \Product\ resource allows listing available carbon removal products with their current prices and availability. The \Supplier\ resource provides listing of carbon removal suppliers and their operational locations. These resources enable users to interact with Stripe's Climate API for purchasing and managing carbon removal credits.
lib/stripe/resources/climate · high confidence
Add Stripe Tax resource models
New resource classes have been added to the \lib/stripe/resources/tax\ directory to support Stripe Tax features. This includes \Association\ for linking tax transactions to payment intents, \Calculation\ and \CalculationLineItem\ for computing tax liabilities, \Registration\ for managing tax registration status, \Settings\ for configuring default tax behaviors, \Transaction\ and \TransactionLineItem\ for recording collected or refunded tax, and \TransactionLineItem\ for individual line details. These classes provide the data structures and API operations needed to interact with the Stripe Tax API.
lib/stripe/resources/tax · high confidence
Add support for Billing Portal Configuration and Session resources
Developers can now configure and launch the Stripe Customer Portal using the new \Stripe::BillingPortal::Configuration\ and \Stripe::BillingPortal::Session\ resources. The Configuration resource allows you to define portal behavior, including business profile details and specific features like customer updates, invoice history access, payment method updates, and granular subscription management (including cancellation reasons, proration behavior, and adjustable quantities). The Session resource enables the creation of short-lived, secure portal sessions for individual customers, supporting various flows such as customer profile updates, subscription cancellations with retention strategies, and subscription updates with discount application.
_lib/stripe/resources/billing\portal · high confidence
Add support for v2 deleted objects
The library now includes support for Stripe API v2 deleted objects. A new \Stripe::V2::DeletedObject\ resource class has been added to represent objects that have been removed, exposing the \id\ of the deleted object and its \object\ type string. Additionally, a new \Stripe::V2::Amount\ class has been introduced to handle monetary values with \value\ and \currency\ attributes.
lib/stripe/resources/v2 · high confidence
Added Identity VerificationSession and VerificationReport resource classes
The library now includes generated Ruby resource classes for Stripe Identity, specifically \VerificationSession\ and \VerificationReport\. These classes provide structured access to identity verification data, including nested objects for document details (address, DOB, expiration), email and phone verification statuses, and session options for configuring verification checks like selfie matching or ID number requirements. This enables users to interact with the Identity API to create verification sessions and inspect the resulting verification reports.
lib/stripe/resources/identity · high confidence
Added Stripe Checkout Session resource
The library now includes the \Stripe::Checkout::Session\ resource, enabling users to create and manage Checkout Sessions for one-time purchases and subscriptions. This new class supports key configuration options such as adaptive pricing, post-expiration recovery, automatic tax calculation, and branding settings (including custom icons, logos, and colors), allowing developers to integrate Stripe's hosted checkout experience directly into their applications.
lib/stripe/resources/checkout · high confidence
Added TestClock resource for deterministic test mode time control
The library now includes a new \TestClock\ resource within the \Stripe::TestHelpers\ namespace, enabling deterministic control over objects in test mode. This resource allows you to create clocks that freeze time, advance to specific future times to observe state changes and webhooks, and manage these clocks via standard CRUD operations (create, list, delete) and a specific \advance\ method. This feature supports testing complex scenarios by providing a frozen or advancing timeline for Stripe objects.
_lib/stripe/resources/test\helpers · high confidence
Added support for usage-based billing meter event resources
The library now includes new resource classes for the v2 billing API: \MeterEvent\ for recording billable usage activity, \MeterEventAdjustment\ for canceling or modifying previously recorded events, and \MeterEventSession\ for obtaining temporary authentication tokens to enable secure, high-throughput submission of usage events.
lib/stripe/resources/v2/billing · high confidence
Initial Sorbet type-checking configuration and gem RBI stubs
The project now includes Sorbet static type-checking support. A new \sorbet/config\ file defines the check scope (the project root) and excludes \tmp/\, \vendor/\, and \rbi/stripe.rbi\. Additionally, a comprehensive set of \.rbi\ stub files has been generated for various gems (including \addressable\, \ast\, \byebug\, \coderay\, \json\, and \language\_server-protocol\) to provide type definitions for external dependencies, enabling Sorbet to type-check code that uses these libraries.
sorbet · high confidence
New Financial Connections resource models for account data and linking sessions
This change introduces the core Ruby resource classes for the Financial Connections API, enabling developers to interact with linked bank accounts and initiate the linking flow. The new \Account\ resource exposes detailed account metadata, including nested structures for account holders, account numbers, and real-time balance data (cash and credit). The \Session\ resource provides the \create\ method to programmatically launch the client-side Stripe.js modal for users to link their accounts, supporting filters for account types and countries. Additionally, \Transaction\ resources allow listing transaction history for linked accounts, while \Authorization\, \AccountOwner\, and \AccountOwnership\ resources model the connection credentials and ownership snapshots.
_lib/stripe/resources/financial\connections · high confidence
New Stripe API v2 Core resource models and event notification handling
This release adds generated resource classes for the Stripe API v2 Core namespace, including Account, AccountLink, AccountPerson, AccountPersonToken, AccountToken, Event, EventDestination, and EventNotification. These classes provide the data structures and object mappings for interacting with the new v2 API endpoints. Additionally, the EventNotification class now supports singleton related objects and includes logic to fetch the generating Event, ensuring proper handling of v2 thin events.
lib/stripe/resources/v2/core · high confidence
New Stripe Treasury resource classes for money movement and account management
The SDK now includes generated resource classes for the Stripe Treasury API, enabling users to manage FinancialAccounts (including creation, listing, and closing) and handle money movement via InboundTransfers, OutboundPayments, and OutboundTransfers. It also adds support for tracking ReceivedCredits and ReceivedDebits, as well as reversing them through CreditReversal and DebitReversal resources, with detailed status transitions and linked flow information exposed for each object.
lib/stripe/resources/treasury · high confidence
New billing resources for meters, alerts, and credit grants
The library now includes generated resource classes for the Stripe Billing API, enabling usage-based billing and credit management. You can now create and manage billing meters and meter events to track usage, set up billing alerts to monitor thresholds, and handle credit grants and credit balance transactions. Specific resources added include Alert, AlertTriggered, CreditBalanceSummary, CreditBalanceTransaction, CreditGrant, FeedbackOption, Meter, MeterEvent, MeterEventAdjustment, and MeterEventSummary, each exposing standard CRUD operations and specific actions like activating alerts or expiring credit grants.
lib/stripe/resources/billing · high confidence
New examples for event notifications and meter event streaming
Added new Ruby examples demonstrating how to handle event notifications via webhooks, including deduplication using the \pre\_handle\ hook and handling unverified payloads from cloud providers, as well as a guide for using the high-throughput meter event stream API.
examples · high confidence
Behavioural changes
Added strongly typed V2 event classes and notifications
The library now includes generated Ruby classes for Stripe API v2 events (such as account, billing meter, and commerce events) and their corresponding notifications. These classes inherit from the new V2::Core base types and provide strongly typed access to event data, including a \related\_object\ attribute and a \fetch\_related\_object\ method to retrieve the full resource from the API. Additionally, an \UnknownEventNotification\ class is provided to handle event types that do not have a specific generated class.
lib/stripe/events · high confidence
Executable moved to the \`exe\` directory
The \stripe-console\ executable has been relocated from the project root to the \exe\ folder. This change reorganizes the project structure to separate executable scripts from library code, but the functionality of the IRB-based console remains unchanged.
exe · high confidence
Issuing resources regenerated with OpenAPI v154 and decimal\_string coercion
The Issuing resource classes (Authorization, Card, Cardholder, Dispute, PersonalizationDesign, PhysicalBundle, Token, and Transaction) have been regenerated from the OpenAPI specification. This update aligns the SDK with the latest API changes and introduces \decimal\_string\ coercion for specific fields (such as fuel and tax amounts in authorizations and transactions) to ensure precise handling of monetary values.
lib/stripe/resources/issuing · high confidence
Major library rewrite: new StripeClient architecture and modular structure
The library has been completely rewritten, replacing the previous monolithic \lib/stripe.rb\ with a modular structure of separate files for API operations, resources, services, and configuration. The core HTTP client has been replaced with a new \StripeClient\ and \StripeService\ architecture, moving away from the old global \Stripe.configuration\ and \Stripe.request\ methods. This change introduces new modules for request options, connection management, and telemetry, significantly altering how the library is initialized and how API calls are made under the hood.
lib · high confidence
Refactor API operations into dedicated modules with static methods and deprecations
The \lib/stripe/api\_operations\ directory has been restructured into distinct modules (\Create\, \Delete\, \List\, \NestedResource\, \Request\, \Save\, \Search\, \SingletonSave\) to standardize how API resources interact with the Stripe API. This change introduces static class methods for operations like \delete\ and \update\, allowing resources to be manipulated without instantiating an object first. It also deprecates the instance \save\ method in favor of the new class-based \update\ method and marks the \\_search\ method as deprecated, guiding users toward the new \request\_stripe\_object\ interface. Additionally, the \NestedResource\ module now provides a cleaner way to define subresource operations (like reversals on transfers) via \nested\_resource\_class\_methods\.
_lib/stripe/api\operations · high confidence
Regenerated API resource models for Stripe API version 2025-09-30.clover
The resource definitions in \lib/stripe/resources\ have been regenerated from the OpenAPI specification to align with Stripe API version 2025-09-30.clover. This update refreshes the Ruby models for core resources such as Account, AccountLink, AccountSession, Balance, and BalanceSettings, ensuring they reflect the latest API structure, fields, and nested object types. Users relying on these resources will see their internal data structures and available attributes updated to match the current Stripe API schema.
lib/stripe/resources · high confidence
Regenerated Stripe API parameter classes
The parameter classes in \lib/stripe/params\ have been regenerated from the Stripe OpenAPI specification to align with the latest API version. This update refreshes the request parameter definitions for resources such as Accounts, Account Capabilities, External Accounts, and Persons, ensuring that the SDK's type signatures and available options match the current Stripe API surface.
lib/stripe/params · high confidence
Regenerated Stripe API service layer
The \lib/stripe/services\ directory has been regenerated from the OpenAPI specification, introducing new service classes for Account capabilities, external accounts, persons, login links, and sessions, as well as expanded Billing and Climate modules. This update aligns the Ruby client with the latest Stripe API versions (including 2024-09-30.acacia and 2025-03-31.basil) and standardizes parameter handling by unifying resource and service method parameters into a single class.
lib/stripe/services · high confidence
Replace custom stripe-console with Tapioca binstub
The custom \bin/stripe-console\ script, which previously launched an IRB session with the Stripe library pre-loaded, has been removed. It has been replaced by a new \bin/tapioca\ binstub that delegates to the Tapioca gem, aligning the project's interactive console tooling with the Sorbet/Tapioca ecosystem.
bin · high confidence
Stripe SDK v19.6.2: New API version 2026-08-26.dahlia and V2 EventNotification support
This release updates the default Stripe API version to 2026-08-26.dahlia and introduces support for the new V2 EventNotification system. Users can now parse and handle V2 webhook payloads, including discriminated unions and singleton related objects, using the updated \EventTypes\ mapping and \V2::Core\ event classes. The SDK also adds runtime support for V2 int64 string-encoded fields and ensures that V2 resources are handled via the \StripeClient\ rather than the legacy \APIResource\ methods.
lib/stripe · high confidence
Updated CA certificate bundle
The bundled CA certificates in lib/data have been refreshed, replacing the legacy set generated from Ubuntu 10.04 (May 2011) with a more current collection. This update ensures that applications relying on this library can verify connections to servers using modern or updated root certificates, improving compatibility and security for TLS handshakes.
lib/data · high confidence
Updated RBI type signatures for Stripe API v2025-09-30.clover
The RBI type signatures in the \rbi/\ directory have been regenerated to align with the Stripe API version 2025-09-30.clover. This update refreshes the Sorbet type definitions for API resources, parameter classes, and error objects, ensuring that static type checking reflects the latest API schema changes.
rbi · high confidence
Updated Terminal resource models with new fields and nested types
The Terminal resource classes (Configuration, ConnectionToken, Location, OnboardingLink, Reader) have been regenerated from the OpenAPI specification, introducing new fields and nested structures. Configuration now includes settings for specific reader hardware (BbposWisepad3, BbposWiseposE, StripeS700, StripeS710), cellular connectivity, offline transaction handling, reboot windows, and currency-specific tipping options (AED, AUD, CAD, CHF, CZK). Location resources now support Japanese address variations (address\_kana, address\_kanji) and display name variations. OnboardingLink resources now include options for Apple Terms and Conditions relinking. Reader resources have expanded Action and error handling structures, including detailed API error fields and new input collection types (CustomText, Email, Numeric, Phone, Selection, Signature).
lib/stripe/resources/terminal · high confidence
Test coverage
Add tests for Identity VerificationSession and migrate test infrastructure to stripe-mock; Added tests for Issuing Authorization, Dispute, and Transaction resources; Expanded test coverage for Stripe Ruby SDK resources and operations.
Dependencies
Update gemspec and add Gemfile for modern Ruby support
The gemspec now requires Ruby 2.7.0 or higher, adds explicit dependencies on \bigdecimal\ and \logger\, and includes metadata for better discoverability. A new Gemfile is introduced to manage development dependencies, pinning RuboCop to version 1.75.2 and Sorbet/Tapioca for type checking, while excluding Windows platforms for Sorbet.
(dependencies) · high confidence
Housekeeping
Introduce EditorConfig, RuboCop, and Code of Conduct configuration files
The repository now includes standard development configuration files to enforce code style and community guidelines. A new \.editorconfig\ file standardizes indentation (2 spaces), line endings (LF), and character encoding (UTF-8) across editors. A comprehensive \.rubocop.yml\ configuration is added, targeting Ruby 2.7, enabling strict style checks (e.g., frozen string literals, double quotes), and excluding generated code and specific complex methods from certain metrics. A corresponding \.rubocop\_todo.yml\ file is generated to track existing offenses. Additionally, \CODE\_OF\_CONDUCT.md\ and \CONTRIBUTING.md\ are added to define community standards and contribution workflows.
(repo-wide) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 64.
Lenses
- Code Health 98
- Architecture 100
- Maturity 56
- Readiness 58
- Security 72
Changes since last survey
- 300 commits — 283 feature/other, 17 fixes
By area
- (root) — 126 commits
- lib/stripe — 118 commits
- .github/workflows — 13 commits
- test/stripe — 13 commits
- rbi/stripe — 11 commits
- .hark/changes — 3 commits
- .vscode/extensions.json — 3 commits
- .github/pull_request_template.md — 2 commits
- examples/event_notification_handler_endpoint.rb — 2 commits
- examples/event_notification_webhook_handler.rb — 2 commits
- lib/stripe.rb — 2 commits
- .claude/CLAUDE.md — 1 commit
- .github/CODEOWNERS — 1 commit
- .vscode/settings.json — 1 commit
- examples/README.md — 1 commit
- sorbet/rbi — 1 commit
Notable commits
- fix: Fix 2D array parameter encoding (#1846)
- fix: Fix APIResource#retrieve bug not returning instance of custom resources (#1476)
- fix: Fix APIResource#retrieve not sending stripe_version (#1483)
- fix: Fix InvoiceLineItem parent class (#1536)
- fix: Fix OAuth authorize response type default (#1956)
- fix: Fix StripeContext hash key behavior (#1959)
- fix: Fix raw_request example in readme (#1620)
- fix: Fix endpoints being hit since requests are stubbed (#1591)
- fix: Fix event refresh (#1617)
- fix: Fix incorrect key in param encoding (#1488)
- fix: Fix mismatched indentations (#1584)
- fix: Fix webhook tolerance reference (#1962)
- fix: Fixed broken test caused by removing overrides for invoice/upcoming (#1544)
- fix: Fixed changelog for major release 12.0.0 (#1436)
- fix: Revert Makefile change to allow autoformatting in codegen (#1382)
- fix: fix one more test (#1945)
- fix: fix: show unfixable rubocop offenses on format failure (#1897)
- change: Add Changelog section to PR template (#1872)
- change: Add ErrorObject rbi file (#1906)
- change: Add PR disclaimer to README (#1892)
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
stripe/stripe-ruby 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 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit fe3354cce155c3963ace707ff572e415bfa711c9 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.