|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +module Lithic |
| 4 | + module Models |
| 5 | + module AuthRules |
| 6 | + class Conditional3DSActionParameters < Lithic::Internal::Type::BaseModel |
| 7 | + # @!attribute action |
| 8 | + # The action to take if the conditions are met. |
| 9 | + # |
| 10 | + # @return [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Action] |
| 11 | + required :action, enum: -> { Lithic::AuthRules::Conditional3DSActionParameters::Action } |
| 12 | + |
| 13 | + # @!attribute conditions |
| 14 | + # |
| 15 | + # @return [Array<Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition>] |
| 16 | + required :conditions, |
| 17 | + -> { |
| 18 | + Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::Conditional3DSActionParameters::Condition] |
| 19 | + } |
| 20 | + |
| 21 | + # @!method initialize(action:, conditions:) |
| 22 | + # @param action [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Action] The action to take if the conditions are met. |
| 23 | + # |
| 24 | + # @param conditions [Array<Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition>] |
| 25 | + |
| 26 | + # The action to take if the conditions are met. |
| 27 | + # |
| 28 | + # @see Lithic::Models::AuthRules::Conditional3DSActionParameters#action |
| 29 | + module Action |
| 30 | + extend Lithic::Internal::Type::Enum |
| 31 | + |
| 32 | + DECLINE = :DECLINE |
| 33 | + CHALLENGE = :CHALLENGE |
| 34 | + |
| 35 | + # @!method self.values |
| 36 | + # @return [Array<Symbol>] |
| 37 | + end |
| 38 | + |
| 39 | + class Condition < Lithic::Internal::Type::BaseModel |
| 40 | + # @!attribute attribute |
| 41 | + # The attribute to target. |
| 42 | + # |
| 43 | + # The following attributes may be targeted: |
| 44 | + # |
| 45 | + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a |
| 46 | + # business by the types of goods or services it provides. |
| 47 | + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all |
| 48 | + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for |
| 49 | + # Netherlands Antilles. |
| 50 | + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of |
| 51 | + # the transaction. |
| 52 | + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor |
| 53 | + # (merchant). |
| 54 | + # - `DESCRIPTOR`: Short description of card acceptor. |
| 55 | + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer |
| 56 | + # fee field in the settlement/cardholder billing currency. This is the amount |
| 57 | + # the issuer should authorize against unless the issuer is paying the acquirer |
| 58 | + # fee on behalf of the cardholder. |
| 59 | + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a |
| 60 | + # given authentication. Scores are on a range of 0-999, with 0 representing the |
| 61 | + # lowest risk and 999 representing the highest risk. For Visa transactions, |
| 62 | + # where the raw score has a range of 0-99, Lithic will normalize the score by |
| 63 | + # multiplying the raw score by 10x. |
| 64 | + # - `MESSAGE_CATEGORY`: The category of the authentication being processed. |
| 65 | + # |
| 66 | + # @return [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::Attribute, nil] |
| 67 | + optional :attribute, |
| 68 | + enum: -> { |
| 69 | + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute |
| 70 | + } |
| 71 | + |
| 72 | + # @!attribute operation |
| 73 | + # The operation to apply to the attribute |
| 74 | + # |
| 75 | + # @return [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::Operation, nil] |
| 76 | + optional :operation, |
| 77 | + enum: -> { |
| 78 | + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation |
| 79 | + } |
| 80 | + |
| 81 | + # @!attribute value |
| 82 | + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` |
| 83 | + # |
| 84 | + # @return [String, Integer, Array<String>, nil] |
| 85 | + optional :value, union: -> { Lithic::AuthRules::Conditional3DSActionParameters::Condition::Value } |
| 86 | + |
| 87 | + # @!method initialize(attribute: nil, operation: nil, value: nil) |
| 88 | + # Some parameter documentations has been truncated, see |
| 89 | + # {Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition} for more |
| 90 | + # details. |
| 91 | + # |
| 92 | + # @param attribute [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::Attribute] The attribute to target. |
| 93 | + # |
| 94 | + # @param operation [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::Operation] The operation to apply to the attribute |
| 95 | + # |
| 96 | + # @param value [String, Integer, Array<String>] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` |
| 97 | + |
| 98 | + # The attribute to target. |
| 99 | + # |
| 100 | + # The following attributes may be targeted: |
| 101 | + # |
| 102 | + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a |
| 103 | + # business by the types of goods or services it provides. |
| 104 | + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all |
| 105 | + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for |
| 106 | + # Netherlands Antilles. |
| 107 | + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of |
| 108 | + # the transaction. |
| 109 | + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor |
| 110 | + # (merchant). |
| 111 | + # - `DESCRIPTOR`: Short description of card acceptor. |
| 112 | + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer |
| 113 | + # fee field in the settlement/cardholder billing currency. This is the amount |
| 114 | + # the issuer should authorize against unless the issuer is paying the acquirer |
| 115 | + # fee on behalf of the cardholder. |
| 116 | + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a |
| 117 | + # given authentication. Scores are on a range of 0-999, with 0 representing the |
| 118 | + # lowest risk and 999 representing the highest risk. For Visa transactions, |
| 119 | + # where the raw score has a range of 0-99, Lithic will normalize the score by |
| 120 | + # multiplying the raw score by 10x. |
| 121 | + # - `MESSAGE_CATEGORY`: The category of the authentication being processed. |
| 122 | + # |
| 123 | + # @see Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition#attribute |
| 124 | + module Attribute |
| 125 | + extend Lithic::Internal::Type::Enum |
| 126 | + |
| 127 | + MCC = :MCC |
| 128 | + COUNTRY = :COUNTRY |
| 129 | + CURRENCY = :CURRENCY |
| 130 | + MERCHANT_ID = :MERCHANT_ID |
| 131 | + DESCRIPTOR = :DESCRIPTOR |
| 132 | + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT |
| 133 | + RISK_SCORE = :RISK_SCORE |
| 134 | + MESSAGE_CATEGORY = :MESSAGE_CATEGORY |
| 135 | + |
| 136 | + # @!method self.values |
| 137 | + # @return [Array<Symbol>] |
| 138 | + end |
| 139 | + |
| 140 | + # The operation to apply to the attribute |
| 141 | + # |
| 142 | + # @see Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition#operation |
| 143 | + module Operation |
| 144 | + extend Lithic::Internal::Type::Enum |
| 145 | + |
| 146 | + IS_ONE_OF = :IS_ONE_OF |
| 147 | + IS_NOT_ONE_OF = :IS_NOT_ONE_OF |
| 148 | + MATCHES = :MATCHES |
| 149 | + DOES_NOT_MATCH = :DOES_NOT_MATCH |
| 150 | + IS_GREATER_THAN = :IS_GREATER_THAN |
| 151 | + IS_LESS_THAN = :IS_LESS_THAN |
| 152 | + |
| 153 | + # @!method self.values |
| 154 | + # @return [Array<Symbol>] |
| 155 | + end |
| 156 | + |
| 157 | + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` |
| 158 | + # |
| 159 | + # @see Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition#value |
| 160 | + module Value |
| 161 | + extend Lithic::Internal::Type::Union |
| 162 | + |
| 163 | + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` |
| 164 | + variant String |
| 165 | + |
| 166 | + # A number, to be used with `IS_GREATER_THAN` or `IS_LESS_THAN` |
| 167 | + variant Integer |
| 168 | + |
| 169 | + # An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` |
| 170 | + variant -> { Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::Value::StringArray } |
| 171 | + |
| 172 | + # @!method self.variants |
| 173 | + # @return [Array(String, Integer, Array<String>)] |
| 174 | + |
| 175 | + # @type [Lithic::Internal::Type::Converter] |
| 176 | + StringArray = Lithic::Internal::Type::ArrayOf[String] |
| 177 | + end |
| 178 | + end |
| 179 | + end |
| 180 | + end |
| 181 | + end |
| 182 | +end |
0 commit comments