Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.80.1"
".": "0.81.0"
}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 4 additions & 3 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ 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
pyright==1.1.380
pyright==1.1.389
pytest==8.3.3
# via pytest-asyncio
pytest-asyncio==0.24.0
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/lithic/__init__.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -47,6 +47,7 @@
"ProxiesTypes",
"NotGiven",
"NOT_GIVEN",
"Omit",
"LithicError",
"APIError",
"APIStatusError",
Expand Down
6 changes: 2 additions & 4 deletions src/lithic/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion src/lithic/_version.py
Original file line number Diff line number Diff line change
@@ -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
74 changes: 74 additions & 0 deletions src/lithic/types/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"EventAmountsCardholder",
"EventAmountsMerchant",
"EventAmountsSettlement",
"EventRuleResult",
]


Expand Down Expand Up @@ -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."""
Expand Down Expand Up @@ -484,6 +556,8 @@ class Event(BaseModel):
]
"""Type of transaction event"""

rule_results: Optional[List[EventRuleResult]] = None


class Transaction(BaseModel):
token: str
Expand Down
Loading