lithic 0.21.0 → 0.22.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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +1 -10
  4. data/lib/lithic/internal/type/union.rb +21 -7
  5. data/lib/lithic/models/account_holder_create_params.rb +4 -2
  6. data/lib/lithic/models/account_holder_simulate_enrollment_review_response.rb +120 -66
  7. data/lib/lithic/models/account_holder_update_params.rb +6 -3
  8. data/lib/lithic/models/account_holder_update_response.rb +156 -86
  9. data/lib/lithic/models/account_holder_updated_webhook_event.rb +120 -66
  10. data/lib/lithic/models/account_holders/account_holder_entity.rb +35 -19
  11. data/lib/lithic/models/account_holders/entity_create_params.rb +39 -21
  12. data/lib/lithic/models/address.rb +33 -19
  13. data/lib/lithic/models/address_update.rb +27 -11
  14. data/lib/lithic/models/auth_rules/auth_rule.rb +55 -27
  15. data/lib/lithic/models/auth_rules/auth_rule_condition.rb +189 -6
  16. data/lib/lithic/models/auth_rules/auth_rule_entities.rb +47 -0
  17. data/lib/lithic/models/auth_rules/auth_rule_entities_response.rb +31 -0
  18. data/lib/lithic/models/auth_rules/auth_rule_entity.rb +150 -0
  19. data/lib/lithic/models/auth_rules/auth_rule_version.rb +3 -6
  20. data/lib/lithic/models/auth_rules/conditional_3ds_action_parameters.rb +33 -6
  21. data/lib/lithic/models/auth_rules/conditional_attribute.rb +101 -5
  22. data/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb +3 -439
  23. data/lib/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rb +7 -0
  24. data/lib/lithic/models/auth_rules/merchant_lock_parameters.rb +11 -1
  25. data/lib/lithic/models/auth_rules/v2_create_params.rb +203 -45
  26. data/lib/lithic/models/auth_rules/v2_draft_params.rb +3 -6
  27. data/lib/lithic/models/auth_rules/v2_list_params.rb +5 -3
  28. data/lib/lithic/models/auth_rules/v2_update_entities_params.rb +39 -0
  29. data/lib/lithic/models/auth_rules/v2_update_params.rb +133 -12
  30. data/lib/lithic/models/card_authorization.rb +11 -1
  31. data/lib/lithic/models/card_create_params.rb +11 -1
  32. data/lib/lithic/models/card_update_params.rb +12 -1
  33. data/lib/lithic/models/financial_accounts/installment_plans/installment_plan_statement.rb +279 -0
  34. data/lib/lithic/models/financial_accounts/installment_plans/statement_list_params.rb +106 -0
  35. data/lib/lithic/models/financial_accounts/installment_plans/statement_retrieve_params.rb +42 -0
  36. data/lib/lithic/models/financial_accounts/loan_tape.rb +62 -1
  37. data/lib/lithic/models/kyb.rb +4 -2
  38. data/lib/lithic/models/kyb_business_entity.rb +35 -19
  39. data/lib/lithic/models/kyc.rb +2 -1
  40. data/lib/lithic/models/non_pci_card.rb +11 -1
  41. data/lib/lithic/models/parsed_webhook_event.rb +120 -66
  42. data/lib/lithic/models/payment.rb +2 -1
  43. data/lib/lithic/models/transaction.rb +2 -1
  44. data/lib/lithic/models/transaction_simulate_authorization_params.rb +28 -4
  45. data/lib/lithic/models/transaction_simulate_credit_authorization_advice_params.rb +11 -1
  46. data/lib/lithic/models/transaction_simulate_return_params.rb +24 -1
  47. data/lib/lithic/resources/auth_rules/v2/backtests.rb +8 -8
  48. data/lib/lithic/resources/auth_rules/v2.rb +44 -8
  49. data/lib/lithic/resources/cards.rb +6 -2
  50. data/lib/lithic/resources/financial_accounts/installment_plans/statements.rb +107 -0
  51. data/lib/lithic/resources/financial_accounts/installment_plans.rb +4 -0
  52. data/lib/lithic/resources/transactions.rb +17 -4
  53. data/lib/lithic/resources/webhooks.rb +18 -0
  54. data/lib/lithic/version.rb +1 -1
  55. data/lib/lithic.rb +8 -1
  56. data/rbi/lithic/models/account_holder_create_params.rbi +8 -4
  57. data/rbi/lithic/models/account_holder_simulate_enrollment_review_response.rbi +195 -90
  58. data/rbi/lithic/models/account_holder_update_params.rbi +12 -6
  59. data/rbi/lithic/models/account_holder_update_response.rbi +254 -117
  60. data/rbi/lithic/models/account_holder_updated_webhook_event.rbi +195 -90
  61. data/rbi/lithic/models/account_holders/account_holder_entity.rbi +59 -27
  62. data/rbi/lithic/models/account_holders/entity_create_params.rbi +65 -30
  63. data/rbi/lithic/models/address.rbi +57 -29
  64. data/rbi/lithic/models/address_update.rbi +50 -24
  65. data/rbi/lithic/models/auth_rules/auth_rule.rbi +53 -19
  66. data/rbi/lithic/models/auth_rules/auth_rule_condition.rbi +442 -13
  67. data/rbi/lithic/models/auth_rules/auth_rule_entities.rbi +163 -0
  68. data/rbi/lithic/models/auth_rules/auth_rule_entities_response.rbi +72 -0
  69. data/rbi/lithic/models/auth_rules/auth_rule_entity.rbi +199 -0
  70. data/rbi/lithic/models/auth_rules/auth_rule_version.rbi +0 -2
  71. data/rbi/lithic/models/auth_rules/conditional_3ds_action_parameters.rbi +67 -9
  72. data/rbi/lithic/models/auth_rules/conditional_attribute.rbi +193 -5
  73. data/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi +3 -939
  74. data/rbi/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rbi +14 -0
  75. data/rbi/lithic/models/auth_rules/merchant_lock_parameters.rbi +14 -3
  76. data/rbi/lithic/models/auth_rules/v2_create_params.rbi +325 -50
  77. data/rbi/lithic/models/auth_rules/v2_draft_params.rbi +0 -4
  78. data/rbi/lithic/models/auth_rules/v2_list_params.rbi +6 -3
  79. data/rbi/lithic/models/auth_rules/v2_update_entities_params.rbi +68 -0
  80. data/rbi/lithic/models/auth_rules/v2_update_params.rbi +198 -5
  81. data/rbi/lithic/models/card_authorization.rbi +12 -0
  82. data/rbi/lithic/models/card_create_params.rbi +15 -0
  83. data/rbi/lithic/models/card_update_params.rbi +17 -0
  84. data/rbi/lithic/models/financial_accounts/installment_plans/installment_plan_statement.rbi +452 -0
  85. data/rbi/lithic/models/financial_accounts/installment_plans/statement_list_params.rbi +191 -0
  86. data/rbi/lithic/models/financial_accounts/installment_plans/statement_retrieve_params.rbi +66 -0
  87. data/rbi/lithic/models/financial_accounts/loan_tape.rbi +119 -0
  88. data/rbi/lithic/models/kyb.rbi +8 -4
  89. data/rbi/lithic/models/kyb_business_entity.rbi +59 -27
  90. data/rbi/lithic/models/kyc.rbi +4 -2
  91. data/rbi/lithic/models/non_pci_card.rbi +12 -0
  92. data/rbi/lithic/models/parsed_webhook_event.rbi +195 -90
  93. data/rbi/lithic/models/payment.rbi +4 -2
  94. data/rbi/lithic/models/transaction.rbi +4 -2
  95. data/rbi/lithic/models/transaction_simulate_authorization_params.rbi +42 -4
  96. data/rbi/lithic/models/transaction_simulate_credit_authorization_advice_params.rbi +15 -0
  97. data/rbi/lithic/models/transaction_simulate_return_params.rbi +30 -0
  98. data/rbi/lithic/resources/account_holders/entities.rbi +2 -1
  99. data/rbi/lithic/resources/auth_rules/v2/backtests.rbi +8 -8
  100. data/rbi/lithic/resources/auth_rules/v2.rbi +43 -8
  101. data/rbi/lithic/resources/cards.rbi +11 -0
  102. data/rbi/lithic/resources/financial_accounts/installment_plans/statements.rbi +86 -0
  103. data/rbi/lithic/resources/financial_accounts/installment_plans.rbi +7 -0
  104. data/rbi/lithic/resources/transactions.rbi +31 -2
  105. data/sig/lithic/models/account_holder_simulate_enrollment_review_response.rbs +39 -39
  106. data/sig/lithic/models/account_holder_update_response.rbs +52 -52
  107. data/sig/lithic/models/account_holder_updated_webhook_event.rbs +39 -39
  108. data/sig/lithic/models/account_holders/account_holder_entity.rbs +13 -13
  109. data/sig/lithic/models/account_holders/entity_create_params.rbs +13 -13
  110. data/sig/lithic/models/address.rbs +13 -13
  111. data/sig/lithic/models/address_update.rbs +8 -12
  112. data/sig/lithic/models/auth_rules/auth_rule.rbs +8 -7
  113. data/sig/lithic/models/auth_rules/auth_rule_condition.rbs +89 -3
  114. data/sig/lithic/models/auth_rules/auth_rule_entities.rbs +37 -0
  115. data/sig/lithic/models/auth_rules/auth_rule_entities_response.rbs +29 -0
  116. data/sig/lithic/models/auth_rules/auth_rule_entity.rbs +80 -0
  117. data/sig/lithic/models/auth_rules/auth_rule_version.rbs +1 -2
  118. data/sig/lithic/models/auth_rules/conditional_3ds_action_parameters.rbs +10 -0
  119. data/sig/lithic/models/auth_rules/conditional_attribute.rbs +46 -0
  120. data/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs +4 -204
  121. data/sig/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rbs +2 -0
  122. data/sig/lithic/models/auth_rules/merchant_lock_parameters.rbs +10 -3
  123. data/sig/lithic/models/auth_rules/v2_create_params.rbs +86 -16
  124. data/sig/lithic/models/auth_rules/v2_draft_params.rbs +1 -2
  125. data/sig/lithic/models/auth_rules/v2_update_entities_params.rbs +46 -0
  126. data/sig/lithic/models/auth_rules/v2_update_params.rbs +47 -1
  127. data/sig/lithic/models/card_authorization.rbs +5 -0
  128. data/sig/lithic/models/card_create_params.rbs +7 -0
  129. data/sig/lithic/models/card_update_params.rbs +8 -1
  130. data/sig/lithic/models/financial_accounts/installment_plans/installment_plan_statement.rbs +191 -0
  131. data/sig/lithic/models/financial_accounts/installment_plans/statement_list_params.rbs +90 -0
  132. data/sig/lithic/models/financial_accounts/installment_plans/statement_retrieve_params.rbs +40 -0
  133. data/sig/lithic/models/financial_accounts/loan_tape.rbs +47 -0
  134. data/sig/lithic/models/kyb_business_entity.rbs +13 -13
  135. data/sig/lithic/models/non_pci_card.rbs +5 -0
  136. data/sig/lithic/models/parsed_webhook_event.rbs +39 -39
  137. data/sig/lithic/models/transaction_simulate_authorization_params.rbs +14 -0
  138. data/sig/lithic/models/transaction_simulate_credit_authorization_advice_params.rbs +7 -0
  139. data/sig/lithic/models/transaction_simulate_return_params.rbs +19 -1
  140. data/sig/lithic/resources/auth_rules/v2.rbs +7 -0
  141. data/sig/lithic/resources/cards.rbs +2 -0
  142. data/sig/lithic/resources/financial_accounts/installment_plans/statements.rbs +30 -0
  143. data/sig/lithic/resources/financial_accounts/installment_plans.rbs +2 -0
  144. data/sig/lithic/resources/transactions.rbs +5 -0
  145. metadata +26 -5
  146. data/lib/lithic/models/auth_rules/conditional_block_parameters.rb +0 -20
  147. data/rbi/lithic/models/auth_rules/conditional_block_parameters.rbi +0 -37
  148. data/sig/lithic/models/auth_rules/conditional_block_parameters.rbs +0 -20
