|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +module Lithic |
| 4 | + module Models |
| 5 | + module AuthRules |
| 6 | + class ConditionalAuthorizationActionParameters < Lithic::Internal::Type::BaseModel |
| 7 | + # @!attribute action |
| 8 | + # The action to take if the conditions are met. |
| 9 | + # |
| 10 | + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Action] |
| 11 | + required :action, enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action } |
| 12 | + |
| 13 | + # @!attribute conditions |
| 14 | + # |
| 15 | + # @return [Array<Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition>] |
| 16 | + required :conditions, |
| 17 | + -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition] } |
| 18 | + |
| 19 | + # @!method initialize(action:, conditions:) |
| 20 | + # @param action [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Action] The action to take if the conditions are met. |
| 21 | + # |
| 22 | + # @param conditions [Array<Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition>] |
| 23 | + |
| 24 | + # The action to take if the conditions are met. |
| 25 | + # |
| 26 | + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters#action |
| 27 | + module Action |
| 28 | + extend Lithic::Internal::Type::Enum |
| 29 | + |
| 30 | + DECLINE = :DECLINE |
| 31 | + CHALLENGE = :CHALLENGE |
| 32 | + |
| 33 | + # @!method self.values |
| 34 | + # @return [Array<Symbol>] |
| 35 | + end |
| 36 | + |
| 37 | + class Condition < Lithic::Internal::Type::BaseModel |
| 38 | + # @!attribute attribute |
| 39 | + # The attribute to target. |
| 40 | + # |
| 41 | + # The following attributes may be targeted: |
| 42 | + # |
| 43 | + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a |
| 44 | + # business by the types of goods or services it provides. |
| 45 | + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all |
| 46 | + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for |
| 47 | + # Netherlands Antilles. |
| 48 | + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of |
| 49 | + # the transaction. |
| 50 | + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor |
| 51 | + # (merchant). |
| 52 | + # - `DESCRIPTOR`: Short description of card acceptor. |
| 53 | + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer |
| 54 | + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or |
| 55 | + # `TOKEN_AUTHENTICATED`. |
| 56 | + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number |
| 57 | + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, |
| 58 | + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, |
| 59 | + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, |
| 60 | + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. |
| 61 | + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer |
| 62 | + # fee field in the settlement/cardholder billing currency. This is the amount |
| 63 | + # the issuer should authorize against unless the issuer is paying the acquirer |
| 64 | + # fee on behalf of the cardholder. |
| 65 | + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This |
| 66 | + # represents the amount of cash being withdrawn or advanced. |
| 67 | + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a |
| 68 | + # given authorization. Scores are on a range of 0-999, with 0 representing the |
| 69 | + # lowest risk and 999 representing the highest risk. For Visa transactions, |
| 70 | + # where the raw score has a range of 0-99, Lithic will normalize the score by |
| 71 | + # multiplying the raw score by 10x. |
| 72 | + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the |
| 73 | + # trailing 15 minutes before the authorization. |
| 74 | + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the |
| 75 | + # trailing hour up and until the authorization. |
| 76 | + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the |
| 77 | + # trailing 24 hours up and until the authorization. |
| 78 | + # - `CARD_STATE`: The current state of the card associated with the transaction. |
| 79 | + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, |
| 80 | + # `PENDING_FULFILLMENT`. |
| 81 | + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. |
| 82 | + # Valid values are `TRUE`, `FALSE`. |
| 83 | + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, |
| 84 | + # `OK`, `BLOCKED`. |
| 85 | + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the |
| 86 | + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, |
| 87 | + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. |
| 88 | + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates |
| 89 | + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. |
| 90 | + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address |
| 91 | + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, |
| 92 | + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. |
| 93 | + # |
| 94 | + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute, nil] |
| 95 | + optional :attribute, |
| 96 | + enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute } |
| 97 | + |
| 98 | + # @!attribute operation |
| 99 | + # The operation to apply to the attribute |
| 100 | + # |
| 101 | + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Operation, nil] |
| 102 | + optional :operation, |
| 103 | + enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Operation } |
| 104 | + |
| 105 | + # @!attribute value |
| 106 | + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` |
| 107 | + # |
| 108 | + # @return [String, Integer, Array<String>, nil] |
| 109 | + optional :value, |
| 110 | + union: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Value } |
| 111 | + |
| 112 | + # @!method initialize(attribute: nil, operation: nil, value: nil) |
| 113 | + # Some parameter documentations has been truncated, see |
| 114 | + # {Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition} |
| 115 | + # for more details. |
| 116 | + # |
| 117 | + # @param attribute [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute] The attribute to target. |
| 118 | + # |
| 119 | + # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Operation] The operation to apply to the attribute |
| 120 | + # |
| 121 | + # @param value [String, Integer, Array<String>] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` |
| 122 | + |
| 123 | + # The attribute to target. |
| 124 | + # |
| 125 | + # The following attributes may be targeted: |
| 126 | + # |
| 127 | + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a |
| 128 | + # business by the types of goods or services it provides. |
| 129 | + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all |
| 130 | + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for |
| 131 | + # Netherlands Antilles. |
| 132 | + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of |
| 133 | + # the transaction. |
| 134 | + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor |
| 135 | + # (merchant). |
| 136 | + # - `DESCRIPTOR`: Short description of card acceptor. |
| 137 | + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer |
| 138 | + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or |
| 139 | + # `TOKEN_AUTHENTICATED`. |
| 140 | + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number |
| 141 | + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, |
| 142 | + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, |
| 143 | + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, |
| 144 | + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. |
| 145 | + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer |
| 146 | + # fee field in the settlement/cardholder billing currency. This is the amount |
| 147 | + # the issuer should authorize against unless the issuer is paying the acquirer |
| 148 | + # fee on behalf of the cardholder. |
| 149 | + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This |
| 150 | + # represents the amount of cash being withdrawn or advanced. |
| 151 | + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a |
| 152 | + # given authorization. Scores are on a range of 0-999, with 0 representing the |
| 153 | + # lowest risk and 999 representing the highest risk. For Visa transactions, |
| 154 | + # where the raw score has a range of 0-99, Lithic will normalize the score by |
| 155 | + # multiplying the raw score by 10x. |
| 156 | + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the |
| 157 | + # trailing 15 minutes before the authorization. |
| 158 | + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the |
| 159 | + # trailing hour up and until the authorization. |
| 160 | + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the |
| 161 | + # trailing 24 hours up and until the authorization. |
| 162 | + # - `CARD_STATE`: The current state of the card associated with the transaction. |
| 163 | + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, |
| 164 | + # `PENDING_FULFILLMENT`. |
| 165 | + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. |
| 166 | + # Valid values are `TRUE`, `FALSE`. |
| 167 | + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, |
| 168 | + # `OK`, `BLOCKED`. |
| 169 | + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the |
| 170 | + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, |
| 171 | + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. |
| 172 | + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates |
| 173 | + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. |
| 174 | + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address |
| 175 | + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, |
| 176 | + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. |
| 177 | + # |
| 178 | + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#attribute |
| 179 | + module Attribute |
| 180 | + extend Lithic::Internal::Type::Enum |
| 181 | + |
| 182 | + MCC = :MCC |
| 183 | + COUNTRY = :COUNTRY |
| 184 | + CURRENCY = :CURRENCY |
| 185 | + MERCHANT_ID = :MERCHANT_ID |
| 186 | + DESCRIPTOR = :DESCRIPTOR |
| 187 | + LIABILITY_SHIFT = :LIABILITY_SHIFT |
| 188 | + PAN_ENTRY_MODE = :PAN_ENTRY_MODE |
| 189 | + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT |
| 190 | + CASH_AMOUNT = :CASH_AMOUNT |
| 191 | + RISK_SCORE = :RISK_SCORE |
| 192 | + CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M |
| 193 | + CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H |
| 194 | + CARD_TRANSACTION_COUNT_24_H = :CARD_TRANSACTION_COUNT_24H |
| 195 | + CARD_STATE = :CARD_STATE |
| 196 | + PIN_ENTERED = :PIN_ENTERED |
| 197 | + PIN_STATUS = :PIN_STATUS |
| 198 | + WALLET_TYPE = :WALLET_TYPE |
| 199 | + TRANSACTION_INITIATOR = :TRANSACTION_INITIATOR |
| 200 | + ADDRESS_MATCH = :ADDRESS_MATCH |
| 201 | + |
| 202 | + # @!method self.values |
| 203 | + # @return [Array<Symbol>] |
| 204 | + end |
| 205 | + |
| 206 | + # The operation to apply to the attribute |
| 207 | + # |
| 208 | + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#operation |
| 209 | + module Operation |
| 210 | + extend Lithic::Internal::Type::Enum |
| 211 | + |
| 212 | + IS_ONE_OF = :IS_ONE_OF |
| 213 | + IS_NOT_ONE_OF = :IS_NOT_ONE_OF |
| 214 | + MATCHES = :MATCHES |
| 215 | + DOES_NOT_MATCH = :DOES_NOT_MATCH |
| 216 | + IS_EQUAL_TO = :IS_EQUAL_TO |
| 217 | + IS_NOT_EQUAL_TO = :IS_NOT_EQUAL_TO |
| 218 | + IS_GREATER_THAN = :IS_GREATER_THAN |
| 219 | + IS_GREATER_THAN_OR_EQUAL_TO = :IS_GREATER_THAN_OR_EQUAL_TO |
| 220 | + IS_LESS_THAN = :IS_LESS_THAN |
| 221 | + IS_LESS_THAN_OR_EQUAL_TO = :IS_LESS_THAN_OR_EQUAL_TO |
| 222 | + |
| 223 | + # @!method self.values |
| 224 | + # @return [Array<Symbol>] |
| 225 | + end |
| 226 | + |
| 227 | + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` |
| 228 | + # |
| 229 | + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#value |
| 230 | + module Value |
| 231 | + extend Lithic::Internal::Type::Union |
| 232 | + |
| 233 | + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` |
| 234 | + variant String |
| 235 | + |
| 236 | + # A number, to be used with `IS_GREATER_THAN`, `IS_GREATER_THAN_OR_EQUAL_TO`, `IS_LESS_THAN`, `IS_LESS_THAN_OR_EQUAL_TO`, `IS_EQUAL_TO`, or `IS_NOT_EQUAL_TO` |
| 237 | + variant Integer |
| 238 | + |
| 239 | + # An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` |
| 240 | + variant -> { Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Value::StringArray } |
| 241 | + |
| 242 | + # @!method self.variants |
| 243 | + # @return [Array(String, Integer, Array<String>)] |
| 244 | + |
| 245 | + # @type [Lithic::Internal::Type::Converter] |
| 246 | + StringArray = Lithic::Internal::Type::ArrayOf[String] |
| 247 | + end |
| 248 | + end |
| 249 | + end |
| 250 | + end |
| 251 | + end |
| 252 | +end |
0 commit comments