lithic 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/internal/util.rb +22 -7
  5. data/lib/lithic/models/auth_rules/backtest_stats.rb +9 -1
  6. data/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb +158 -1
  7. data/lib/lithic/models/auth_rules/report_stats.rb +46 -81
  8. data/lib/lithic/models/auth_rules/rule_feature.rb +47 -1
  9. data/lib/lithic/models/auth_rules/typescript_code_parameters.rb +2 -2
  10. data/lib/lithic/models/auth_rules/v2_list_results_response.rb +36 -4
  11. data/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb +4 -531
  12. data/lib/lithic/models/card_authorization_approval_request_webhook_event.rb +17 -26
  13. data/lib/lithic/models/card_authorization_challenge_response_webhook_event.rb +103 -0
  14. data/lib/lithic/models/card_bulk_order.rb +8 -3
  15. data/lib/lithic/models/card_bulk_order_create_params.rb +8 -3
  16. data/lib/lithic/models/card_convert_physical_params.rb +5 -3
  17. data/lib/lithic/models/card_create_params.rb +5 -3
  18. data/lib/lithic/models/card_reissue_params.rb +5 -3
  19. data/lib/lithic/models/card_renew_params.rb +5 -3
  20. data/lib/lithic/models/event.rb +5 -0
  21. data/lib/lithic/models/event_list_params.rb +3 -0
  22. data/lib/lithic/models/event_subscription.rb +3 -0
  23. data/lib/lithic/models/events/subscription_create_params.rb +3 -0
  24. data/lib/lithic/models/events/subscription_send_simulated_example_params.rb +1 -0
  25. data/lib/lithic/models/events/subscription_update_params.rb +3 -0
  26. data/lib/lithic/models/external_bank_account_set_verification_method_params.rb +55 -0
  27. data/lib/lithic/models/financial_account.rb +1 -0
  28. data/lib/lithic/models/financial_account_update_status_params.rb +1 -0
  29. data/lib/lithic/models/financial_accounts/statement.rb +11 -4
  30. data/lib/lithic/models/instance_financial_account_type.rb +1 -0
  31. data/lib/lithic/models/parsed_webhook_event.rb +3 -1
  32. data/lib/lithic/models/payment_create_params.rb +13 -1
  33. data/lib/lithic/models.rb +6 -0
  34. data/lib/lithic/resources/card_bulk_orders.rb +10 -11
  35. data/lib/lithic/resources/external_bank_accounts.rb +31 -0
  36. data/lib/lithic/resources/webhooks.rb +1 -1
  37. data/lib/lithic/version.rb +1 -1
  38. data/lib/lithic.rb +2 -0
  39. data/rbi/lithic/internal/util.rbi +8 -0
  40. data/rbi/lithic/models/auth_rules/backtest_stats.rbi +11 -3
  41. data/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi +370 -3
  42. data/rbi/lithic/models/auth_rules/report_stats.rbi +73 -177
  43. data/rbi/lithic/models/auth_rules/rule_feature.rbi +104 -1
  44. data/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi +6 -3
  45. data/rbi/lithic/models/auth_rules/v2_list_results_response.rbi +38 -6
  46. data/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi +3 -1721
  47. data/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi +23 -78
  48. data/rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi +175 -0
  49. data/rbi/lithic/models/card_bulk_order.rbi +21 -3
  50. data/rbi/lithic/models/card_bulk_order_create_params.rbi +21 -3
  51. data/rbi/lithic/models/card_convert_physical_params.rbi +8 -5
  52. data/rbi/lithic/models/card_create_params.rbi +8 -8
  53. data/rbi/lithic/models/card_reissue_params.rbi +8 -8
  54. data/rbi/lithic/models/card_renew_params.rbi +8 -8
  55. data/rbi/lithic/models/event.rbi +11 -0
  56. data/rbi/lithic/models/event_list_params.rbi +7 -0
  57. data/rbi/lithic/models/event_subscription.rbi +7 -0
  58. data/rbi/lithic/models/events/subscription_create_params.rbi +7 -0
  59. data/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi +5 -0
  60. data/rbi/lithic/models/events/subscription_update_params.rbi +7 -0
  61. data/rbi/lithic/models/external_bank_account_set_verification_method_params.rbi +111 -0
  62. data/rbi/lithic/models/financial_account.rbi +5 -0
  63. data/rbi/lithic/models/financial_account_update_status_params.rbi +5 -0
  64. data/rbi/lithic/models/financial_accounts/statement.rbi +15 -6
  65. data/rbi/lithic/models/instance_financial_account_type.rbi +5 -0
  66. data/rbi/lithic/models/parsed_webhook_event.rbi +1 -0
  67. data/rbi/lithic/models/payment_create_params.rbi +13 -3
  68. data/rbi/lithic/models.rbi +6 -0
  69. data/rbi/lithic/resources/card_bulk_orders.rbi +11 -11
  70. data/rbi/lithic/resources/cards.rbi +8 -4
  71. data/rbi/lithic/resources/external_bank_accounts.rbi +22 -0
  72. data/rbi/lithic/resources/webhooks.rbi +1 -0
  73. data/sig/lithic/internal/util.rbs +4 -0
  74. data/sig/lithic/models/auth_rules/backtest_stats.rbs +8 -3
  75. data/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs +93 -3
  76. data/sig/lithic/models/auth_rules/report_stats.rbs +34 -70
  77. data/sig/lithic/models/auth_rules/rule_feature.rbs +42 -0
  78. data/sig/lithic/models/auth_rules/v2_list_results_response.rbs +29 -9
  79. data/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs +4 -667
  80. data/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs +14 -41
  81. data/sig/lithic/models/card_authorization_challenge_response_webhook_event.rbs +76 -0
  82. data/sig/lithic/models/card_bulk_order.rbs +5 -1
  83. data/sig/lithic/models/card_bulk_order_create_params.rbs +5 -1
  84. data/sig/lithic/models/card_convert_physical_params.rbs +2 -2
  85. data/sig/lithic/models/card_create_params.rbs +2 -2
  86. data/sig/lithic/models/card_reissue_params.rbs +2 -2
  87. data/sig/lithic/models/card_renew_params.rbs +2 -2
  88. data/sig/lithic/models/event.rbs +2 -0
  89. data/sig/lithic/models/event_list_params.rbs +2 -0
  90. data/sig/lithic/models/event_subscription.rbs +2 -0
  91. data/sig/lithic/models/events/subscription_create_params.rbs +2 -0
  92. data/sig/lithic/models/events/subscription_send_simulated_example_params.rbs +2 -0
  93. data/sig/lithic/models/events/subscription_update_params.rbs +2 -0
  94. data/sig/lithic/models/external_bank_account_set_verification_method_params.rbs +51 -0
  95. data/sig/lithic/models/financial_account.rbs +2 -0
  96. data/sig/lithic/models/financial_account_update_status_params.rbs +2 -0
  97. data/sig/lithic/models/financial_accounts/statement.rbs +16 -7
  98. data/sig/lithic/models/instance_financial_account_type.rbs +2 -0
  99. data/sig/lithic/models/parsed_webhook_event.rbs +1 -0
  100. data/sig/lithic/models/payment_create_params.rbs +8 -3
  101. data/sig/lithic/models.rbs +4 -0
  102. data/sig/lithic/resources/external_bank_accounts.rbs +7 -0
  103. data/sig/lithic/resources/webhooks.rbs +1 -0
  104. metadata +8 -2