@@ -39,18 +39,27 @@ module Lithic
39
39
  # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
40
40
  # fee field in the settlement/cardholder billing currency. This is the amount
41
41
  # the issuer should authorize against unless the issuer is paying the acquirer
42
- # fee on behalf of the cardholder.
42
+ # fee on behalf of the cardholder. Use an integer value.
43
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
44
+ # represents the amount of cash being withdrawn or advanced. Use an integer
45
+ # value.
43
46
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
44
47
  # given authorization. Scores are on a range of 0-999, with 0 representing the
45
48
  # lowest risk and 999 representing the highest risk. For Visa transactions,
46
49
  # where the raw score has a range of 0-99, Lithic will normalize the score by
47
- # multiplying the raw score by 10x.
50
+ # multiplying the raw score by 10x. Use an integer value.
48
51
  # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the
49
- # trailing 15 minutes before the authorization.
52
+ # trailing 15 minutes before the authorization. Use an integer value.
50
53
  # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
51
- # trailing hour up and until the authorization.
54
+ # trailing hour up and until the authorization. Use an integer value.
52
55
  # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
53
- # trailing 24 hours up and until the authorization.
56
+ # trailing 24 hours up and until the authorization. Use an integer value.
57
+ # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
58
+ # the trailing 15 minutes before the authorization. Use an integer value.
59
+ # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
60
+ # the trailing hour up and until the authorization. Use an integer value.
61
+ # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
62
+ # the trailing 24 hours up and until the authorization. Use an integer value.
54
63
  # - `CARD_STATE`: The current state of the card associated with the transaction.
