Class: Lithic::Models::SignalsResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/lithic/models/signals_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(approved_txn_amount_m2:, approved_txn_amount_m2_30d:, approved_txn_amount_m2_7d:, approved_txn_amount_m2_90d:, approved_txn_count:, approved_txn_count_30d:, approved_txn_count_7d:, approved_txn_count_90d:, avg_transaction_amount:, avg_transaction_amount_30d:, avg_transaction_amount_7d:, avg_transaction_amount_90d:, distinct_country_count:, distinct_mcc_count:, first_txn_at:, is_first_transaction:, last_cp_country:, last_cp_postal_code:, last_cp_timestamp:, last_txn_approved_at:, seen_countries:, seen_mccs:, seen_merchants:, stdev_transaction_amount:, stdev_transaction_amount_30d:, stdev_transaction_amount_7d:, stdev_transaction_amount_90d:, three_ds_success_count:, three_ds_success_rate:, three_ds_total_count:, time_since_last_transaction_days:) ⇒ Object

Some parameter documentations has been truncated, see Lithic::Models::SignalsResponse for more details.

Behavioral feature state for a card or account derived from its transaction history.

Derived statistical features (averages, standard deviations, z-scores) are computed using Welford’s online algorithm over approved transactions. Average fields are null when fewer than 5 approved transactions have been recorded. Standard deviation fields are null when fewer than 30 approved transactions have been recorded.

3DS fields (‘three_ds_success_rate`, `three_ds_success_count`, `three_ds_total_count`) are card-scoped and will be null for account responses.

Raw fields (‘seen_countries`, `seen_mccs`, `approved_txn_amount_m2`, etc.) are included so clients can compute their own transaction-specific derivations, such as checking whether a new transaction’s country is in ‘seen_countries` to determine `is_new_country`, or computing a z-score using the raw mean and M2 values.

Parameters:

  • approved_txn_amount_m2 (Float, nil)

    The Welford M2 accumulator for lifetime approved transaction amounts. Used toget

  • approved_txn_amount_m2_30d (Float, nil)

    The Welford M2 accumulator for approved transaction amounts over the last 30 day

  • approved_txn_amount_m2_7d (Float, nil)

    The Welford M2 accumulator for approved transaction amounts over the last 7 days

  • approved_txn_amount_m2_90d (Float, nil)

    The Welford M2 accumulator for approved transaction amounts over the last 90 day

  • approved_txn_count (Integer, nil)

    The total number of approved transactions over the entity’s lifetime.

  • approved_txn_count_30d (Integer, nil)

    The number of approved transactions in the last 30 days.

  • approved_txn_count_7d (Integer, nil)

    The number of approved transactions in the last 7 days.

  • approved_txn_count_90d (Integer, nil)

    The number of approved transactions in the last 90 days.

  • avg_transaction_amount (Float, nil)

    The average approved transaction amount over the entity’s lifetime, in cents. Nu

  • avg_transaction_amount_30d (Float, nil)

    The average approved transaction amount over the last 30 days, in cents. Null if

  • avg_transaction_amount_7d (Float, nil)

    The average approved transaction amount over the last 7 days, in cents. Null if

  • avg_transaction_amount_90d (Float, nil)

    The average approved transaction amount over the last 90 days, in cents. Null if

  • distinct_country_count (Integer, nil)

    The number of distinct merchant countries seen in the entity’s transaction histo

  • distinct_mcc_count (Integer, nil)

    The number of distinct MCCs seen in the entity’s transaction history.

  • first_txn_at (Time, nil)

    The timestamp of the first approved transaction for the entity, in ISO 8601 form

  • is_first_transaction (Boolean, nil)

    Whether the entity has no prior transaction history. Returns true if no history

  • last_cp_country (String, nil)

    The merchant country of the last card-present transaction.

  • last_cp_postal_code (String, nil)

    The merchant postal code of the last card-present transaction.

  • last_cp_timestamp (Time, nil)

    The timestamp of the last card-present transaction, in ISO 8601 format.

  • last_txn_approved_at (Time, nil)

    The timestamp of the most recent approved transaction for the entity, in ISO 860

  • seen_countries (Array<String>, nil)

    The set of merchant countries seen in the entity’s transaction history. Clients

  • seen_mccs (Array<String>, nil)

    The set of MCCs seen in the entity’s transaction history. Clients can use this t

  • seen_merchants (Array<String>, nil)

    The set of card acceptor IDs seen in the card’s approved transaction history, ca

  • stdev_transaction_amount (Float, nil)

    The standard deviation of approved transaction amounts over the entity’s lifetim

  • stdev_transaction_amount_30d (Float, nil)

    The standard deviation of approved transaction amounts over the last 30 days, in

  • stdev_transaction_amount_7d (Float, nil)

    The standard deviation of approved transaction amounts over the last 7 days, in

  • stdev_transaction_amount_90d (Float, nil)

    The standard deviation of approved transaction amounts over the last 90 days, in

  • three_ds_success_count (Integer, nil)

    The number of successful 3DS authentications for the card. Null for account resp

  • three_ds_success_rate (Float, nil)

    The 3DS authentication success rate for the card, as a percentage from 0.0 to 10

  • three_ds_total_count (Integer, nil)

    The total number of 3DS authentication attempts for the card. Null for account r

  • time_since_last_transaction_days (Float, nil)

    The number of days since the last approved transaction on the entity.



# File 'lib/lithic/models/signals_response.rb', line 221

Instance Attribute Details

#approved_txn_amount_m2Float?

The Welford M2 accumulator for lifetime approved transaction amounts. Used together with ‘avg_transaction_amount` and `approved_txn_count` to compute the z-score of a new transaction amount (variance = M2 / (count - 1)).