@@ -176,6 +176,37 @@ module Lithic
176
176
  )
177
177
  end
178
178
 
179
+ # Some parameter documentations has been truncated, see
180
+ # {Lithic::Models::ExternalBankAccountSetVerificationMethodParams} for more
181
+ # details.
182
+ #
183
+ # Update the verification method for an external bank account. Verification method
184
+ # can only be updated if the `verification_state` is `PENDING`.
185
+ #
186
+ # @overload set_verification_method(external_bank_account_token, verification_method:, financial_account_token: nil, request_options: {})
187
+ #
188
+ # @param external_bank_account_token [String]
189
+ #
190
+ # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] The verification method to set for the external bank account
191
+ #
192
+ # @param financial_account_token [String] The financial account token of the operating account to fund the micro deposits.
193
+ #
194
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
195
+ #
196
+ # @return [Lithic::Models::ExternalBankAccount]
197
+ #
198
+ # @see Lithic::Models::ExternalBankAccountSetVerificationMethodParams
199
+ def set_verification_method(external_bank_account_token, params)
200
+ parsed, options = Lithic::ExternalBankAccountSetVerificationMethodParams.dump_request(params)
201
+ @client.request(
202
+ method: :post,
203
+ path: ["v1/external_bank_accounts/%1$s/set_verification_method", external_bank_account_token],
204
+ body: parsed,
205
+ model: Lithic::ExternalBankAccount,
206
+ options: options
207
+ )
208
+ end
209
+
179
210
  # Unpause an external bank account
