diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b7b74c5..da59f99e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.4.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ddb484b7..021c6dec 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4ecc06edca2cfad4eaf11573611e89823fda5f56370bac5cd02a498a6b277d09.yml -openapi_spec_hash: 8f4a30bec4348cbde85b1e65bef9189a -config_hash: 9dddee5f7af579864599849cb28a0770 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d6e80e52c9f20d95780f2cf4869f80ee2c4b270ff9470941dc057e79d15bda1a.yml +openapi_spec_hash: f2bb7084cd5225769302589cd1563241 +config_hash: 31d71922d7838f34ae0875c9b8026d99 diff --git a/CHANGELOG.md b/CHANGELOG.md index 82022fd2..bf2e8169 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # Changelog +## 0.4.0 (2026-01-16) + +Full Changelog: [v0.3.0...v0.4.0](https://github.com/lithic-com/lithic-ruby/compare/v0.3.0...v0.4.0) + +### Features + +* **api:** Add card state attribute to tokenization rules ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) +* **api:** Add event_type to ASA request and 3DS decisioning request ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) +* **api:** Add idempotency key to cards POST and PATCH endpoints ([51321d8](https://github.com/lithic-com/lithic-ruby/commit/51321d8d84f5e1fcb4e9161dd607f01dc9d5cf5d)) +* **api:** Add user defined status to ledger accounts ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) +* **api:** Expose Payment Allocation Details ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) +* **api:** make filter optional for Spend Velocity Auth Rules ([3e09d4a](https://github.com/lithic-com/lithic-ruby/commit/3e09d4a5488c83ad8122c973baf5eb4e18de29b0)) + + +### Bug Fixes + +* **api:** Correct field name from ach_hold__period to ach_hold_period ([16b6555](https://github.com/lithic-com/lithic-ruby/commit/16b65553840cfad0d39eb52d9770ca394a893c44)) +* **api:** mark AppleWebPushProvisioningResponse fields required ([4105b29](https://github.com/lithic-com/lithic-ruby/commit/4105b29d27ce48c60180c5b7166e664fdd1c0e46)) +* **api:** rename WIRE_DRAWDOWN_REQUEST to WIRE_INBOUND_DRAWDOWN_REQUEST ([3e09d4a](https://github.com/lithic-com/lithic-ruby/commit/3e09d4a5488c83ad8122c973baf5eb4e18de29b0)) + + +### Chores + +* configure new SDK language ([ba770b2](https://github.com/lithic-com/lithic-ruby/commit/ba770b2cd5f50ba1871c539f89036ff4538b1df2)) +* **internal:** codegen related update ([ef965b2](https://github.com/lithic-com/lithic-ruby/commit/ef965b2fc0cfebc92a3d2317b7201318bcd500aa)) +* **internal:** codegen related update ([143a5ea](https://github.com/lithic-com/lithic-ruby/commit/143a5ea456ee1e6db32fd923ddb68f749ceed53b)) +* Rework event type generation to support spec splitting ([fdb9960](https://github.com/lithic-com/lithic-ruby/commit/fdb9960d08f95f161da8abf310509d594a0d2957)) +* update code formatting ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) + + +### Documentation + +* Update language for Google Web Push Provisioning docs ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) + ## 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) diff --git a/Gemfile.lock b/Gemfile.lock index ec7d09db..b3ae62c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,8 @@ GIT PATH remote: . specs: - lithic (0.3.0) + lithic (0.4.0) + cgi connection_pool GEM @@ -49,6 +50,7 @@ GEM base64 (0.3.0) benchmark (0.5.0) bigdecimal (3.3.1) + cgi (0.5.1) concurrent-ruby (1.3.5) connection_pool (2.5.4) console (1.34.2) diff --git a/README.md b/README.md index 2333dd34..69d956a4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "lithic", "~> 0.3.0" +gem "lithic", "~> 0.4.0" ``` diff --git a/lib/lithic/models/auth_rules/velocity_limit_params.rb b/lib/lithic/models/auth_rules/velocity_limit_params.rb index af706df4..55b2d7a4 100644 --- a/lib/lithic/models/auth_rules/velocity_limit_params.rb +++ b/lib/lithic/models/auth_rules/velocity_limit_params.rb @@ -4,11 +4,6 @@ module Lithic module Models module AuthRules class VelocityLimitParams < Lithic::Internal::Type::BaseModel - # @!attribute filters - # - # @return [Lithic::Models::AuthRules::VelocityLimitParams::Filters] - required :filters, -> { Lithic::AuthRules::VelocityLimitParams::Filters } - # @!attribute period # Velocity over the current day since 00:00 / 12 AM in Eastern Time # @@ -21,6 +16,11 @@ class VelocityLimitParams < Lithic::Internal::Type::BaseModel # @return [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] required :scope, enum: -> { Lithic::AuthRules::VelocityLimitParams::Scope } + # @!attribute filters + # + # @return [Lithic::Models::AuthRules::VelocityLimitParams::Filters, nil] + optional :filters, -> { Lithic::AuthRules::VelocityLimitParams::Filters } + # @!attribute limit_amount # The maximum amount of spend velocity allowed in the period in minor units (the # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this @@ -39,20 +39,33 @@ class VelocityLimitParams < Lithic::Internal::Type::BaseModel # @return [Integer, nil] optional :limit_count, Integer, nil?: true - # @!method initialize(filters:, period:, scope:, limit_amount: nil, limit_count: nil) + # @!method initialize(period:, scope:, filters: nil, limit_amount: nil, limit_count: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::AuthRules::VelocityLimitParams} for more details. # - # @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters] - # # @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] Velocity over the current day since 00:00 / 12 AM in Eastern Time # # @param scope [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] The scope the velocity is calculated for # + # @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters] + # # @param limit_amount [Integer, nil] The maximum amount of spend velocity allowed in the period in minor units (the s # # @param limit_count [Integer, nil] The number of spend velocity impacting transactions may not exceed this limit in + # The scope the velocity is calculated for + # + # @see Lithic::Models::AuthRules::VelocityLimitParams#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + # @!method self.values + # @return [Array] + end + # @see Lithic::Models::AuthRules::VelocityLimitParams#filters class Filters < Lithic::Internal::Type::BaseModel # @!attribute exclude_countries @@ -133,19 +146,6 @@ module IncludePanEntryMode # @return [Array] end end - - # The scope the velocity is calculated for - # - # @see Lithic::Models::AuthRules::VelocityLimitParams#scope - module Scope - extend Lithic::Internal::Type::Enum - - CARD = :CARD - ACCOUNT = :ACCOUNT - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/lithic/models/card_create_params.rb b/lib/lithic/models/card_create_params.rb index 02866cdf..7248d940 100644 --- a/lib/lithic/models/card_create_params.rb +++ b/lib/lithic/models/card_create_params.rb @@ -226,7 +226,12 @@ class CardCreateParams < Lithic::Internal::Type::BaseModel # @return [Symbol, Lithic::Models::CardCreateParams::State, nil] optional :state, enum: -> { Lithic::CardCreateParams::State } - # @!method initialize(type:, account_token: nil, bulk_order_token: nil, card_program_token: nil, carrier: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, memo: nil, pin: nil, product_id: nil, replacement_account_token: nil, replacement_comment: nil, replacement_for: nil, replacement_substatus: nil, shipping_address: nil, shipping_method: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, request_options: {}) + # @!attribute idempotency_key + # + # @return [String, nil] + optional :idempotency_key, String + + # @!method initialize(type:, account_token: nil, bulk_order_token: nil, card_program_token: nil, carrier: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, memo: nil, pin: nil, product_id: nil, replacement_account_token: nil, replacement_comment: nil, replacement_for: nil, replacement_substatus: nil, shipping_address: nil, shipping_method: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, idempotency_key: nil, request_options: {}) # Some parameter documentations has been truncated, see # {Lithic::Models::CardCreateParams} for more details. # @@ -270,6 +275,8 @@ class CardCreateParams < Lithic::Internal::Type::BaseModel # # @param state [Symbol, Lithic::Models::CardCreateParams::State] Card state values: # + # @param idempotency_key [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] # Card types: diff --git a/lib/lithic/models/card_web_provision_response.rb b/lib/lithic/models/card_web_provision_response.rb index c5371e02..2f20b874 100644 --- a/lib/lithic/models/card_web_provision_response.rb +++ b/lib/lithic/models/card_web_provision_response.rb @@ -14,16 +14,16 @@ class AppleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel # @!attribute jws # JWS object required for handoff to Apple's script. # - # @return [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, nil] - optional :jws, -> { Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws } + # @return [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws] + required :jws, -> { Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws } # @!attribute state # A unique identifier for the JWS object. # - # @return [String, nil] - optional :state, String + # @return [String] + required :state, String - # @!method initialize(jws: nil, state: nil) + # @!method initialize(jws:, state:) # @param jws [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws] JWS object required for handoff to Apple's script. # # @param state [String] A unique identifier for the JWS object. diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb index 68b8f367..aa25ca3c 100644 --- a/lib/lithic/models/payment.rb +++ b/lib/lithic/models/payment.rb @@ -650,7 +650,7 @@ module Type WIRE_INBOUND_ADMIN = :WIRE_INBOUND_ADMIN WIRE_OUTBOUND_PAYMENT = :WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN = :WIRE_OUTBOUND_ADMIN - WIRE_DRAWDOWN_REQUEST = :WIRE_DRAWDOWN_REQUEST + WIRE_INBOUND_DRAWDOWN_REQUEST = :WIRE_INBOUND_DRAWDOWN_REQUEST # @!method self.values # @return [Array] diff --git a/lib/lithic/models/payment_create_params.rb b/lib/lithic/models/payment_create_params.rb index ee1ae3a5..efba70e3 100644 --- a/lib/lithic/models/payment_create_params.rb +++ b/lib/lithic/models/payment_create_params.rb @@ -98,7 +98,7 @@ class MethodAttributes < Lithic::Internal::Type::BaseModel # Number of days to hold the ACH payment # # @return [Integer, nil] - optional :ach_hold_period, Integer, api_name: :ach_hold__period + optional :ach_hold_period, Integer # @!attribute addenda # diff --git a/lib/lithic/resources/cards.rb b/lib/lithic/resources/cards.rb index 5d7bd6cb..bcf5e7b3 100644 --- a/lib/lithic/resources/cards.rb +++ b/lib/lithic/resources/cards.rb @@ -15,47 +15,49 @@ class Cards # Create a new virtual or physical card. Parameters `shipping_address` and # `product_id` only apply to physical cards. # - # @overload create(type:, account_token: nil, bulk_order_token: nil, card_program_token: nil, carrier: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, memo: nil, pin: nil, product_id: nil, replacement_account_token: nil, replacement_comment: nil, replacement_for: nil, replacement_substatus: nil, shipping_address: nil, shipping_method: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, request_options: {}) + # @overload create(type:, account_token: nil, bulk_order_token: nil, card_program_token: nil, carrier: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, memo: nil, pin: nil, product_id: nil, replacement_account_token: nil, replacement_comment: nil, replacement_for: nil, replacement_substatus: nil, shipping_address: nil, shipping_method: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, idempotency_key: nil, request_options: {}) # - # @param type [Symbol, Lithic::Models::CardCreateParams::Type] Card types: + # @param type [Symbol, Lithic::Models::CardCreateParams::Type] Body param: Card types: # - # @param account_token [String] Globally unique identifier for the account that the card will be associated with + # @param account_token [String] Body param: Globally unique identifier for the account that the card will be ass # - # @param bulk_order_token [String] Globally unique identifier for an existing bulk order to associate this card wit + # @param bulk_order_token [String] Body param: Globally unique identifier for an existing bulk order to associate t # - # @param card_program_token [String] For card programs with more than one BIN range. This must be configured with Lit + # @param card_program_token [String] Body param: For card programs with more than one BIN range. This must be configu # - # @param carrier [Lithic::Models::Carrier] + # @param carrier [Lithic::Models::Carrier] Body param # - # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet afte + # @param digital_card_art_token [String] Body param: Specifies the digital card art to be displayed in the user’s digital # - # @param exp_month [String] Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # @param exp_month [String] Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` i # - # @param exp_year [String] Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided + # @param exp_year [String] Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` # - # @param memo [String] Friendly name to identify the card. + # @param memo [String] Body param: Friendly name to identify the card. # - # @param pin [String] Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and `VIRTUA + # @param pin [String] Body param: Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` # - # @param product_id [String] Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # @param product_id [String] Body param: Only applicable to cards of type `PHYSICAL`. This must be configured # - # @param replacement_account_token [String] Restricted field limited to select use cases. Lithic will reach out directly if + # @param replacement_account_token [String] Body param: Restricted field limited to select use cases. Lithic will reach out # - # @param replacement_comment [String] Additional context or information related to the card that this card will replac + # @param replacement_comment [String] Body param: Additional context or information related to the card that this card # - # @param replacement_for [String] Globally unique identifier for the card that this card will replace. If the card + # @param replacement_for [String] Body param: Globally unique identifier for the card that this card will replace. # - # @param replacement_substatus [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus] Card state substatus values for the card that this card will replace: + # @param replacement_substatus [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus] Body param: Card state substatus values for the card that this card will replace # - # @param shipping_address [Lithic::Models::ShippingAddress] + # @param shipping_address [Lithic::Models::ShippingAddress] Body param # - # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] Body param: Shipping method for the card. Only applies to cards of type PHYSICAL # - # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,00 + # @param spend_limit [Integer] Body param: Amount (in cents) to limit approved authorizations (e.g. 100000 woul # - # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Spend limit duration values: + # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Body param: Spend limit duration values: + # + # @param state [Symbol, Lithic::Models::CardCreateParams::State] Body param: Card state values: # - # @param state [Symbol, Lithic::Models::CardCreateParams::State] Card state values: + # @param idempotency_key [String] Header param: Idempotency key for the request # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -64,7 +66,15 @@ class Cards # @see Lithic::Models::CardCreateParams def create(params) parsed, options = Lithic::CardCreateParams.dump_request(params) - @client.request(method: :post, path: "v1/cards", body: parsed, model: Lithic::Card, options: options) + header_params = {idempotency_key: "idempotency-key"} + @client.request( + method: :post, + path: "v1/cards", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Lithic::Card, + options: options + ) end # Get card configuration such as spend limit and state. diff --git a/lib/lithic/resources/financial_accounts.rb b/lib/lithic/resources/financial_accounts.rb index ee7e18c0..fc2f9e9c 100644 --- a/lib/lithic/resources/financial_accounts.rb +++ b/lib/lithic/resources/financial_accounts.rb @@ -22,15 +22,15 @@ class FinancialAccounts # # @overload create(nickname:, type:, account_token: nil, is_for_benefit_of: nil, idempotency_key: nil, request_options: {}) # - # @param nickname [String] Body param: + # @param nickname [String] Body param # - # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] Body param: + # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] Body param # - # @param account_token [String] Body param: + # @param account_token [String] Body param # - # @param is_for_benefit_of [Boolean] Body param: + # @param is_for_benefit_of [Boolean] Body param # - # @param idempotency_key [String] Header param: + # @param idempotency_key [String] Header param: Idempotency key for the request # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index 5040b33e..3586eca7 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lithic - VERSION = "0.3.0" + VERSION = "0.4.0" end diff --git a/lithic.gemspec b/lithic.gemspec index fb28b4e3..004e5d22 100644 --- a/lithic.gemspec +++ b/lithic.gemspec @@ -24,5 +24,6 @@ Gem::Specification.new do |s| ".ignore" ] s.extra_rdoc_files = ["README.md"] + s.add_dependency "cgi" s.add_dependency "connection_pool" end diff --git a/rbi/lithic/models/auth_rules/velocity_limit_params.rbi b/rbi/lithic/models/auth_rules/velocity_limit_params.rbi index a7fa0ed9..c9026a50 100644 --- a/rbi/lithic/models/auth_rules/velocity_limit_params.rbi +++ b/rbi/lithic/models/auth_rules/velocity_limit_params.rbi @@ -12,16 +12,6 @@ module Lithic ) end - sig { returns(Lithic::AuthRules::VelocityLimitParams::Filters) } - attr_reader :filters - - sig do - params( - filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash - ).void - end - attr_writer :filters - # Velocity over the current day since 00:00 / 12 AM in Eastern Time sig do returns( @@ -40,6 +30,18 @@ module Lithic sig { returns(Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol) } attr_accessor :scope + sig do + returns(T.nilable(Lithic::AuthRules::VelocityLimitParams::Filters)) + end + attr_reader :filters + + sig do + params( + filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash + ).void + end + attr_writer :filters + # The maximum amount of spend velocity allowed in the period in minor units (the # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this # limit will be declined. @@ -56,7 +58,6 @@ module Lithic sig do params( - filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash, period: T.any( Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, @@ -66,16 +67,17 @@ module Lithic Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash ), scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol, + filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash, limit_amount: T.nilable(Integer), limit_count: T.nilable(Integer) ).returns(T.attached_class) end def self.new( - filters:, # Velocity over the current day since 00:00 / 12 AM in Eastern Time period:, # The scope the velocity is calculated for scope:, + filters: nil, # The maximum amount of spend velocity allowed in the period in minor units (the # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this # limit will be declined. @@ -92,7 +94,6 @@ module Lithic sig do override.returns( { - filters: Lithic::AuthRules::VelocityLimitParams::Filters, period: T.any( Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, @@ -102,6 +103,7 @@ module Lithic Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear ), scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol, + filters: Lithic::AuthRules::VelocityLimitParams::Filters, limit_amount: T.nilable(Integer), limit_count: T.nilable(Integer) } @@ -110,6 +112,38 @@ module Lithic def to_hash end + # The scope the velocity is calculated for + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + class Filters < Lithic::Internal::Type::BaseModel OrHash = T.type_alias do @@ -307,38 +341,6 @@ module Lithic end end end - - # The scope the velocity is calculated for - module Scope - extend Lithic::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CARD = - T.let( - :CARD, - Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol - ) - ACCOUNT = - T.let( - :ACCOUNT, - Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/lithic/models/card_create_params.rbi b/rbi/lithic/models/card_create_params.rbi index 7e6901cc..ba208800 100644 --- a/rbi/lithic/models/card_create_params.rbi +++ b/rbi/lithic/models/card_create_params.rbi @@ -264,6 +264,12 @@ module Lithic sig { params(state: Lithic::CardCreateParams::State::OrSymbol).void } attr_writer :state + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + sig do params( type: Lithic::CardCreateParams::Type::OrSymbol, @@ -287,6 +293,7 @@ module Lithic spend_limit: Integer, spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, request_options: Lithic::RequestOptions::OrHash ).returns(T.attached_class) end @@ -430,6 +437,7 @@ module Lithic # - `PAUSED` - Card will decline authorizations, but can be resumed at a later # time. state: nil, + idempotency_key: nil, request_options: {} ) end @@ -458,6 +466,7 @@ module Lithic spend_limit: Integer, spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, request_options: Lithic::RequestOptions } ) diff --git a/rbi/lithic/models/card_web_provision_response.rbi b/rbi/lithic/models/card_web_provision_response.rbi index fb68bbba..ad66b2d1 100644 --- a/rbi/lithic/models/card_web_provision_response.rbi +++ b/rbi/lithic/models/card_web_provision_response.rbi @@ -25,9 +25,7 @@ module Lithic # JWS object required for handoff to Apple's script. sig do returns( - T.nilable( - Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws - ) + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws ) end attr_reader :jws @@ -41,11 +39,8 @@ module Lithic attr_writer :jws # A unique identifier for the JWS object. - sig { returns(T.nilable(String)) } - attr_reader :state - - sig { params(state: String).void } - attr_writer :state + sig { returns(String) } + attr_accessor :state sig do params( @@ -56,9 +51,9 @@ module Lithic end def self.new( # JWS object required for handoff to Apple's script. - jws: nil, + jws:, # A unique identifier for the JWS object. - state: nil + state: ) end diff --git a/rbi/lithic/models/payment.rbi b/rbi/lithic/models/payment.rbi index 523b96dc..28dd76eb 100644 --- a/rbi/lithic/models/payment.rbi +++ b/rbi/lithic/models/payment.rbi @@ -1061,8 +1061,11 @@ module Lithic T.let(:WIRE_OUTBOUND_PAYMENT, Lithic::Payment::Type::TaggedSymbol) WIRE_OUTBOUND_ADMIN = T.let(:WIRE_OUTBOUND_ADMIN, Lithic::Payment::Type::TaggedSymbol) - WIRE_DRAWDOWN_REQUEST = - T.let(:WIRE_DRAWDOWN_REQUEST, Lithic::Payment::Type::TaggedSymbol) + WIRE_INBOUND_DRAWDOWN_REQUEST = + T.let( + :WIRE_INBOUND_DRAWDOWN_REQUEST, + Lithic::Payment::Type::TaggedSymbol + ) sig { override.returns(T::Array[Lithic::Payment::Type::TaggedSymbol]) } def self.values diff --git a/rbi/lithic/resources/cards.rbi b/rbi/lithic/resources/cards.rbi index 733e5ad2..a6dde942 100644 --- a/rbi/lithic/resources/cards.rbi +++ b/rbi/lithic/resources/cards.rbi @@ -34,11 +34,12 @@ module Lithic spend_limit: Integer, spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, request_options: Lithic::RequestOptions::OrHash ).returns(Lithic::Card) end def create( - # Card types: + # Body param: Card types: # # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital # wallet like Apple Pay or Google Pay (if the card program is digital @@ -55,58 +56,60 @@ module Lithic # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please # use VIRTUAL instead. type:, - # Globally unique identifier for the account that the card will be associated - # with. Required for programs enrolling users using the + # Body param: Globally unique identifier for the account that the card will be + # associated with. Required for programs enrolling users using the # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). # See [Managing Your Program](doc:managing-your-program) for more information. account_token: nil, - # Globally unique identifier for an existing bulk order to associate this card - # with. When specified, the card will be added to the bulk order for batch - # shipment. Only applicable to cards of type PHYSICAL + # Body param: Globally unique identifier for an existing bulk order to associate + # this card with. When specified, the card will be added to the bulk order for + # batch shipment. Only applicable to cards of type PHYSICAL bulk_order_token: nil, - # For card programs with more than one BIN range. This must be configured with - # Lithic before use. Identifies the card program/BIN range under which to create - # the card. If omitted, will utilize the program's default `card_program_token`. - # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # Body param: For card programs with more than one BIN range. This must be + # configured with Lithic before use. Identifies the card program/BIN range under + # which to create the card. If omitted, will utilize the program's default + # `card_program_token`. In Sandbox, use 00000000-0000-0000-1000-000000000000 and # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card # programs. card_program_token: nil, + # Body param carrier: nil, - # Specifies the digital card art to be displayed in the user’s digital wallet - # after tokenization. This artwork must be approved by Mastercard and configured - # by Lithic to use. See + # Body param: Specifies the digital card art to be displayed in the user’s digital + # wallet after tokenization. This artwork must be approved by Mastercard and + # configured by Lithic to use. See # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). digital_card_art_token: nil, - # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - # an expiration date will be generated. + # Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` + # is provided, an expiration date will be generated. exp_month: nil, - # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - # provided, an expiration date will be generated. + # Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` + # is provided, an expiration date will be generated. exp_year: nil, - # Friendly name to identify the card. + # Body param: Friendly name to identify the card. memo: nil, - # Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and - # `VIRTUAL`. See + # Body param: Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` + # and `VIRTUAL`. See # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). pin: nil, - # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic - # before use. Specifies the configuration (i.e., physical card art) that the card - # should be manufactured with. + # Body param: Only applicable to cards of type `PHYSICAL`. This must be configured + # with Lithic before use. Specifies the configuration (i.e., physical card art) + # that the card should be manufactured with. product_id: nil, - # Restricted field limited to select use cases. Lithic will reach out directly if - # this field should be used. Globally unique identifier for the replacement card's - # account. If this field is specified, `replacement_for` must also be specified. - # If `replacement_for` is specified and this field is omitted, the replacement - # card's account will be inferred from the card being replaced. + # Body param: Restricted field limited to select use cases. Lithic will reach out + # directly if this field should be used. Globally unique identifier for the + # replacement card's account. If this field is specified, `replacement_for` must + # also be specified. If `replacement_for` is specified and this field is omitted, + # the replacement card's account will be inferred from the card being replaced. replacement_account_token: nil, - # Additional context or information related to the card that this card will - # replace. + # Body param: Additional context or information related to the card that this card + # will replace. replacement_comment: nil, - # Globally unique identifier for the card that this card will replace. If the card - # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is - # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + # Body param: Globally unique identifier for the card that this card will replace. + # If the card type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the + # card type is `VIRTUAL` it will be replaced by a `VIRTUAL` card. replacement_for: nil, - # Card state substatus values for the card that this card will replace: + # Body param: Card state substatus values for the card that this card will + # replace: # # - `LOST` - The physical card is no longer in the cardholder's possession due to # being lost or never received by the cardholder. @@ -134,9 +137,10 @@ module Lithic # - `OTHER` - The reason for the status does not fall into any of the above # categories. A comment should be provided to specify the reason. replacement_substatus: nil, + # Body param shipping_address: nil, - # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of - # options besides `STANDARD` require additional permissions. + # Body param: Shipping method for the card. Only applies to cards of type + # PHYSICAL. Use of options besides `STANDARD` require additional permissions. # # - `STANDARD` - USPS regular mail or similar international option, with no # tracking @@ -151,13 +155,13 @@ module Lithic # or similar international option, with tracking # - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping shipping_method: nil, - # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a - # $1,000 limit). Transaction requests above the spend limit will be declined. Note - # that a spend limit of 0 is effectively no limit, and should only be used to - # reset or remove a prior limit. Only a limit of 1 or above will result in - # declined transactions due to checks against the card limit. + # Body param: Amount (in cents) to limit approved authorizations (e.g. 100000 + # would be a $1,000 limit). Transaction requests above the spend limit will be + # declined. Note that a spend limit of 0 is effectively no limit, and should only + # be used to reset or remove a prior limit. Only a limit of 1 or above will result + # in declined transactions due to checks against the card limit. spend_limit: nil, - # Spend limit duration values: + # Body param: Spend limit duration values: # # - `ANNUALLY` - Card will authorize transactions up to spend limit for the # trailing year. @@ -170,13 +174,15 @@ module Lithic # - `TRANSACTION` - Card will authorize multiple transactions if each individual # transaction is under the spend limit. spend_limit_duration: nil, - # Card state values: + # Body param: Card state values: # # - `OPEN` - Card will approve authorizations (if they match card and account # parameters). # - `PAUSED` - Card will decline authorizations, but can be resumed at a later # time. state: nil, + # Header param: Idempotency key for the request + idempotency_key: nil, request_options: {} ) end diff --git a/rbi/lithic/resources/financial_accounts.rbi b/rbi/lithic/resources/financial_accounts.rbi index 66e0ac9e..fddebdd4 100644 --- a/rbi/lithic/resources/financial_accounts.rbi +++ b/rbi/lithic/resources/financial_accounts.rbi @@ -32,15 +32,15 @@ module Lithic ).returns(Lithic::FinancialAccount) end def create( - # Body param: + # Body param nickname:, - # Body param: + # Body param type:, - # Body param: + # Body param account_token: nil, - # Body param: + # Body param is_for_benefit_of: nil, - # Header param: + # Header param: Idempotency key for the request idempotency_key: nil, request_options: {} ) diff --git a/rbi/lithic/resources/webhooks.rbi b/rbi/lithic/resources/webhooks.rbi index 767a2dfd..1d887194 100644 --- a/rbi/lithic/resources/webhooks.rbi +++ b/rbi/lithic/resources/webhooks.rbi @@ -8,7 +8,67 @@ module Lithic payload: String, headers: T::Hash[String, String], secret: T.nilable(String) - ).returns(Lithic::ParsedWebhookEvent::Variants) + ).returns( + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::CardAuthorizationApprovalRequestWebhookEvent, + Lithic::TokenizationDecisioningRequestWebhookEvent, + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::BalanceUpdatedWebhookEvent, + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::CardCreatedWebhookEvent, + Lithic::CardConvertedWebhookEvent, + Lithic::CardRenewedWebhookEvent, + Lithic::CardReissuedWebhookEvent, + Lithic::CardShippedWebhookEvent, + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::DisputeUpdatedWebhookEvent, + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::FundingEventCreatedWebhookEvent, + Lithic::LoanTapeCreatedWebhookEvent, + Lithic::LoanTapeUpdatedWebhookEvent, + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::StatementsCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::TokenizationResultWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent, + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::DisputeTransactionUpdatedWebhookEvent + ) + ) end def parse(payload, headers:, secret: nil) end diff --git a/sig/lithic/models/auth_rules/velocity_limit_params.rbs b/sig/lithic/models/auth_rules/velocity_limit_params.rbs index 709c43fb..d85272ca 100644 --- a/sig/lithic/models/auth_rules/velocity_limit_params.rbs +++ b/sig/lithic/models/auth_rules/velocity_limit_params.rbs @@ -3,40 +3,55 @@ module Lithic module AuthRules type velocity_limit_params = { - filters: Lithic::AuthRules::VelocityLimitParams::Filters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + filters: Lithic::AuthRules::VelocityLimitParams::Filters, limit_amount: Integer?, limit_count: Integer? } class VelocityLimitParams < Lithic::Internal::Type::BaseModel - attr_accessor filters: Lithic::AuthRules::VelocityLimitParams::Filters - attr_accessor period: Lithic::Models::AuthRules::velocity_limit_period attr_accessor scope: Lithic::Models::AuthRules::VelocityLimitParams::scope + attr_reader filters: Lithic::AuthRules::VelocityLimitParams::Filters? + + def filters=: ( + Lithic::AuthRules::VelocityLimitParams::Filters + ) -> Lithic::AuthRules::VelocityLimitParams::Filters + attr_accessor limit_amount: Integer? attr_accessor limit_count: Integer? def initialize: ( - filters: Lithic::AuthRules::VelocityLimitParams::Filters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + ?filters: Lithic::AuthRules::VelocityLimitParams::Filters, ?limit_amount: Integer?, ?limit_count: Integer? ) -> void def to_hash: -> { - filters: Lithic::AuthRules::VelocityLimitParams::Filters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + filters: Lithic::AuthRules::VelocityLimitParams::Filters, limit_amount: Integer?, limit_count: Integer? } + type scope = :CARD | :ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope] + end + type filters = { exclude_countries: ::Array[String]?, @@ -112,17 +127,6 @@ module Lithic def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::Filters::include_pan_entry_mode] end end - - type scope = :CARD | :ACCOUNT - - module Scope - extend Lithic::Internal::Type::Enum - - CARD: :CARD - ACCOUNT: :ACCOUNT - - def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope] - end end end end diff --git a/sig/lithic/models/card_create_params.rbs b/sig/lithic/models/card_create_params.rbs index edc57451..8ea307b4 100644 --- a/sig/lithic/models/card_create_params.rbs +++ b/sig/lithic/models/card_create_params.rbs @@ -21,7 +21,8 @@ module Lithic shipping_method: Lithic::Models::CardCreateParams::shipping_method, spend_limit: Integer, spend_limit_duration: Lithic::Models::spend_limit_duration, - state: Lithic::Models::CardCreateParams::state + state: Lithic::Models::CardCreateParams::state, + idempotency_key: String } & Lithic::Internal::Type::request_parameters @@ -117,6 +118,10 @@ module Lithic Lithic::Models::CardCreateParams::state ) -> Lithic::Models::CardCreateParams::state + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + def initialize: ( type: Lithic::Models::CardCreateParams::type_, ?account_token: String, @@ -138,6 +143,7 @@ module Lithic ?spend_limit: Integer, ?spend_limit_duration: Lithic::Models::spend_limit_duration, ?state: Lithic::Models::CardCreateParams::state, + ?idempotency_key: String, ?request_options: Lithic::request_opts ) -> void @@ -162,6 +168,7 @@ module Lithic spend_limit: Integer, spend_limit_duration: Lithic::Models::spend_limit_duration, state: Lithic::Models::CardCreateParams::state, + idempotency_key: String, request_options: Lithic::RequestOptions } diff --git a/sig/lithic/models/card_web_provision_response.rbs b/sig/lithic/models/card_web_provision_response.rbs index 59537141..2f4fa578 100644 --- a/sig/lithic/models/card_web_provision_response.rbs +++ b/sig/lithic/models/card_web_provision_response.rbs @@ -14,19 +14,13 @@ module Lithic } class AppleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel - attr_reader jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws? + attr_accessor jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws - def jws=: ( - Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws - ) -> Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws - - attr_reader state: String? - - def state=: (String) -> String + attr_accessor state: String def initialize: ( - ?jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, - ?state: String + jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, + state: String ) -> void def to_hash: -> { diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs index 3fbdbd5b..e908b268 100644 --- a/sig/lithic/models/payment.rbs +++ b/sig/lithic/models/payment.rbs @@ -524,7 +524,7 @@ module Lithic | :WIRE_INBOUND_ADMIN | :WIRE_OUTBOUND_PAYMENT | :WIRE_OUTBOUND_ADMIN - | :WIRE_DRAWDOWN_REQUEST + | :WIRE_INBOUND_DRAWDOWN_REQUEST module Type extend Lithic::Internal::Type::Enum @@ -537,7 +537,7 @@ module Lithic WIRE_INBOUND_ADMIN: :WIRE_INBOUND_ADMIN WIRE_OUTBOUND_PAYMENT: :WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN: :WIRE_OUTBOUND_ADMIN - WIRE_DRAWDOWN_REQUEST: :WIRE_DRAWDOWN_REQUEST + WIRE_INBOUND_DRAWDOWN_REQUEST: :WIRE_INBOUND_DRAWDOWN_REQUEST def self?.values: -> ::Array[Lithic::Models::Payment::type_] end diff --git a/sig/lithic/resources/cards.rbs b/sig/lithic/resources/cards.rbs index ef8d2773..b8288b8f 100644 --- a/sig/lithic/resources/cards.rbs +++ b/sig/lithic/resources/cards.rbs @@ -26,6 +26,7 @@ module Lithic ?spend_limit: Integer, ?spend_limit_duration: Lithic::Models::spend_limit_duration, ?state: Lithic::Models::CardCreateParams::state, + ?idempotency_key: String, ?request_options: Lithic::request_opts ) -> Lithic::Card