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 .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-bf54d7063b11e1b1656e00d02438f34f87938a9fdbdd5b980fce3cfae3dabffa.yml
openapi_spec_hash: c6efbc9d3105fa48f76ebb095b887e08
config_hash: edbdfefeb0d3d927c2f9fe3402793215
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.11.0 (2026-04-02)

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 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))


### 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))
* 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
25 changes: 19 additions & 6 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 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
11 changes: 8 additions & 3 deletions lib/lithic/models/card_bulk_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class CardBulkOrder < Lithic::Internal::Type::BaseModel
required :shipping_address, Lithic::Internal::Type::Unknown

# @!attribute shipping_method
# Shipping method for all cards in this bulk order
# Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and
# BULK_EXPRESS are only available with Perfect Plastic Printing
#
# @return [Symbol, Lithic::Models::CardBulkOrder::ShippingMethod]
required :shipping_method, enum: -> { Lithic::CardBulkOrder::ShippingMethod }
Expand Down Expand Up @@ -70,19 +71,23 @@ class CardBulkOrder < Lithic::Internal::Type::BaseModel
#
# @param shipping_address [Object] Shipping address for all cards in this bulk order
#
# @param shipping_method [Symbol, Lithic::Models::CardBulkOrder::ShippingMethod] Shipping method for all cards in this bulk order
# @param shipping_method [Symbol, Lithic::Models::CardBulkOrder::ShippingMethod] Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and
#
# @param status [Symbol, Lithic::Models::CardBulkOrder::Status] Status of the bulk order. OPEN indicates the order is accepting cards. LOCKED in
#
# @param updated [Time] An RFC 3339 timestamp for when the bulk order was last updated. UTC time zone

# Shipping method for all cards in this bulk order
# Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and
# BULK_EXPRESS are only available with Perfect Plastic Printing
#
# @see Lithic::Models::CardBulkOrder#shipping_method
module ShippingMethod
extend Lithic::Internal::Type::Enum

BULK_EXPEDITED = :BULK_EXPEDITED
BULK_PRIORITY = :BULK_PRIORITY
BULK_2_DAY = :BULK_2_DAY
BULK_EXPRESS = :BULK_EXPRESS

# @!method self.values
# @return [Array<Symbol>]
Expand Down
11 changes: 8 additions & 3 deletions lib/lithic/models/card_bulk_order_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class CardBulkOrderCreateParams < Lithic::Internal::Type::BaseModel
required :shipping_address, Lithic::Internal::Type::Unknown

# @!attribute shipping_method
# Shipping method for all cards in this bulk order
# Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and
# BULK_EXPRESS are only available with Perfect Plastic Printing
#
# @return [Symbol, Lithic::Models::CardBulkOrderCreateParams::ShippingMethod]
required :shipping_method, enum: -> { Lithic::CardBulkOrderCreateParams::ShippingMethod }
Expand All @@ -34,15 +35,19 @@ class CardBulkOrderCreateParams < Lithic::Internal::Type::BaseModel
#
# @param shipping_address [Object] Shipping address for all cards in this bulk order
#
# @param shipping_method [Symbol, Lithic::Models::CardBulkOrderCreateParams::ShippingMethod] Shipping method for all cards in this bulk order
# @param shipping_method [Symbol, Lithic::Models::CardBulkOrderCreateParams::ShippingMethod] Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and
#
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}]

# Shipping method for all cards in this bulk order
# Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and
# BULK_EXPRESS are only available with Perfect Plastic Printing
module ShippingMethod
extend Lithic::Internal::Type::Enum

BULK_EXPEDITED = :BULK_EXPEDITED
BULK_PRIORITY = :BULK_PRIORITY
BULK_2_DAY = :BULK_2_DAY
BULK_EXPRESS = :BULK_EXPRESS

# @!method self.values
# @return [Array<Symbol>]
Expand Down
8 changes: 5 additions & 3 deletions lib/lithic/models/card_convert_physical_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class CardConvertPhysicalParams < Lithic::Internal::Type::BaseModel
# tracking
# - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight
# or similar international option, with tracking
# - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping
# - `BULK` - Card will be shipped as part of a bulk fulfillment order. The
# shipping method and timeline are inherited from the parent bulk order.
#
# @return [Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod, nil]
optional :shipping_method, enum: -> { Lithic::CardConvertPhysicalParams::ShippingMethod }
Expand Down Expand Up @@ -82,12 +83,13 @@ class CardConvertPhysicalParams < Lithic::Internal::Type::BaseModel
# tracking
# - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight
# or similar international option, with tracking
# - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping
# - `BULK` - Card will be shipped as part of a bulk fulfillment order. The
# shipping method and timeline are inherited from the parent bulk order.
module ShippingMethod
extend Lithic::Internal::Type::Enum

SHIPPING_METHOD_2_DAY = :"2_DAY"
BULK_EXPEDITED = :BULK_EXPEDITED
BULK = :BULK
EXPEDITED = :EXPEDITED
EXPRESS = :EXPRESS
PRIORITY = :PRIORITY
Expand Down
8 changes: 5 additions & 3 deletions lib/lithic/models/card_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ class CardCreateParams < Lithic::Internal::Type::BaseModel
# tracking
# - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight
# or similar international option, with tracking
# - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping
# - `BULK` - Card will be shipped as part of a bulk fulfillment order. The
# shipping method and timeline are inherited from the parent bulk order.
#
# @return [Symbol, Lithic::Models::CardCreateParams::ShippingMethod, nil]
optional :shipping_method, enum: -> { Lithic::CardCreateParams::ShippingMethod }
Expand Down Expand Up @@ -369,12 +370,13 @@ module ReplacementSubstatus
# tracking
# - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight
# or similar international option, with tracking
# - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping
# - `BULK` - Card will be shipped as part of a bulk fulfillment order. The
# shipping method and timeline are inherited from the parent bulk order.
module ShippingMethod
extend Lithic::Internal::Type::Enum