180
211
  #
181
212
  # @overload unpause(external_bank_account_token, request_options: {})
@@ -9,7 +9,7 @@ module Lithic
9
9
  # @param headers [Hash{String => String}] The webhook request headers
10
10
  # @param secret [String, nil] The webhook secret. If not provided, reads from LITHIC_WEBHOOK_SECRET environment variable.
11
11
  #
12
- # @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] #
12
+ # @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] #
13
13
  # @raise [ArgumentError] if secret is not provided and LITHIC_WEBHOOK_SECRET env var is not set
14
14
  # @raise [Lithic::Errors::MissingDependencyError] if the standardwebhooks gem is not installed
15
15
  # @raise [StandardWebhooks::WebhookVerificationError] if the signature is invalid
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lithic
4
- VERSION = "0.10.0"
4
+ VERSION = "0.12.0"
5
5
  end
data/lib/lithic.rb CHANGED
@@ -168,6 +168,7 @@ require_relative "lithic/models/book_transfer_transaction_created_webhook_event"
168
168
  require_relative "lithic/models/book_transfer_transaction_updated_webhook_event"
169
169
  require_relative "lithic/models/card"
170
170
  require_relative "lithic/models/card_authorization_approval_request_webhook_event"
171
+ require_relative "lithic/models/card_authorization_challenge_response_webhook_event"
171
172
  require_relative "lithic/models/card_bulk_order"
172
173
  require_relative "lithic/models/card_bulk_order_create_params"
173
174
  require_relative "lithic/models/card_bulk_order_list_params"
@@ -270,6 +271,7 @@ require_relative "lithic/models/external_bank_account_retry_micro_deposits_respo
270
271
  require_relative "lithic/models/external_bank_account_retry_prenote_params"
271
272
  require_relative "lithic/models/external_bank_accounts/micro_deposit_create_params"
272
273
  require_relative "lithic/models/external_bank_accounts/micro_deposit_create_response"
274
+ require_relative "lithic/models/external_bank_account_set_verification_method_params"
273
275
  require_relative "lithic/models/external_bank_account_unpause_params"
274
276
  require_relative "lithic/models/external_bank_account_updated_webhook_event"
275
277
  require_relative "lithic/models/external_bank_account_update_params"
@@ -148,12 +148,20 @@ module Lithic
148
148
  end
149
149
  end
150
150
 
151
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
152
+ RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp)
153
+
151
154
  class << self
152
155
  # @api private
153
156
  sig { params(uri: URI::Generic).returns(String) }
154
157
  def uri_origin(uri)
155
158
  end
156
159
 
160
+ # @api private
161
+ sig { params(path: T.any(String, Integer)).returns(String) }
162
+ def encode_path(path)
163
+ end
164
+
157
165
  # @api private
158
166
  sig { params(path: T.any(String, T::Array[String])).returns(String) }
159
167
  def interpolate_path(path)
@@ -148,12 +148,17 @@ module Lithic
148
148
  sig { params(timestamp: Time).void }