55
64
  # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
56
65
  # `PENDING_FULFILLMENT`.
@@ -61,9 +70,73 @@ module Lithic
61
70
  # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the
62
71
  # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`,
63
72
  # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`.
73
+ # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates
74
+ # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`.
64
75
  # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address
65
76
  # data with the cardholder KYC data if it exists. Valid values are `MATCH`,
66
77
  # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
78
+ # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the
79
+ # cardholder received the service, e.g. "NY". When a service location is present
80
+ # in the network data, the service location state is used. Otherwise, falls back
81
+ # to the card acceptor state.
82
+ # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received
83
+ # the service, e.g. "10001". When a service location is present in the network
84
+ # data, the service location postal code is used. Otherwise, falls back to the
85
+ # card acceptor postal code.
86
+ # - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
87
+ # Use an integer value.
88
+ # - `IS_DOMESTIC`: Whether the merchant's country matches the card program's
89
+ # issuing country. Valid values are `TRUE`, `FALSE`. For programs with no
90
+ # issuing country configured, this attribute does not evaluate.
91
+ # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
92
+ # of the authorization. Use an integer value. For programs where Lithic does not
93
+ # manage or retain account holder data, this attribute does not evaluate.
94
+ # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the
95
+ # entity's transaction history. Null if fewer than 30 approved transactions in
96
+ # the specified window. Requires `parameters.scope` and `parameters.interval`.
97
+ # Use a decimal value.
98
+ # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the
99
+ # entity over the specified window, in cents. Requires `parameters.scope` and
100
+ # `parameters.interval`. Use a decimal value.
101
+ # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction
102
+ # amounts for the entity over the specified window, in cents. Null if fewer than
103
+ # 30 approved transactions in the specified window. Requires `parameters.scope`
104
+ # and `parameters.interval`. Use a decimal value.
105
+ # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen
106
+ # in the entity's transaction history. Valid values are `TRUE`, `FALSE`.
107
+ # Requires `parameters.scope`.
108
+ # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's
109
+ # transaction history. Valid values are `TRUE`, `FALSE`. Requires
110
+ # `parameters.scope`.
111
+ # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity.
112
+ # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`.
113
+ # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for
114
+ # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not
115
+ # supported for `BUSINESS_ACCOUNT` scope. Use an integer value.
116
+ # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved
117
+ # transaction for the entity, rounded to the nearest whole day. Requires
118
+ # `parameters.scope`. Use an integer value.
119
+ # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in
120
+ # the entity's transaction history. Requires `parameters.scope`. Use an integer
121
+ # value.
122
+ # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the
123
+ # card's approved transaction history (capped at the 1000 most recently seen
124
+ # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no
125
+ # `parameters` required.
126
+ # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
127
+ # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
128
+ # Use a decimal value.
129
+ # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance
130
+ # between the postal code centers of the last card-present transaction and the
131
+ # current transaction, divided by the elapsed time. Null if there is no prior
132
+ # card-present transaction, if either postal code cannot be geocoded, or if
133
+ # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a
134
+ # decimal value.
135
+ # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal
136
+ # code centers of the last card-present transaction and the current transaction.
137
+ # Null if there is no prior card-present transaction or if either postal code
138
+ # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`.
139
+ # Use a decimal value.
67
140
  sig { returns(Lithic::AuthRules::ConditionalAttribute::OrSymbol) }