SHIPPING_METHOD_2_DAY = :"2_DAY"
BULK_EXPEDITED = :BULK_EXPEDITED
BULK = :BULK
EXPEDITED = :EXPEDITED
EXPRESS = :EXPRESS
PRIORITY = :PRIORITY
Expand Down
8 changes: 5 additions & 3 deletions lib/lithic/models/card_reissue_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class CardReissueParams < Lithic::Internal::Type::BaseModel
# tracking
# - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight
# or similar international option, with tracking
# - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping
# - `BULK` - Card will be shipped as part of a bulk fulfillment order. The
# shipping method and timeline are inherited from the parent bulk order.
#
# @return [Symbol, Lithic::Models::CardReissueParams::ShippingMethod, nil]
optional :shipping_method, enum: -> { Lithic::CardReissueParams::ShippingMethod }
Expand Down Expand Up @@ -82,12 +83,13 @@ class CardReissueParams < Lithic::Internal::Type::BaseModel
# tracking
# - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight
# or similar international option, with tracking
# - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping
# - `BULK` - Card will be shipped as part of a bulk fulfillment order. The
# shipping method and timeline are inherited from the parent bulk order.
module ShippingMethod
extend Lithic::Internal::Type::Enum

SHIPPING_METHOD_2_DAY = :"2_DAY"
BULK_EXPEDITED = :BULK_EXPEDITED
BULK = :BULK
EXPEDITED = :EXPEDITED
EXPRESS = :EXPRESS
PRIORITY = :PRIORITY
Expand Down
8 changes: 5 additions & 3 deletions lib/lithic/models/card_renew_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class CardRenewParams < Lithic::Internal::Type::BaseModel
# tracking
# - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight
# or similar international option, with tracking
# - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping
# - `BULK` - Card will be shipped as part of a bulk fulfillment order. The
# shipping method and timeline are inherited from the parent bulk order.
#
# @return [Symbol, Lithic::Models::CardRenewParams::ShippingMethod, nil]
optional :shipping_method, enum: -> { Lithic::CardRenewParams::ShippingMethod }
Expand Down Expand Up @@ -100,12 +101,13 @@ class CardRenewParams < Lithic::Internal::Type::BaseModel
# tracking
# - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight
# or similar international option, with tracking
# - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping
# - `BULK` - Card will be shipped as part of a bulk fulfillment order. The
# shipping method and timeline are inherited from the parent bulk order.
module ShippingMethod
extend Lithic::Internal::Type::Enum

SHIPPING_METHOD_2_DAY = :"2_DAY"
BULK_EXPEDITED = :BULK_EXPEDITED
BULK = :BULK
EXPEDITED = :EXPEDITED
EXPRESS = :EXPRESS
PRIORITY = :PRIORITY
Expand Down
9 changes: 8 additions & 1 deletion lib/lithic/models/financial_accounts/statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ class Statement < Lithic::Internal::Type::BaseModel
# @return [Lithic::Models::FinancialAccounts::Statement::PayoffDetails, nil]
optional :payoff_details, -> { Lithic::FinancialAccounts::Statement::PayoffDetails }, nil?: true

# @!method initialize(token:, account_standing:, amount_due:, available_credit:, created:, credit_limit:, credit_product_token:, days_in_billing_cycle:, ending_balance:, financial_account_token:, payment_due_date:, period_totals:, starting_balance:, statement_end_date:, statement_start_date:, statement_type:, updated:, ytd_totals:, interest_details: nil, next_payment_due_date: nil, next_statement_end_date: nil, payoff_details: nil)
# @!attribute statement_totals
#
# @return [Lithic::Models::StatementTotals, nil]
optional :statement_totals, -> { Lithic::StatementTotals }

# @!method initialize(token:, account_standing:, amount_due:, available_credit:, created:, credit_limit:, credit_product_token:, days_in_billing_cycle:, ending_balance:, financial_account_token:, payment_due_date:, period_totals:, starting_balance:, statement_end_date:, statement_start_date:, statement_type:, updated:, ytd_totals:, interest_details: nil, next_payment_due_date: nil, next_statement_end_date: nil, payoff_details: nil, statement_totals: nil)
# Some parameter documentations has been truncated, see
# {Lithic::Models::FinancialAccounts::Statement} for more details.
#
Expand Down Expand Up @@ -179,6 +184,8 @@ class Statement < Lithic::Internal::Type::BaseModel
# @param next_statement_end_date [Date] Date when the next billing period will end
#
# @param payoff_details [Lithic::Models::FinancialAccounts::Statement::PayoffDetails, nil] Details on number and size of payments to pay off balance
#
# @param statement_totals [Lithic::Models::StatementTotals]

# @see Lithic::Models::FinancialAccounts::Statement#account_standing
class AccountStanding < Lithic::Internal::Type::BaseModel
Expand Down
Loading