Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7e916b6
feat(api): add override_company_name field to payment create parameters
stainless-app[bot] Mar 24, 2026
810ca31
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 24, 2026
5af97d6
codegen metadata
stainless-app[bot] Mar 24, 2026
b11902d
docs(api): update nature_of_business and qr_code_url field descriptions
stainless-app[bot] Mar 25, 2026
abfc1fd
fix(internal): correct multipart form field name encoding
stainless-app[bot] Mar 26, 2026
40b20fb
chore(ci): support opting out of skipping builds on metadata-only com…
stainless-app[bot] Mar 27, 2026
0156ca5
fix: variable name typo
stainless-app[bot] Mar 31, 2026
5624e72
fix: align path encoding with RFC 3986 section 3.3
stainless-app[bot] Mar 31, 2026
d8d98d9
feat(api): add card decline count attributes to auth_rules conditiona…
stainless-app[bot] Mar 31, 2026
1fa7586
feat(api): add statement_totals field to financial accounts statement
stainless-app[bot] Apr 2, 2026
a0fa401
fix(types): make credit_product_token optional in financial_accounts …
stainless-app[bot] Apr 7, 2026
fb4f7d9
fix(types): require Card fields, remove hostname in authorization app…
stainless-app[bot] Apr 7, 2026
3d54444
feat(api): add interchange/chargeback/provisional_credit_account to f…
stainless-app[bot] Apr 8, 2026
6077d32
fix(types): remove INTERCHANGE/CHARGEBACK from FinancialAccount/Insta…
stainless-app[bot] Apr 8, 2026
5a0bdeb
fix: multipart encoding for file arrays
stainless-app[bot] Apr 8, 2026
acca757
feat(api): add transaction_token field to auth_rules v2 results response
stainless-app[bot] Apr 9, 2026
4729281
feat(api): add transaction_token field to auth_rules examples
stainless-app[bot] Apr 9, 2026
2addd10
release: 0.11.0
stainless-app[bot] Apr 9, 2026
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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/lithic-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/lithic-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork)
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
Expand Down
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.10.0"
".": "0.11.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 190
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-17c04dd1b0508b380c21e3acc3d4cd1e86b590f81d14fa26d1973b236f660e38.yml
openapi_spec_hash: f8ddee07358d2c938450a6889fbf7940
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-bc1866f92f50e1de35c16e782a13052913aeedc56723b13de396dea7c754889b.yml
openapi_spec_hash: d7110a33edc390903093258735ee0cfb
config_hash: edbdfefeb0d3d927c2f9fe3402793215
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## 0.11.0 (2026-04-09)

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

### Features

