Skip to content
Open
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.18.0"
".": "0.18.1"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 214
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-47e9f78d22682623e313f1689f5fa7e3420575ff285a14a2f4704c49ffb6b72e.yml
openapi_spec_hash: 4797fe46d942cb32e648a79015783d01
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-9e397c65ffb81e2928b8ecf979769a79131ae6058b6fb373a5e930dc8a168732.yml
openapi_spec_hash: 93aea3855d2d1c390107d223762aa818
config_hash: 5bb913c05ebeb301ec925b16e75bb251
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.18.1 (2026-06-29)

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

### Bug Fixes

* **types:** convert CaseTransaction to union with Card/Payment variants ([0d84634](https://github.com/lithic-com/lithic-ruby/commit/0d84634d5cf4e42f4270832089df3cdbd50deed2))


### Chores

* **internal:** bound formatter parallelism to CPU count ([acf4dc5](https://github.com/lithic-com/lithic-ruby/commit/acf4dc52c4d33ea1bce9b0544123caf6c2d764d2))


### Documentation

* **types:** update cash_amount field description in CardAuthorization ([1385cde](https://github.com/lithic-com/lithic-ruby/commit/1385cde62aca3c83a7525150b535decc016c8ed4))

## 0.18.0 (2026-06-23)

Full Changelog: [v0.17.0...v0.18.0](https://github.com/lithic-com/lithic-ruby/compare/v0.17.0...v0.18.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
lithic (0.18.0)
lithic (0.18.1)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "lithic", "~> 0.18.0"
gem "lithic", "~> 0.18.1"
```

<!-- x-release-please-end -->
Expand Down
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require "etc"
require "pathname"
require "securerandom"
require "shellwords"
Expand Down Expand Up @@ -37,7 +38,11 @@ multitask(:test) do
ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 }
end

xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
# Cap parallelism at the CPU count. `--max-procs=0` spawns one process per
# 300-file batch with no upper bound; on large SDKs (thousands of files) that
# oversubscribes CPUs and stacks up rubocop processes, exhausting memory and
# slowing CI to the point of timing out.
xargs = %W[xargs --no-run-if-empty --null --max-procs=#{Etc.nprocessors} --max-args=300 --]
ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")}

filtered = ->(ext, dirs) do
Expand Down
28 changes: 7 additions & 21 deletions lib/lithic/internal/type/union.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,14 @@ module Type
# @api private
#
# @example
# # `account_activity_list_response` is a `Lithic::Models::AccountActivityListResponse`
# case account_activity_list_response
# when Lithic::Models::AccountActivityListResponse::Internal
# puts(account_activity_list_response.token)
# when Lithic::BookTransferResponse
# puts(account_activity_list_response.category)
# when Lithic::Models::AccountActivityListResponse::Card
# # ...
# # `case_transaction` is a `Lithic::TransactionMonitoring::CaseTransaction`
# case case_transaction
# when Lithic::TransactionMonitoring::CaseTransaction::CardCaseTransaction
# puts(case_transaction.token)
# when Lithic::TransactionMonitoring::CaseTransaction::PaymentCaseTransaction
# puts(case_transaction.added_at)
# else
# puts(account_activity_list_response)
# end
#
# @example
# case account_activity_list_response
# in {family: :INTERNAL, token: token, category: category, created: created}
# puts(token)
# in {family: :TRANSFER, token: token, category: category, created: created}
# puts(category)
# in {family: :PAYMENT, token: token, category: category, created: created}
# puts(created)
# else
# puts(account_activity_list_response)
# puts(case_transaction)
# end
module Union
include Lithic::Internal::Type::Converter
Expand Down
13 changes: 7 additions & 6 deletions lib/lithic/models/card_authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ class CardAuthorization < Lithic::Internal::Type::BaseModel
required :cardholder_currency, String

# @!attribute cash_amount
# The portion of the transaction requested as cash back by the cardholder, and
# does not include any acquirer fees. The amount field includes the purchase
# amount, the requested cash back amount, and any acquirer fees.
# The amount of cash requested by the cardholder, in the cardholder billing
# currency's smallest unit. For purchase-with-cashback transactions this is the
# cashback portion only; for ATM transactions this is the full amount. This amount
# includes all acquirer fees.
#
# If no cash back was requested, the value of this field will be 0, and the field
# will always be present.
# If no cash was requested, the value of this field will be 0, and the field will
# always be present.
#
# @return [Integer]
required :cash_amount, Integer
Expand Down Expand Up @@ -263,7 +264,7 @@ class CardAuthorization < Lithic::Internal::Type::BaseModel
#
# @param cardholder_currency [String] Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for cardholder's
#
# @param cash_amount [Integer] The portion of the transaction requested as cash back by the cardholder, and doe
# @param cash_amount [Integer] The amount of cash requested by the cardholder, in the cardholder billing curren
#
# @param created [Time] Date and time when the transaction first occurred in UTC.
#
Expand Down
163 changes: 120 additions & 43 deletions lib/lithic/models/transaction_monitoring/case_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,127 @@
module Lithic
module Models
module TransactionMonitoring
# A single transaction associated with a case. The `category` field identifies
# whether this is a card transaction or a payment transaction.
#
# @see Lithic::Resources::TransactionMonitoring::Cases#list_transactions
class CaseTransaction < Lithic::Internal::Type::BaseModel
# @!attribute token
# Globally unique identifier for the transaction
#
# @return [String]
required :token, String

# @!attribute account_token
# Token of the account the transaction belongs to
#
# @return [String]
required :account_token, String

# @!attribute added_at
# Date and time at which the transaction was added to the case
#
# @return [Time]
required :added_at, Time

# @!attribute card_token
# Token of the card the transaction was made on
#
# @return [String]
required :card_token, String

# @!attribute transaction_created_at
# Date and time at which the transaction was created
#
# @return [Time]
required :transaction_created_at, Time

# @!method initialize(token:, account_token:, added_at:, card_token:, transaction_created_at:)
# A single transaction associated with a case
#
# @param token [String] Globally unique identifier for the transaction
#
# @param account_token [String] Token of the account the transaction belongs to
#
# @param added_at [Time] Date and time at which the transaction was added to the case
#
# @param card_token [String] Token of the card the transaction was made on
#
# @param transaction_created_at [Time] Date and time at which the transaction was created
module CaseTransaction
extend Lithic::Internal::Type::Union

discriminator :category

# A card transaction associated with a case
variant -> { Lithic::TransactionMonitoring::CaseTransaction::CardCaseTransaction }

# A payment (ACH) transaction associated with a case
variant -> { Lithic::TransactionMonitoring::CaseTransaction::PaymentCaseTransaction }

class CardCaseTransaction < Lithic::Internal::Type::BaseModel
# @!attribute token
# Globally unique identifier for the card transaction
#
# @return [String]
required :token, String

# @!attribute account_token
# Token of the account the transaction belongs to
#
# @return [String]
required :account_token, String

# @!attribute added_at
# Date and time at which the transaction was added to the case
#
# @return [Time]
required :added_at, Time

# @!attribute card_token
# Token of the card the transaction was made on
#
# @return [String]
required :card_token, String

# @!attribute category
#
# @return [Symbol, :CARD]
required :category, const: :CARD

# @!attribute transaction_created_at
# Date and time at which the transaction was created
#
# @return [Time]
required :transaction_created_at, Time

# @!method initialize(token:, account_token:, added_at:, card_token:, transaction_created_at:, category: :CARD)
# A card transaction associated with a case
#
# @param token [String] Globally unique identifier for the card transaction
#
# @param account_token [String] Token of the account the transaction belongs to
#
# @param added_at [Time] Date and time at which the transaction was added to the case
#
# @param card_token [String] Token of the card the transaction was made on
#
# @param transaction_created_at [Time] Date and time at which the transaction was created
#
# @param category [Symbol, :CARD]
end

class PaymentCaseTransaction < Lithic::Internal::Type::BaseModel
# @!attribute token
# Globally unique identifier for the payment transaction
#
# @return [String]
required :token, String

# @!attribute added_at
# Date and time at which the transaction was added to the case
#
# @return [Time]
required :added_at, Time

# @!attribute category
#
# @return [Symbol, :PAYMENT]
required :category, const: :PAYMENT

# @!attribute financial_account_token
# Token of the financial account the payment belongs to
#
# @return [String]
required :financial_account_token, String

# @!attribute transaction_created_at
# Date and time at which the transaction was created
#
# @return [Time]
required :transaction_created_at, Time

# @!attribute account_token
# Token of the account the payment belongs to, if applicable
#
# @return [String, nil]
optional :account_token, String

# @!method initialize(token:, added_at:, financial_account_token:, transaction_created_at:, account_token: nil, category: :PAYMENT)
# A payment (ACH) transaction associated with a case
#
# @param token [String] Globally unique identifier for the payment transaction
#
# @param added_at [Time] Date and time at which the transaction was added to the case
#
# @param financial_account_token [String] Token of the financial account the payment belongs to
#
# @param transaction_created_at [Time] Date and time at which the transaction was created
#
# @param account_token [String] Token of the account the payment belongs to, if applicable
#
# @param category [Symbol, :PAYMENT]
end

# @!method self.variants
# @return [Array(Lithic::Models::TransactionMonitoring::CaseTransaction::CardCaseTransaction, Lithic::Models::TransactionMonitoring::CaseTransaction::PaymentCaseTransaction)]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/lithic/resources/transaction_monitoring/cases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def list_activity(case_token, params = {})
#
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [Lithic::Internal::CursorPage<Lithic::Models::TransactionMonitoring::CaseTransaction>]
# @return [Lithic::Internal::CursorPage<Lithic::Models::TransactionMonitoring::CaseTransaction::CardCaseTransaction, Lithic::Models::TransactionMonitoring::CaseTransaction::PaymentCaseTransaction>]
#
# @see Lithic::Models::TransactionMonitoring::CaseListTransactionsParams
def list_transactions(case_token, params = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/lithic/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Lithic
VERSION = "0.18.0"
VERSION = "0.18.1"
end
22 changes: 12 additions & 10 deletions rbi/lithic/models/card_authorization.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ module Lithic
sig { returns(String) }
attr_accessor :cardholder_currency

# The portion of the transaction requested as cash back by the cardholder, and
# does not include any acquirer fees. The amount field includes the purchase
# amount, the requested cash back amount, and any acquirer fees.
# The amount of cash requested by the cardholder, in the cardholder billing
# currency's smallest unit. For purchase-with-cashback transactions this is the
# cashback portion only; for ATM transactions this is the full amount. This amount
# includes all acquirer fees.
#
# If no cash back was requested, the value of this field will be 0, and the field
# will always be present.
# If no cash was requested, the value of this field will be 0, and the field will
# always be present.
sig { returns(Integer) }
attr_accessor :cash_amount

Expand Down Expand Up @@ -328,12 +329,13 @@ module Lithic
# Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for cardholder's
# billing currency.
cardholder_currency:,
# The portion of the transaction requested as cash back by the cardholder, and
# does not include any acquirer fees. The amount field includes the purchase
# amount, the requested cash back amount, and any acquirer fees.
# The amount of cash requested by the cardholder, in the cardholder billing
# currency's smallest unit. For purchase-with-cashback transactions this is the
# cashback portion only; for ATM transactions this is the full amount. This amount
# includes all acquirer fees.
#
# If no cash back was requested, the value of this field will be 0, and the field
# will always be present.
# If no cash was requested, the value of this field will be 0, and the field will
# always be present.
cash_amount:,
# Date and time when the transaction first occurred in UTC.
created:,
Expand Down
Loading