From 69d895702fe674b8554580e9346ad266b7057cb3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 20:46:33 +0000 Subject: [PATCH 1/5] chore(internal): bump pyright (#642) --- requirements-dev.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 3b6cb70d..e35ea2c5 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -68,7 +68,7 @@ pydantic-core==2.23.4 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.380 +pyright==1.1.389 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 @@ -97,6 +97,7 @@ typing-extensions==4.12.2 # via mypy # via pydantic # via pydantic-core + # via pyright virtualenv==20.24.5 # via nox zipp==3.17.0 From 095008f17b01d4cc0ec76cb0f84aaf0e5bdc60de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 02:16:53 +0000 Subject: [PATCH 2/5] chore: make the `Omit` type public (#644) --- src/lithic/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lithic/__init__.py b/src/lithic/__init__.py index 039b8692..f847e185 100644 --- a/src/lithic/__init__.py +++ b/src/lithic/__init__.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from . import types -from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes from ._utils import file_from_path from ._client import ( ENVIRONMENTS, @@ -47,6 +47,7 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "Omit", "LithicError", "APIError", "APIStatusError", From b55feb0d12f89d50830ce285ae48e56fd129c7c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:38:07 +0000 Subject: [PATCH 3/5] chore(internal): bump pydantic dependency (#645) --- requirements-dev.lock | 4 ++-- requirements.lock | 4 ++-- src/lithic/_types.py | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index e35ea2c5..af8ea8ad 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -62,9 +62,9 @@ platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 # via pytest -pydantic==2.9.2 +pydantic==2.10.3 # via lithic -pydantic-core==2.23.4 +pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich diff --git a/requirements.lock b/requirements.lock index 92cb7a04..03084024 100644 --- a/requirements.lock +++ b/requirements.lock @@ -30,9 +30,9 @@ httpx==0.25.2 idna==3.4 # via anyio # via httpx -pydantic==2.9.2 +pydantic==2.10.3 # via lithic -pydantic-core==2.23.4 +pydantic-core==2.27.1 # via pydantic sniffio==1.3.0 # via anyio diff --git a/src/lithic/_types.py b/src/lithic/_types.py index f8e76e82..3cb9cf06 100644 --- a/src/lithic/_types.py +++ b/src/lithic/_types.py @@ -194,10 +194,8 @@ def get(self, __key: str) -> str | None: ... StrBytesIntFloat = Union[str, bytes, int, float] # Note: copied from Pydantic -# https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49 -IncEx: TypeAlias = Union[ - Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]] -] +# https://github.com/pydantic/pydantic/blob/6f31f8f68ef011f84357330186f603ff295312fd/pydantic/main.py#L79 +IncEx: TypeAlias = Union[Set[int], Set[str], Mapping[int, Union["IncEx", bool]], Mapping[str, Union["IncEx", bool]]] PostParser = Callable[[Any], Any] From 51de0e605212aef46aac02d5a45fa7f591630629 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:31:58 +0000 Subject: [PATCH 4/5] feat(api): adds EventRuleResult to Transaction Events (#646) --- src/lithic/types/transaction.py | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/src/lithic/types/transaction.py b/src/lithic/types/transaction.py index 6f6c3797..92c8db75 100644 --- a/src/lithic/types/transaction.py +++ b/src/lithic/types/transaction.py @@ -28,6 +28,7 @@ "EventAmountsCardholder", "EventAmountsMerchant", "EventAmountsSettlement", + "EventRuleResult", ] @@ -368,6 +369,77 @@ class EventAmounts(BaseModel): settlement: Optional[EventAmountsSettlement] = None +class EventRuleResult(BaseModel): + auth_rule_token: Optional[str] = None + """The Auth Rule Token associated with the rule from which the decline originated. + + If this is set to null, then the decline was not associated with a + customer-configured Auth Rule. This may happen in cases where a transaction is + declined due to a Lithic-configured security or compliance rule, for example. + """ + + explanation: Optional[str] = None + """A human-readable explanation outlining the motivation for the rule's decline.""" + + name: Optional[str] = None + """The name for the rule, if any was configured.""" + + result: Literal[ + "ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_DELINQUENT", + "ACCOUNT_INACTIVE", + "ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED", + "ACCOUNT_UNDER_REVIEW", + "ADDRESS_INCORRECT", + "APPROVED", + "AUTH_RULE_ALLOWED_COUNTRY", + "AUTH_RULE_ALLOWED_MCC", + "AUTH_RULE_BLOCKED_COUNTRY", + "AUTH_RULE_BLOCKED_MCC", + "CARD_CLOSED", + "CARD_CRYPTOGRAM_VALIDATION_FAILURE", + "CARD_EXPIRED", + "CARD_EXPIRY_DATE_INCORRECT", + "CARD_INVALID", + "CARD_NOT_ACTIVATED", + "CARD_PAUSED", + "CARD_PIN_INCORRECT", + "CARD_RESTRICTED", + "CARD_SECURITY_CODE_INCORRECT", + "CARD_SPEND_LIMIT_EXCEEDED", + "CONTACT_CARD_ISSUER", + "CUSTOMER_ASA_TIMEOUT", + "CUSTOM_ASA_RESULT", + "DECLINED", + "DO_NOT_HONOR", + "DRIVER_NUMBER_INVALID", + "FORMAT_ERROR", + "INSUFFICIENT_FUNDING_SOURCE_BALANCE", + "INSUFFICIENT_FUNDS", + "LITHIC_SYSTEM_ERROR", + "LITHIC_SYSTEM_RATE_LIMIT", + "MALFORMED_ASA_RESPONSE", + "MERCHANT_INVALID", + "MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE", + "MERCHANT_NOT_PERMITTED", + "OVER_REVERSAL_ATTEMPTED", + "PIN_BLOCKED", + "PROGRAM_CARD_SPEND_LIMIT_EXCEEDED", + "PROGRAM_SUSPENDED", + "PROGRAM_USAGE_RESTRICTION", + "REVERSAL_UNMATCHED", + "SECURITY_VIOLATION", + "SINGLE_USE_CARD_REATTEMPTED", + "TRANSACTION_INVALID", + "TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL", + "TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER", + "TRANSACTION_PREVIOUSLY_COMPLETED", + "UNAUTHORIZED_MERCHANT", + "VEHICLE_NUMBER_INVALID", + ] + + class Event(BaseModel): token: str """Transaction event identifier.""" @@ -484,6 +556,8 @@ class Event(BaseModel): ] """Type of transaction event""" + rule_results: Optional[List[EventRuleResult]] = None + class Transaction(BaseModel): token: str From 9cc925bb23a1f589a22fe0b135e2875154403224 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:32:41 +0000 Subject: [PATCH 5/5] release: 0.81.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ pyproject.toml | 2 +- src/lithic/_version.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 33fc155c..f8e21778 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.80.1" + ".": "0.81.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dfeea93..a4c8d651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.81.0 (2024-12-09) + +Full Changelog: [v0.80.1...v0.81.0](https://github.com/lithic-com/lithic-python/compare/v0.80.1...v0.81.0) + +### Features + +* **api:** adds EventRuleResult to Transaction Events ([#646](https://github.com/lithic-com/lithic-python/issues/646)) ([51de0e6](https://github.com/lithic-com/lithic-python/commit/51de0e605212aef46aac02d5a45fa7f591630629)) + + +### Chores + +* **internal:** bump pydantic dependency ([#645](https://github.com/lithic-com/lithic-python/issues/645)) ([b55feb0](https://github.com/lithic-com/lithic-python/commit/b55feb0d12f89d50830ce285ae48e56fd129c7c2)) +* **internal:** bump pyright ([#642](https://github.com/lithic-com/lithic-python/issues/642)) ([69d8957](https://github.com/lithic-com/lithic-python/commit/69d895702fe674b8554580e9346ad266b7057cb3)) +* make the `Omit` type public ([#644](https://github.com/lithic-com/lithic-python/issues/644)) ([095008f](https://github.com/lithic-com/lithic-python/commit/095008f17b01d4cc0ec76cb0f84aaf0e5bdc60de)) + ## 0.80.1 (2024-11-28) Full Changelog: [v0.80.0...v0.80.1](https://github.com/lithic-com/lithic-python/compare/v0.80.0...v0.80.1) diff --git a/pyproject.toml b/pyproject.toml index b1cc9e26..9d2ee505 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.80.1" +version = "0.81.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/lithic/_version.py b/src/lithic/_version.py index 85968f1d..5ce77b50 100644 --- a/src/lithic/_version.py +++ b/src/lithic/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "lithic" -__version__ = "0.80.1" # x-release-please-version +__version__ = "0.81.0" # x-release-please-version