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
8 changes: 7 additions & 1 deletion src/blindpay/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
__version__ = "2.2.0"
__version__ = "2.3.0"

from ._internal.exceptions import BlindPayError
from .client import BlindPay, BlindPaySync
from .types import (
AccountClass,
AipriseDocumentType,
BankAccountType,
BankingPartner,
BlindpayApiResponse,
Expand All @@ -13,6 +14,7 @@
Currency,
CurrencyType,
ErrorResponse,
ManualExecutionStatus,
Network,
PaginationMetadata,
PaginationParams,
Expand All @@ -27,25 +29,29 @@
TrackingTransaction,
TransactionDocumentType,
TransactionStatus,
WebhookEvent,
)

__all__ = [
"BlindPay",
"BlindPaySync",
"BlindPayError",
"AccountClass",
"AipriseDocumentType",
"BankAccountType",
"BankingPartner",
"Country",
"Currency",
"CurrencyType",
"ManualExecutionStatus",
"Network",
"PaymentMethod",
"Rail",
"RecipientRelationship",
"StablecoinToken",
"TransactionDocumentType",
"TransactionStatus",
"WebhookEvent",
"BlindpayApiResponse",
"BlindpayErrorResponse",
"BlindpaySuccessResponse",
Expand Down
119 changes: 118 additions & 1 deletion src/blindpay/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@
CustodialWalletsResource,
CustodialWalletsResourceSync,
)
from blindpay.resources.customers.customers import CustomersResource, CustomersResourceSync
from blindpay.resources.customers.bank_accounts import CustomerBankAccountsResource, CustomerBankAccountsResourceSync
from blindpay.resources.customers.blockchain_wallets import CustomerBlockchainWalletsResource, CustomerBlockchainWalletsResourceSync
from blindpay.resources.customers.virtual_accounts import CustomerVirtualAccountsResource, CustomerVirtualAccountsResourceSync
from blindpay.resources.customers.wallets import CustomerWalletsResource, CustomerWalletsResourceSync
from blindpay.resources.customers.offramp_wallets import CustomerOfframpWalletsResource, CustomerOfframpWalletsResourceSync
from blindpay.resources.fees.fees import FeesResource, FeesResourceSync
from blindpay.resources.instances.instances import InstancesResource, InstancesResourceSync
from blindpay.resources.ownership.ownership import OwnershipResource, OwnershipResourceSync
from blindpay.resources.partner_fees.partner_fees import PartnerFeesResource, PartnerFeesResourceSync
from blindpay.resources.payins.payins import PayinsResource, PayinsResourceSync
from blindpay.resources.payins.quotes import PayinQuotesResource, PayinQuotesResourceSync
Expand All @@ -39,7 +46,7 @@
from blindpay.resources.wallets.offramp import OfframpWalletsResource, OfframpWalletsResourceSync
from blindpay.resources.webhooks.webhooks import WebhookEndpointsResource, WebhookEndpointsResourceSync

__version__ = "2.2.0"
__version__ = "2.3.0"

T = TypeVar("T")

Expand Down Expand Up @@ -224,6 +231,51 @@ 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) -> "CustomerBankAccountsResource":
from blindpay.resources.customers.bank_accounts import create_customer_bank_accounts_resource

return create_customer_bank_accounts_resource(self._instance_id, self._api)

@cached_property
def blockchain_wallets(self) -> "CustomerBlockchainWalletsResource":
from blindpay.resources.customers.blockchain_wallets import create_customer_blockchain_wallets_resource

return create_customer_blockchain_wallets_resource(self._instance_id, self._api)

@cached_property
def virtual_accounts(self) -> "CustomerVirtualAccountsResource":
from blindpay.resources.customers.virtual_accounts import create_customer_virtual_accounts_resource

return create_customer_virtual_accounts_resource(self._instance_id, self._api)

@cached_property
def wallets(self) -> "CustomerWalletsResource":
from blindpay.resources.customers.wallets import create_customer_wallets_resource

return create_customer_wallets_resource(self._instance_id, self._api)