68
141
  attr_accessor :attribute
69
142
 
@@ -75,11 +148,30 @@ module Lithic
75
148
  sig { returns(Lithic::AuthRules::ConditionalValue::Variants) }
76
149
  attr_accessor :value
77
150
 
151
+ # Additional parameters for certain attributes. Required when `attribute` is one
152
+ # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`,
153
+ # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`,
154
+ # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or
155
+ # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used
156
+ # for other attributes.
157
+ sig do
158
+ returns(T.nilable(Lithic::AuthRules::AuthRuleCondition::Parameters))
159
+ end
160
+ attr_reader :parameters
161
+
162
+ sig do
163
+ params(
164
+ parameters: Lithic::AuthRules::AuthRuleCondition::Parameters::OrHash
165
+ ).void
166
+ end
167
+ attr_writer :parameters
168
+
78
169
  sig do
79
170
  params(
80
171
  attribute: Lithic::AuthRules::ConditionalAttribute::OrSymbol,
81
172
  operation: Lithic::AuthRules::ConditionalOperation::OrSymbol,
82
- value: Lithic::AuthRules::ConditionalValue::Variants
173
+ value: Lithic::AuthRules::ConditionalValue::Variants,
174
+ parameters: Lithic::AuthRules::AuthRuleCondition::Parameters::OrHash
83
175
  ).returns(T.attached_class)