149
149
  attr_writer :timestamp
150
150
 
151
+ # The token of the transaction associated with the event
152
+ sig { returns(T.nilable(String)) }
153
+ attr_accessor :transaction_token
154
+
151
155
  sig do
152
156
  params(
153
157
  decision:
154
158
  Lithic::AuthRules::BacktestStats::Example::Decision::OrSymbol,
155
159
  event_token: String,
156
- timestamp: Time
160
+ timestamp: Time,
161
+ transaction_token: T.nilable(String)
157
162
  ).returns(T.attached_class)
158
163
  end
159
164
  def self.new(
@@ -162,7 +167,9 @@ module Lithic
162
167
  # The event token.
163
168
  event_token: nil,
164
169
  # The timestamp of the event.
165
- timestamp: nil
170
+ timestamp: nil,
171
+ # The token of the transaction associated with the event
172
+ transaction_token: nil
166
173
  )
167
174
  end
168
175
 
@@ -172,7 +179,8 @@ module Lithic
172
179
  decision:
173
180
  Lithic::AuthRules::BacktestStats::Example::Decision::TaggedSymbol,
174
181
  event_token: String,
175
- timestamp: Time
182
+ timestamp: Time,
183
+ transaction_token: T.nilable(String)
176
184
  }
177
185
  )
178
186
  end
@@ -144,6 +144,12 @@ module Lithic
144
144
  # trailing hour up and until the authorization.
145
145
  # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
146
146
  # trailing 24 hours up and until the authorization.
147
+ # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
148
+ # the trailing 15 minutes before the authorization.
149
+ # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
150
+ # the trailing hour up and until the authorization.
151
+ # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
152
+ # the trailing 24 hours up and until the authorization.
147
153
  # - `CARD_STATE`: The current state of the card associated with the transaction.
148
154
  # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
149
155
  # `PENDING_FULFILLMENT`.
@@ -170,6 +176,33 @@ module Lithic
170
176
  # - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
171
177
  # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
172
178
  # of the authorization.
179
+ # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the
180
+ # entity's transaction history. Null if fewer than 30 approved transactions in
181
+ # the specified window. Requires `parameters.scope` and `parameters.interval`.
182
+ # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the
183
+ # entity over the specified window, in cents. Requires `parameters.scope` and
184
+ # `parameters.interval`.
185
+ # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction
186
+ # amounts for the entity over the specified window, in cents. Null if fewer than
187
+ # 30 approved transactions in the specified window. Requires `parameters.scope`
188
+ # and `parameters.interval`.
189
+ # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen
190
+ # in the entity's transaction history. Valid values are `TRUE`, `FALSE`.
191
+ # Requires `parameters.scope`.
192
+ # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's
193
+ # transaction history. Valid values are `TRUE`, `FALSE`. Requires
194
+ # `parameters.scope`.
195
+ # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity.
196
+ # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`.
197
+ # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for
198
+ # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not
199
+ # supported for `BUSINESS_ACCOUNT` scope.
200
+ # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved
201
+ # transaction for the entity. Requires `parameters.scope`.
202
+ # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in
203
+ # the entity's transaction history. Requires `parameters.scope`.
204
+ # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
205
+ # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
173
206
  sig do