@cached_property
def offramp_wallets(self) -> "CustomerOfframpWalletsResource":
from blindpay.resources.customers.offramp_wallets import create_customer_offramp_wallets_resource

return create_customer_offramp_wallets_resource(self._instance_id, self._api)

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


class _WalletsNamespace:
def __init__(self, instance_id: str, api_client: ApiClientImpl) -> None:
self._instance_id = instance_id
Expand Down Expand Up @@ -309,6 +361,16 @@ def payouts(self) -> "PayoutsResource":
def receivers(self) -> _ReceiversNamespace:
return _ReceiversNamespace(self._instance_id, self._api)

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

@cached_property
def ownership(self) -> "OwnershipResource":
from blindpay.resources.ownership import create_ownership_resource

return create_ownership_resource(self._instance_id, self._api)

@cached_property
def virtual_accounts(self) -> "VirtualAccountsResource":
from blindpay.resources.virtual_accounts import create_virtual_accounts_resource
Expand Down Expand Up @@ -454,6 +516,51 @@ 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) -> "CustomerBankAccountsResourceSync":
from blindpay.resources.customers.bank_accounts import create_customer_bank_accounts_resource_sync

return create_customer_bank_accounts_resource_sync(self._instance_id, self._api)

@cached_property
def blockchain_wallets(self) -> "CustomerBlockchainWalletsResourceSync":
from blindpay.resources.customers.blockchain_wallets import create_customer_blockchain_wallets_resource_sync

return create_customer_blockchain_wallets_resource_sync(self._instance_id, self._api)

@cached_property
def virtual_accounts(self) -> "CustomerVirtualAccountsResourceSync":
from blindpay.resources.customers.virtual_accounts import create_customer_virtual_accounts_resource_sync

return create_customer_virtual_accounts_resource_sync(self._instance_id, self._api)

@cached_property
def wallets(self) -> "CustomerWalletsResourceSync":
from blindpay.resources.customers.wallets import create_customer_wallets_resource_sync

return create_customer_wallets_resource_sync(self._instance_id, self._api)

@cached_property
def offramp_wallets(self) -> "CustomerOfframpWalletsResourceSync":
from blindpay.resources.customers.offramp_wallets import create_customer_offramp_wallets_resource_sync

return create_customer_offramp_wallets_resource_sync(self._instance_id, self._api)

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


class _WalletsNamespaceSync:
def __init__(self, instance_id: str, api_client: ApiClientImplSync) -> None:
self._instance_id = instance_id
Expand Down Expand Up @@ -539,6 +646,16 @@ def payouts(self) -> "PayoutsResourceSync":
def receivers(self) -> _ReceiversNamespaceSync:
return _ReceiversNamespaceSync(self._instance_id, self._api)

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

@cached_property
def ownership(self) -> "OwnershipResourceSync":
from blindpay.resources.ownership import create_ownership_resource_sync

return create_ownership_resource_sync(self._instance_id, self._api)

