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
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,31 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
build:
if: github.repository == 'stainless-sdks/lithic-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
Expand Down
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.95.0"
".": "0.96.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 164
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa684ff2a2af585fe502a6e44520ddd883f5141a1113fc9dbe7830027842aa09.yml
openapi_spec_hash: b58989fdc04768fc1eb758e180c5f128
config_hash: 1a83dceb58f6f525b19a5775018db7e8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-80f2056989855259782c8e23b9b95530b708b87669d2ba82594ecfee843b4db3.yml
openapi_spec_hash: 160aa2f0e95a7be3ad9d68390ae9aa7c
config_hash: a5d12cd64a37624cbe350cd7b2380693
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.96.0 (2025-07-02)

Full Changelog: [v0.95.0...v0.96.0](https://github.com/lithic-com/lithic-python/compare/v0.95.0...v0.96.0)

### Features

* **api:** add models for merchant_lock_parameters and conditional_3ds_action_parameters ([6dcfc0d](https://github.com/lithic-com/lithic-python/commit/6dcfc0dc2ea8e25b316317c3c99d34c9beb92465))
* **api:** api update ([9387b8d](https://github.com/lithic-com/lithic-python/commit/9387b8dcd62abdea2f001dad29fc5f85f1d31f29))


### Chores

* **ci:** change upload type ([58fae0a](https://github.com/lithic-com/lithic-python/commit/58fae0a7c82b38bed1b3adc9a6077ab2d232ccba))

## 0.95.0 (2025-06-29)

Full Changelog: [v0.94.0...v0.95.0](https://github.com/lithic-com/lithic-python/compare/v0.94.0...v0.95.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ Types:
from lithic.types.auth_rules import (
AuthRule,
AuthRuleCondition,
Conditional3DSActionParameters,
ConditionalAttribute,
ConditionalBlockParameters,
MerchantLockParameters,
RuleStats,
VelocityLimitParams,
VelocityLimitParamsPeriodWindow,
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.95.0"
version = "0.96.0"
description = "The official Python library for the lithic API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
12 changes: 7 additions & 5 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
set -exuo pipefail

RESPONSE=$(curl -X POST "$URL" \
FILENAME=$(basename dist/*.whl)

RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")

Expand All @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)
UPLOAD_RESPONSE=$(curl -v -X PUT \
-H "Content-Type: binary/octet-stream" \
--data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/lithic-python/$SHA'\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/lithic-python/$SHA/$FILENAME'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
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.95.0" # x-release-please-version
__version__ = "0.96.0" # x-release-please-version
6 changes: 6 additions & 0 deletions src/lithic/types/auth_rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@
from .v2_retrieve_response import V2RetrieveResponse as V2RetrieveResponse
from .conditional_attribute import ConditionalAttribute as ConditionalAttribute
from .velocity_limit_params import VelocityLimitParams as VelocityLimitParams
from .merchant_lock_parameters import MerchantLockParameters as MerchantLockParameters
from .auth_rule_condition_param import AuthRuleConditionParam as AuthRuleConditionParam
from .v2_retrieve_report_params import V2RetrieveReportParams as V2RetrieveReportParams
from .v2_retrieve_report_response import V2RetrieveReportResponse as V2RetrieveReportResponse
from .velocity_limit_params_param import VelocityLimitParamsParam as VelocityLimitParamsParam
from .conditional_block_parameters import ConditionalBlockParameters as ConditionalBlockParameters
from .merchant_lock_parameters_param import MerchantLockParametersParam as MerchantLockParametersParam
from .conditional_3ds_action_parameters import Conditional3DSActionParameters as Conditional3DSActionParameters
from .conditional_block_parameters_param import ConditionalBlockParametersParam as ConditionalBlockParametersParam
from .velocity_limit_params_period_window import VelocityLimitParamsPeriodWindow as VelocityLimitParamsPeriodWindow
from .conditional_3ds_action_parameters_param import (
Conditional3DSActionParametersParam as Conditional3DSActionParametersParam,
)
63 changes: 63 additions & 0 deletions src/lithic/types/auth_rules/conditional_3ds_action_parameters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Union, Optional
from typing_extensions import Literal

from ..._models import BaseModel

__all__ = ["Conditional3DSActionParameters", "Condition"]


class Condition(BaseModel):
attribute: Optional[
Literal[
"MCC",
"COUNTRY",
"CURRENCY",
"MERCHANT_ID",
"DESCRIPTOR",
"TRANSACTION_AMOUNT",
"RISK_SCORE",
"MESSAGE_CATEGORY",
]
] = None
"""The attribute to target.

The following attributes may be targeted:

- `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
business by the types of goods or services it provides.
- `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
Netherlands Antilles.
- `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of
the transaction.
- `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
(merchant).
- `DESCRIPTOR`: Short description of card acceptor.
- `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
fee field in the settlement/cardholder billing currency. This is the amount
the issuer should authorize against unless the issuer is paying the acquirer
fee on behalf of the cardholder.
- `RISK_SCORE`: Network-provided score assessing risk level associated with a
given authentication. Scores are on a range of 0-999, with 0 representing the
lowest risk and 999 representing the highest risk. For Visa transactions,
where the raw score has a range of 0-99, Lithic will normalize the score by
multiplying the raw score by 10x.
- `MESSAGE_CATEGORY`: The category of the authentication being processed.
"""

operation: Optional[
Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"]
] = None
"""The operation to apply to the attribute"""

value: Union[str, int, List[str], None] = None
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""


class Conditional3DSActionParameters(BaseModel):
action: Literal["DECLINE", "CHALLENGE"]
"""The action to take if the conditions are met."""

conditions: List[Condition]
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import List, Union, Iterable
from typing_extensions import Literal, Required, TypedDict

__all__ = ["Conditional3DSActionParametersParam", "Condition"]


class Condition(TypedDict, total=False):
attribute: Literal[
"MCC",
"COUNTRY",
"CURRENCY",
"MERCHANT_ID",
"DESCRIPTOR",
"TRANSACTION_AMOUNT",
"RISK_SCORE",
"MESSAGE_CATEGORY",
]
"""The attribute to target.

The following attributes may be targeted:

- `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
business by the types of goods or services it provides.
- `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
Netherlands Antilles.
- `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of
the transaction.
- `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
(merchant).
- `DESCRIPTOR`: Short description of card acceptor.
- `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
fee field in the settlement/cardholder billing currency. This is the amount
the issuer should authorize against unless the issuer is paying the acquirer
fee on behalf of the cardholder.
- `RISK_SCORE`: Network-provided score assessing risk level associated with a
given authentication. Scores are on a range of 0-999, with 0 representing the
lowest risk and 999 representing the highest risk. For Visa transactions,
where the raw score has a range of 0-99, Lithic will normalize the score by
multiplying the raw score by 10x.
- `MESSAGE_CATEGORY`: The category of the authentication being processed.
"""

operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"]
"""The operation to apply to the attribute"""

value: Union[str, int, List[str]]
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""


class Conditional3DSActionParametersParam(TypedDict, total=False):
action: Required[Literal["DECLINE", "CHALLENGE"]]
"""The action to take if the conditions are met."""

conditions: Required[Iterable[Condition]]
37 changes: 37 additions & 0 deletions src/lithic/types/auth_rules/merchant_lock_parameters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional

from ..._models import BaseModel

__all__ = ["MerchantLockParameters", "Merchant"]


class Merchant(BaseModel):
comment: Optional[str] = None
"""
A comment or explanation about the merchant, used internally for rule management
purposes.
"""

descriptor: Optional[str] = None
"""
Short description of the merchant, often used to provide more human-readable
context about the transaction merchant. This is typically the name or label
shown on transaction summaries.
"""

merchant_id: Optional[str] = None
"""Unique alphanumeric identifier for the payment card acceptor (merchant).

This attribute specifies the merchant entity that will be locked or referenced
for authorization rules.
"""


class MerchantLockParameters(BaseModel):
merchants: List[Merchant]
"""
A list of merchant locks defining specific merchants or groups of merchants
(based on descriptors or IDs) that the lock applies to.
"""
38 changes: 38 additions & 0 deletions src/lithic/types/auth_rules/merchant_lock_parameters_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Iterable
from typing_extensions import Required, TypedDict

__all__ = ["MerchantLockParametersParam", "Merchant"]


class Merchant(TypedDict, total=False):
comment: str
"""
A comment or explanation about the merchant, used internally for rule management
purposes.
"""

descriptor: str
"""
Short description of the merchant, often used to provide more human-readable
context about the transaction merchant. This is typically the name or label
shown on transaction summaries.
"""

merchant_id: str
"""Unique alphanumeric identifier for the payment card acceptor (merchant).

This attribute specifies the merchant entity that will be locked or referenced
for authorization rules.
"""


class MerchantLockParametersParam(TypedDict, total=False):
merchants: Required[Iterable[Merchant]]
"""
A list of merchant locks defining specific merchants or groups of merchants
(based on descriptors or IDs) that the lock applies to.
"""
Loading