|
| 1 | +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +from typing import List, Optional |
| 4 | +from typing_extensions import Literal |
| 5 | + |
| 6 | +from ..._models import BaseModel |
| 7 | +from .conditional_value import ConditionalValue |
| 8 | +from .conditional_operation import ConditionalOperation |
| 9 | +from .velocity_limit_period import VelocityLimitPeriod |
| 10 | +from .spend_velocity_filters import SpendVelocityFilters |
| 11 | +from .card_transaction_update_action import CardTransactionUpdateAction |
| 12 | + |
| 13 | +__all__ = ["ConditionalCardTransactionUpdateActionParameters", "Condition", "ConditionParameters"] |
| 14 | + |
| 15 | + |
| 16 | +class ConditionParameters(BaseModel): |
| 17 | + """Additional parameters for spend velocity attributes. |
| 18 | +
|
| 19 | + Required when `attribute` is |
| 20 | + `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. Not used for other attributes. |
| 21 | + """ |
| 22 | + |
| 23 | + filters: Optional[SpendVelocityFilters] = None |
| 24 | + |
| 25 | + period: Optional[VelocityLimitPeriod] = None |
| 26 | + """The time period over which to calculate the spend velocity.""" |
| 27 | + |
| 28 | + scope: Optional[Literal["CARD", "ACCOUNT", "GLOBAL"]] = None |
| 29 | + """The entity scope to evaluate the attribute against.""" |
| 30 | + |
| 31 | + |
| 32 | +class Condition(BaseModel): |
| 33 | + attribute: Literal[ |
| 34 | + "MCC", |
| 35 | + "COUNTRY", |
| 36 | + "CURRENCY", |
| 37 | + "MERCHANT_ID", |
| 38 | + "DESCRIPTOR", |
| 39 | + "TRANSACTION_AMOUNT", |
| 40 | + "RISK_SCORE", |
| 41 | + "TRANSACTION_STATUS", |
| 42 | + "LAST_EVENT_TYPE", |
| 43 | + "LIABILITY_SHIFT", |
| 44 | + "PAN_ENTRY_MODE", |
| 45 | + "WALLET_TYPE", |
| 46 | + "CARD_AGE", |
| 47 | + "ACCOUNT_AGE", |
| 48 | + "SPEND_VELOCITY_COUNT", |
| 49 | + "SPEND_VELOCITY_AMOUNT", |
| 50 | + ] |
| 51 | + """The attribute to target. |
| 52 | +
|
| 53 | + The following attributes may be targeted: |
| 54 | +
|
| 55 | + - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a |
| 56 | + business by the types of goods or services it provides. |
| 57 | + - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all |
| 58 | + ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for |
| 59 | + Netherlands Antilles. |
| 60 | + - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of |
| 61 | + the transaction. |
| 62 | + - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor |
| 63 | + (merchant). |
| 64 | + - `DESCRIPTOR`: Short description of card acceptor. |
| 65 | + - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer |
| 66 | + fee field in the settlement/cardholder billing currency. This is the amount |
| 67 | + the issuer should authorize against unless the issuer is paying the acquirer |
| 68 | + fee on behalf of the cardholder. |
| 69 | + - `RISK_SCORE`: Network-provided score assessing risk level associated with a |
| 70 | + given authorization. Scores are on a range of 0-999, with 0 representing the |
| 71 | + lowest risk and 999 representing the highest risk. For Visa transactions, |
| 72 | + where the raw score has a range of 0-99, Lithic will normalize the score by |
| 73 | + multiplying the raw score by 10x. |
| 74 | + - `TRANSACTION_STATUS`: The status of the transaction. Valid values are |
| 75 | + `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, |
| 76 | + `EXPIRED`. |
| 77 | + - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid |
| 78 | + values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, |
| 79 | + `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, |
| 80 | + `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, |
| 81 | + `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, |
| 82 | + `RETURN_REVERSAL`. |
| 83 | + - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer |
| 84 | + applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or |
| 85 | + `TOKEN_AUTHENTICATED`. |
| 86 | + - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number |
| 87 | + (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, |
| 88 | + `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, |
| 89 | + `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, |
| 90 | + `UNKNOWN`, or `CREDENTIAL_ON_FILE`. |
| 91 | + - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the |
| 92 | + source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, |
| 93 | + `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. |
| 94 | + - `CARD_AGE`: The age of the card in seconds at the time of the transaction. |
| 95 | + - `ACCOUNT_AGE`: The age of the account in seconds at the time of the |
| 96 | + transaction. |
| 97 | + - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified |
| 98 | + filters within the given period. Requires `parameters` with `scope`, `period`, |
| 99 | + and optional `filters`. |
| 100 | + - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions |
| 101 | + matching the specified filters within the given period. Requires `parameters` |
| 102 | + with `scope`, `period`, and optional `filters`. |
| 103 | + """ |
| 104 | + |
| 105 | + operation: ConditionalOperation |
| 106 | + """The operation to apply to the attribute""" |
| 107 | + |
| 108 | + value: ConditionalValue |
| 109 | + """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`""" |
| 110 | + |
| 111 | + parameters: Optional[ConditionParameters] = None |
| 112 | + """Additional parameters for spend velocity attributes. |
| 113 | +
|
| 114 | + Required when `attribute` is `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. |
| 115 | + Not used for other attributes. |
| 116 | + """ |
| 117 | + |
| 118 | + |
| 119 | +class ConditionalCardTransactionUpdateActionParameters(BaseModel): |
| 120 | + action: CardTransactionUpdateAction |
| 121 | + """The action to take if the conditions are met.""" |
| 122 | + |
| 123 | + conditions: List[Condition] |
0 commit comments