Skip to content

Commit 846d5d9

Browse files
feat(api): add travel speed/distance attributes and unit parameter to auth_rules
1 parent 0ee539a commit 846d5d9

4 files changed

Lines changed: 242 additions & 35 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 191
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0f374e78a0212145a2f55a55dfc39a612de19094d5152ae26b1bc74b01b9e343.yml
3-
openapi_spec_hash: ec888cdaebea979a2cd6231ca04c346c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-af9701d01abffc53ba2bf56c06415d893460e6b420f122e602cf4afe67bbf57b.yml
3+
openapi_spec_hash: 963688b09480159a06865075c94a2577
44
config_hash: 01dfc901bb6d54b0f582155d779bcbe0

lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb

Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ class Condition < Lithic::Internal::Type::BaseModel
138138
# `parameters` required.
139139
# - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
140140
# a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
141+
# - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance
142+
# between the postal code centers of the last card-present transaction and the
143+
# current transaction, divided by the elapsed time. Null if there is no prior
144+
# card-present transaction, if either postal code cannot be geocoded, or if
145+
# elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`.
146+
# - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal
147+
# code centers of the last card-present transaction and the current transaction.
148+
# Null if there is no prior card-present transaction or if either postal code
149+
# cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`.
141150
#
142151
# @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute]
143152
required :attribute,
@@ -156,11 +165,12 @@ class Condition < Lithic::Internal::Type::BaseModel
156165
required :value, union: -> { Lithic::AuthRules::ConditionalValue }
157166

158167
# @!attribute parameters
159-
# Additional parameters required for transaction history signal attributes.
160-
# Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
161-
# `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`,
162-
# `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`,
163-
# or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes.
168+
# Additional parameters for certain attributes. Required when `attribute` is one
169+
# of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`,
170+
# `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`,
171+
# `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or
172+
# `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used
173+
# for other attributes.
164174
#
165175
# @return [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters, nil]
166176
optional :parameters,
@@ -177,7 +187,7 @@ class Condition < Lithic::Internal::Type::BaseModel
177187
#
178188
# @param value [String, Integer, Array<String>, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
179189
#
180-
# @param parameters [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters] Additional parameters required for transaction history signal attributes. Requir
190+
# @param parameters [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters] Additional parameters for certain attributes. Required when `attribute` is one o
181191

182192
# The attribute to target.
183193
#
@@ -281,6 +291,15 @@ class Condition < Lithic::Internal::Type::BaseModel
281291
# `parameters` required.
282292
# - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
283293
# a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
294+
# - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance
295+
# between the postal code centers of the last card-present transaction and the
296+
# current transaction, divided by the elapsed time. Null if there is no prior
297+
# card-present transaction, if either postal code cannot be geocoded, or if
298+
# elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`.
299+
# - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal
300+
# code centers of the last card-present transaction and the current transaction.
301+
# Null if there is no prior card-present transaction or if either postal code
302+
# cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`.
284303
#
285304
# @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#attribute
286305
module Attribute
@@ -323,6 +342,8 @@ module Attribute
323342
DISTINCT_COUNTRY_COUNT = :DISTINCT_COUNTRY_COUNT
324343
IS_NEW_MERCHANT = :IS_NEW_MERCHANT
325344
THREE_DS_SUCCESS_RATE = :THREE_DS_SUCCESS_RATE
345+
TRAVEL_SPEED = :TRAVEL_SPEED
346+
DISTANCE_FROM_LAST_TRANSACTION = :DISTANCE_FROM_LAST_TRANSACTION
326347

327348
# @!method self.values
328349
# @return [Array<Symbol>]
@@ -346,20 +367,36 @@ class Parameters < Lithic::Internal::Type::BaseModel
346367
optional :scope,
347368
enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope }
348369

349-
# @!method initialize(interval: nil, scope: nil)
370+
# @!attribute unit
371+
# The unit for impossible travel attributes. Required when `attribute` is
372+
# `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`.
373+
#
374+
# For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour).
375+
#
376+
# For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`.
377+
#
378+
# @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit, nil]
379+
optional :unit,
380+
enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit }
381+
382+
# @!method initialize(interval: nil, scope: nil, unit: nil)
350383
# Some parameter documentations has been truncated, see
351384
# {Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters}
352385
# for more details.
353386
#
354-
# Additional parameters required for transaction history signal attributes.
355-
# Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
356-
# `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`,
357-
# `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`,
358-
# or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes.
387+
# Additional parameters for certain attributes. Required when `attribute` is one
388+
# of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`,
389+
# `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`,
390+
# `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or
391+
# `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used
392+
# for other attributes.
359393
#
360394
# @param interval [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval] The time window for statistical attributes (`AMOUNT_Z_SCORE`, `AVG_TRANSACTION_A
361395
#
362396
# @param scope [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope] The entity scope to evaluate the attribute against.
397+
#
398+
# @param unit [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit] The unit for impossible travel attributes. Required when `attribute` is
399+
# `TRAVEL\_
363400

364401
# The time window for statistical attributes (`AMOUNT_Z_SCORE`,
365402
# `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
@@ -391,6 +428,26 @@ module Scope
391428
# @!method self.values
392429
# @return [Array<Symbol>]
393430
end
431+
432+
# The unit for impossible travel attributes. Required when `attribute` is
433+
# `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`.
434+
#
435+
# For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour).
436+
#
437+
# For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`.
438+
#
439+
# @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters#unit
440+
module Unit
441+
extend Lithic::Internal::Type::Enum
442+
443+
MPH = :MPH
444+
KPH = :KPH
445+
MILES = :MILES
446+
KILOMETERS = :KILOMETERS
447+
448+
# @!method self.values
449+
# @return [Array<Symbol>]
450+
end
394451
end
395452
end
396453
end

0 commit comments

Comments
 (0)