84
176
  end
85
177
  def self.new(
@@ -108,18 +200,27 @@ module Lithic
108
200
  # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
109
201
  # fee field in the settlement/cardholder billing currency. This is the amount
110
202
  # the issuer should authorize against unless the issuer is paying the acquirer
111
- # fee on behalf of the cardholder.
203
+ # fee on behalf of the cardholder. Use an integer value.
204
+ # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
205
+ # represents the amount of cash being withdrawn or advanced. Use an integer
206
+ # value.
112
207
  # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
113
208
  # given authorization. Scores are on a range of 0-999, with 0 representing the
114
209
  # lowest risk and 999 representing the highest risk. For Visa transactions,
115
210
  # where the raw score has a range of 0-99, Lithic will normalize the score by
116
- # multiplying the raw score by 10x.
211
+ # multiplying the raw score by 10x. Use an integer value.
117
212
  # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the
118
- # trailing 15 minutes before the authorization.
213
+ # trailing 15 minutes before the authorization. Use an integer value.
119
214
  # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
120
- # trailing hour up and until the authorization.
215
+ # trailing hour up and until the authorization. Use an integer value.
121
216
  # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
122
- # trailing 24 hours up and until the authorization.
217
+ # trailing 24 hours up and until the authorization. Use an integer value.
218
+ # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
219
+ # the trailing 15 minutes before the authorization. Use an integer value.
220
+ # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
221
+ # the trailing hour up and until the authorization. Use an integer value.
222
+ # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
223
+ # the trailing 24 hours up and until the authorization. Use an integer value.
123
224
  # - `CARD_STATE`: The current state of the card associated with the transaction.
124
225
  # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
125
226
  # `PENDING_FULFILLMENT`.
@@ -130,14 +231,85 @@ module Lithic
130
231
  # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the
131
232
  # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`,
132
233
  # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`.
234
+ # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates
235
+ # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`.
133
236
  # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address
134
237
  # data with the cardholder KYC data if it exists. Valid values are `MATCH`,
135
238
  # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
239
+ # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the
240
+ # cardholder received the service, e.g. "NY". When a service location is present
241
+ # in the network data, the service location state is used. Otherwise, falls back
242
+ # to the card acceptor state.
243
+ # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received
244
+ # the service, e.g. "10001". When a service location is present in the network
245
+ # data, the service location postal code is used. Otherwise, falls back to the
246
+ # card acceptor postal code.
247
+ # - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
248
+ # Use an integer value.
249
+ # - `IS_DOMESTIC`: Whether the merchant's country matches the card program's
250
+ # issuing country. Valid values are `TRUE`, `FALSE`. For programs with no
251
+ # issuing country configured, this attribute does not evaluate.
252
+ # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
253
+ # of the authorization. Use an integer value. For programs where Lithic does not
254
+ # manage or retain account holder data, this attribute does not evaluate.
255
+ # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the
256
+ # entity's transaction history. Null if fewer than 30 approved transactions in
257
+ # the specified window. Requires `parameters.scope` and `parameters.interval`.
258
+ # Use a decimal value.
259
+ # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the
260
+ # entity over the specified window, in cents. Requires `parameters.scope` and
261
+ # `parameters.interval`. Use a decimal value.
262
+ # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction
263
+ # amounts for the entity over the specified window, in cents. Null if fewer than
264
+ # 30 approved transactions in the specified window. Requires `parameters.scope`
265
+ # and `parameters.interval`. Use a decimal value.
266
+ # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen
267
+ # in the entity's transaction history. Valid values are `TRUE`, `FALSE`.
268
+ # Requires `parameters.scope`.
269
+ # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's
270
+ # transaction history. Valid values are `TRUE`, `FALSE`. Requires
271
+ # `parameters.scope`.
272
+ # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity.
273
+ # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`.
274
+ # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for
275
+ # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not
276
+ # supported for `BUSINESS_ACCOUNT` scope. Use an integer value.
277
+ # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved
278
+ # transaction for the entity, rounded to the nearest whole day. Requires
279
+ # `parameters.scope`. Use an integer value.
280
+ # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in
281
+ # the entity's transaction history. Requires `parameters.scope`. Use an integer
282
+ # value.
283
+ # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the
284
+ # card's approved transaction history (capped at the 1000 most recently seen
285
+ # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no
286
+ # `parameters` required.
287
+ # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
288
+ # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
289
+ # Use a decimal value.
290
+ # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance
291
+ # between the postal code centers of the last card-present transaction and the
292
+ # current transaction, divided by the elapsed time. Null if there is no prior
293
+ # card-present transaction, if either postal code cannot be geocoded, or if
294
+ # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a
295
+ # decimal value.
296
+ # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal
297
+ # code centers of the last card-present transaction and the current transaction.
298
+ # Null if there is no prior card-present transaction or if either postal code
299
+ # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`.
300
+ # Use a decimal value.
136
301
  attribute:,
137
302
  # The operation to apply to the attribute
138
303
  operation:,
139
304
  # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
140
- value:
305
+ value:,
306
+ # Additional parameters for certain attributes. Required when `attribute` is one
307
+ # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`,
308
+ # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`,
309
+ # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or
310
+ # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used
311
+ # for other attributes.
312
+ parameters: nil
141
313
  )