174
207
  returns(
175
208
  Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol
@@ -185,12 +218,36 @@ module Lithic
185
218
  sig { returns(Lithic::AuthRules::ConditionalValue::Variants) }
186
219
  attr_accessor :value
187
220
 
221
+ # Additional parameters required for transaction history signal attributes.
222
+ # Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
223
+ # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`,
224
+ # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`,
225
+ # or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes.
226
+ sig do
227
+ returns(
228
+ T.nilable(
229
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters
230
+ )
231
+ )
232
+ end
233
+ attr_reader :parameters
234
+
235
+ sig do
236
+ params(
237
+ parameters:
238
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::OrHash
239
+ ).void
240
+ end
241
+ attr_writer :parameters
242
+
188
243
  sig do
189
244
  params(
190
245
  attribute:
191
246
  Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol,
192
247
  operation: Lithic::AuthRules::ConditionalOperation::OrSymbol,
193
- value: Lithic::AuthRules::ConditionalValue::Variants
248
+ value: Lithic::AuthRules::ConditionalValue::Variants,
249
+ parameters:
250
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::OrHash
194
251
  ).returns(T.attached_class)
195
252
  end
196
253
  def self.new(
@@ -233,6 +290,12 @@ module Lithic
233
290
  # trailing hour up and until the authorization.
234
291
  # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
235
292
  # trailing 24 hours up and until the authorization.
293
+ # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
294
+ # the trailing 15 minutes before the authorization.
295
+ # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
296
+ # the trailing hour up and until the authorization.
297
+ # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
298
+ # the trailing 24 hours up and until the authorization.
236
299
  # - `CARD_STATE`: The current state of the card associated with the transaction.
237
300
  # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
238
301
  # `PENDING_FULFILLMENT`.
@@ -259,11 +322,44 @@ module Lithic
259
322
  # - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
260
323
  # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
261
324
  # of the authorization.
325
+ # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the
326
+ # entity's transaction history. Null if fewer than 30 approved transactions in
327
+ # the specified window. Requires `parameters.scope` and `parameters.interval`.
328
+ # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the
329
+ # entity over the specified window, in cents. Requires `parameters.scope` and
330
+ # `parameters.interval`.
331
+ # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction
332
+ # amounts for the entity over the specified window, in cents. Null if fewer than
333
+ # 30 approved transactions in the specified window. Requires `parameters.scope`
334
+ # and `parameters.interval`.
335
+ # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen
336
+ # in the entity's transaction history. Valid values are `TRUE`, `FALSE`.
337
+ # Requires `parameters.scope`.
338
+ # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's
339
+ # transaction history. Valid values are `TRUE`, `FALSE`. Requires
340
+ # `parameters.scope`.
341
+ # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity.
342
+ # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`.
343
+ # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for
344
+ # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not
345
+ # supported for `BUSINESS_ACCOUNT` scope.
346
+ # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved
347
+ # transaction for the entity. Requires `parameters.scope`.
348
+ # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in
349
+ # the entity's transaction history. Requires `parameters.scope`.
350
+ # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
351
+ # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
262
352
  attribute:,
263
353
  # The operation to apply to the attribute
264
354
  operation:,
265
355
  # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
266
- value:
356
+ value:,
357
+ # Additional parameters required for transaction history signal attributes.
358
+ # Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
359
+ # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`,
360
+ # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`,
361
+ # or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes.
362
+ parameters: nil
267
363
  )
268
364
  end
269
365
 
@@ -273,7 +369,9 @@ module Lithic
273
369
  attribute:
274
370
  Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol,
275
371
  operation: Lithic::AuthRules::ConditionalOperation::OrSymbol,
276
- value: Lithic::AuthRules::ConditionalValue::Variants
372
+ value: Lithic::AuthRules::ConditionalValue::Variants,
373
+ parameters:
374
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters
277
375
  }
278
376
  )
279
377
  end
@@ -319,6 +417,12 @@ module Lithic
319
417
  # trailing hour up and until the authorization.
320
418
  # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
321
419
  # trailing 24 hours up and until the authorization.
420
+ # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
421
+ # the trailing 15 minutes before the authorization.
422
+ # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
423
+ # the trailing hour up and until the authorization.
424
+ # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
425
+ # the trailing 24 hours up and until the authorization.
322
426
  # - `CARD_STATE`: The current state of the card associated with the transaction.
323
427
  # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
324
428
  # `PENDING_FULFILLMENT`.
@@ -345,6 +449,33 @@ module Lithic
345
449
  # - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
346
450
  # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
347
451
  # of the authorization.