Returns:

  • (Float, nil)


12
# File 'lib/lithic/models/signals_response.rb', line 12

required :approved_txn_amount_m2, Float, nil?: true

#approved_txn_amount_m2_30dFloat?

The Welford M2 accumulator for approved transaction amounts over the last 30 days.

Returns:

  • (Float, nil)


19
# File 'lib/lithic/models/signals_response.rb', line 19

required :approved_txn_amount_m2_30d, Float, nil?: true

#approved_txn_amount_m2_7dFloat?

The Welford M2 accumulator for approved transaction amounts over the last 7 days.

Returns:

  • (Float, nil)


26
# File 'lib/lithic/models/signals_response.rb', line 26

required :approved_txn_amount_m2_7d, Float, nil?: true

#approved_txn_amount_m2_90dFloat?

The Welford M2 accumulator for approved transaction amounts over the last 90 days.

Returns:

  • (Float, nil)


33
# File 'lib/lithic/models/signals_response.rb', line 33

required :approved_txn_amount_m2_90d, Float, nil?: true

#approved_txn_countInteger?

The total number of approved transactions over the entity’s lifetime.

Returns:

  • (Integer, nil)


39
# File 'lib/lithic/models/signals_response.rb', line 39

required :approved_txn_count, Integer, nil?: true

#approved_txn_count_30dInteger?

The number of approved transactions in the last 30 days.

Returns:

  • (Integer, nil)


45
# File 'lib/lithic/models/signals_response.rb', line 45

required :approved_txn_count_30d, Integer, nil?: true

#approved_txn_count_7dInteger?

The number of approved transactions in the last 7 days.

Returns:

  • (Integer, nil)


51
# File 'lib/lithic/models/signals_response.rb', line 51

required :approved_txn_count_7d, Integer, nil?: true

#approved_txn_count_90dInteger?

The number of approved transactions in the last 90 days.

Returns:

  • (Integer, nil)


57
# File 'lib/lithic/models/signals_response.rb', line 57

required :approved_txn_count_90d, Integer, nil?: true

#avg_transaction_amountFloat?

The average approved transaction amount over the entity’s lifetime, in cents. Null if fewer than 5 approved transactions have been recorded.

Returns:

  • (Float, nil)


64
# File 'lib/lithic/models/signals_response.rb', line 64

required :avg_transaction_amount, Float, nil?: true

#avg_transaction_amount_30dFloat?

The average approved transaction amount over the last 30 days, in cents. Null if fewer than 5 approved transactions in window.

Returns:

  • (Float, nil)


71
# File 'lib/lithic/models/signals_response.rb', line 71

required :avg_transaction_amount_30d, Float, nil?: true

#avg_transaction_amount_7dFloat?

The average approved transaction amount over the last 7 days, in cents. Null if fewer than 5 approved transactions in window.

Returns:

  • (Float, nil)


78
# File 'lib/lithic/models/signals_response.rb', line 78

required :avg_transaction_amount_7d, Float, nil?: true

#avg_transaction_amount_90dFloat?

The average approved transaction amount over the last 90 days, in cents. Null if fewer than 5 approved transactions in window.

Returns:

  • (Float, nil)


85
# File 'lib/lithic/models/signals_response.rb', line 85

required :avg_transaction_amount_90d, Float, nil?: true

#distinct_country_countInteger?

The number of distinct merchant countries seen in the entity’s transaction history.

Returns:

  • (Integer, nil)


92
# File 'lib/lithic/models/signals_response.rb', line 92

required :distinct_country_count, Integer, nil?: true

#distinct_mcc_countInteger?

The number of distinct MCCs seen in the entity’s transaction history.

Returns:

  • (Integer, nil)


98
# File 'lib/lithic/models/signals_response.rb', line 98

required :distinct_mcc_count, Integer, nil?: true

#first_txn_atTime?

The timestamp of the first approved transaction for the entity, in ISO 8601 format.

Returns:

  • (Time, nil)


105
# File 'lib/lithic/models/signals_response.rb', line 105