142
314
  end
143
315
 
@@ -146,12 +318,269 @@ module Lithic
146
318
  {
147
319
  attribute: Lithic::AuthRules::ConditionalAttribute::OrSymbol,
148
320
  operation: Lithic::AuthRules::ConditionalOperation::OrSymbol,
149
- value: Lithic::AuthRules::ConditionalValue::Variants
321
+ value: Lithic::AuthRules::ConditionalValue::Variants,
322
+ parameters: Lithic::AuthRules::AuthRuleCondition::Parameters
150
323
  }
151
324
  )
152
325
  end
153
326
  def to_hash
154
327
  end
328
+
329
+ class Parameters < Lithic::Internal::Type::BaseModel
330
+ OrHash =
331
+ T.type_alias do
332
+ T.any(
333
+ Lithic::AuthRules::AuthRuleCondition::Parameters,
334
+ Lithic::Internal::AnyHash
335
+ )
336
+ end
337
+
338
+ # The time window for statistical attributes (`AMOUNT_Z_SCORE`,
339
+ # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
340
+ # all-time history or a specific window (`7D`, `30D`, `90D`).
341
+ sig do
342
+ returns(
343
+ T.nilable(
344
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::OrSymbol
345
+ )
346
+ )
347
+ end
348
+ attr_reader :interval
349
+
350
+ sig do
351
+ params(
352
+ interval:
353
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::OrSymbol
354
+ ).void
355
+ end
356
+ attr_writer :interval
357
+
358
+ # The entity scope to evaluate the attribute against.
359
+ sig do
360
+ returns(
361
+ T.nilable(
362
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope::OrSymbol
363
+ )
364
+ )
365
+ end
366
+ attr_reader :scope
367
+
368
+ sig do
369
+ params(
370
+ scope:
371
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope::OrSymbol
372
+ ).void
373
+ end
374
+ attr_writer :scope
375
+
376
+ # The unit for impossible travel attributes. Required when `attribute` is
377
+ # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`.
378
+ #
379
+ # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour).
380
+ #
381
+ # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`.
382
+ sig do
383
+ returns(
384
+ T.nilable(
385
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::OrSymbol
386
+ )
387
+ )
388
+ end
389
+ attr_reader :unit
390
+
391
+ sig do
392
+ params(
393
+ unit:
394
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::OrSymbol
395
+ ).void
396
+ end
397
+ attr_writer :unit
398
+
399
+ # Additional parameters for certain attributes. Required when `attribute` is one
400
+ # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`,
401
+ # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`,
402
+ # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or
403
+ # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used
404
+ # for other attributes.
405
+ sig do
406
+ params(
407
+ interval:
408
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::OrSymbol,
409
+ scope:
410
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope::OrSymbol,
411
+ unit:
412
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::OrSymbol
413
+ ).returns(T.attached_class)
414
+ end
415
+ def self.new(
416
+ # The time window for statistical attributes (`AMOUNT_Z_SCORE`,
417
+ # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
418
+ # all-time history or a specific window (`7D`, `30D`, `90D`).
419
+ interval: nil,
420
+ # The entity scope to evaluate the attribute against.
421
+ scope: nil,
422
+ # The unit for impossible travel attributes. Required when `attribute` is
423
+ # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`.
424
+ #
425
+ # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour).
426
+ #
427
+ # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`.
428
+ unit: nil
429
+ )
430
+ end
431
+
432
+ sig do
433
+ override.returns(
434
+ {
435
+ interval:
436
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::OrSymbol,
437
+ scope:
438
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope::OrSymbol,
439
+ unit:
440
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::OrSymbol
441
+ }
442
+ )
443
+ end
444
+ def to_hash
445
+ end
446
+
447
+ # The time window for statistical attributes (`AMOUNT_Z_SCORE`,
448
+ # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
449
+ # all-time history or a specific window (`7D`, `30D`, `90D`).
450
+ module Interval
451
+ extend Lithic::Internal::Type::Enum
452
+
453
+ TaggedSymbol =
454
+ T.type_alias do
455
+ T.all(
456
+ Symbol,
457
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval
458
+ )
459
+ end
460
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
461
+
462
+ LIFETIME =
463
+ T.let(
464
+ :LIFETIME,
465
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::TaggedSymbol
466
+ )
467
+ INTERVAL_7_D =
468
+ T.let(
469
+ :"7D",
470
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::TaggedSymbol
471
+ )
472
+ INTERVAL_30_D =
473
+ T.let(
474
+ :"30D",
475
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::TaggedSymbol
476
+ )
477
+ INTERVAL_90_D =
478
+ T.let(
479
+ :"90D",
480
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::TaggedSymbol
481
+ )
482
+
483
+ sig do
484
+ override.returns(
485
+ T::Array[
486
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Interval::TaggedSymbol
487
+ ]
488
+ )
489
+ end
490
+ def self.values
491
+ end
492
+ end
493
+
494
+ # The entity scope to evaluate the attribute against.
495
+ module Scope
496
+ extend Lithic::Internal::Type::Enum
497
+
498
+ TaggedSymbol =
499
+ T.type_alias do
500
+ T.all(
501
+ Symbol,
502
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope
503
+ )
504
+ end
505
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
506
+
507
+ CARD =
508
+ T.let(
509
+ :CARD,
510
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope::TaggedSymbol
511
+ )
512
+ ACCOUNT =
513
+ T.let(
514
+ :ACCOUNT,
515
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope::TaggedSymbol
516
+ )
517
+ BUSINESS_ACCOUNT =
518
+ T.let(
519
+ :BUSINESS_ACCOUNT,
520
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope::TaggedSymbol
521
+ )
522
+
523
+ sig do
524
+ override.returns(
525
+ T::Array[
526
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Scope::TaggedSymbol
527
+ ]
528
+ )
529
+ end
530
+ def self.values
531
+ end
532
+ end
533
+
534
+ # The unit for impossible travel attributes. Required when `attribute` is
535
+ # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`.
536
+ #
537
+ # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour).
538
+ #
539
+ # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`.
540
+ module Unit
541
+ extend Lithic::Internal::Type::Enum
542
+
543
+ TaggedSymbol =
544
+ T.type_alias do
545
+ T.all(
546
+ Symbol,
547
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit
548
+ )
549
+ end
550
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
551
+
552
+ MPH =
553
+ T.let(
554
+ :MPH,
555
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::TaggedSymbol
556
+ )
557
+ KPH =
558
+ T.let(
559
+ :KPH,
560
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::TaggedSymbol
561
+ )
562
+ MILES =
563
+ T.let(
564
+ :MILES,
565
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::TaggedSymbol
566
+ )
567
+ KILOMETERS =
568
+ T.let(
569
+ :KILOMETERS,
570
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::TaggedSymbol
571
+ )
572
+
573
+ sig do
574
+ override.returns(
575
+ T::Array[
576
+ Lithic::AuthRules::AuthRuleCondition::Parameters::Unit::TaggedSymbol
577
+ ]
578
+ )
579
+ end
580
+ def self.values
581
+ end
582
+ end
583
+ end
155
584
  end
156
585
  end
157
586
  end