Skip to content

Commit db13429

Browse files
feat(api): re-add rules metadata to tokenization events
fix(api): adjust Auth Rules spec for better SDK structure feat(api): remove deprecated fields from Cardholder Authentication object
1 parent e38952b commit db13429

22 files changed

+532
-1998
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 167
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-2cfd81dfd3ad2c5a4e98161e54dbac5ddee125c058f9163f29aad4632cadf08d.yml
3-
openapi_spec_hash: 400a2563ad969fba47b3eb0f02372b1e
4-
config_hash: f5a16e702bac54729afed6e50b0de3ff
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c3f6c23018d70fd1b259b21cfd377b5d905872f0d3c5ce2cdb8013f4b6daa338.yml
3+
openapi_spec_hash: b551344da9d29eb4c5374874ed84a9b0
4+
config_hash: 012f050e575d1bbfe8db56a9eeaa5fcd

api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ from lithic.types.auth_rules import (
8383
AuthRuleCondition,
8484
Conditional3DSActionParameters,
8585
ConditionalAttribute,
86+
ConditionalAuthorizationActionParameters,
8687
ConditionalBlockParameters,
8788
MerchantLockParameters,
8889
RuleStats,
8990
VelocityLimitParams,
90-
VelocityLimitParamsPeriodWindow,
91+
VelocityLimitPeriod,
9192
V2CreateResponse,
9293
V2RetrieveResponse,
9394
V2UpdateResponse,

src/lithic/resources/auth_rules/v2/v2.py

Lines changed: 71 additions & 67 deletions
Large diffs are not rendered by default.

src/lithic/types/auth_rules/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,25 @@
1616
from .v2_retrieve_response import V2RetrieveResponse as V2RetrieveResponse
1717
from .conditional_attribute import ConditionalAttribute as ConditionalAttribute
1818
from .velocity_limit_params import VelocityLimitParams as VelocityLimitParams
19+
from .velocity_limit_period import VelocityLimitPeriod as VelocityLimitPeriod
1920
from .merchant_lock_parameters import MerchantLockParameters as MerchantLockParameters
2021
from .auth_rule_condition_param import AuthRuleConditionParam as AuthRuleConditionParam
2122
from .v2_retrieve_report_params import V2RetrieveReportParams as V2RetrieveReportParams
2223
from .v2_retrieve_features_params import V2RetrieveFeaturesParams as V2RetrieveFeaturesParams
2324
from .v2_retrieve_report_response import V2RetrieveReportResponse as V2RetrieveReportResponse
2425
from .velocity_limit_params_param import VelocityLimitParamsParam as VelocityLimitParamsParam
26+
from .velocity_limit_period_param import VelocityLimitPeriodParam as VelocityLimitPeriodParam
2527
from .conditional_block_parameters import ConditionalBlockParameters as ConditionalBlockParameters
2628
from .v2_retrieve_features_response import V2RetrieveFeaturesResponse as V2RetrieveFeaturesResponse
2729
from .merchant_lock_parameters_param import MerchantLockParametersParam as MerchantLockParametersParam
2830
from .conditional_3ds_action_parameters import Conditional3DSActionParameters as Conditional3DSActionParameters
2931
from .conditional_block_parameters_param import ConditionalBlockParametersParam as ConditionalBlockParametersParam
30-
from .velocity_limit_params_period_window import VelocityLimitParamsPeriodWindow as VelocityLimitParamsPeriodWindow
3132
from .conditional_3ds_action_parameters_param import (
3233
Conditional3DSActionParametersParam as Conditional3DSActionParametersParam,
3334
)
34-
from .velocity_limit_params_period_window_param import (
35-
VelocityLimitParamsPeriodWindowParam as VelocityLimitParamsPeriodWindowParam,
35+
from .conditional_authorization_action_parameters import (
36+
ConditionalAuthorizationActionParameters as ConditionalAuthorizationActionParameters,
37+
)
38+
from .conditional_authorization_action_parameters_param import (
39+
ConditionalAuthorizationActionParametersParam as ConditionalAuthorizationActionParametersParam,
3640
)
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Union, Optional
4+
from typing_extensions import Literal
5+
6+
from ..._models import BaseModel
7+
8+
__all__ = ["ConditionalAuthorizationActionParameters", "Condition"]
9+
10+
11+
class Condition(BaseModel):
12+
attribute: Optional[
13+
Literal[
14+
"MCC",
15+
"COUNTRY",
16+
"CURRENCY",
17+
"MERCHANT_ID",
18+
"DESCRIPTOR",
19+
"LIABILITY_SHIFT",
20+
"PAN_ENTRY_MODE",
21+
"TRANSACTION_AMOUNT",
22+
"CASH_AMOUNT",
23+
"RISK_SCORE",
24+
"CARD_TRANSACTION_COUNT_15M",
25+
"CARD_TRANSACTION_COUNT_1H",
26+
"CARD_TRANSACTION_COUNT_24H",
27+
"CARD_STATE",
28+
"PIN_ENTERED",
29+
"PIN_STATUS",
30+
"WALLET_TYPE",
31+
"TRANSACTION_INITIATOR",
32+
"ADDRESS_MATCH",
33+
]
34+
] = None
35+
"""The attribute to target.
36+
37+
The following attributes may be targeted:
38+
39+
- `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
40+
business by the types of goods or services it provides.
41+
- `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
42+
ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
43+
Netherlands Antilles.
44+
- `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of
45+
the transaction.
46+
- `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
47+
(merchant).
48+
- `DESCRIPTOR`: Short description of card acceptor.
49+
- `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer
50+
applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or
51+
`TOKEN_AUTHENTICATED`.
52+
- `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number
53+
(PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`,
54+
`ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`,
55+
`MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`,
56+
`UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`.
57+
- `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
58+
fee field in the settlement/cardholder billing currency. This is the amount
59+
the issuer should authorize against unless the issuer is paying the acquirer
60+
fee on behalf of the cardholder.
61+
- `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
62+
represents the amount of cash being withdrawn or advanced.
63+
- `RISK_SCORE`: Network-provided score assessing risk level associated with a
64+
given authorization. Scores are on a range of 0-999, with 0 representing the
65+
lowest risk and 999 representing the highest risk. For Visa transactions,
66+
where the raw score has a range of 0-99, Lithic will normalize the score by
67+
multiplying the raw score by 10x.
68+
- `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the
69+
trailing 15 minutes before the authorization.
70+
- `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
71+
trailing hour up and until the authorization.
72+
- `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
73+
trailing 24 hours up and until the authorization.
74+
- `CARD_STATE`: The current state of the card associated with the transaction.
75+
Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
76+
`PENDING_FULFILLMENT`.
77+
- `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction.
78+
Valid values are `TRUE`, `FALSE`.
79+
- `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`,
80+
`OK`, `BLOCKED`.
81+
- `WALLET_TYPE`: For transactions using a digital wallet token, indicates the
82+
source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`,
83+
`SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`.
84+
- `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates
85+
the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`.
86+
- `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address
87+
data with the cardholder KYC data if it exists. Valid values are `MATCH`,
88+
`MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
89+
"""
90+
91+
operation: Optional[
92+
Literal[
93+
"IS_ONE_OF",
94+
"IS_NOT_ONE_OF",
95+
"MATCHES",
96+
"DOES_NOT_MATCH",
97+
"IS_EQUAL_TO",
98+
"IS_NOT_EQUAL_TO",
99+
"IS_GREATER_THAN",
100+
"IS_GREATER_THAN_OR_EQUAL_TO",
101+
"IS_LESS_THAN",
102+
"IS_LESS_THAN_OR_EQUAL_TO",
103+
]
104+
] = None
105+
"""The operation to apply to the attribute"""
106+
107+
value: Union[str, int, List[str], None] = None
108+
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
109+
110+
111+
class ConditionalAuthorizationActionParameters(BaseModel):
112+
action: Literal["DECLINE", "CHALLENGE"]
113+
"""The action to take if the conditions are met."""
114+
115+
conditions: List[Condition]
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Union, Iterable
6+
from typing_extensions import Literal, Required, TypedDict
7+
8+
from ..._types import SequenceNotStr
9+
10+
__all__ = ["ConditionalAuthorizationActionParametersParam", "Condition"]
11+
12+
13+
class Condition(TypedDict, total=False):
14+
attribute: Literal[
15+
"MCC",
16+
"COUNTRY",
17+
"CURRENCY",
18+
"MERCHANT_ID",
19+
"DESCRIPTOR",
20+
"LIABILITY_SHIFT",
21+
"PAN_ENTRY_MODE",
22+
"TRANSACTION_AMOUNT",
23+
"CASH_AMOUNT",
24+
"RISK_SCORE",
25+
"CARD_TRANSACTION_COUNT_15M",
26+
"CARD_TRANSACTION_COUNT_1H",
27+
"CARD_TRANSACTION_COUNT_24H",
28+
"CARD_STATE",
29+
"PIN_ENTERED",
30+
"PIN_STATUS",
31+
"WALLET_TYPE",
32+
"TRANSACTION_INITIATOR",
33+
"ADDRESS_MATCH",
34+
]
35+
"""The attribute to target.
36+
37+
The following attributes may be targeted:
38+
39+
- `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
40+
business by the types of goods or services it provides.
41+
- `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
42+
ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
43+
Netherlands Antilles.
44+
- `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of
45+
the transaction.
46+
- `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
47+
(merchant).
48+
- `DESCRIPTOR`: Short description of card acceptor.
49+
- `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer
50+
applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or
51+
`TOKEN_AUTHENTICATED`.
52+
- `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number
53+
(PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`,
54+
`ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`,
55+
`MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`,
56+
`UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`.
57+
- `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
58+
fee field in the settlement/cardholder billing currency. This is the amount
59+
the issuer should authorize against unless the issuer is paying the acquirer
60+
fee on behalf of the cardholder.
61+
- `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This
62+
represents the amount of cash being withdrawn or advanced.
63+
- `RISK_SCORE`: Network-provided score assessing risk level associated with a
64+
given authorization. Scores are on a range of 0-999, with 0 representing the
65+
lowest risk and 999 representing the highest risk. For Visa transactions,
66+
where the raw score has a range of 0-99, Lithic will normalize the score by
67+
multiplying the raw score by 10x.
68+
- `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the
69+
trailing 15 minutes before the authorization.
70+
- `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
71+
trailing hour up and until the authorization.
72+
- `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
73+
trailing 24 hours up and until the authorization.
74+
- `CARD_STATE`: The current state of the card associated with the transaction.
75+
Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
76+
`PENDING_FULFILLMENT`.
77+
- `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction.
78+
Valid values are `TRUE`, `FALSE`.
79+
- `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`,
80+
`OK`, `BLOCKED`.
81+
- `WALLET_TYPE`: For transactions using a digital wallet token, indicates the
82+
source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`,
83+
`SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`.
84+
- `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates
85+
the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`.
86+
- `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address
87+
data with the cardholder KYC data if it exists. Valid values are `MATCH`,
88+
`MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
89+
"""
90+
91+
operation: Literal[
92+
"IS_ONE_OF",
93+
"IS_NOT_ONE_OF",
94+
"MATCHES",
95+
"DOES_NOT_MATCH",
96+
"IS_EQUAL_TO",
97+
"IS_NOT_EQUAL_TO",
98+
"IS_GREATER_THAN",
99+
"IS_GREATER_THAN_OR_EQUAL_TO",
100+
"IS_LESS_THAN",
101+
"IS_LESS_THAN_OR_EQUAL_TO",
102+
]
103+
"""The operation to apply to the attribute"""
104+
105+
value: Union[str, int, SequenceNotStr[str]]
106+
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
107+
108+
109+
class ConditionalAuthorizationActionParametersParam(TypedDict, total=False):
110+
action: Required[Literal["DECLINE", "CHALLENGE"]]
111+
"""The action to take if the conditions are met."""
112+
113+
conditions: Required[Iterable[Condition]]

0 commit comments

Comments
 (0)