required :first_txn_at, Time, nil?: true

#is_first_transactionBoolean?

Whether the entity has no prior transaction history. Returns true if no history is found. Null if transaction history exists but a first transaction timestamp is unavailable.

Returns:

  • (Boolean, nil)


113
# File 'lib/lithic/models/signals_response.rb', line 113

required :is_first_transaction, Lithic::Internal::Type::Boolean, nil?: true

#last_cp_countryString?

The merchant country of the last card-present transaction.

Returns:

  • (String, nil)


119
# File 'lib/lithic/models/signals_response.rb', line 119

required :last_cp_country, String, nil?: true

#last_cp_postal_codeString?

The merchant postal code of the last card-present transaction.

Returns:

  • (String, nil)


125
# File 'lib/lithic/models/signals_response.rb', line 125

required :last_cp_postal_code, String, nil?: true

#last_cp_timestampTime?

The timestamp of the last card-present transaction, in ISO 8601 format.

Returns:

  • (Time, nil)


131
# File 'lib/lithic/models/signals_response.rb', line 131

required :last_cp_timestamp, Time, nil?: true

#last_txn_approved_atTime?

The timestamp of the most recent approved transaction for the entity, in ISO 8601 format.

Returns:

  • (Time, nil)


138
# File 'lib/lithic/models/signals_response.rb', line 138

required :last_txn_approved_at, Time, nil?: true

#seen_countriesArray<String>?

The set of merchant countries seen in the entity’s transaction history. Clients can use this to determine whether a new transaction’s country is novel (i.e. compute ‘is_new_country`).

Returns:

  • (Array<String>, nil)


146
# File 'lib/lithic/models/signals_response.rb', line 146

required :seen_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true

#seen_mccsArray<String>?

The set of MCCs seen in the entity’s transaction history. Clients can use this to determine whether a new transaction’s MCC is novel (i.e. compute ‘is_new_mcc`).

Returns:

  • (Array<String>, nil)


154
# File 'lib/lithic/models/signals_response.rb', line 154

required :seen_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true

#seen_merchantsArray<String>?

The set of card acceptor IDs seen in the card’s approved transaction history, capped at the 1000 most recently seen. Null for account responses. Clients can use this to determine whether a new transaction’s merchant is novel (i.e. compute ‘is_new_merchant`).

Returns:

  • (Array<String>, nil)


163
# File 'lib/lithic/models/signals_response.rb', line 163

required :seen_merchants, Lithic::Internal::Type::ArrayOf[String], nil?: true

#stdev_transaction_amountFloat?

The standard deviation of approved transaction amounts over the entity’s lifetime, in cents. Null if fewer than 30 approved transactions have been recorded.

Returns:

  • (Float, nil)


171
# File 'lib/lithic/models/signals_response.rb', line 171

required :stdev_transaction_amount, Float, nil?: true

#stdev_transaction_amount_30dFloat?

The standard deviation of approved transaction amounts over the last 30 days, in cents. Null if fewer than 30 approved transactions in window.

Returns:

  • (Float, nil)


178
# File 'lib/lithic/models/signals_response.rb', line 178

required :stdev_transaction_amount_30d, Float, nil?: true

#stdev_transaction_amount_7dFloat?

The standard deviation of approved transaction amounts over the last 7 days, in cents. Null if fewer than 30 approved transactions in window.

Returns:

  • (Float, nil)


185
# File 'lib/lithic/models/signals_response.rb', line 185

required :stdev_transaction_amount_7d, Float, nil?: true

#stdev_transaction_amount_90dFloat?

The standard deviation of approved transaction amounts over the last 90 days, in cents. Null if fewer than 30 approved transactions in window.

Returns:

  • (Float, nil)


192
# File 'lib/lithic/models/signals_response.rb', line 192

required :stdev_transaction_amount_90d, Float, nil?: true

#three_ds_success_countInteger?

The number of successful 3DS authentications for the card. Null for account responses.

Returns:

  • (Integer, nil)


199
# File 'lib/lithic/models/signals_response.rb', line 199

required :three_ds_success_count, Integer, nil?: true

#three_ds_success_rateFloat?

The 3DS authentication success rate for the card, as a percentage from 0.0 to 100.0. Null for account responses.

Returns:

  • (Float, nil)


206
# File 'lib/lithic/models/signals_response.rb', line 206

required :three_ds_success_rate, Float, nil?: true

#three_ds_total_countInteger?

The total number of 3DS authentication attempts for the card. Null for account responses.

Returns:

  • (Integer, nil)


213
# File 'lib/lithic/models/signals_response.rb', line 213

required :three_ds_total_count, Integer, nil?: true

#time_since_last_transaction_daysFloat?

The number of days since the last approved transaction on the entity.

Returns:

  • (Float, nil)


219
# File 'lib/lithic/models/signals_response.rb', line 219

required :time_since_last_transaction_days, Float, nil?: true