Skip to content
Open
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 pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "blindpay"
version = "2.2.0"
version = "2.3.0"
description = "Official Python SDK for the Blindpay API — Global payments infrastructure"
readme = "README.md"
authors = [{ name = "Blindpay", email = "alves@blindpay.com" }]
Expand Down
4 changes: 3 additions & 1 deletion src/blindpay/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.2.0"
__version__ = "2.3.0"

from ._internal.exceptions import BlindPayError
from .client import BlindPay, BlindPaySync
Expand Down Expand Up @@ -27,6 +27,7 @@
TrackingTransaction,
TransactionDocumentType,
TransactionStatus,
WebhookEvent,
)

__all__ = [
Expand All @@ -46,6 +47,7 @@
"StablecoinToken",
"TransactionDocumentType",
"TransactionStatus",
"WebhookEvent",
"BlindpayApiResponse",
"BlindpayErrorResponse",
"BlindpaySuccessResponse",
Expand Down
61 changes: 60 additions & 1 deletion src/blindpay/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import base64
import hashlib
import hmac
import warnings
from functools import cached_property
from typing import TYPE_CHECKING, Any, Dict, Literal, Mapping, Optional, TypeVar

Expand All @@ -24,6 +25,7 @@
from blindpay.resources.payins.quotes import PayinQuotesResource, PayinQuotesResourceSync
from blindpay.resources.payouts.payouts import PayoutsResource, PayoutsResourceSync
from blindpay.resources.quotes.quotes import QuotesResource, QuotesResourceSync
from blindpay.resources.customers.customers import CustomersResource, CustomersResourceSync
from blindpay.resources.receivers.receivers import ReceiversResource, ReceiversResourceSync
from blindpay.resources.terms_of_service.terms_of_service import (
TermsOfServiceResource,
Expand All @@ -39,7 +41,12 @@
from blindpay.resources.wallets.offramp import OfframpWalletsResource, OfframpWalletsResourceSync
from blindpay.resources.webhooks.webhooks import WebhookEndpointsResource, WebhookEndpointsResourceSync

__version__ = "2.2.0"
__version__ = "2.3.0"

_RECEIVERS_DEPRECATION_MESSAGE = (
"Use 'customers' instead. 'receivers' is deprecated and will be removed in "
"v3.0.0. See https://www.blindpay.com/changelog/2026-06-04-customers-rename"
)

T = TypeVar("T")

Expand Down Expand Up @@ -203,6 +210,27 @@ def __getattr__(self, name: str) -> Any:
return getattr(self._base, name)


class _CustomersNamespace:
def __init__(self, instance_id: str, api_client: ApiClientImpl) -> None:
self._instance_id = instance_id
self._api = api_client

@cached_property
def _base(self) -> "CustomersResource":
from blindpay.resources.customers.customers import create_customers_resource

return create_customers_resource(self._instance_id, self._api)

@cached_property
def bank_accounts(self) -> "BankAccountsResource":
from blindpay.resources.bank_accounts.bank_accounts import create_bank_accounts_resource

return create_bank_accounts_resource(self._instance_id, self._api)

def __getattr__(self, name: str) -> Any:
return getattr(self._base, name)


class _ReceiversNamespace:
def __init__(self, instance_id: str, api_client: ApiClientImpl) -> None:
self._instance_id = instance_id
Expand Down Expand Up @@ -305,8 +333,13 @@ def payouts(self) -> "PayoutsResource":

return create_payouts_resource(self._instance_id, self._api)

@cached_property
def customers(self) -> _CustomersNamespace:
return _CustomersNamespace(self._instance_id, self._api)

@cached_property
def receivers(self) -> _ReceiversNamespace:
warnings.warn(_RECEIVERS_DEPRECATION_MESSAGE, DeprecationWarning, stacklevel=2)
return _ReceiversNamespace(self._instance_id, self._api)

@cached_property
Expand Down Expand Up @@ -433,6 +466,27 @@ def __getattr__(self, name: str) -> Any:
return getattr(self._base, name)


class _CustomersNamespaceSync:
def __init__(self, instance_id: str, api_client: ApiClientImplSync) -> None:
self._instance_id = instance_id
self._api = api_client

@cached_property
def _base(self) -> "CustomersResourceSync":
from blindpay.resources.customers.customers import create_customers_resource_sync

return create_customers_resource_sync(self._instance_id, self._api)

@cached_property
def bank_accounts(self) -> "BankAccountsResourceSync":
from blindpay.resources.bank_accounts.bank_accounts import create_bank_accounts_resource_sync

return create_bank_accounts_resource_sync(self._instance_id, self._api)

def __getattr__(self, name: str) -> Any:
return getattr(self._base, name)


class _ReceiversNamespaceSync:
def __init__(self, instance_id: str, api_client: ApiClientImplSync) -> None:
self._instance_id = instance_id
Expand Down Expand Up @@ -535,8 +589,13 @@ def payouts(self) -> "PayoutsResourceSync":

return create_payouts_resource_sync(self._instance_id, self._api)

@cached_property
def customers(self) -> _CustomersNamespaceSync:
return _CustomersNamespaceSync(self._instance_id, self._api)

@cached_property
def receivers(self) -> _ReceiversNamespaceSync:
warnings.warn(_RECEIVERS_DEPRECATION_MESSAGE, DeprecationWarning, stacklevel=2)
return _ReceiversNamespaceSync(self._instance_id, self._api)

@cached_property
Expand Down
6 changes: 4 additions & 2 deletions src/blindpay/resources/bank_accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
CreatePixSafeResponse,
CreateRtpInput,
CreateRtpResponse,
CreateSepaInput,
CreateSepaResponse,
CreateSpeiInput,
CreateSpeiResponse,
CreateTedInput,
Expand All @@ -27,7 +29,6 @@
CreateWireResponse,
GetBankAccountResponse,
ListBankAccountsResponse,
OfframpNetwork,
PixSafeType,
PixType,
RtpType,
Expand All @@ -53,12 +54,12 @@
"CreateWireInput",
"CreateInternationalSwiftInput",
"CreateRtpInput",
"CreateSepaInput",
"CreateTedInput",
"AchCopBitsoType",
"AchCopDocument",
"AchType",
"ArgentinaTransfers",
"OfframpNetwork",
"PixType",
"PixSafeType",
"TransfersBitsoType",
Expand All @@ -75,6 +76,7 @@
"CreatePixResponse",
"CreatePixSafeResponse",
"CreateRtpResponse",
"CreateSepaResponse",
"CreateSpeiResponse",
"CreateTedResponse",
"CreateWireResponse",
Expand Down
Loading
Loading