@cached_property
def virtual_accounts(self) -> "VirtualAccountsResourceSync":
from blindpay.resources.virtual_accounts import create_virtual_accounts_resource_sync
Expand Down
4 changes: 4 additions & 0 deletions src/blindpay/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
from .available import create_available_resource
from .bank_accounts import create_bank_accounts_resource
from .custodial_wallets import create_custodial_wallets_resource
from .customers import create_customers_resource
from .fees import create_fees_resource
from .instances import create_instances_resource
from .ownership import create_ownership_resource
from .partner_fees import create_partner_fees_resource
from .payins import create_payin_quotes_resource, create_payins_resource
from .payouts import create_payouts_resource
Expand All @@ -21,8 +23,10 @@
"create_available_resource",
"create_bank_accounts_resource",
"create_custodial_wallets_resource",
"create_customers_resource",
"create_fees_resource",
"create_instances_resource",
"create_ownership_resource",
"create_partner_fees_resource",
"create_payins_resource",
"create_payin_quotes_resource",
Expand Down
125 changes: 125 additions & 0 deletions src/blindpay/resources/customers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
from .bank_accounts import (
BankAccount,
CreateBankAccountInput,
CustomerBankAccountsResource,
CustomerBankAccountsResourceSync,
ListBankAccountsResponse,
create_customer_bank_accounts_resource,
create_customer_bank_accounts_resource_sync,
)
from .blockchain_wallets import (
BlockchainWallet,
BlockchainWalletMessage,
CreateBlockchainWalletInput,
CustomerBlockchainWalletsResource,
CustomerBlockchainWalletsResourceSync,
ListBlockchainWalletsResponse,
create_customer_blockchain_wallets_resource,
create_customer_blockchain_wallets_resource_sync,
)
from .customers import (
CreateCustomerInput,
CreateCustomerResponse,
Customer,
CustomersResource,
CustomersResourceSync,
GetCustomerLimitsResponse,
LimitIncreaseRequestInput,
LimitIncreaseRequestResponse,
ListCustomersResponse,
Rfi,
UpdateCustomerInput,
create_customers_resource,
create_customers_resource_sync,
)
from .offramp_wallets import (
CreateOfframpWalletInput,
CreateOfframpWalletResponse,
CustomerOfframpWalletsResource,
CustomerOfframpWalletsResourceSync,
ListOfframpWalletsResponse,
OfframpWallet,
create_customer_offramp_wallets_resource,
create_customer_offramp_wallets_resource_sync,
)
from .virtual_accounts import (
CreateVirtualAccountInput,
CustomerVirtualAccountsResource,
CustomerVirtualAccountsResourceSync,
ListVirtualAccountsResponse,
UpdateVirtualAccountInput,
VirtualAccount,
create_customer_virtual_accounts_resource,
create_customer_virtual_accounts_resource_sync,
)
from .wallets import (
CreateWalletInput,
CustomerWalletsResource,
CustomerWalletsResourceSync,
ListWalletsResponse,
Wallet,
WalletBalance,
create_customer_wallets_resource,
create_customer_wallets_resource_sync,
)

__all__ = [
# Main customers resource
"CustomersResource",
"CustomersResourceSync",
"create_customers_resource",
"create_customers_resource_sync",
"CreateCustomerInput",
"CreateCustomerResponse",
"Customer",
"UpdateCustomerInput",
"ListCustomersResponse",
"LimitIncreaseRequestInput",
"LimitIncreaseRequestResponse",
"GetCustomerLimitsResponse",
"Rfi",
# Bank accounts
"CustomerBankAccountsResource",
"CustomerBankAccountsResourceSync",
"create_customer_bank_accounts_resource",
"create_customer_bank_accounts_resource_sync",
"CreateBankAccountInput",
"BankAccount",
"ListBankAccountsResponse",
# Blockchain wallets
"CustomerBlockchainWalletsResource",
"CustomerBlockchainWalletsResourceSync",
"create_customer_blockchain_wallets_resource",
"create_customer_blockchain_wallets_resource_sync",
"CreateBlockchainWalletInput",
"BlockchainWallet",
"BlockchainWalletMessage",
"ListBlockchainWalletsResponse",
# Virtual accounts
"CustomerVirtualAccountsResource",
"CustomerVirtualAccountsResourceSync",
"create_customer_virtual_accounts_resource",
"create_customer_virtual_accounts_resource_sync",
"CreateVirtualAccountInput",
"UpdateVirtualAccountInput",
"VirtualAccount",
"ListVirtualAccountsResponse",
# Wallets
"CustomerWalletsResource",
"CustomerWalletsResourceSync",
"create_customer_wallets_resource",
"create_customer_wallets_resource_sync",
"CreateWalletInput",
"Wallet",
"WalletBalance",
"ListWalletsResponse",
# Offramp wallets
"CustomerOfframpWalletsResource",
"CustomerOfframpWalletsResourceSync",
"create_customer_offramp_wallets_resource",
"create_customer_offramp_wallets_resource_sync",
"CreateOfframpWalletInput",
"CreateOfframpWalletResponse",
"OfframpWallet",
"ListOfframpWalletsResponse",
]
Loading
Loading