452
+ # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the
453
+ # entity's transaction history. Null if fewer than 30 approved transactions in
454
+ # the specified window. Requires `parameters.scope` and `parameters.interval`.
455
+ # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the
456
+ # entity over the specified window, in cents. Requires `parameters.scope` and
457
+ # `parameters.interval`.
458
+ # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction
459
+ # amounts for the entity over the specified window, in cents. Null if fewer than
460
+ # 30 approved transactions in the specified window. Requires `parameters.scope`
461
+ # and `parameters.interval`.
462
+ # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen
463
+ # in the entity's transaction history. Valid values are `TRUE`, `FALSE`.
464
+ # Requires `parameters.scope`.
465
+ # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's
466
+ # transaction history. Valid values are `TRUE`, `FALSE`. Requires
467
+ # `parameters.scope`.
468
+ # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity.
469
+ # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`.
470
+ # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for
471
+ # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not
472
+ # supported for `BUSINESS_ACCOUNT` scope.
473
+ # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved
474
+ # transaction for the entity. Requires `parameters.scope`.
475
+ # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in
476
+ # the entity's transaction history. Requires `parameters.scope`.
477
+ # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
478
+ # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
348
479
  module Attribute
349
480
  extend Lithic::Internal::Type::Enum
350
481
 
@@ -422,6 +553,21 @@ module Lithic
422
553
  :CARD_TRANSACTION_COUNT_24H,
423
554
  Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
424
555
  )
556
+ CARD_DECLINE_COUNT_15_M =
557
+ T.let(
558
+ :CARD_DECLINE_COUNT_15M,
559
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
560
+ )
561
+ CARD_DECLINE_COUNT_1_H =
562
+ T.let(
563
+ :CARD_DECLINE_COUNT_1H,
564
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
565
+ )
566
+ CARD_DECLINE_COUNT_24_H =
567
+ T.let(
568
+ :CARD_DECLINE_COUNT_24H,
569
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
570
+ )
425
571
  CARD_STATE =
426
572
  T.let(
427
573
  :CARD_STATE,
@@ -472,6 +618,56 @@ module Lithic
472
618
  :ACCOUNT_AGE,
473
619
  Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
474
620
  )
621
+ AMOUNT_Z_SCORE =
622
+ T.let(
623
+ :AMOUNT_Z_SCORE,
624
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
625
+ )
626
+ AVG_TRANSACTION_AMOUNT =
627
+ T.let(
628
+ :AVG_TRANSACTION_AMOUNT,
629
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
630
+ )
631
+ STDEV_TRANSACTION_AMOUNT =
632
+ T.let(
633
+ :STDEV_TRANSACTION_AMOUNT,
634
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
635
+ )
636
+ IS_NEW_COUNTRY =
637
+ T.let(
638
+ :IS_NEW_COUNTRY,
639
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
640
+ )
641
+ IS_NEW_MCC =
642
+ T.let(
643
+ :IS_NEW_MCC,
644
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
645
+ )
646
+ IS_FIRST_TRANSACTION =
647
+ T.let(
648
+ :IS_FIRST_TRANSACTION,
649
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
650
+ )
651
+ CONSECUTIVE_DECLINES =
652
+ T.let(
653
+ :CONSECUTIVE_DECLINES,
654
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
655
+ )
656
+ TIME_SINCE_LAST_TRANSACTION =
657
+ T.let(
658
+ :TIME_SINCE_LAST_TRANSACTION,
659
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
660
+ )
661
+ DISTINCT_COUNTRY_COUNT =
662
+ T.let(
663
+ :DISTINCT_COUNTRY_COUNT,
664
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
665
+ )
666
+ THREE_DS_SUCCESS_RATE =
667
+ T.let(
668
+ :THREE_DS_SUCCESS_RATE,
669
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol
670
+ )
475
671
 
476
672
  sig do
