Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.2.0"
".": "0.3.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 176
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml
openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f
config_hash: 2b2786c821f62db49cc630ba45329336
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4ecc06edca2cfad4eaf11573611e89823fda5f56370bac5cd02a498a6b277d09.yml
openapi_spec_hash: 8f4a30bec4348cbde85b1e65bef9189a
config_hash: 9dddee5f7af579864599849cb28a0770
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Changelog

## 0.3.0 (2026-01-08)

Full Changelog: [v0.2.0...v0.3.0](https://github.com/lithic-com/lithic-ruby/compare/v0.2.0...v0.3.0)

### Features

* **api:** Add card state attribute to tokenization rules ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
* **api:** Add event_type to ASA request and 3DS decisioning request ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
* **api:** add external_id to payment_event ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f))
* **api:** add get /v1/transfer_limits endpoint ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f))
* **api:** add post /v1/book_transfers/{book_transfer_token}/retry endpoint ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f))
* **api:** Add user defined status to ledger accounts ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
* **api:** add WIRE_DRAWDOWN_REQUEST transfer type ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14))
* **api:** Expose Payment Allocation Details ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
* **api:** remove unnecessary X-Lithic-Pagination header ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14))
* **api:** remove v1/aggregate_balances and related models ([c66d75e](https://github.com/lithic-com/lithic-ruby/commit/c66d75ed7b10521d5f73efeafb9dbcd6ff7a7f0c))


### Bug Fixes

* calling `break` out of streams should be instantaneous ([86db080](https://github.com/lithic-com/lithic-ruby/commit/86db080240382ba1cd73af9a01c89379cfb8e330))
* issue where json.parse errors when receiving HTTP 204 with nobody ([9c9d63b](https://github.com/lithic-com/lithic-ruby/commit/9c9d63b07badd9fdd107314ac0bd5c8c23ddd0c3))


### Chores

* formatting ([e736094](https://github.com/lithic-com/lithic-ruby/commit/e736094a8bcf11007a6ea2666cfc6a646aca6972))
* **internal:** codegen related update ([6bacc68](https://github.com/lithic-com/lithic-ruby/commit/6bacc684b578951ece05155697ec0b68c2d8d4e0))
* Simplify custom code ([67dc77a](https://github.com/lithic-com/lithic-ruby/commit/67dc77a78348d9d910cca58ffba483992b738f30))
* Simplify custom code - same for rbs file ([3438ceb](https://github.com/lithic-com/lithic-ruby/commit/3438cebfd4899c87d06a2bc42d4a76af709ea21f))
* update code formatting ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))


### Documentation

* **api:** clarify description of token / retry_token when it serves as idempotency key ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14))
* Update language for Google Web Push Provisioning docs ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))

## 0.2.0 (2025-12-10)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0...v0.2.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GIT
PATH
remote: .
specs:
lithic (0.2.0)
lithic (0.3.0)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 Lithic
Copyright 2026 Lithic

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "lithic", "~> 0.2.0"
gem "lithic", "~> 0.3.0"
```

<!-- x-release-please-end -->
Expand Down
13 changes: 6 additions & 7 deletions lib/lithic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@
require_relative "lithic/models/account_update_params"
require_relative "lithic/models/address"
require_relative "lithic/models/address_update"
require_relative "lithic/models/aggregate_balance"
require_relative "lithic/models/aggregate_balance_list_params"
require_relative "lithic/models/api_status"
require_relative "lithic/models/asa_request_webhook_event"
require_relative "lithic/models/auth_rules/auth_rule"
require_relative "lithic/models/auth_rules/auth_rule_condition"
require_relative "lithic/models/auth_rules/conditional_3ds_action_parameters"
Expand Down Expand Up @@ -149,10 +146,12 @@
require_relative "lithic/models/book_transfer_create_params"
require_relative "lithic/models/book_transfer_list_params"
require_relative "lithic/models/book_transfer_retrieve_params"
require_relative "lithic/models/book_transfer_retry_params"
require_relative "lithic/models/book_transfer_reverse_params"
require_relative "lithic/models/book_transfer_transaction_created_webhook_event"
require_relative "lithic/models/book_transfer_transaction_updated_webhook_event"
require_relative "lithic/models/card"
require_relative "lithic/models/card_authorization_approval_request_webhook_event"
require_relative "lithic/models/card_bulk_order"
require_relative "lithic/models/card_bulk_order_create_params"
require_relative "lithic/models/card_bulk_order_list_params"
Expand All @@ -177,8 +176,6 @@
require_relative "lithic/models/card_renew_params"
require_relative "lithic/models/card_retrieve_params"
require_relative "lithic/models/card_retrieve_spend_limits_params"
require_relative "lithic/models/cards/aggregate_balance_list_params"
require_relative "lithic/models/cards/aggregate_balance_list_response"
require_relative "lithic/models/cards/balance_list_params"
require_relative "lithic/models/cards/financial_transaction_list_params"
require_relative "lithic/models/cards/financial_transaction_retrieve_params"
Expand Down Expand Up @@ -374,6 +371,7 @@
require_relative "lithic/models/three_ds/decisioning_retrieve_secret_params"
require_relative "lithic/models/three_ds/decisioning_retrieve_secret_response"
require_relative "lithic/models/three_ds/decisioning_rotate_secret_params"
require_relative "lithic/models/three_ds_authentication_approval_request_webhook_event"
require_relative "lithic/models/three_ds_authentication_challenge_webhook_event"
require_relative "lithic/models/three_ds_authentication_created_webhook_event"
require_relative "lithic/models/three_ds_authentication_updated_webhook_event"
Expand Down Expand Up @@ -423,6 +421,8 @@
require_relative "lithic/models/transaction_simulate_void_response"
require_relative "lithic/models/transfer"
require_relative "lithic/models/transfer_create_params"
require_relative "lithic/models/transfer_limit_list_params"
require_relative "lithic/models/transfer_limits_response"
require_relative "lithic/models/verification_method"
require_relative "lithic/models/wallet_decisioning_info"
require_relative "lithic/models/webhook_parsed_params"
Expand All @@ -431,7 +431,6 @@
require_relative "lithic/resources/account_activity"
require_relative "lithic/resources/account_holders"
require_relative "lithic/resources/accounts"
require_relative "lithic/resources/aggregate_balances"
require_relative "lithic/resources/auth_rules"
require_relative "lithic/resources/auth_rules/v2"
require_relative "lithic/resources/auth_rules/v2/backtests"
Expand All @@ -441,7 +440,6 @@
require_relative "lithic/resources/card_bulk_orders"
require_relative "lithic/resources/card_programs"
require_relative "lithic/resources/cards"
require_relative "lithic/resources/cards/aggregate_balances"
require_relative "lithic/resources/cards/balances"
require_relative "lithic/resources/cards/financial_transactions"
require_relative "lithic/resources/credit_products"
Expand Down Expand Up @@ -483,5 +481,6 @@
require_relative "lithic/resources/transactions/enhanced_commercial_data"
require_relative "lithic/resources/transactions/events"
require_relative "lithic/resources/transactions/events/enhanced_commercial_data"
require_relative "lithic/resources/transfer_limits"
require_relative "lithic/resources/transfers"
require_relative "lithic/resources/webhooks"
15 changes: 5 additions & 10 deletions lib/lithic/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ class Client < Lithic::Internal::Transport::BaseClient
# @return [Lithic::Resources::Balances]
attr_reader :balances

# @return [Lithic::Resources::AggregateBalances]
attr_reader :aggregate_balances

# @return [Lithic::Resources::Disputes]
attr_reader :disputes

Expand Down Expand Up @@ -119,6 +116,9 @@ class Client < Lithic::Internal::Transport::BaseClient
# @return [Lithic::Resources::AccountActivity]
attr_reader :account_activity

# @return [Lithic::Resources::TransferLimits]
attr_reader :transfer_limits

# @return [Lithic::Resources::Webhooks]
attr_reader :webhooks

Expand Down Expand Up @@ -181,19 +181,14 @@ def initialize(
raise ArgumentError.new("api_key is required, and can be set via environ: \"LITHIC_API_KEY\"")
end

headers = {
"x-lithic-pagination" => "cursor"
}

@api_key = api_key.to_s

super(
base_url: base_url,
timeout: timeout,
max_retries: max_retries,
initial_retry_delay: initial_retry_delay,
max_retry_delay: max_retry_delay,
headers: headers
max_retry_delay: max_retry_delay
)

@accounts = Lithic::Resources::Accounts.new(client: self)
Expand All @@ -205,7 +200,6 @@ def initialize(
@cards = Lithic::Resources::Cards.new(client: self)
@card_bulk_orders = Lithic::Resources::CardBulkOrders.new(client: self)
@balances = Lithic::Resources::Balances.new(client: self)
@aggregate_balances = Lithic::Resources::AggregateBalances.new(client: self)
@disputes = Lithic::Resources::Disputes.new(client: self)
@disputes_v2 = Lithic::Resources::DisputesV2.new(client: self)
@events = Lithic::Resources::Events.new(client: self)
Expand All @@ -228,6 +222,7 @@ def initialize(
@fraud = Lithic::Resources::Fraud.new(client: self)
@network_programs = Lithic::Resources::NetworkPrograms.new(client: self)
@account_activity = Lithic::Resources::AccountActivity.new(client: self)
@transfer_limits = Lithic::Resources::TransferLimits.new(client: self)
@webhooks = Lithic::Resources::Webhooks.new(client: self)
end
end
Expand Down
22 changes: 12 additions & 10 deletions lib/lithic/internal/transport/pooled_net_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,19 @@ def execute(request)
end

self.class.calibrate_socket_timeout(conn, deadline)
conn.request(req) do |rsp|
y << [req, rsp]
break if finished

rsp.read_body do |bytes|
y << bytes.force_encoding(Encoding::BINARY)
break if finished

self.class.calibrate_socket_timeout(conn, deadline)
::Kernel.catch(:jump) do
conn.request(req) do |rsp|
y << [req, rsp]
::Kernel.throw(:jump) if finished

rsp.read_body do |bytes|
y << bytes.force_encoding(Encoding::BINARY)
::Kernel.throw(:jump) if finished

self.class.calibrate_socket_timeout(conn, deadline)
end
eof = true
end
eof = true
end
end
ensure
Expand Down
9 changes: 7 additions & 2 deletions lib/lithic/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@ def force_charset!(content_type, text:)
def decode_content(headers, stream:, suppress_error: false)
case (content_type = headers["content-type"])
in Lithic::Internal::Util::JSON_CONTENT
json = stream.to_a.join
return nil if (json = stream.to_a.join).empty?

begin
JSON.parse(json, symbolize_names: true)
rescue JSON::ParserError => e
Expand All @@ -667,7 +668,11 @@ def decode_content(headers, stream:, suppress_error: false)
in Lithic::Internal::Util::JSONL_CONTENT
lines = decode_lines(stream)
chain_fused(lines) do |y|
lines.each { y << JSON.parse(_1, symbolize_names: true) }
lines.each do
next if _1.empty?

y << JSON.parse(_1, symbolize_names: true)
end
end
in %r{^text/event-stream}
lines = decode_lines(stream)
Expand Down
18 changes: 12 additions & 6 deletions lib/lithic/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,8 @@ module Lithic

AddressUpdate = Lithic::Models::AddressUpdate

AggregateBalance = Lithic::Models::AggregateBalance

AggregateBalanceListParams = Lithic::Models::AggregateBalanceListParams

APIStatus = Lithic::Models::APIStatus

AsaRequestWebhookEvent = Lithic::Models::AsaRequestWebhookEvent

AuthRules = Lithic::Models::AuthRules

AuthRulesBacktestReportCreatedWebhookEvent = Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent
Expand All @@ -122,6 +116,8 @@ module Lithic

BookTransferRetrieveParams = Lithic::Models::BookTransferRetrieveParams

BookTransferRetryParams = Lithic::Models::BookTransferRetryParams

BookTransferReverseParams = Lithic::Models::BookTransferReverseParams

BookTransferTransactionCreatedWebhookEvent = Lithic::Models::BookTransferTransactionCreatedWebhookEvent
Expand All @@ -130,6 +126,9 @@ module Lithic

Card = Lithic::Models::Card

CardAuthorizationApprovalRequestWebhookEvent =
Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent

CardBulkOrder = Lithic::Models::CardBulkOrder

CardBulkOrderCreateParams = Lithic::Models::CardBulkOrderCreateParams
Expand Down Expand Up @@ -478,6 +477,9 @@ module Lithic

ThreeDSAuthentication = Lithic::Models::ThreeDSAuthentication

ThreeDSAuthenticationApprovalRequestWebhookEvent =
Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent

ThreeDSAuthenticationChallengeWebhookEvent = Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent

ThreeDSAuthenticationCreatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent
Expand Down Expand Up @@ -562,6 +564,10 @@ module Lithic

TransferCreateParams = Lithic::Models::TransferCreateParams

TransferLimitListParams = Lithic::Models::TransferLimitListParams

TransferLimitsResponse = Lithic::Models::TransferLimitsResponse

VerificationMethod = Lithic::Models::VerificationMethod

WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo
Expand Down
Loading