diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f7014c35..a7130553 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.11.0" + ".": "0.12.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d1255ff6..1a1957f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fd53f07a8b1f148011972d7eba834d5995778d707ff8ef1ead92580b44142a15.yml -openapi_spec_hash: 45892e6361542824364d82181d4eb80d -config_hash: 5eca052bb23d273fa970eac3127dd919 +configured_endpoints: 191 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d29b68bb85936070878d8badaa8a7c5991313285e70a990bc812c838eba85373.yml +openapi_spec_hash: 54b44da68df22eb0ea99f2bc564667a2 +config_hash: ac8326134e692f3f3bdec82396bbec80 diff --git a/CHANGELOG.md b/CHANGELOG.md index 47f3158b..88ae7832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.12.0 (2026-04-20) + +Full Changelog: [v0.11.0...v0.12.0](https://github.com/lithic-com/lithic-ruby/compare/v0.11.0...v0.12.0) + +### Features + +* **api:** Add card_authorization.challenge_response webhook ([8abc734](https://github.com/lithic-com/lithic-ruby/commit/8abc7348e6ed248c532058d68388fc357e54f65f)) +* **api:** Add card/account/business account signals endpoints and behavioral rule attributes ([76de3de](https://github.com/lithic-com/lithic-ruby/commit/76de3de7a510e54712be632789e90457b7486f3d)) +* **api:** add set_verification_method to external_bank_accounts ([3878cb3](https://github.com/lithic-com/lithic-ruby/commit/3878cb30db9f591d2070bed948cc40da07dd3f0e)) + ## 0.11.0 (2026-04-13) Full Changelog: [v0.10.0...v0.11.0](https://github.com/lithic-com/lithic-ruby/compare/v0.10.0...v0.11.0) diff --git a/Gemfile.lock b/Gemfile.lock index 8db6021d..f4ee606a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - lithic (0.11.0) + lithic (0.12.0) cgi connection_pool diff --git a/README.md b/README.md index ed016fd5..e1731131 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "lithic", "~> 0.11.0" +gem "lithic", "~> 0.12.0" ``` diff --git a/lib/lithic.rb b/lib/lithic.rb index bd345350..8a27d74c 100644 --- a/lib/lithic.rb +++ b/lib/lithic.rb @@ -168,6 +168,7 @@ require_relative "lithic/models/book_transfer_transaction_updated_webhook_event" require_relative "lithic/models/card" require_relative "lithic/models/card_authorization_approval_request_webhook_event" +require_relative "lithic/models/card_authorization_challenge_response_webhook_event" require_relative "lithic/models/card_bulk_order" require_relative "lithic/models/card_bulk_order_create_params" require_relative "lithic/models/card_bulk_order_list_params" @@ -270,6 +271,7 @@ require_relative "lithic/models/external_bank_account_retry_prenote_params" require_relative "lithic/models/external_bank_accounts/micro_deposit_create_params" require_relative "lithic/models/external_bank_accounts/micro_deposit_create_response" +require_relative "lithic/models/external_bank_account_set_verification_method_params" require_relative "lithic/models/external_bank_account_unpause_params" require_relative "lithic/models/external_bank_account_updated_webhook_event" require_relative "lithic/models/external_bank_account_update_params" diff --git a/lib/lithic/models.rb b/lib/lithic/models.rb index e8b01997..baf6f347 100644 --- a/lib/lithic/models.rb +++ b/lib/lithic/models.rb @@ -131,6 +131,9 @@ module Lithic CardAuthorizationApprovalRequestWebhookEvent = Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent + CardAuthorizationChallengeResponseWebhookEvent = + Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent + CardBulkOrder = Lithic::Models::CardBulkOrder CardBulkOrderCreateParams = Lithic::Models::CardBulkOrderCreateParams @@ -297,6 +300,9 @@ module Lithic ExternalBankAccounts = Lithic::Models::ExternalBankAccounts + ExternalBankAccountSetVerificationMethodParams = + Lithic::Models::ExternalBankAccountSetVerificationMethodParams + ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent diff --git a/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb b/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb index 02996e02..b72676b9 100644 --- a/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb +++ b/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb @@ -107,6 +107,33 @@ class Condition < Lithic::Internal::Type::BaseModel # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time # of the authorization. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity. Requires `parameters.scope`. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. # # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute] required :attribute, @@ -124,7 +151,18 @@ class Condition < Lithic::Internal::Type::BaseModel # @return [String, Integer, Array, Time] required :value, union: -> { Lithic::AuthRules::ConditionalValue } - # @!method initialize(attribute:, operation:, value:) + # @!attribute parameters + # Additional parameters required for transaction history signal attributes. + # Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes. + # + # @return [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters, nil] + optional :parameters, + -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters } + + # @!method initialize(attribute:, operation:, value:, parameters: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition} # for more details. @@ -134,6 +172,8 @@ class Condition < Lithic::Internal::Type::BaseModel # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute # # @param value [String, Integer, Array, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @param parameters [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters] Additional parameters required for transaction history signal attributes. Requir # The attribute to target. # @@ -206,6 +246,33 @@ class Condition < Lithic::Internal::Type::BaseModel # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time # of the authorization. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity. Requires `parameters.scope`. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. # # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#attribute module Attribute @@ -237,10 +304,85 @@ module Attribute SERVICE_LOCATION_POSTAL_CODE = :SERVICE_LOCATION_POSTAL_CODE CARD_AGE = :CARD_AGE ACCOUNT_AGE = :ACCOUNT_AGE + AMOUNT_Z_SCORE = :AMOUNT_Z_SCORE + AVG_TRANSACTION_AMOUNT = :AVG_TRANSACTION_AMOUNT + STDEV_TRANSACTION_AMOUNT = :STDEV_TRANSACTION_AMOUNT + IS_NEW_COUNTRY = :IS_NEW_COUNTRY + IS_NEW_MCC = :IS_NEW_MCC + IS_FIRST_TRANSACTION = :IS_FIRST_TRANSACTION + CONSECUTIVE_DECLINES = :CONSECUTIVE_DECLINES + TIME_SINCE_LAST_TRANSACTION = :TIME_SINCE_LAST_TRANSACTION + DISTINCT_COUNTRY_COUNT = :DISTINCT_COUNTRY_COUNT + THREE_DS_SUCCESS_RATE = :THREE_DS_SUCCESS_RATE # @!method self.values # @return [Array] end + + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#parameters + class Parameters < Lithic::Internal::Type::BaseModel + # @!attribute interval + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval, nil] + optional :interval, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval } + + # @!attribute scope + # The entity scope to evaluate the attribute against. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope, nil] + optional :scope, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope } + + # @!method initialize(interval: nil, scope: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters} + # for more details. + # + # Additional parameters required for transaction history signal attributes. + # Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes. + # + # @param interval [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval] The time window for statistical attributes (`AMOUNT_Z_SCORE`, `AVG_TRANSACTION_A + # + # @param scope [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope] The entity scope to evaluate the attribute against. + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters#interval + module Interval + extend Lithic::Internal::Type::Enum + + LIFETIME = :LIFETIME + INTERVAL_7_D = :"7D" + INTERVAL_30_D = :"30D" + INTERVAL_90_D = :"90D" + + # @!method self.values + # @return [Array] + end + + # The entity scope to evaluate the attribute against. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/lithic/models/auth_rules/rule_feature.rb b/lib/lithic/models/auth_rules/rule_feature.rb index f798a60b..b861735a 100644 --- a/lib/lithic/models/auth_rules/rule_feature.rb +++ b/lib/lithic/models/auth_rules/rule_feature.rb @@ -24,6 +24,10 @@ module AuthRules # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires # `scope`, `period`, and optionally `filters` to configure the velocity # calculation. Available for AUTHORIZATION event stream rules. + # - `TRANSACTION_HISTORY_SIGNALS`: Behavioral feature state derived from the + # entity's transaction history. Requires `scope` to specify whether to load + # card, account, or business account history. Available for AUTHORIZATION event + # stream rules. module RuleFeature extend Lithic::Internal::Type::Union @@ -43,6 +47,8 @@ module RuleFeature variant -> { Lithic::AuthRules::RuleFeature::SpendVelocityFeature } + variant -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature } + class AuthorizationFeature < Lithic::Internal::Type::BaseModel # @!attribute type # @@ -223,8 +229,48 @@ module Scope end end + class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel + # @!attribute scope + # The entity scope to load transaction history signals for. + # + # @return [Symbol, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope] + required :scope, enum: -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope } + + # @!attribute type + # + # @return [Symbol, :TRANSACTION_HISTORY_SIGNALS] + required :type, const: :TRANSACTION_HISTORY_SIGNALS + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(scope:, name: nil, type: :TRANSACTION_HISTORY_SIGNALS) + # @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope] The entity scope to load transaction history signals for. + # + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :TRANSACTION_HISTORY_SIGNALS] + + # The entity scope to load transaction history signals for. + # + # @see Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT + + # @!method self.values + # @return [Array] + end + end + # @!method self.variants - # @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature)] + # @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature)] end end end diff --git a/lib/lithic/models/auth_rules/typescript_code_parameters.rb b/lib/lithic/models/auth_rules/typescript_code_parameters.rb index 0eb2bd6a..f5aa389b 100644 --- a/lib/lithic/models/auth_rules/typescript_code_parameters.rb +++ b/lib/lithic/models/auth_rules/typescript_code_parameters.rb @@ -15,7 +15,7 @@ class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel # @!attribute features # Features available to the TypeScript code at evaluation time # - # @return [Array] + # @return [Array] required :features, -> { Lithic::Internal::Type::ArrayOf[union: Lithic::AuthRules::RuleFeature] } # @!method initialize(code:, features:) @@ -26,7 +26,7 @@ class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel # # @param code [String] The TypeScript source code of the rule. Must define a `rule()` function that acc # - # @param features [Array] Features available to the TypeScript code at evaluation time + # @param features [Array] Features available to the TypeScript code at evaluation time end end end diff --git a/lib/lithic/models/card_authorization_challenge_response_webhook_event.rb b/lib/lithic/models/card_authorization_challenge_response_webhook_event.rb new file mode 100644 index 00000000..e02210c7 --- /dev/null +++ b/lib/lithic/models/card_authorization_challenge_response_webhook_event.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardAuthorizationChallengeResponseWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute card_token + # The token of the card associated with the challenge + # + # @return [String, nil] + required :card_token, String, nil?: true + + # @!attribute challenge_method + # The method used to deliver the challenge to the cardholder + # + # @return [Symbol, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod] + required :challenge_method, + enum: -> { Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod } + + # @!attribute completed + # The timestamp of when the challenge was completed + # + # @return [Time, nil] + required :completed, Time, nil?: true + + # @!attribute created + # The timestamp of when the challenge was created + # + # @return [Time] + required :created, Time + + # @!attribute event_token + # Globally unique identifier for the event + # + # @return [String] + required :event_token, String + + # @!attribute event_type + # Event type + # + # @return [Symbol, :"card_authorization.challenge_response"] + required :event_type, const: :"card_authorization.challenge_response" + + # @!attribute response + # The cardholder's response to the challenge + # + # @return [Symbol, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::Response] + required :response, enum: -> { Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response } + + # @!attribute transaction_token + # The token of the transaction associated with the authorization event being + # challenged + # + # @return [String, nil] + required :transaction_token, String, nil?: true + + # @!method initialize(card_token:, challenge_method:, completed:, created:, event_token:, response:, transaction_token:, event_type: :"card_authorization.challenge_response") + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent} for more + # details. + # + # @param card_token [String, nil] The token of the card associated with the challenge + # + # @param challenge_method [Symbol, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod] The method used to deliver the challenge to the cardholder + # + # @param completed [Time, nil] The timestamp of when the challenge was completed + # + # @param created [Time] The timestamp of when the challenge was created + # + # @param event_token [String] Globally unique identifier for the event + # + # @param response [Symbol, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::Response] The cardholder's response to the challenge + # + # @param transaction_token [String, nil] The token of the transaction associated with the authorization event being chall + # + # @param event_type [Symbol, :"card_authorization.challenge_response"] Event type + + # The method used to deliver the challenge to the cardholder + # + # @see Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent#challenge_method + module ChallengeMethod + extend Lithic::Internal::Type::Enum + + SMS = :SMS + + # @!method self.values + # @return [Array] + end + + # The cardholder's response to the challenge + # + # @see Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent#response + module Response + extend Lithic::Internal::Type::Enum + + APPROVE = :APPROVE + DECLINE = :DECLINE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/event.rb b/lib/lithic/models/event.rb index 7e6e3518..1200cb2e 100644 --- a/lib/lithic/models/event.rb +++ b/lib/lithic/models/event.rb @@ -33,6 +33,8 @@ class Event < Lithic::Internal::Type::BaseModel # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -154,6 +156,8 @@ class Event < Lithic::Internal::Type::BaseModel # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -251,6 +255,7 @@ module EventType BALANCE_UPDATED = :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED = :"card_transaction.updated" diff --git a/lib/lithic/models/event_list_params.rb b/lib/lithic/models/event_list_params.rb index 401041fe..9f0abb9a 100644 --- a/lib/lithic/models/event_list_params.rb +++ b/lib/lithic/models/event_list_params.rb @@ -87,6 +87,8 @@ class EventListParams < Lithic::Internal::Type::BaseModel # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -182,6 +184,7 @@ module EventType BALANCE_UPDATED = :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED = :"card_transaction.updated" diff --git a/lib/lithic/models/event_subscription.rb b/lib/lithic/models/event_subscription.rb index 3e17e7e0..b332a538 100644 --- a/lib/lithic/models/event_subscription.rb +++ b/lib/lithic/models/event_subscription.rb @@ -60,6 +60,8 @@ class EventSubscription < Lithic::Internal::Type::BaseModel # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -155,6 +157,7 @@ module EventType BALANCE_UPDATED = :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED = :"card_transaction.updated" diff --git a/lib/lithic/models/events/subscription_create_params.rb b/lib/lithic/models/events/subscription_create_params.rb index d18eb93f..4b91b304 100644 --- a/lib/lithic/models/events/subscription_create_params.rb +++ b/lib/lithic/models/events/subscription_create_params.rb @@ -62,6 +62,8 @@ class SubscriptionCreateParams < Lithic::Internal::Type::BaseModel # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -157,6 +159,7 @@ module EventType BALANCE_UPDATED = :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED = :"card_transaction.updated" diff --git a/lib/lithic/models/events/subscription_send_simulated_example_params.rb b/lib/lithic/models/events/subscription_send_simulated_example_params.rb index 8570b50a..203c23df 100644 --- a/lib/lithic/models/events/subscription_send_simulated_example_params.rb +++ b/lib/lithic/models/events/subscription_send_simulated_example_params.rb @@ -38,6 +38,7 @@ module EventType BALANCE_UPDATED = :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED = :"card_transaction.updated" diff --git a/lib/lithic/models/events/subscription_update_params.rb b/lib/lithic/models/events/subscription_update_params.rb index 45493a11..fb3a1c33 100644 --- a/lib/lithic/models/events/subscription_update_params.rb +++ b/lib/lithic/models/events/subscription_update_params.rb @@ -69,6 +69,8 @@ class SubscriptionUpdateParams < Lithic::Internal::Type::BaseModel # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -164,6 +166,7 @@ module EventType BALANCE_UPDATED = :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED = :"card_transaction.updated" diff --git a/lib/lithic/models/external_bank_account_set_verification_method_params.rb b/lib/lithic/models/external_bank_account_set_verification_method_params.rb new file mode 100644 index 00000000..041edd0b --- /dev/null +++ b/lib/lithic/models/external_bank_account_set_verification_method_params.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#set_verification_method + class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!attribute verification_method + # The verification method to set for the external bank account + # + # @return [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] + required :verification_method, + enum: -> { Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod } + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits. + # Required when verification_method is MICRO_DEPOSIT or PRENOTE. + # + # @return [String, nil] + optional :financial_account_token, String + + # @!method initialize(external_bank_account_token:, verification_method:, financial_account_token: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountSetVerificationMethodParams} for more + # details. + # + # @param external_bank_account_token [String] + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] The verification method to set for the external bank account + # + # @param financial_account_token [String] The financial account token of the operating account to fund the micro deposits. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The verification method to set for the external bank account + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MICRO_DEPOSIT = :MICRO_DEPOSIT + PRENOTE = :PRENOTE + EXTERNALLY_VERIFIED = :EXTERNALLY_VERIFIED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/parsed_webhook_event.rb b/lib/lithic/models/parsed_webhook_event.rb index 7894f258..4e78511d 100644 --- a/lib/lithic/models/parsed_webhook_event.rb +++ b/lib/lithic/models/parsed_webhook_event.rb @@ -23,6 +23,8 @@ module ParsedWebhookEvent variant -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent } + variant -> { Lithic::CardAuthorizationChallengeResponseWebhookEvent } + variant -> { Lithic::AuthRulesBacktestReportCreatedWebhookEvent } variant -> { Lithic::BalanceUpdatedWebhookEvent } @@ -811,7 +813,7 @@ module EventType end # @!method self.variants - # @return [Array(Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardUpdatedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent)] + # @return [Array(Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardUpdatedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent)] end end end diff --git a/lib/lithic/resources/external_bank_accounts.rb b/lib/lithic/resources/external_bank_accounts.rb index f2563497..fc2da354 100644 --- a/lib/lithic/resources/external_bank_accounts.rb +++ b/lib/lithic/resources/external_bank_accounts.rb @@ -176,6 +176,37 @@ def retry_prenote(external_bank_account_token, params = {}) ) end + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountSetVerificationMethodParams} for more + # details. + # + # Update the verification method for an external bank account. Verification method + # can only be updated if the `verification_state` is `PENDING`. + # + # @overload set_verification_method(external_bank_account_token, verification_method:, financial_account_token: nil, request_options: {}) + # + # @param external_bank_account_token [String] + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] The verification method to set for the external bank account + # + # @param financial_account_token [String] The financial account token of the operating account to fund the micro deposits. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccount] + # + # @see Lithic::Models::ExternalBankAccountSetVerificationMethodParams + def set_verification_method(external_bank_account_token, params) + parsed, options = Lithic::ExternalBankAccountSetVerificationMethodParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%1$s/set_verification_method", external_bank_account_token], + body: parsed, + model: Lithic::ExternalBankAccount, + options: options + ) + end + # Unpause an external bank account # # @overload unpause(external_bank_account_token, request_options: {}) diff --git a/lib/lithic/resources/webhooks.rb b/lib/lithic/resources/webhooks.rb index 0f399bb9..4268eaf0 100644 --- a/lib/lithic/resources/webhooks.rb +++ b/lib/lithic/resources/webhooks.rb @@ -9,7 +9,7 @@ class Webhooks # @param headers [Hash{String => String}] The webhook request headers # @param secret [String, nil] The webhook secret. If not provided, reads from LITHIC_WEBHOOK_SECRET environment variable. # - # @return [Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardUpdatedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent] # + # @return [Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardUpdatedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent] # # @raise [ArgumentError] if secret is not provided and LITHIC_WEBHOOK_SECRET env var is not set # @raise [Lithic::Errors::MissingDependencyError] if the standardwebhooks gem is not installed # @raise [StandardWebhooks::WebhookVerificationError] if the signature is invalid diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index 2b43120f..297e5449 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lithic - VERSION = "0.11.0" + VERSION = "0.12.0" end diff --git a/rbi/lithic/models.rbi b/rbi/lithic/models.rbi index e2280d10..b5750b72 100644 --- a/rbi/lithic/models.rbi +++ b/rbi/lithic/models.rbi @@ -108,6 +108,9 @@ module Lithic CardAuthorizationApprovalRequestWebhookEvent = Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent + CardAuthorizationChallengeResponseWebhookEvent = + Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent + CardBulkOrder = Lithic::Models::CardBulkOrder CardBulkOrderCreateParams = Lithic::Models::CardBulkOrderCreateParams @@ -285,6 +288,9 @@ module Lithic ExternalBankAccounts = Lithic::Models::ExternalBankAccounts + ExternalBankAccountSetVerificationMethodParams = + Lithic::Models::ExternalBankAccountSetVerificationMethodParams + ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams diff --git a/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi index 201fb34a..0a16b138 100644 --- a/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi +++ b/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi @@ -176,6 +176,33 @@ module Lithic # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time # of the authorization. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity. Requires `parameters.scope`. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. sig do returns( Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol @@ -191,12 +218,36 @@ module Lithic sig { returns(Lithic::AuthRules::ConditionalValue::Variants) } attr_accessor :value + # Additional parameters required for transaction history signal attributes. + # Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + ) + ) + end + attr_reader :parameters + + sig do + params( + parameters: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::OrHash + ).void + end + attr_writer :parameters + sig do params( attribute: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol, operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, - value: Lithic::AuthRules::ConditionalValue::Variants + value: Lithic::AuthRules::ConditionalValue::Variants, + parameters: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::OrHash ).returns(T.attached_class) end def self.new( @@ -271,11 +322,44 @@ module Lithic # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time # of the authorization. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity. Requires `parameters.scope`. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. attribute:, # The operation to apply to the attribute operation:, # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` - value: + value:, + # Additional parameters required for transaction history signal attributes. + # Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes. + parameters: nil ) end @@ -285,7 +369,9 @@ module Lithic attribute: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol, operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, - value: Lithic::AuthRules::ConditionalValue::Variants + value: Lithic::AuthRules::ConditionalValue::Variants, + parameters: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters } ) end @@ -363,6 +449,33 @@ module Lithic # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time # of the authorization. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity. Requires `parameters.scope`. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. module Attribute extend Lithic::Internal::Type::Enum @@ -505,6 +618,56 @@ module Lithic :ACCOUNT_AGE, Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol ) + AMOUNT_Z_SCORE = + T.let( + :AMOUNT_Z_SCORE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + AVG_TRANSACTION_AMOUNT = + T.let( + :AVG_TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + STDEV_TRANSACTION_AMOUNT = + T.let( + :STDEV_TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_COUNTRY = + T.let( + :IS_NEW_COUNTRY, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_MCC = + T.let( + :IS_NEW_MCC, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_FIRST_TRANSACTION = + T.let( + :IS_FIRST_TRANSACTION, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CONSECUTIVE_DECLINES = + T.let( + :CONSECUTIVE_DECLINES, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TIME_SINCE_LAST_TRANSACTION = + T.let( + :TIME_SINCE_LAST_TRANSACTION, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + DISTINCT_COUNTRY_COUNT = + T.let( + :DISTINCT_COUNTRY_COUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + THREE_DS_SUCCESS_RATE = + T.let( + :THREE_DS_SUCCESS_RATE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) sig do override.returns( @@ -516,6 +679,177 @@ module Lithic def self.values end end + + class Parameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters, + Lithic::Internal::AnyHash + ) + end + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol + ) + ) + end + attr_reader :interval + + sig do + params( + interval: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol + ).void + end + attr_writer :interval + + # The entity scope to evaluate the attribute against. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol + ) + ) + end + attr_reader :scope + + sig do + params( + scope: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol + ).void + end + attr_writer :scope + + # Additional parameters required for transaction history signal attributes. + # Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes. + sig do + params( + interval: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol, + scope: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + interval: nil, + # The entity scope to evaluate the attribute against. + scope: nil + ) + end + + sig do + override.returns( + { + interval: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol, + scope: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol + } + ) + end + def to_hash + end + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + module Interval + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIFETIME = + T.let( + :LIFETIME, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_7_D = + T.let( + :"7D", + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_30_D = + T.let( + :"30D", + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_90_D = + T.let( + :"90D", + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The entity scope to evaluate the attribute against. + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + BUSINESS_ACCOUNT = + T.let( + :BUSINESS_ACCOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/lithic/models/auth_rules/rule_feature.rbi b/rbi/lithic/models/auth_rules/rule_feature.rbi index efd1574a..9a9ef9fa 100644 --- a/rbi/lithic/models/auth_rules/rule_feature.rbi +++ b/rbi/lithic/models/auth_rules/rule_feature.rbi @@ -24,6 +24,10 @@ module Lithic # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires # `scope`, `period`, and optionally `filters` to configure the velocity # calculation. Available for AUTHORIZATION event stream rules. + # - `TRANSACTION_HISTORY_SIGNALS`: Behavioral feature state derived from the + # entity's transaction history. Requires `scope` to specify whether to load + # card, account, or business account history. Available for AUTHORIZATION event + # stream rules. module RuleFeature extend Lithic::Internal::Type::Union @@ -37,7 +41,8 @@ module Lithic Lithic::AuthRules::RuleFeature::CardFeature, Lithic::AuthRules::RuleFeature::AccountHolderFeature, Lithic::AuthRules::RuleFeature::IPMetadataFeature, - Lithic::AuthRules::RuleFeature::SpendVelocityFeature + Lithic::AuthRules::RuleFeature::SpendVelocityFeature, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature ) end @@ -403,6 +408,104 @@ module Lithic end end + class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature, + Lithic::Internal::AnyHash + ) + end + + # The entity scope to load transaction history signals for. + sig do + returns( + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::OrSymbol + ) + end + attr_accessor :scope + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig do + params( + scope: + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::OrSymbol, + name: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The entity scope to load transaction history signals for. + scope:, + # The variable name for this feature in the rule function signature + name: nil, + type: :TRANSACTION_HISTORY_SIGNALS + ) + end + + sig do + override.returns( + { + scope: + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::OrSymbol, + type: Symbol, + name: String + } + ) + end + def to_hash + end + + # The entity scope to load transaction history signals for. + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::TaggedSymbol + ) + BUSINESS_ACCOUNT = + T.let( + :BUSINESS_ACCOUNT, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + end + sig do override.returns(T::Array[Lithic::AuthRules::RuleFeature::Variants]) end diff --git a/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi b/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi index 909c3759..93bf85c4 100644 --- a/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi +++ b/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi @@ -30,7 +30,8 @@ module Lithic Lithic::AuthRules::RuleFeature::CardFeature, Lithic::AuthRules::RuleFeature::AccountHolderFeature, Lithic::AuthRules::RuleFeature::IPMetadataFeature, - Lithic::AuthRules::RuleFeature::SpendVelocityFeature + Lithic::AuthRules::RuleFeature::SpendVelocityFeature, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature ) ] ) @@ -51,7 +52,8 @@ module Lithic Lithic::AuthRules::RuleFeature::CardFeature::OrHash, Lithic::AuthRules::RuleFeature::AccountHolderFeature::OrHash, Lithic::AuthRules::RuleFeature::IPMetadataFeature::OrHash, - Lithic::AuthRules::RuleFeature::SpendVelocityFeature::OrHash + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::OrHash, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::OrHash ) ] ).returns(T.attached_class) @@ -80,7 +82,8 @@ module Lithic Lithic::AuthRules::RuleFeature::CardFeature, Lithic::AuthRules::RuleFeature::AccountHolderFeature, Lithic::AuthRules::RuleFeature::IPMetadataFeature, - Lithic::AuthRules::RuleFeature::SpendVelocityFeature + Lithic::AuthRules::RuleFeature::SpendVelocityFeature, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature ) ] } diff --git a/rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi b/rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi new file mode 100644 index 00000000..7cd5bcd2 --- /dev/null +++ b/rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi @@ -0,0 +1,175 @@ +# typed: strong + +module Lithic + module Models + class CardAuthorizationChallengeResponseWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorizationChallengeResponseWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The token of the card associated with the challenge + sig { returns(T.nilable(String)) } + attr_accessor :card_token + + # The method used to deliver the challenge to the cardholder + sig do + returns( + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol + ) + end + attr_accessor :challenge_method + + # The timestamp of when the challenge was completed + sig { returns(T.nilable(Time)) } + attr_accessor :completed + + # The timestamp of when the challenge was created + sig { returns(Time) } + attr_accessor :created + + # Globally unique identifier for the event + sig { returns(String) } + attr_accessor :event_token + + # Event type + sig { returns(Symbol) } + attr_accessor :event_type + + # The cardholder's response to the challenge + sig do + returns( + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol + ) + end + attr_accessor :response + + # The token of the transaction associated with the authorization event being + # challenged + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + sig do + params( + card_token: T.nilable(String), + challenge_method: + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::OrSymbol, + completed: T.nilable(Time), + created: Time, + event_token: String, + response: + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::OrSymbol, + transaction_token: T.nilable(String), + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the card associated with the challenge + card_token:, + # The method used to deliver the challenge to the cardholder + challenge_method:, + # The timestamp of when the challenge was completed + completed:, + # The timestamp of when the challenge was created + created:, + # Globally unique identifier for the event + event_token:, + # The cardholder's response to the challenge + response:, + # The token of the transaction associated with the authorization event being + # challenged + transaction_token:, + # Event type + event_type: :"card_authorization.challenge_response" + ) + end + + sig do + override.returns( + { + card_token: T.nilable(String), + challenge_method: + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol, + completed: T.nilable(Time), + created: Time, + event_token: String, + event_type: Symbol, + response: + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol, + transaction_token: T.nilable(String) + } + ) + end + def to_hash + end + + # The method used to deliver the challenge to the cardholder + module ChallengeMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS = + T.let( + :SMS, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The cardholder's response to the challenge + module Response + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVE = + T.let( + :APPROVE, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol + ) + DECLINE = + T.let( + :DECLINE, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/event.rbi b/rbi/lithic/models/event.rbi index 9185a613..fe497ddb 100644 --- a/rbi/lithic/models/event.rbi +++ b/rbi/lithic/models/event.rbi @@ -29,6 +29,8 @@ module Lithic # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -149,6 +151,8 @@ module Lithic # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -265,6 +269,8 @@ module Lithic # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -392,6 +398,11 @@ module Lithic :"book_transfer_transaction.updated", Lithic::Event::EventType::TaggedSymbol ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::Event::EventType::TaggedSymbol + ) CARD_TRANSACTION_ENHANCED_DATA_CREATED = T.let( :"card_transaction.enhanced_data.created", diff --git a/rbi/lithic/models/event_list_params.rbi b/rbi/lithic/models/event_list_params.rbi index 40512743..197280c7 100644 --- a/rbi/lithic/models/event_list_params.rbi +++ b/rbi/lithic/models/event_list_params.rbi @@ -138,6 +138,8 @@ module Lithic # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -269,6 +271,11 @@ module Lithic :"book_transfer_transaction.updated", Lithic::EventListParams::EventType::TaggedSymbol ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::EventListParams::EventType::TaggedSymbol + ) CARD_TRANSACTION_ENHANCED_DATA_CREATED = T.let( :"card_transaction.enhanced_data.created", diff --git a/rbi/lithic/models/event_subscription.rbi b/rbi/lithic/models/event_subscription.rbi index 4dddc57e..970c46f8 100644 --- a/rbi/lithic/models/event_subscription.rbi +++ b/rbi/lithic/models/event_subscription.rbi @@ -86,6 +86,8 @@ module Lithic # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -217,6 +219,11 @@ module Lithic :"book_transfer_transaction.updated", Lithic::EventSubscription::EventType::TaggedSymbol ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::EventSubscription::EventType::TaggedSymbol + ) CARD_TRANSACTION_ENHANCED_DATA_CREATED = T.let( :"card_transaction.enhanced_data.created", diff --git a/rbi/lithic/models/events/subscription_create_params.rbi b/rbi/lithic/models/events/subscription_create_params.rbi index 5bc4db9c..51940009 100644 --- a/rbi/lithic/models/events/subscription_create_params.rbi +++ b/rbi/lithic/models/events/subscription_create_params.rbi @@ -113,6 +113,8 @@ module Lithic # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -246,6 +248,11 @@ module Lithic :"book_transfer_transaction.updated", Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) CARD_TRANSACTION_ENHANCED_DATA_CREATED = T.let( :"card_transaction.enhanced_data.created", diff --git a/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi b/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi index 6bd52287..8a9789ef 100644 --- a/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi +++ b/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi @@ -118,6 +118,11 @@ module Lithic :"book_transfer_transaction.updated", Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) CARD_TRANSACTION_ENHANCED_DATA_CREATED = T.let( :"card_transaction.enhanced_data.created", diff --git a/rbi/lithic/models/events/subscription_update_params.rbi b/rbi/lithic/models/events/subscription_update_params.rbi index 13edc386..aa5d8ed7 100644 --- a/rbi/lithic/models/events/subscription_update_params.rbi +++ b/rbi/lithic/models/events/subscription_update_params.rbi @@ -119,6 +119,8 @@ module Lithic # created. # - book_transfer_transaction.updated: Occurs when a book transfer transaction is # updated. + # - card_authorization.challenge_response: Occurs when a cardholder responds to an + # SMS challenge during card authorization. # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial # data is processed for a transaction event. # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial @@ -252,6 +254,11 @@ module Lithic :"book_transfer_transaction.updated", Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) CARD_TRANSACTION_ENHANCED_DATA_CREATED = T.let( :"card_transaction.enhanced_data.created", diff --git a/rbi/lithic/models/external_bank_account_set_verification_method_params.rbi b/rbi/lithic/models/external_bank_account_set_verification_method_params.rbi new file mode 100644 index 00000000..f185bbed --- /dev/null +++ b/rbi/lithic/models/external_bank_account_set_verification_method_params.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountSetVerificationMethodParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + # The verification method to set for the external bank account + sig do + returns( + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol + ) + end + attr_accessor :verification_method + + # The financial account token of the operating account to fund the micro deposits. + # Required when verification_method is MICRO_DEPOSIT or PRENOTE. + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + sig do + params( + external_bank_account_token: String, + verification_method: + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_bank_account_token:, + # The verification method to set for the external bank account + verification_method:, + # The financial account token of the operating account to fund the micro deposits. + # Required when verification_method is MICRO_DEPOSIT or PRENOTE. + financial_account_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_bank_account_token: String, + verification_method: + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The verification method to set for the external bank account + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol + ) + EXTERNALLY_VERIFIED = + T.let( + :EXTERNALLY_VERIFIED, + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/parsed_webhook_event.rbi b/rbi/lithic/models/parsed_webhook_event.rbi index c53cf3d0..61a524d7 100644 --- a/rbi/lithic/models/parsed_webhook_event.rbi +++ b/rbi/lithic/models/parsed_webhook_event.rbi @@ -16,6 +16,7 @@ module Lithic Lithic::AccountHolderVerificationWebhookEvent, Lithic::AccountHolderDocumentUpdatedWebhookEvent, Lithic::CardAuthorizationApprovalRequestWebhookEvent, + Lithic::CardAuthorizationChallengeResponseWebhookEvent, Lithic::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::BalanceUpdatedWebhookEvent, Lithic::BookTransferTransactionCreatedWebhookEvent, diff --git a/rbi/lithic/resources/external_bank_accounts.rbi b/rbi/lithic/resources/external_bank_accounts.rbi index fcfedd89..c6783ff5 100644 --- a/rbi/lithic/resources/external_bank_accounts.rbi +++ b/rbi/lithic/resources/external_bank_accounts.rbi @@ -146,6 +146,28 @@ module Lithic ) end + # Update the verification method for an external bank account. Verification method + # can only be updated if the `verification_state` is `PENDING`. + sig do + params( + external_bank_account_token: String, + verification_method: + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalBankAccount) + end + def set_verification_method( + external_bank_account_token, + # The verification method to set for the external bank account + verification_method:, + # The financial account token of the operating account to fund the micro deposits. + # Required when verification_method is MICRO_DEPOSIT or PRENOTE. + financial_account_token: nil, + request_options: {} + ) + end + # Unpause an external bank account sig do params( diff --git a/rbi/lithic/resources/webhooks.rbi b/rbi/lithic/resources/webhooks.rbi index 35783177..1f703e54 100644 --- a/rbi/lithic/resources/webhooks.rbi +++ b/rbi/lithic/resources/webhooks.rbi @@ -17,6 +17,7 @@ module Lithic Lithic::AccountHolderVerificationWebhookEvent, Lithic::AccountHolderDocumentUpdatedWebhookEvent, Lithic::CardAuthorizationApprovalRequestWebhookEvent, + Lithic::CardAuthorizationChallengeResponseWebhookEvent, Lithic::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::BalanceUpdatedWebhookEvent, Lithic::BookTransferTransactionCreatedWebhookEvent, diff --git a/sig/lithic/models.rbs b/sig/lithic/models.rbs index 5783e92f..a0c41968 100644 --- a/sig/lithic/models.rbs +++ b/sig/lithic/models.rbs @@ -89,6 +89,8 @@ module Lithic class CardAuthorizationApprovalRequestWebhookEvent = Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent + class CardAuthorizationChallengeResponseWebhookEvent = Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent + class CardBulkOrder = Lithic::Models::CardBulkOrder class CardBulkOrderCreateParams = Lithic::Models::CardBulkOrderCreateParams @@ -249,6 +251,8 @@ module Lithic module ExternalBankAccounts = Lithic::Models::ExternalBankAccounts + class ExternalBankAccountSetVerificationMethodParams = Lithic::Models::ExternalBankAccountSetVerificationMethodParams + class ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams class ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent diff --git a/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs b/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs index c868d500..a6161c7c 100644 --- a/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs +++ b/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs @@ -37,7 +37,8 @@ module Lithic { attribute: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute, operation: Lithic::Models::AuthRules::conditional_operation, - value: Lithic::Models::AuthRules::conditional_value + value: Lithic::Models::AuthRules::conditional_value, + parameters: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters } class Condition < Lithic::Internal::Type::BaseModel @@ -47,16 +48,24 @@ module Lithic attr_accessor value: Lithic::Models::AuthRules::conditional_value + attr_reader parameters: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters? + + def parameters=: ( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + ) -> Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + def initialize: ( attribute: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute, operation: Lithic::Models::AuthRules::conditional_operation, - value: Lithic::Models::AuthRules::conditional_value + value: Lithic::Models::AuthRules::conditional_value, + ?parameters: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters ) -> void def to_hash: -> { attribute: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute, operation: Lithic::Models::AuthRules::conditional_operation, - value: Lithic::Models::AuthRules::conditional_value + value: Lithic::Models::AuthRules::conditional_value, + parameters: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters } type attribute = @@ -86,6 +95,16 @@ module Lithic | :SERVICE_LOCATION_POSTAL_CODE | :CARD_AGE | :ACCOUNT_AGE + | :AMOUNT_Z_SCORE + | :AVG_TRANSACTION_AMOUNT + | :STDEV_TRANSACTION_AMOUNT + | :IS_NEW_COUNTRY + | :IS_NEW_MCC + | :IS_FIRST_TRANSACTION + | :CONSECUTIVE_DECLINES + | :TIME_SINCE_LAST_TRANSACTION + | :DISTINCT_COUNTRY_COUNT + | :THREE_DS_SUCCESS_RATE module Attribute extend Lithic::Internal::Type::Enum @@ -116,9 +135,74 @@ module Lithic SERVICE_LOCATION_POSTAL_CODE: :SERVICE_LOCATION_POSTAL_CODE CARD_AGE: :CARD_AGE ACCOUNT_AGE: :ACCOUNT_AGE + AMOUNT_Z_SCORE: :AMOUNT_Z_SCORE + AVG_TRANSACTION_AMOUNT: :AVG_TRANSACTION_AMOUNT + STDEV_TRANSACTION_AMOUNT: :STDEV_TRANSACTION_AMOUNT + IS_NEW_COUNTRY: :IS_NEW_COUNTRY + IS_NEW_MCC: :IS_NEW_MCC + IS_FIRST_TRANSACTION: :IS_FIRST_TRANSACTION + CONSECUTIVE_DECLINES: :CONSECUTIVE_DECLINES + TIME_SINCE_LAST_TRANSACTION: :TIME_SINCE_LAST_TRANSACTION + DISTINCT_COUNTRY_COUNT: :DISTINCT_COUNTRY_COUNT + THREE_DS_SUCCESS_RATE: :THREE_DS_SUCCESS_RATE def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute] end + + type parameters = + { + interval: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval, + scope: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope + } + + class Parameters < Lithic::Internal::Type::BaseModel + attr_reader interval: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval? + + def interval=: ( + Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval + ) -> Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval + + attr_reader scope: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope? + + def scope=: ( + Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope + ) -> Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope + + def initialize: ( + ?interval: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval, + ?scope: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope + ) -> void + + def to_hash: -> { + interval: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval, + scope: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope + } + + type interval = :LIFETIME | :"7D" | :"30D" | :"90D" + + module Interval + extend Lithic::Internal::Type::Enum + + LIFETIME: :LIFETIME + INTERVAL_7_D: :"7D" + INTERVAL_30_D: :"30D" + INTERVAL_90_D: :"90D" + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval] + end + + type scope = :CARD | :ACCOUNT | :BUSINESS_ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + BUSINESS_ACCOUNT: :BUSINESS_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope] + end + end end end end diff --git a/sig/lithic/models/auth_rules/rule_feature.rbs b/sig/lithic/models/auth_rules/rule_feature.rbs index 323d20a1..2f856a61 100644 --- a/sig/lithic/models/auth_rules/rule_feature.rbs +++ b/sig/lithic/models/auth_rules/rule_feature.rbs @@ -10,6 +10,7 @@ module Lithic | Lithic::AuthRules::RuleFeature::AccountHolderFeature | Lithic::AuthRules::RuleFeature::IPMetadataFeature | Lithic::AuthRules::RuleFeature::SpendVelocityFeature + | Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature module RuleFeature extend Lithic::Internal::Type::Union @@ -166,6 +167,47 @@ module Lithic end end + type transaction_history_signals_feature = + { + scope: Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope, + type: :TRANSACTION_HISTORY_SIGNALS, + name: String + } + + class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel + attr_accessor scope: Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope + + attr_accessor type: :TRANSACTION_HISTORY_SIGNALS + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + scope: Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope, + ?name: String, + ?type: :TRANSACTION_HISTORY_SIGNALS + ) -> void + + def to_hash: -> { + scope: Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope, + type: :TRANSACTION_HISTORY_SIGNALS, + name: String + } + + type scope = :CARD | :ACCOUNT | :BUSINESS_ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + BUSINESS_ACCOUNT: :BUSINESS_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope] + end + end + def self?.variants: -> ::Array[Lithic::Models::AuthRules::rule_feature] end end diff --git a/sig/lithic/models/card_authorization_challenge_response_webhook_event.rbs b/sig/lithic/models/card_authorization_challenge_response_webhook_event.rbs new file mode 100644 index 00000000..ab9d91b3 --- /dev/null +++ b/sig/lithic/models/card_authorization_challenge_response_webhook_event.rbs @@ -0,0 +1,76 @@ +module Lithic + module Models + type card_authorization_challenge_response_webhook_event = + { + card_token: String?, + challenge_method: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method, + completed: Time?, + created: Time, + event_token: String, + event_type: :"card_authorization.challenge_response", + response: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response, + transaction_token: String? + } + + class CardAuthorizationChallengeResponseWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor card_token: String? + + attr_accessor challenge_method: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method + + attr_accessor completed: Time? + + attr_accessor created: Time + + attr_accessor event_token: String + + attr_accessor event_type: :"card_authorization.challenge_response" + + attr_accessor response: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response + + attr_accessor transaction_token: String? + + def initialize: ( + card_token: String?, + challenge_method: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method, + completed: Time?, + created: Time, + event_token: String, + response: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response, + transaction_token: String?, + ?event_type: :"card_authorization.challenge_response" + ) -> void + + def to_hash: -> { + card_token: String?, + challenge_method: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method, + completed: Time?, + created: Time, + event_token: String, + event_type: :"card_authorization.challenge_response", + response: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response, + transaction_token: String? + } + + type challenge_method = :SMS + + module ChallengeMethod + extend Lithic::Internal::Type::Enum + + SMS: :SMS + + def self?.values: -> ::Array[Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method] + end + + type response = :APPROVE | :DECLINE + + module Response + extend Lithic::Internal::Type::Enum + + APPROVE: :APPROVE + DECLINE: :DECLINE + + def self?.values: -> ::Array[Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response] + end + end + end +end diff --git a/sig/lithic/models/event.rbs b/sig/lithic/models/event.rbs index e6821385..11df5b77 100644 --- a/sig/lithic/models/event.rbs +++ b/sig/lithic/models/event.rbs @@ -40,6 +40,7 @@ module Lithic | :"balance.updated" | :"book_transfer_transaction.created" | :"book_transfer_transaction.updated" + | :"card_authorization.challenge_response" | :"card_transaction.enhanced_data.created" | :"card_transaction.enhanced_data.updated" | :"card_transaction.updated" @@ -96,6 +97,7 @@ module Lithic BALANCE_UPDATED: :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED: :"card_transaction.updated" diff --git a/sig/lithic/models/event_list_params.rbs b/sig/lithic/models/event_list_params.rbs index e36f292d..b652a36d 100644 --- a/sig/lithic/models/event_list_params.rbs +++ b/sig/lithic/models/event_list_params.rbs @@ -77,6 +77,7 @@ module Lithic | :"balance.updated" | :"book_transfer_transaction.created" | :"book_transfer_transaction.updated" + | :"card_authorization.challenge_response" | :"card_transaction.enhanced_data.created" | :"card_transaction.enhanced_data.updated" | :"card_transaction.updated" @@ -133,6 +134,7 @@ module Lithic BALANCE_UPDATED: :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED: :"card_transaction.updated" diff --git a/sig/lithic/models/event_subscription.rbs b/sig/lithic/models/event_subscription.rbs index 9eb94d74..52bf08bb 100644 --- a/sig/lithic/models/event_subscription.rbs +++ b/sig/lithic/models/event_subscription.rbs @@ -45,6 +45,7 @@ module Lithic | :"balance.updated" | :"book_transfer_transaction.created" | :"book_transfer_transaction.updated" + | :"card_authorization.challenge_response" | :"card_transaction.enhanced_data.created" | :"card_transaction.enhanced_data.updated" | :"card_transaction.updated" @@ -101,6 +102,7 @@ module Lithic BALANCE_UPDATED: :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED: :"card_transaction.updated" diff --git a/sig/lithic/models/events/subscription_create_params.rbs b/sig/lithic/models/events/subscription_create_params.rbs index 1b5580c6..fea39c4a 100644 --- a/sig/lithic/models/events/subscription_create_params.rbs +++ b/sig/lithic/models/events/subscription_create_params.rbs @@ -55,6 +55,7 @@ module Lithic | :"balance.updated" | :"book_transfer_transaction.created" | :"book_transfer_transaction.updated" + | :"card_authorization.challenge_response" | :"card_transaction.enhanced_data.created" | :"card_transaction.enhanced_data.updated" | :"card_transaction.updated" @@ -111,6 +112,7 @@ module Lithic BALANCE_UPDATED: :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED: :"card_transaction.updated" diff --git a/sig/lithic/models/events/subscription_send_simulated_example_params.rbs b/sig/lithic/models/events/subscription_send_simulated_example_params.rbs index 7adba661..9f56b550 100644 --- a/sig/lithic/models/events/subscription_send_simulated_example_params.rbs +++ b/sig/lithic/models/events/subscription_send_simulated_example_params.rbs @@ -41,6 +41,7 @@ module Lithic | :"balance.updated" | :"book_transfer_transaction.created" | :"book_transfer_transaction.updated" + | :"card_authorization.challenge_response" | :"card_transaction.enhanced_data.created" | :"card_transaction.enhanced_data.updated" | :"card_transaction.updated" @@ -97,6 +98,7 @@ module Lithic BALANCE_UPDATED: :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED: :"card_transaction.updated" diff --git a/sig/lithic/models/events/subscription_update_params.rbs b/sig/lithic/models/events/subscription_update_params.rbs index c66fd09a..7938039c 100644 --- a/sig/lithic/models/events/subscription_update_params.rbs +++ b/sig/lithic/models/events/subscription_update_params.rbs @@ -60,6 +60,7 @@ module Lithic | :"balance.updated" | :"book_transfer_transaction.created" | :"book_transfer_transaction.updated" + | :"card_authorization.challenge_response" | :"card_transaction.enhanced_data.created" | :"card_transaction.enhanced_data.updated" | :"card_transaction.updated" @@ -116,6 +117,7 @@ module Lithic BALANCE_UPDATED: :"balance.updated" BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" CARD_TRANSACTION_UPDATED: :"card_transaction.updated" diff --git a/sig/lithic/models/external_bank_account_set_verification_method_params.rbs b/sig/lithic/models/external_bank_account_set_verification_method_params.rbs new file mode 100644 index 00000000..4581fe87 --- /dev/null +++ b/sig/lithic/models/external_bank_account_set_verification_method_params.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + type external_bank_account_set_verification_method_params = + { + external_bank_account_token: String, + verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method, + financial_account_token: String + } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + def initialize: ( + external_bank_account_token: String, + verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + + type verification_method = + :MICRO_DEPOSIT | :PRENOTE | :EXTERNALLY_VERIFIED + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MICRO_DEPOSIT: :MICRO_DEPOSIT + PRENOTE: :PRENOTE + EXTERNALLY_VERIFIED: :EXTERNALLY_VERIFIED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method] + end + end + end +end diff --git a/sig/lithic/models/parsed_webhook_event.rbs b/sig/lithic/models/parsed_webhook_event.rbs index 70c31c8b..dc8f8a81 100644 --- a/sig/lithic/models/parsed_webhook_event.rbs +++ b/sig/lithic/models/parsed_webhook_event.rbs @@ -8,6 +8,7 @@ module Lithic | Lithic::AccountHolderVerificationWebhookEvent | Lithic::AccountHolderDocumentUpdatedWebhookEvent | Lithic::CardAuthorizationApprovalRequestWebhookEvent + | Lithic::CardAuthorizationChallengeResponseWebhookEvent | Lithic::AuthRulesBacktestReportCreatedWebhookEvent | Lithic::BalanceUpdatedWebhookEvent | Lithic::BookTransferTransactionCreatedWebhookEvent diff --git a/sig/lithic/resources/external_bank_accounts.rbs b/sig/lithic/resources/external_bank_accounts.rbs index 4fd67784..599b4b3a 100644 --- a/sig/lithic/resources/external_bank_accounts.rbs +++ b/sig/lithic/resources/external_bank_accounts.rbs @@ -52,6 +52,13 @@ module Lithic ?request_options: Lithic::request_opts ) -> Lithic::ExternalBankAccount + def set_verification_method: ( + String external_bank_account_token, + verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalBankAccount + def unpause: ( String external_bank_account_token, ?request_options: Lithic::request_opts diff --git a/sig/lithic/resources/webhooks.rbs b/sig/lithic/resources/webhooks.rbs index 2daf0e85..1e83cbc7 100644 --- a/sig/lithic/resources/webhooks.rbs +++ b/sig/lithic/resources/webhooks.rbs @@ -12,6 +12,7 @@ module Lithic | Lithic::AccountHolderVerificationWebhookEvent | Lithic::AccountHolderDocumentUpdatedWebhookEvent | Lithic::CardAuthorizationApprovalRequestWebhookEvent + | Lithic::CardAuthorizationChallengeResponseWebhookEvent | Lithic::AuthRulesBacktestReportCreatedWebhookEvent | Lithic::BalanceUpdatedWebhookEvent | Lithic::BookTransferTransactionCreatedWebhookEvent diff --git a/test/lithic/resources/external_bank_accounts_test.rb b/test/lithic/resources/external_bank_accounts_test.rb index d83c98c9..bc7b677e 100644 --- a/test/lithic/resources/external_bank_accounts_test.rb +++ b/test/lithic/resources/external_bank_accounts_test.rb @@ -233,6 +233,45 @@ def test_retry_prenote end end + def test_set_verification_method_required_params + response = + @lithic.external_bank_accounts.set_verification_method( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + verification_method: :MICRO_DEPOSIT + ) + + assert_pattern do + response => Lithic::ExternalBankAccount + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::OwnerType, + routing_number: String, + state: Lithic::ExternalBankAccount::State, + type: Lithic::ExternalBankAccount::Type, + verification_attempts: Integer, + verification_method: Lithic::VerificationMethod, + verification_state: Lithic::ExternalBankAccount::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + def test_unpause response = @lithic.external_bank_accounts.unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")