* **api:** add card decline count attributes to auth_rules conditional authorization ([d8d98d9](https://github.com/lithic-com/lithic-ruby/commit/d8d98d927f33b011b1a28c37df6b971ab7c895a0))
* **api:** add interchange/chargeback/provisional_credit_account to financial account type enums ([3d54444](https://github.com/lithic-com/lithic-ruby/commit/3d544442bb1ecfc4c69c806fb72cf8a1b0564c8d))
* **api:** add override_company_name field to payment create parameters ([7e916b6](https://github.com/lithic-com/lithic-ruby/commit/7e916b6bb6e41494aab381d5a30bb83f9ea6ca23))
* **api:** add statement_totals field to financial accounts statement ([1fa7586](https://github.com/lithic-com/lithic-ruby/commit/1fa758668e1caf7beefca72abe384c99d112ae85))
* **api:** add transaction_token field to auth_rules examples ([4729281](https://github.com/lithic-com/lithic-ruby/commit/47292818b9afc96e2ac358235012b4deb8987016))
* **api:** add transaction_token field to auth_rules v2 results response ([acca757](https://github.com/lithic-com/lithic-ruby/commit/acca757780ead14f428e035409c3b7cb815d9d83))


### Bug Fixes

* align path encoding with RFC 3986 section 3.3 ([5624e72](https://github.com/lithic-com/lithic-ruby/commit/5624e7234a615d0de2ecc92e007be91a54a90c98))
* **internal:** correct multipart form field name encoding ([abfc1fd](https://github.com/lithic-com/lithic-ruby/commit/abfc1fdd7c78682932979e362448f95bca347d43))
* multipart encoding for file arrays ([5a0bdeb](https://github.com/lithic-com/lithic-ruby/commit/5a0bdeb87640bd6340039f86a366886894e9991a))
* **types:** make credit_product_token optional in financial_accounts statement ([a0fa401](https://github.com/lithic-com/lithic-ruby/commit/a0fa40166b98f3d7e91878d5ea948027c72ea440))
* **types:** remove INTERCHANGE/CHARGEBACK from FinancialAccount/InstanceFinancialAccountType ([6077d32](https://github.com/lithic-com/lithic-ruby/commit/6077d32ca7a8bc77204000d9c2e0cf7f28569c4b))
* **types:** require Card fields, remove hostname in authorization approval webhook ([fb4f7d9](https://github.com/lithic-com/lithic-ruby/commit/fb4f7d98735f400ca090a07b7fe59373e8eb9ef1))
* variable name typo ([0156ca5](https://github.com/lithic-com/lithic-ruby/commit/0156ca5e46b58cdfb25fdbcd293d16778e762c2a))


### Chores

* **ci:** skip lint on metadata-only changes ([810ca31](https://github.com/lithic-com/lithic-ruby/commit/810ca31d3deeb0fd04c5843496dc601187076633))
* **ci:** support opting out of skipping builds on metadata-only commits ([40b20fb](https://github.com/lithic-com/lithic-ruby/commit/40b20fb0c3c2c31e2870ee2df86d4a55fac67a04))


### Documentation

* **api:** update nature_of_business and qr_code_url field descriptions ([b11902d](https://github.com/lithic-com/lithic-ruby/commit/b11902d30b4b337e7ffc05358df51c18e6ea6648))

## 0.10.0 (2026-03-23)

Full Changelog: [v0.9.0...v0.10.0](https://github.com/lithic-com/lithic-ruby/compare/v0.9.0...v0.10.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.10.0)
lithic (0.11.0)
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.10.0"
gem "lithic", "~> 0.11.0"
```

<!-- x-release-please-end -->
Expand Down
29 changes: 22 additions & 7 deletions lib/lithic/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def coerce_hash!(input)
in Hash | nil => coerced
coerced
else
message = "Expected a #{Hash} or #{Lithic::Internal::Type::BaseModel}, got #{data.inspect}"
message = "Expected a #{Hash} or #{Lithic::Internal::Type::BaseModel}, got #{input.inspect}"
raise ArgumentError.new(message)
end
end
Expand Down Expand Up @@ -237,6 +237,11 @@ def dig(data, pick, &blk)
end
end

# @type [Regexp]
#
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/

class << self
# @api private
#
Expand All @@ -247,6 +252,15 @@ def uri_origin(uri)
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
end

# @api private
#
# @param path [String, Integer]
#
# @return [String]
def encode_path(path)
path.to_s.gsub(Lithic::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
end

# @api private
#
# @param path [String, Array<String>]
Expand All @@ -259,7 +273,7 @@ def interpolate_path(path)
in []
""
in [String => p, *interpolations]
encoded = interpolations.map { ERB::Util.url_encode(_1) }
encoded = interpolations.map { encode_path(_1) }
format(p, *encoded)
end
end
Expand Down Expand Up @@ -571,16 +585,15 @@ def encode_query_params(query)
y << "Content-Disposition: form-data"

unless key.nil?
name = ERB::Util.url_encode(key.to_s)
y << "; name=\"#{name}\""
y << "; name=\"#{key}\""
end

case val
in Lithic::FilePart unless val.filename.nil?
filename = ERB::Util.url_encode(val.filename)
filename = encode_path(val.filename)
y << "; filename=\"#{filename}\""
in Pathname | IO
filename = ERB::Util.url_encode(::File.basename(val.to_path))
filename = encode_path(::File.basename(val.to_path))
y << "; filename=\"#{filename}\""
else
end
Expand All @@ -597,6 +610,7 @@ def encode_query_params(query)
#
# @return [Array(String, Enumerable<String>)]
private def encode_multipart_streaming(body)
# rubocop:disable Style/CaseEquality
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
boundary = SecureRandom.urlsafe_base64(46)

Expand All @@ -606,7 +620,7 @@ def encode_query_params(query)
in Hash
body.each do |key, val|
case val
in Array if val.all? { primitive?(_1) }
in Array if val.all? { primitive?(_1) || Lithic::Internal::Type::FileInput === _1 }
val.each do |v|
write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
end
Expand All @@ -622,6 +636,7 @@ def encode_query_params(query)

fused_io = fused_enum(strio) { closing.each(&:call) }
[boundary, fused_io]
# rubocop:enable Style/CaseEquality
end

# @api private
Expand Down
10 changes: 9 additions & 1 deletion lib/lithic/models/auth_rules/backtest_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,20 @@ class Example < Lithic::Internal::Type::BaseModel
# @return [Time, nil]
optional :timestamp, Time

# @!method initialize(decision: nil, event_token: nil, timestamp: nil)
# @!attribute transaction_token
# The token of the transaction associated with the event
#
# @return [String, nil]
optional :transaction_token, String, nil?: true

# @!method initialize(decision: nil, event_token: nil, timestamp: nil, transaction_token: nil)
# @param decision [Symbol, Lithic::Models::AuthRules::BacktestStats::Example::Decision] The decision made by the rule for this event.
#
# @param event_token [String] The event token.
#
# @param timestamp [Time] The timestamp of the event.
#
# @param transaction_token [String, nil] The token of the transaction associated with the event

# The decision made by the rule for this event.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class Condition < Lithic::Internal::Type::BaseModel
# trailing hour up and until the authorization.
# - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
# trailing 24 hours up and until the authorization.
# - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
# the trailing 15 minutes before the authorization.
# - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
# the trailing hour up and until the authorization.
# - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
# the trailing 24 hours up and until the authorization.
# - `CARD_STATE`: The current state of the card associated with the transaction.
# Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
# `PENDING_FULFILLMENT`.
Expand Down Expand Up @@ -168,6 +174,12 @@ class Condition < Lithic::Internal::Type::BaseModel
# trailing hour up and until the authorization.
# - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
# trailing 24 hours up and until the authorization.
# - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
# the trailing 15 minutes before the authorization.
# - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
# the trailing hour up and until the authorization.
# - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
# the trailing 24 hours up and until the authorization.
# - `CARD_STATE`: The current state of the card associated with the transaction.
# Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
# `PENDING_FULFILLMENT`.
Expand Down Expand Up @@ -212,6 +224,9 @@ module Attribute
CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M
CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H
CARD_TRANSACTION_COUNT_24_H = :CARD_TRANSACTION_COUNT_24H
CARD_DECLINE_COUNT_15_M = :CARD_DECLINE_COUNT_15M
CARD_DECLINE_COUNT_1_H = :CARD_DECLINE_COUNT_1H
CARD_DECLINE_COUNT_24_H = :CARD_DECLINE_COUNT_24H
CARD_STATE = :CARD_STATE
PIN_ENTERED = :PIN_ENTERED
PIN_STATUS = :PIN_STATUS
Expand Down
10 changes: 9 additions & 1 deletion lib/lithic/models/auth_rules/report_stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ class Example < Lithic::Internal::Type::BaseModel
# @return [Time, nil]
optional :timestamp, Time

# @!method initialize(actions: nil, approved: nil, decision: nil, event_token: nil, timestamp: nil)
# @!attribute transaction_token
# The token of the transaction associated with the event
#
# @return [String, nil]
optional :transaction_token, String, nil?: true

# @!method initialize(actions: nil, approved: nil, decision: nil, event_token: nil, timestamp: nil, transaction_token: nil)
# @param actions [Array<Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction>] The actions taken by the rule for this event.
#
# @param approved [Boolean] Whether the rule would have approved the request.
Expand All @@ -110,6 +116,8 @@ class Example < Lithic::Internal::Type::BaseModel
# @param event_token [String] The event token.
#
# @param timestamp [Time] The timestamp of the event.
#
# @param transaction_token [String, nil] The token of the transaction associated with the event

module Action
extend Lithic::Internal::Type::Union
Expand Down
40 changes: 36 additions & 4 deletions lib/lithic/models/auth_rules/v2_list_results_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ class AuthorizationResult < Lithic::Internal::Type::BaseModel
# @return [Integer]
required :rule_version, Integer

# @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :AUTHORIZATION)
# @!attribute transaction_token
# The token of the transaction that triggered the rule evaluation
#
# @return [String, nil]
required :transaction_token, String, nil?: true

# @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :AUTHORIZATION)
# @param token [String] Globally unique identifier for the evaluation
#
# @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization>] Actions returned by the rule evaluation
Expand All @@ -82,6 +88,8 @@ class AuthorizationResult < Lithic::Internal::Type::BaseModel
#
# @param rule_version [Integer] Version of the rule that was evaluated
#
# @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
#
# @param event_stream [Symbol, :AUTHORIZATION] The event stream during which the rule was evaluated

module Action
Expand Down Expand Up @@ -295,7 +303,13 @@ class Authentication3DSResult < Lithic::Internal::Type::BaseModel
# @return [Integer]
required :rule_version, Integer

# @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :THREE_DS_AUTHENTICATION)
# @!attribute transaction_token
# The token of the transaction that triggered the rule evaluation
#
# @return [String, nil]
required :transaction_token, String, nil?: true

# @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :THREE_DS_AUTHENTICATION)
# @param token [String] Globally unique identifier for the evaluation
#
# @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action>] Actions returned by the rule evaluation
Expand All @@ -310,6 +324,8 @@ class Authentication3DSResult < Lithic::Internal::Type::BaseModel
#
# @param rule_version [Integer] Version of the rule that was evaluated
#
# @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
#
# @param event_stream [Symbol, :THREE_DS_AUTHENTICATION] The event stream during which the rule was evaluated

class Action < Lithic::Internal::Type::BaseModel
Expand Down Expand Up @@ -406,7 +422,13 @@ class TokenizationResult < Lithic::Internal::Type::BaseModel
# @return [Integer]
required :rule_version, Integer

# @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :TOKENIZATION)
# @!attribute transaction_token
# The token of the transaction that triggered the rule evaluation
#
# @return [String, nil]
required :transaction_token, String, nil?: true

# @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :TOKENIZATION)
# @param token [String] Globally unique identifier for the evaluation
#
# @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction>] Actions returned by the rule evaluation
Expand All @@ -421,6 +443,8 @@ class TokenizationResult < Lithic::Internal::Type::BaseModel
#
# @param rule_version [Integer] Version of the rule that was evaluated
#
# @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
#
# @param event_stream [Symbol, :TOKENIZATION] The event stream during which the rule was evaluated

module Action
Expand Down Expand Up @@ -631,7 +655,13 @@ class ACHResult < Lithic::Internal::Type::BaseModel
# @return [Integer]
required :rule_version, Integer

# @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_stream:, event_token:, mode:, rule_version:)
# @!attribute transaction_token
# The token of the transaction that triggered the rule evaluation
#
# @return [String, nil]
required :transaction_token, String, nil?: true

# @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_stream:, event_token:, mode:, rule_version:, transaction_token:)
# @param token [String] Globally unique identifier for the evaluation
#
# @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction>] Actions returned by the rule evaluation
Expand All @@ -647,6 +677,8 @@ class ACHResult < Lithic::Internal::Type::BaseModel
# @param mode [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode] The state of the Auth Rule
#
# @param rule_version [Integer] Version of the rule that was evaluated
#
# @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation

module Action
extend Lithic::Internal::Type::Union
Expand Down
Loading