477
673
  override.returns(
@@ -483,6 +679,177 @@ module Lithic
483
679
  def self.values
484
680
  end
485
681
  end
682
+
683
+ class Parameters < Lithic::Internal::Type::BaseModel
684
+ OrHash =
685
+ T.type_alias do
686
+ T.any(
687
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters,
688
+ Lithic::Internal::AnyHash
689
+ )
690
+ end
691
+
692
+ # The time window for statistical attributes (`AMOUNT_Z_SCORE`,
693
+ # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
694
+ # all-time history or a specific window (`7D`, `30D`, `90D`).
695
+ sig do
696
+ returns(
697
+ T.nilable(
698
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol
699
+ )
700
+ )
701
+ end
702
+ attr_reader :interval
703
+
704
+ sig do
705
+ params(
706
+ interval:
707
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol
708
+ ).void
709
+ end
710
+ attr_writer :interval
711
+
712
+ # The entity scope to evaluate the attribute against.
713
+ sig do
714
+ returns(
715
+ T.nilable(
716
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol
717
+ )
718
+ )
719
+ end
720
+ attr_reader :scope
721
+
722
+ sig do
723
+ params(
724
+ scope:
725
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol
726
+ ).void
727
+ end
728
+ attr_writer :scope
729
+
730
+ # Additional parameters required for transaction history signal attributes.
731
+ # Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
732
+ # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`,
733
+ # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`,
734
+ # or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes.
735
+ sig do
736
+ params(
737
+ interval:
738
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol,
739
+ scope:
740
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol
741
+ ).returns(T.attached_class)
742
+ end
743
+ def self.new(
744
+ # The time window for statistical attributes (`AMOUNT_Z_SCORE`,
745
+ # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
746
+ # all-time history or a specific window (`7D`, `30D`, `90D`).
747
+ interval: nil,
748
+ # The entity scope to evaluate the attribute against.
749
+ scope: nil
750
+ )
751
+ end
752
+
753
+ sig do
754
+ override.returns(
755
+ {
756
+ interval:
757
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol,
758
+ scope:
759
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol
760
+ }
761
+ )
762
+ end
763
+ def to_hash
764
+ end
765
+
766
+ # The time window for statistical attributes (`AMOUNT_Z_SCORE`,
767
+ # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
768
+ # all-time history or a specific window (`7D`, `30D`, `90D`).
769
+ module Interval
770
+ extend Lithic::Internal::Type::Enum
771
+
772
+ TaggedSymbol =
773
+ T.type_alias do
774
+ T.all(
775
+ Symbol,
776
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval
777
+ )
778
+ end
779
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
780
+
781
+ LIFETIME =
782
+ T.let(
783
+ :LIFETIME,
784
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol
785
+ )
786
+ INTERVAL_7_D =
787
+ T.let(
788
+ :"7D",
789
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol
790
+ )
791
+ INTERVAL_30_D =
792
+ T.let(
793
+ :"30D",
794
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol
795
+ )
796
+ INTERVAL_90_D =
797
+ T.let(
798
+ :"90D",
799
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol
800
+ )
801
+
802
+ sig do
803
+ override.returns(
804
+ T::Array[
805
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol
806
+ ]
807
+ )
808
+ end
809
+ def self.values
810
+ end
811
+ end
812
+
813
+ # The entity scope to evaluate the attribute against.
814
+ module Scope
815
+ extend Lithic::Internal::Type::Enum
816
+
817
+ TaggedSymbol =
818
+ T.type_alias do
819
+ T.all(
820
+ Symbol,
821
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope
822
+ )
823
+ end
824
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
825
+
826
+ CARD =
827
+ T.let(
828
+ :CARD,
829
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol
830
+ )
831
+ ACCOUNT =
832
+ T.let(
833
+ :ACCOUNT,
834
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol
835
+ )
836
+ BUSINESS_ACCOUNT =
837
+ T.let(
838
+ :BUSINESS_ACCOUNT,
839
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol
840
+ )
841
+
842
+ sig do
843
+ override.returns(
844
+ T::Array[
845
+ Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol
846
+ ]
847
+ )
848
+ end
849
+ def self.values
850
+ end
851
+ end
852
+ end
486
853
  end
487
854
  end
488
855
  end