From a3cde8ed0021011a0955f60a96bdb109614c0359 Mon Sep 17 00:00:00 2001 From: alvseven Date: Mon, 8 Jun 2026 13:51:10 -0300 Subject: [PATCH] feat!: remove deprecated receivers resource (v3.0.0) Deletes the receivers resource and its namespace. All callers must use the customers resource instead. https://www.blindpay.com/changelog/2026-06-04-customers-rename --- pyproject.toml | 2 +- src/blindpay/__init__.py | 2 +- src/blindpay/client.py | 61 +- src/blindpay/resources/__init__.py | 4 +- src/blindpay/resources/receivers/__init__.py | 104 --- src/blindpay/resources/receivers/receivers.py | 859 ------------------ tests/resources/test_bank_accounts.py | 44 +- .../{test_receivers.py => test_customers.py} | 100 +- 8 files changed, 77 insertions(+), 1099 deletions(-) delete mode 100644 src/blindpay/resources/receivers/__init__.py delete mode 100644 src/blindpay/resources/receivers/receivers.py rename tests/resources/{test_receivers.py => test_customers.py} (94%) diff --git a/pyproject.toml b/pyproject.toml index 415a080..1cc6d66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "blindpay" -version = "2.3.0" +version = "3.0.0" description = "Official Python SDK for the Blindpay API — Global payments infrastructure" readme = "README.md" authors = [{ name = "Blindpay", email = "alves@blindpay.com" }] diff --git a/src/blindpay/__init__.py b/src/blindpay/__init__.py index 5b079c8..02ef1c9 100644 --- a/src/blindpay/__init__.py +++ b/src/blindpay/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.3.0" +__version__ = "3.0.0" from ._internal.exceptions import BlindPayError from .client import BlindPay, BlindPaySync diff --git a/src/blindpay/client.py b/src/blindpay/client.py index f7eec5c..96d767d 100644 --- a/src/blindpay/client.py +++ b/src/blindpay/client.py @@ -1,7 +1,6 @@ import base64 import hashlib import hmac -import warnings from functools import cached_property from typing import TYPE_CHECKING, Any, Dict, Literal, Mapping, Optional, TypeVar @@ -26,7 +25,6 @@ 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, TermsOfServiceResourceSync, @@ -41,12 +39,7 @@ from blindpay.resources.wallets.offramp import OfframpWalletsResource, OfframpWalletsResourceSync from blindpay.resources.webhooks.webhooks import WebhookEndpointsResource, WebhookEndpointsResourceSync -__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" -) +__version__ = "3.0.0" T = TypeVar("T") @@ -231,27 +224,6 @@ 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 - self._api = api_client - - @cached_property - def _base(self) -> "ReceiversResource": - from blindpay.resources.receivers.receivers import create_receivers_resource - - return create_receivers_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 _WalletsNamespace: def __init__(self, instance_id: str, api_client: ApiClientImpl) -> None: self._instance_id = instance_id @@ -337,11 +309,6 @@ def payouts(self) -> "PayoutsResource": 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 def virtual_accounts(self) -> "VirtualAccountsResource": from blindpay.resources.virtual_accounts import create_virtual_accounts_resource @@ -487,27 +454,6 @@ 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 - self._api = api_client - - @cached_property - def _base(self) -> "ReceiversResourceSync": - from blindpay.resources.receivers.receivers import create_receivers_resource_sync - - return create_receivers_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 _WalletsNamespaceSync: def __init__(self, instance_id: str, api_client: ApiClientImplSync) -> None: self._instance_id = instance_id @@ -593,11 +539,6 @@ def payouts(self) -> "PayoutsResourceSync": 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 def virtual_accounts(self) -> "VirtualAccountsResourceSync": from blindpay.resources.virtual_accounts import create_virtual_accounts_resource_sync diff --git a/src/blindpay/resources/__init__.py b/src/blindpay/resources/__init__.py index 3819881..e78a68c 100644 --- a/src/blindpay/resources/__init__.py +++ b/src/blindpay/resources/__init__.py @@ -2,13 +2,13 @@ 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 .partner_fees import create_partner_fees_resource from .payins import create_payin_quotes_resource, create_payins_resource from .payouts import create_payouts_resource from .quotes import create_quotes_resource -from .receivers import create_receivers_resource from .terms_of_service import create_terms_of_service_resource, create_terms_of_service_resource_sync from .transfers import create_transfers_resource from .upload import create_upload_resource @@ -27,8 +27,8 @@ "create_payins_resource", "create_payin_quotes_resource", "create_payouts_resource", + "create_customers_resource", "create_quotes_resource", - "create_receivers_resource", "create_terms_of_service_resource", "create_terms_of_service_resource_sync", "create_transfers_resource", diff --git a/src/blindpay/resources/receivers/__init__.py b/src/blindpay/resources/receivers/__init__.py deleted file mode 100644 index b297bdf..0000000 --- a/src/blindpay/resources/receivers/__init__.py +++ /dev/null @@ -1,104 +0,0 @@ -from .receivers import ( - AccountPurpose, - AmlHits, - AmlStatus, - BusinessIndustry, - BusinessType, - BusinessWithStandardKYB, - CreateBusinessWithStandardKYBInput, - CreateBusinessWithStandardKYBResponse, - CreateIndividualWithEnhancedKYCInput, - CreateIndividualWithEnhancedKYCResponse, - CreateIndividualWithStandardKYCInput, - CreateIndividualWithStandardKYCResponse, - EnhancedKycType, - EstimatedAnnualRevenue, - FraudWarning, - GetLimitIncreaseRequestsResponse, - GetReceiverLimitsResponse, - GetReceiverResponse, - IdentificationDocument, - IndividualType, - IndividualWithEnhancedKYC, - IndividualWithStandardKYC, - KycType, - KycWarning, - LimitIncreaseRequest, - LimitIncreaseRequestStatus, - LimitIncreaseRequestSupportingDocumentType, - ListReceiversInput, - ListReceiversPaginatedResponse, - ListReceiversResponse, - Owner, - OwnerRole, - OwnerUpdate, - ProofOfAddressDocType, - PurposeOfTransactions, - ReceiverBusinessType, - ReceiversResource, - ReceiversResourceSync, - ReceiverStatus, - RequestLimitIncreaseInput, - RequestLimitIncreaseResponse, - SoleProprietorDocType, - SourceOfFundsDocType, - SourceOfWealth, - TaxType, - TransactionLimit, - UpdateReceiverInput, - create_receivers_resource, - create_receivers_resource_sync, -) - -__all__ = [ - "create_receivers_resource", - "create_receivers_resource_sync", - "ReceiversResource", - "ReceiversResourceSync", - "IndividualWithStandardKYC", - "IndividualWithEnhancedKYC", - "BusinessWithStandardKYB", - "CreateIndividualWithStandardKYCInput", - "CreateIndividualWithEnhancedKYCInput", - "CreateBusinessWithStandardKYBInput", - "UpdateReceiverInput", - "GetReceiverLimitsResponse", - "KycType", - "BusinessType", - "IndividualType", - "EnhancedKycType", - "ProofOfAddressDocType", - "PurposeOfTransactions", - "SourceOfFundsDocType", - "IdentificationDocument", - "OwnerRole", - "KycWarning", - "TransactionLimit", - "Owner", - "CreateBusinessWithStandardKYBResponse", - "CreateIndividualWithEnhancedKYCResponse", - "CreateIndividualWithStandardKYCResponse", - "ListReceiversResponse", - "GetReceiverResponse", - "OwnerUpdate", - "UpdateReceiverInput", - "LimitIncreaseRequest", - "LimitIncreaseRequestStatus", - "LimitIncreaseRequestSupportingDocumentType", - "GetLimitIncreaseRequestsResponse", - "RequestLimitIncreaseInput", - "RequestLimitIncreaseResponse", - "ReceiverStatus", - "AccountPurpose", - "ReceiverBusinessType", - "BusinessIndustry", - "EstimatedAnnualRevenue", - "SoleProprietorDocType", - "SourceOfWealth", - "TaxType", - "AmlStatus", - "FraudWarning", - "AmlHits", - "ListReceiversInput", - "ListReceiversPaginatedResponse", -] diff --git a/src/blindpay/resources/receivers/receivers.py b/src/blindpay/resources/receivers/receivers.py deleted file mode 100644 index 77c420e..0000000 --- a/src/blindpay/resources/receivers/receivers.py +++ /dev/null @@ -1,859 +0,0 @@ -from typing import List, Optional, Union -from urllib.parse import urlencode - -from typing_extensions import Literal, TypedDict - -from ..._internal.api_client import InternalApiClient, InternalApiClientSync -from ...types import ( - BlindpayApiResponse, - Country, - PaginationMetadata, - PaginationParams, -) - -IndividualType = Literal["individual"] -BusinessType = Literal["business"] -StandardKycType = Literal["standard"] -EnhancedKycType = Literal["enhanced"] -KycType = Literal["light", "standard", "enhanced"] -KycStatus = Literal["awaiting_contract", "compliance_request"] - -ProofOfAddressDocType = Literal[ - "UTILITY_BILL", "BANK_STATEMENT", "RENTAL_AGREEMENT", "TAX_DOCUMENT", "GOVERNMENT_CORRESPONDENCE" -] - -PurposeOfTransactions = Literal[ - "business_transactions", - "charitable_donations", - "investment_purposes", - "payments_to_friends_or_family_abroad", - "personal_or_living_expenses", - "protect_wealth", - "purchase_good_and_services", - "receive_payment_for_freelancing", - "receive_salary", - "other", -] - -SourceOfFundsDocType = Literal[ - "business_income", - "gambling_proceeds", - "gifts", - "government_benefits", - "inheritance", - "investment_loans", - "pension_retirement", - "salary", - "sale_of_assets_real_estate", - "savings", - "esops", - "investment_proceeds", - "someone_else_funds", -] - -SoleProprietorDocType = Literal["bank_statement", "master_service_agreement", "salary_slip"] - -IdentificationDocument = Literal["PASSPORT", "ID_CARD", "DRIVERS"] - -OwnerRole = Literal["beneficial_controlling", "beneficial_owner", "controlling_person"] - -LimitIncreaseRequestStatus = Literal["in_review", "approved", "rejected"] - -LimitIncreaseRequestSupportingDocumentType = Literal[ - "individual_bank_statement", - "individual_tax_return", - "individual_proof_of_income", - "business_bank_statement", - "business_financial_statements", - "business_tax_return", -] - -ReceiverStatus = Literal["verifying", "approved", "rejected", "deprecated", "pending_review"] - -AccountPurpose = Literal[ - "charitable_donations", - "ecommerce_retail_payments", - "investment_purposes", - "business_expenses", - "payments_to_friends_or_family_abroad", - "personal_or_living_expenses", - "protect_wealth", - "purchase_goods_and_services", - "receive_payments_for_goods_and_services", - "tax_optimization", - "third_party_money_transmission", - "payroll", - "treasury_management", - "other", -] - -ReceiverBusinessType = Literal["corporation", "llc", "partnership", "sole_proprietorship", "trust", "non_profit"] - -BusinessIndustry = Literal[ - "111998", - "112120", - "113310", - "115114", - "541211", - "541810", - "541430", - "541715", - "541930", - "561422", - "561311", - "561612", - "561740", - "561730", - "236115", - "236220", - "237310", - "238210", - "811111", - "812111", - "812112", - "532111", - "624410", - "541922", - "811210", - "812199", - "611110", - "611310", - "611410", - "611710", - "211120", - "212114", - "221310", - "562111", - "562920", - "213112", - "522110", - "522210", - "522320", - "523150", - "523940", - "523999", - "524113", - "813110", - "813211", - "813219", - "551112", - "721110", - "722511", - "722513", - "561510", - "713110", - "713210", - "712110", - "711110", - "711211", - "621111", - "621210", - "622110", - "623110", - "621511", - "623220", - "541940", - "621399", - "621910", - "541110", - "311421", - "337121", - "322220", - "339920", - "334210", - "339930", - "312130", - "334111", - "334118", - "325412", - "339112", - "336110", - "336390", - "315990", - "313110", - "339910", - "516120", - "513130", - "512250", - "519130", - "711410", - "711510", - "531110", - "531120", - "531130", - "531190", - "531210", - "531311", - "531312", - "531320", - "531390", - "454110", - "445110", - "455110", - "457110", - "449210", - "444110", - "459210", - "459120", - "445320", - "458110", - "458210", - "458310", - "455219", - "424210", - "456110", - "541511", - "541512", - "541519", - "518210", - "511210", - "517111", - "517112", - "517410", - "481111", - "483111", - "485210", - "488510", - "484121", - "493110", - "423430", - "423690", - "423110", - "423830", - "423840", - "423510", - "424690", - "424990", - "424410", - "424480", - "423940", - "541611", - "541618", - "541330", - "541990", - "541214", - "561499", - "dapp", - "exchange", - "gambling", - "gaming", - "infra", - "marketplace", - "neo_bank", - "other", - "saas", - "social", - "wallet", -] - -EstimatedAnnualRevenue = Literal[ - "0_99999", - "100000_999999", - "1000000_9999999", - "10000000_49999999", - "50000000_249999999", - "2500000000_plus", -] - -SourceOfWealth = Literal[ - "business_dividends_or_profits", - "investments", - "asset_sales", - "client_investor_contributions", - "gambling", - "charitable_contributions", - "inheritance", - "affiliate_or_royalty_income", -] - -TaxType = Literal["SSN", "ITIN"] - -AmlStatus = Literal["clear", "hit", "error"] - - -class FraudWarning(TypedDict): - id: Optional[str] - name: Optional[str] - operation: Optional[str] - score: Optional[float] - - -class AmlHits(TypedDict): - has_sanction_match: bool - has_pep_match: bool - has_watchlist_match: bool - has_crimelist_match: bool - has_adversemedia_match: bool - - -class KycWarning(TypedDict): - code: Optional[str] - message: Optional[str] - resolution_status: Optional[str] - warning_id: Optional[str] - - -class TransactionLimit(TypedDict): - per_transaction: float - daily: float - monthly: float - - -class Owner(TypedDict): - id: str - instance_id: str - receiver_id: str - role: OwnerRole - first_name: str - last_name: str - date_of_birth: str - tax_id: str - address_line_1: str - address_line_2: Optional[str] - city: str - state_province_region: str - country: Country - postal_code: str - id_doc_country: Country - id_doc_type: IdentificationDocument - id_doc_front_file: str - id_doc_back_file: Optional[str] - proof_of_address_doc_type: ProofOfAddressDocType - proof_of_address_doc_file: str - ownership_percentage: Optional[int] - title: Optional[str] - tax_type: Optional[TaxType] - - -class IndividualWithStandardKYC(TypedDict): - id: str - type: IndividualType - kyc_type: StandardKycType - kyc_status: KycStatus - kyc_warnings: Optional[List[KycWarning]] - email: str - tax_id: str - address_line_1: str - address_line_2: Optional[str] - city: str - state_province_region: str - country: Country - postal_code: str - ip_address: Optional[str] - image_url: Optional[str] - phone_number: str - proof_of_address_doc_type: ProofOfAddressDocType - proof_of_address_doc_file: str - first_name: str - last_name: str - date_of_birth: str - id_doc_country: Country - id_doc_type: IdentificationDocument - id_doc_front_file: str - id_doc_back_file: str - aiprise_validation_key: str - instance_id: str - tos_id: Optional[str] - created_at: str - updated_at: str - limit: TransactionLimit - fraud_warnings: Optional[List[FraudWarning]] - selfie_file: Optional[str] - is_fbo: Optional[bool] - account_purpose: Optional[AccountPurpose] - account_purpose_other: Optional[str] - business_type: Optional[ReceiverBusinessType] - business_description: Optional[str] - business_industry: Optional[BusinessIndustry] - estimated_annual_revenue: Optional[EstimatedAnnualRevenue] - source_of_wealth: Optional[SourceOfWealth] - publicly_traded: Optional[bool] - occupation: Optional[str] - external_id: Optional[str] - aml_status: Optional[AmlStatus] - aml_hits: Optional[AmlHits] - is_tos_accepted: Optional[bool] - - -class IndividualWithEnhancedKYC(TypedDict): - id: str - type: IndividualType - kyc_type: EnhancedKycType - kyc_status: KycStatus - kyc_warnings: Optional[List[KycWarning]] - email: str - tax_id: str - address_line_1: str - address_line_2: Optional[str] - city: str - state_province_region: str - country: Country - postal_code: str - ip_address: Optional[str] - image_url: Optional[str] - phone_number: Optional[str] - proof_of_address_doc_type: ProofOfAddressDocType - proof_of_address_doc_file: str - first_name: str - last_name: str - date_of_birth: str - id_doc_country: Country - id_doc_type: IdentificationDocument - id_doc_front_file: str - id_doc_back_file: Optional[str] - aiprise_validation_key: str - instance_id: str - source_of_funds_doc_type: str - source_of_funds_doc_file: str - individual_holding_doc_front_file: str - purpose_of_transactions: PurposeOfTransactions - purpose_of_transactions_explanation: Optional[str] - tos_id: Optional[str] - created_at: str - updated_at: str - limit: TransactionLimit - fraud_warnings: Optional[List[FraudWarning]] - selfie_file: Optional[str] - is_fbo: Optional[bool] - account_purpose: Optional[AccountPurpose] - account_purpose_other: Optional[str] - business_type: Optional[ReceiverBusinessType] - business_description: Optional[str] - business_industry: Optional[BusinessIndustry] - estimated_annual_revenue: Optional[EstimatedAnnualRevenue] - source_of_wealth: Optional[SourceOfWealth] - publicly_traded: Optional[bool] - occupation: Optional[str] - external_id: Optional[str] - aml_status: Optional[AmlStatus] - aml_hits: Optional[AmlHits] - is_tos_accepted: Optional[bool] - - -class BusinessWithStandardKYB(TypedDict): - id: str - type: BusinessType - kyc_type: StandardKycType - kyc_status: KycStatus - kyc_warnings: Optional[List[KycWarning]] - email: str - tax_id: str - address_line_1: str - address_line_2: Optional[str] - city: str - state_province_region: str - country: Country - postal_code: str - ip_address: Optional[str] - image_url: Optional[str] - phone_number: Optional[str] - proof_of_address_doc_type: ProofOfAddressDocType - proof_of_address_doc_file: str - legal_name: str - alternate_name: Optional[str] - formation_date: str - website: Optional[str] - owners: List[Owner] - incorporation_doc_file: str - proof_of_ownership_doc_file: str - external_id: Optional[str] - instance_id: str - tos_id: Optional[str] - aiprise_validation_key: str - created_at: str - updated_at: str - limit: TransactionLimit - fraud_warnings: Optional[List[FraudWarning]] - selfie_file: Optional[str] - is_fbo: Optional[bool] - account_purpose: Optional[AccountPurpose] - account_purpose_other: Optional[str] - business_type: Optional[ReceiverBusinessType] - business_description: Optional[str] - business_industry: Optional[BusinessIndustry] - estimated_annual_revenue: Optional[EstimatedAnnualRevenue] - source_of_wealth: Optional[SourceOfWealth] - publicly_traded: Optional[bool] - occupation: Optional[str] - aml_status: Optional[AmlStatus] - aml_hits: Optional[AmlHits] - is_tos_accepted: Optional[bool] - - -class CreateIndividualWithStandardKYCInput(TypedDict): - external_id: Optional[str] - address_line_1: str - address_line_2: Optional[str] - city: str - country: Country - date_of_birth: str - email: str - first_name: str - phone_number: Optional[str] - id_doc_country: Country - id_doc_front_file: str - id_doc_type: IdentificationDocument - id_doc_back_file: Optional[str] - last_name: str - postal_code: str - proof_of_address_doc_file: str - proof_of_address_doc_type: ProofOfAddressDocType - state_province_region: str - tax_id: str - tos_id: str - ip_address: Optional[str] - image_url: Optional[str] - selfie_file: Optional[str] - account_purpose: Optional[AccountPurpose] - account_purpose_other: Optional[str] - occupation: Optional[str] - - -class CreateIndividualWithStandardKYCResponse(TypedDict): - id: str - - -class CreateIndividualWithEnhancedKYCInput(TypedDict): - external_id: Optional[str] - address_line_1: str - address_line_2: Optional[str] - city: str - country: Country - date_of_birth: str - email: str - first_name: str - id_doc_country: Country - id_doc_front_file: str - id_doc_type: IdentificationDocument - id_doc_back_file: Optional[str] - individual_holding_doc_front_file: str - last_name: str - postal_code: str - phone_number: Optional[str] - proof_of_address_doc_file: str - proof_of_address_doc_type: ProofOfAddressDocType - purpose_of_transactions: PurposeOfTransactions - source_of_funds_doc_file: str - source_of_funds_doc_type: SourceOfFundsDocType - purpose_of_transactions_explanation: Optional[str] - state_province_region: str - tax_id: str - tos_id: str - ip_address: Optional[str] - image_url: Optional[str] - selfie_file: Optional[str] - is_fbo: Optional[bool] - account_purpose: Optional[AccountPurpose] - account_purpose_other: Optional[str] - occupation: Optional[str] - - -class CreateIndividualWithEnhancedKYCResponse(TypedDict): - id: str - - -class CreateBusinessWithStandardKYBInput(TypedDict): - external_id: Optional[str] - address_line_1: str - address_line_2: Optional[str] - alternate_name: str - city: str - country: Country - email: str - formation_date: str - incorporation_doc_file: str - legal_name: str - owners: List[Owner] - postal_code: str - proof_of_address_doc_file: str - proof_of_address_doc_type: ProofOfAddressDocType - proof_of_ownership_doc_file: str - state_province_region: str - tax_id: str - tos_id: str - website: Optional[str] - ip_address: Optional[str] - image_url: Optional[str] - phone_number: Optional[str] - selfie_file: Optional[str] - account_purpose: Optional[AccountPurpose] - account_purpose_other: Optional[str] - business_type: Optional[ReceiverBusinessType] - business_description: Optional[str] - business_industry: Optional[BusinessIndustry] - estimated_annual_revenue: Optional[EstimatedAnnualRevenue] - source_of_wealth: Optional[SourceOfWealth] - publicly_traded: Optional[bool] - occupation: Optional[str] - - -class CreateBusinessWithStandardKYBResponse(TypedDict): - id: str - - -ListReceiversResponse = List[Union[IndividualWithStandardKYC, IndividualWithEnhancedKYC, BusinessWithStandardKYB]] - - -class ListReceiversPaginatedResponse(TypedDict): - data: List[Union[IndividualWithStandardKYC, IndividualWithEnhancedKYC, BusinessWithStandardKYB]] - pagination: PaginationMetadata - - -class ListReceiversInput(PaginationParams, total=False): - full_name: str - receiver_name: str - status: ReceiverStatus - receiver_id: str - bank_account_id: str - country: str - - -GetReceiverResponse = Union[IndividualWithStandardKYC, IndividualWithEnhancedKYC, BusinessWithStandardKYB] - - -class OwnerUpdate(TypedDict): - id: str - first_name: str - last_name: str - role: OwnerRole - date_of_birth: str - tax_id: str - address_line_1: str - address_line_2: Optional[str] - city: str - state_province_region: str - country: Country - postal_code: str - id_doc_country: Country - id_doc_type: IdentificationDocument - id_doc_front_file: str - id_doc_back_file: Optional[str] - ownership_percentage: Optional[int] - title: Optional[str] - tax_type: Optional[TaxType] - proof_of_address_doc_type: Optional[ProofOfAddressDocType] - proof_of_address_doc_file: Optional[str] - - -class UpdateReceiverInput(TypedDict): - receiver_id: str - email: Optional[str] - tax_id: Optional[str] - address_line_1: Optional[str] - address_line_2: Optional[str] - city: Optional[str] - state_province_region: Optional[str] - country: Optional[Country] - postal_code: Optional[str] - ip_address: Optional[str] - image_url: Optional[str] - phone_number: Optional[str] - proof_of_address_doc_type: Optional[ProofOfAddressDocType] - proof_of_address_doc_file: Optional[str] - first_name: Optional[str] - last_name: Optional[str] - date_of_birth: Optional[str] - id_doc_country: Optional[Country] - id_doc_type: Optional[IdentificationDocument] - id_doc_front_file: Optional[str] - id_doc_back_file: Optional[str] - legal_name: Optional[str] - alternate_name: Optional[str] - formation_date: Optional[str] - website: Optional[str] - owners: Optional[List[OwnerUpdate]] - incorporation_doc_file: Optional[str] - proof_of_ownership_doc_file: Optional[str] - source_of_funds_doc_type: Optional[SourceOfFundsDocType] - source_of_funds_doc_file: Optional[str] - individual_holding_doc_front_file: Optional[str] - purpose_of_transactions: Optional[PurposeOfTransactions] - purpose_of_transactions_explanation: Optional[str] - external_id: Optional[str] - tos_id: Optional[str] - selfie_file: Optional[str] - account_purpose: Optional[AccountPurpose] - account_purpose_other: Optional[str] - business_type: Optional[ReceiverBusinessType] - business_description: Optional[str] - business_industry: Optional[BusinessIndustry] - estimated_annual_revenue: Optional[EstimatedAnnualRevenue] - source_of_wealth: Optional[SourceOfWealth] - publicly_traded: Optional[bool] - occupation: Optional[str] - - -class PayinLimit(TypedDict): - daily: float - monthly: float - - -class PayoutLimit(TypedDict): - daily: float - monthly: float - - -class Limits(TypedDict): - payin: PayinLimit - payout: PayoutLimit - - -class GetReceiverLimitsResponse(TypedDict): - limits: Limits - - -class LimitIncreaseRequest(TypedDict): - id: str - receiver_id: str - status: LimitIncreaseRequestStatus - daily: float - monthly: float - per_transaction: float - supporting_document_file: str - supporting_document_type: LimitIncreaseRequestSupportingDocumentType - created_at: str - updated_at: str - - -GetLimitIncreaseRequestsResponse = List[LimitIncreaseRequest] - - -class RequestLimitIncreaseInput(TypedDict): - receiver_id: str - daily: float - monthly: float - per_transaction: float - supporting_document_file: str - supporting_document_type: LimitIncreaseRequestSupportingDocumentType - - -class RequestLimitIncreaseResponse(TypedDict): - id: str - - -class ReceiversResource: - def __init__(self, instance_id: str, client: InternalApiClient): - self._instance_id = instance_id - self._client = client - - async def list( - self, params: Optional[ListReceiversInput] = None - ) -> BlindpayApiResponse[Union[ListReceiversResponse, ListReceiversPaginatedResponse]]: - query_string = "" - if params: - filtered_params = {k: v for k, v in params.items() if v is not None} - if filtered_params: - query_string = f"?{urlencode(filtered_params)}" - return await self._client.get(f"/instances/{self._instance_id}/receivers{query_string}") - - async def create_individual_with_standard_kyc( - self, data: CreateIndividualWithStandardKYCInput - ) -> BlindpayApiResponse[CreateIndividualWithStandardKYCResponse]: - payload = {"kyc_type": "standard", "type": "individual", **data} - return await self._client.post(f"/instances/{self._instance_id}/receivers", payload) - - async def create_individual_with_enhanced_kyc( - self, data: CreateIndividualWithEnhancedKYCInput - ) -> BlindpayApiResponse[CreateIndividualWithEnhancedKYCResponse]: - payload = {"kyc_type": "enhanced", "type": "individual", **data} - return await self._client.post(f"/instances/{self._instance_id}/receivers", payload) - - async def create_business_with_standard_kyb( - self, data: CreateBusinessWithStandardKYBInput - ) -> BlindpayApiResponse[CreateBusinessWithStandardKYBResponse]: - payload = {"kyc_type": "standard", "type": "business", **data} - return await self._client.post(f"/instances/{self._instance_id}/receivers", payload) - - async def get(self, receiver_id: str) -> BlindpayApiResponse[GetReceiverResponse]: - return await self._client.get(f"/instances/{self._instance_id}/receivers/{receiver_id}") - - async def update(self, data: UpdateReceiverInput) -> BlindpayApiResponse[None]: - receiver_id = data["receiver_id"] - payload = {k: v for k, v in data.items() if k != "receiver_id"} - return await self._client.put(f"/instances/{self._instance_id}/receivers/{receiver_id}", payload) - - async def delete(self, receiver_id: str) -> BlindpayApiResponse[None]: - return await self._client.delete(f"/instances/{self._instance_id}/receivers/{receiver_id}") - - async def get_limits(self, receiver_id: str) -> BlindpayApiResponse[GetReceiverLimitsResponse]: - return await self._client.get(f"/instances/{self._instance_id}/limits/receivers/{receiver_id}") - - async def get_limit_increase_requests( - self, receiver_id: str - ) -> BlindpayApiResponse[GetLimitIncreaseRequestsResponse]: - return await self._client.get(f"/instances/{self._instance_id}/receivers/{receiver_id}/limit-increase") - - async def request_limit_increase( - self, data: RequestLimitIncreaseInput - ) -> BlindpayApiResponse[RequestLimitIncreaseResponse]: - receiver_id = data["receiver_id"] - payload = {k: v for k, v in data.items() if k != "receiver_id"} - return await self._client.post( - f"/instances/{self._instance_id}/receivers/{receiver_id}/limit-increase", payload - ) - - -class ReceiversResourceSync: - def __init__(self, instance_id: str, client: InternalApiClientSync): - self._instance_id = instance_id - self._client = client - - def list( - self, params: Optional[ListReceiversInput] = None - ) -> BlindpayApiResponse[Union[ListReceiversResponse, ListReceiversPaginatedResponse]]: - query_string = "" - if params: - filtered_params = {k: v for k, v in params.items() if v is not None} - if filtered_params: - query_string = f"?{urlencode(filtered_params)}" - return self._client.get(f"/instances/{self._instance_id}/receivers{query_string}") - - def create_individual_with_standard_kyc( - self, data: CreateIndividualWithStandardKYCInput - ) -> BlindpayApiResponse[CreateIndividualWithStandardKYCResponse]: - payload = {"kyc_type": "standard", "type": "individual", **data} - return self._client.post(f"/instances/{self._instance_id}/receivers", payload) - - def create_individual_with_enhanced_kyc( - self, data: CreateIndividualWithEnhancedKYCInput - ) -> BlindpayApiResponse[CreateIndividualWithEnhancedKYCResponse]: - payload = {"kyc_type": "enhanced", "type": "individual", **data} - return self._client.post(f"/instances/{self._instance_id}/receivers", payload) - - def create_business_with_standard_kyb( - self, data: CreateBusinessWithStandardKYBInput - ) -> BlindpayApiResponse[CreateBusinessWithStandardKYBResponse]: - payload = {"kyc_type": "standard", "type": "business", **data} - return self._client.post(f"/instances/{self._instance_id}/receivers", payload) - - def get(self, receiver_id: str) -> BlindpayApiResponse[GetReceiverResponse]: - return self._client.get(f"/instances/{self._instance_id}/receivers/{receiver_id}") - - def update(self, data: UpdateReceiverInput) -> BlindpayApiResponse[None]: - receiver_id = data["receiver_id"] - payload = {k: v for k, v in data.items() if k != "receiver_id"} - return self._client.put(f"/instances/{self._instance_id}/receivers/{receiver_id}", payload) - - def delete(self, receiver_id: str) -> BlindpayApiResponse[None]: - return self._client.delete(f"/instances/{self._instance_id}/receivers/{receiver_id}") - - def get_limits(self, receiver_id: str) -> BlindpayApiResponse[GetReceiverLimitsResponse]: - return self._client.get(f"/instances/{self._instance_id}/limits/receivers/{receiver_id}") - - def get_limit_increase_requests(self, receiver_id: str) -> BlindpayApiResponse[GetLimitIncreaseRequestsResponse]: - return self._client.get(f"/instances/{self._instance_id}/receivers/{receiver_id}/limit-increase") - - def request_limit_increase( - self, data: RequestLimitIncreaseInput - ) -> BlindpayApiResponse[RequestLimitIncreaseResponse]: - receiver_id = data["receiver_id"] - payload = {k: v for k, v in data.items() if k != "receiver_id"} - return self._client.post(f"/instances/{self._instance_id}/receivers/{receiver_id}/limit-increase", payload) - - -def create_receivers_resource(instance_id: str, client: InternalApiClient) -> ReceiversResource: - return ReceiversResource(instance_id, client) - - -def create_receivers_resource_sync(instance_id: str, client: InternalApiClientSync) -> ReceiversResourceSync: - return ReceiversResourceSync(instance_id, client) diff --git a/tests/resources/test_bank_accounts.py b/tests/resources/test_bank_accounts.py index 4541e26..8a6836a 100644 --- a/tests/resources/test_bank_accounts.py +++ b/tests/resources/test_bank_accounts.py @@ -23,7 +23,7 @@ async def test_create_pix_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_pix_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.create_pix( + response = await self.blindpay.customers.bank_accounts.create_pix( { "customer_id": "re_000000000000", "name": "PIX Account", @@ -49,7 +49,7 @@ async def test_create_argentina_transfers_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_argentina_transfers_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.create_argentina_transfers( + response = await self.blindpay.customers.bank_accounts.create_argentina_transfers( { "customer_id": "re_000000000000", "name": "Argentina Transfers Account", @@ -78,7 +78,7 @@ async def test_create_spei_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_spei_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.create_spei( + response = await self.blindpay.customers.bank_accounts.create_spei( { "customer_id": "re_000000000000", "name": "SPEI Account", @@ -112,7 +112,7 @@ async def test_create_colombia_ach_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_colombia_ach_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.create_colombia_ach( + response = await self.blindpay.customers.bank_accounts.create_colombia_ach( { "customer_id": "re_000000000000", "name": "Colombia ACH Account", @@ -160,7 +160,7 @@ async def test_create_ach_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_ach_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.create_ach( + response = await self.blindpay.customers.bank_accounts.create_ach( { "customer_id": "re_000000000000", "name": "ACH Account", @@ -196,7 +196,7 @@ async def test_create_wire_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_wire_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.create_wire( + response = await self.blindpay.customers.bank_accounts.create_wire( { "customer_id": "re_000000000000", "name": "Wire Account", @@ -254,7 +254,7 @@ async def test_create_international_swift_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_international_swift_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.create_international_swift( + response = await self.blindpay.customers.bank_accounts.create_international_swift( { "customer_id": "re_000000000000", "name": "International Swift Account", @@ -307,7 +307,7 @@ async def test_create_rtp_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_rtp_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.create_rtp( + response = await self.blindpay.customers.bank_accounts.create_rtp( { "customer_id": "re_000000000000", "name": "John Doe RTP", @@ -346,7 +346,7 @@ async def test_get_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_bank_account, "error": None} - response = await self.blindpay.receivers.bank_accounts.get("re_000000000000", "ba_000000000000") + response = await self.blindpay.customers.bank_accounts.get("re_000000000000", "ba_000000000000") assert response["error"] is None assert response["data"] == mocked_bank_account @@ -428,7 +428,7 @@ async def test_list_bank_accounts(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_bank_accounts, "error": None} - response = await self.blindpay.receivers.bank_accounts.list("re_000000000000") + response = await self.blindpay.customers.bank_accounts.list("re_000000000000") assert response["error"] is None assert response["data"] == mocked_bank_accounts @@ -438,7 +438,7 @@ async def test_delete_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": {"data": None}, "error": None} - response = await self.blindpay.receivers.bank_accounts.delete("re_000000000000", "ba_000000000000") + response = await self.blindpay.customers.bank_accounts.delete("re_000000000000", "ba_000000000000") assert response["error"] is None assert response["data"] == {"data": None} @@ -461,7 +461,7 @@ def test_create_pix_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_pix_account, "error": None} - response = self.blindpay.receivers.bank_accounts.create_pix( + response = self.blindpay.customers.bank_accounts.create_pix( { "customer_id": "re_000000000000", "name": "PIX Account", @@ -486,7 +486,7 @@ def test_create_argentina_transfers_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_argentina_transfers_account, "error": None} - response = self.blindpay.receivers.bank_accounts.create_argentina_transfers( + response = self.blindpay.customers.bank_accounts.create_argentina_transfers( { "customer_id": "re_000000000000", "name": "Argentina Transfers Account", @@ -514,7 +514,7 @@ def test_create_spei_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_spei_account, "error": None} - response = self.blindpay.receivers.bank_accounts.create_spei( + response = self.blindpay.customers.bank_accounts.create_spei( { "customer_id": "re_000000000000", "name": "SPEI Account", @@ -547,7 +547,7 @@ def test_create_colombia_ach_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_colombia_ach_account, "error": None} - response = self.blindpay.receivers.bank_accounts.create_colombia_ach( + response = self.blindpay.customers.bank_accounts.create_colombia_ach( { "customer_id": "re_000000000000", "name": "Colombia ACH Account", @@ -594,7 +594,7 @@ def test_create_ach_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_ach_account, "error": None} - response = self.blindpay.receivers.bank_accounts.create_ach( + response = self.blindpay.customers.bank_accounts.create_ach( { "customer_id": "re_000000000000", "name": "ACH Account", @@ -629,7 +629,7 @@ def test_create_wire_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_wire_account, "error": None} - response = self.blindpay.receivers.bank_accounts.create_wire( + response = self.blindpay.customers.bank_accounts.create_wire( { "customer_id": "re_000000000000", "name": "Wire Account", @@ -686,7 +686,7 @@ def test_create_international_swift_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_international_swift_account, "error": None} - response = self.blindpay.receivers.bank_accounts.create_international_swift( + response = self.blindpay.customers.bank_accounts.create_international_swift( { "customer_id": "re_000000000000", "name": "International Swift Account", @@ -738,7 +738,7 @@ def test_create_rtp_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_rtp_account, "error": None} - response = self.blindpay.receivers.bank_accounts.create_rtp( + response = self.blindpay.customers.bank_accounts.create_rtp( { "customer_id": "re_000000000000", "name": "John Doe RTP", @@ -776,7 +776,7 @@ def test_get_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_bank_account, "error": None} - response = self.blindpay.receivers.bank_accounts.get("re_000000000000", "ba_000000000000") + response = self.blindpay.customers.bank_accounts.get("re_000000000000", "ba_000000000000") assert response["error"] is None assert response["data"] == mocked_bank_account @@ -857,7 +857,7 @@ def test_list_bank_accounts(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_bank_accounts, "error": None} - response = self.blindpay.receivers.bank_accounts.list("re_000000000000") + response = self.blindpay.customers.bank_accounts.list("re_000000000000") assert response["error"] is None assert response["data"] == mocked_bank_accounts @@ -866,7 +866,7 @@ def test_delete_bank_account(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": {"data": None}, "error": None} - response = self.blindpay.receivers.bank_accounts.delete("re_000000000000", "ba_000000000000") + response = self.blindpay.customers.bank_accounts.delete("re_000000000000", "ba_000000000000") assert response["error"] is None assert response["data"] == {"data": None} diff --git a/tests/resources/test_receivers.py b/tests/resources/test_customers.py similarity index 94% rename from tests/resources/test_receivers.py rename to tests/resources/test_customers.py index 175dda4..61cfc08 100644 --- a/tests/resources/test_receivers.py +++ b/tests/resources/test_customers.py @@ -5,7 +5,7 @@ from blindpay import BlindPay, BlindPaySync -class TestReceivers: +class TestCustomers: @pytest.fixture(autouse=True) def setup(self): self.blindpay = BlindPay(api_key="test-key", instance_id="in_000000000000") @@ -143,7 +143,7 @@ async def test_list_receivers(self): "proof_of_address_doc_file": "https://example.com/image.png", "id": "ub_000000000000", "instance_id": "in_000000000000", - "receiver_id": "re_IOxAUL24LG7P", + "customer_id": "re_IOxAUL24LG7P", }, ], "incorporation_doc_file": "https://example.com/image.png", @@ -165,11 +165,11 @@ async def test_list_receivers(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receivers, "error": None} - response = await self.blindpay.receivers.list() + response = await self.blindpay.customers.list() assert response["error"] is None assert response["data"] == mocked_receivers - mock_request.assert_called_once_with("GET", "/instances/in_000000000000/receivers") + mock_request.assert_called_once_with("GET", "/instances/in_000000000000/customers") @pytest.mark.asyncio async def test_list_receivers_with_params(self): @@ -181,11 +181,11 @@ async def test_list_receivers_with_params(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_data, "error": None} - response = await self.blindpay.receivers.list({"status": "approved", "limit": "10"}) + response = await self.blindpay.customers.list({"status": "approved", "limit": "10"}) assert response["error"] is None assert response["data"] == mocked_data - mock_request.assert_called_once_with("GET", "/instances/in_000000000000/receivers?status=approved&limit=10") + mock_request.assert_called_once_with("GET", "/instances/in_000000000000/customers?status=approved&limit=10") @pytest.mark.asyncio async def test_create_individual_with_standard_kyc(self): @@ -196,7 +196,7 @@ async def test_create_individual_with_standard_kyc(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver, "error": None} - response = await self.blindpay.receivers.create_individual_with_standard_kyc( + response = await self.blindpay.customers.create_individual_with_standard_kyc( { "email": "bernardo.simonassi@gmail.com", "tax_id": "12345678900", @@ -232,7 +232,7 @@ async def test_create_individual_with_enhanced_kyc(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver, "error": None} - response = await self.blindpay.receivers.create_individual_with_enhanced_kyc( + response = await self.blindpay.customers.create_individual_with_enhanced_kyc( { "email": "bernardo.simonassi@gmail.com", "tax_id": "12345678900", @@ -273,7 +273,7 @@ async def test_create_business_with_standard_kyb(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver, "error": None} - response = await self.blindpay.receivers.create_business_with_standard_kyb( + response = await self.blindpay.customers.create_business_with_standard_kyb( { "email": "contato@empresa.com.br", "tax_id": "20096178000195", @@ -313,7 +313,7 @@ async def test_create_business_with_standard_kyb(self): "proof_of_address_doc_file": "https://example.com/image.png", "id": "ub_000000000000", "instance_id": "in_000000000000", - "receiver_id": "re_IOxAUL24LG7P", + "customer_id": "re_IOxAUL24LG7P", }, ], } @@ -377,20 +377,20 @@ async def test_get_receiver(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver, "error": None} - response = await self.blindpay.receivers.get("re_YuaMcI2B8zbQ") + response = await self.blindpay.customers.get("re_YuaMcI2B8zbQ") assert response["error"] is None assert response["data"] == mocked_receiver - mock_request.assert_called_once_with("GET", "/instances/in_000000000000/receivers/re_YuaMcI2B8zbQ") + mock_request.assert_called_once_with("GET", "/instances/in_000000000000/customers/re_YuaMcI2B8zbQ") @pytest.mark.asyncio async def test_update_receiver(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": {"data": None}, "error": None} - response = await self.blindpay.receivers.update( + response = await self.blindpay.customers.update( { - "receiver_id": "re_YuaMcI2B8zbQ", + "customer_id": "re_YuaMcI2B8zbQ", "email": "bernardo.simonassi@gmail.com", "tax_id": "12345678900", "address_line_1": "Av. Paulista, 1000", @@ -454,11 +454,11 @@ async def test_delete_receiver(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": {"data": None}, "error": None} - response = await self.blindpay.receivers.delete("re_YuaMcI2B8zbQ") + response = await self.blindpay.customers.delete("re_YuaMcI2B8zbQ") assert response["error"] is None assert response["data"] == {"data": None} - mock_request.assert_called_once_with("DELETE", "/instances/in_000000000000/receivers/re_YuaMcI2B8zbQ", None) + mock_request.assert_called_once_with("DELETE", "/instances/in_000000000000/customers/re_YuaMcI2B8zbQ", None) @pytest.mark.asyncio async def test_get_receiver_limits(self): @@ -478,18 +478,18 @@ async def test_get_receiver_limits(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver_limits, "error": None} - response = await self.blindpay.receivers.get_limits("re_YuaMcI2B8zbQ") + response = await self.blindpay.customers.get_limits("re_YuaMcI2B8zbQ") assert response["error"] is None assert response["data"] == mocked_receiver_limits - mock_request.assert_called_once_with("GET", "/instances/in_000000000000/limits/receivers/re_YuaMcI2B8zbQ") + mock_request.assert_called_once_with("GET", "/instances/in_000000000000/limits/customers/re_YuaMcI2B8zbQ") @pytest.mark.asyncio async def test_get_limit_increase_requests(self): mocked_limit_increase_requests = [ { "id": "rl_000000000000", - "receiver_id": "re_YuaMcI2B8zbQ", + "customer_id": "re_YuaMcI2B8zbQ", "status": "in_review", "daily": 50000, "monthly": 250000, @@ -501,7 +501,7 @@ async def test_get_limit_increase_requests(self): }, { "id": "rl_000000000000", - "receiver_id": "re_YuaMcI2B8zbQ", + "customer_id": "re_YuaMcI2B8zbQ", "status": "approved", "daily": 30000, "monthly": 150000, @@ -516,12 +516,12 @@ async def test_get_limit_increase_requests(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_limit_increase_requests, "error": None} - response = await self.blindpay.receivers.get_limit_increase_requests("re_YuaMcI2B8zbQ") + response = await self.blindpay.customers.get_limit_increase_requests("re_YuaMcI2B8zbQ") assert response["error"] is None assert response["data"] == mocked_limit_increase_requests mock_request.assert_called_once_with( - "GET", "/instances/in_000000000000/receivers/re_YuaMcI2B8zbQ/limit-increase" + "GET", "/instances/in_000000000000/customers/re_YuaMcI2B8zbQ/limit-increase" ) @pytest.mark.asyncio @@ -533,9 +533,9 @@ async def test_request_limit_increase(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_response, "error": None} - response = await self.blindpay.receivers.request_limit_increase( + response = await self.blindpay.customers.request_limit_increase( { - "receiver_id": "re_YuaMcI2B8zbQ", + "customer_id": "re_YuaMcI2B8zbQ", "daily": 100000, "monthly": 500000, "per_transaction": 50000, @@ -548,7 +548,7 @@ async def test_request_limit_increase(self): assert response["data"] == mocked_response mock_request.assert_called_once_with( "POST", - "/instances/in_000000000000/receivers/re_YuaMcI2B8zbQ/limit-increase", + "/instances/in_000000000000/customers/re_YuaMcI2B8zbQ/limit-increase", { "daily": 100000, "monthly": 500000, @@ -559,7 +559,7 @@ async def test_request_limit_increase(self): ) -class TestReceiversSync: +class TestCustomersSync: @pytest.fixture(autouse=True) def setup(self): self.blindpay = BlindPaySync(api_key="test-key", instance_id="in_000000000000") @@ -696,7 +696,7 @@ def test_list_receivers(self): "proof_of_address_doc_file": "https://example.com/image.png", "id": "ub_000000000000", "instance_id": "in_000000000000", - "receiver_id": "re_IOxAUL24LG7P", + "customer_id": "re_IOxAUL24LG7P", }, ], "incorporation_doc_file": "https://example.com/image.png", @@ -718,11 +718,11 @@ def test_list_receivers(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receivers, "error": None} - response = self.blindpay.receivers.list() + response = self.blindpay.customers.list() assert response["error"] is None assert response["data"] == mocked_receivers - mock_request.assert_called_once_with("GET", "/instances/in_000000000000/receivers") + mock_request.assert_called_once_with("GET", "/instances/in_000000000000/customers") def test_list_receivers_with_params(self): mocked_data = { @@ -733,11 +733,11 @@ def test_list_receivers_with_params(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_data, "error": None} - response = self.blindpay.receivers.list({"status": "approved", "limit": "10"}) + response = self.blindpay.customers.list({"status": "approved", "limit": "10"}) assert response["error"] is None assert response["data"] == mocked_data - mock_request.assert_called_once_with("GET", "/instances/in_000000000000/receivers?status=approved&limit=10") + mock_request.assert_called_once_with("GET", "/instances/in_000000000000/customers?status=approved&limit=10") def test_create_individual_with_standard_kyc(self): mocked_receiver = { @@ -747,7 +747,7 @@ def test_create_individual_with_standard_kyc(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver, "error": None} - response = self.blindpay.receivers.create_individual_with_standard_kyc( + response = self.blindpay.customers.create_individual_with_standard_kyc( { "email": "bernardo.simonassi@gmail.com", "tax_id": "12345678900", @@ -782,7 +782,7 @@ def test_create_individual_with_enhanced_kyc(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver, "error": None} - response = self.blindpay.receivers.create_individual_with_enhanced_kyc( + response = self.blindpay.customers.create_individual_with_enhanced_kyc( { "email": "bernardo.simonassi@gmail.com", "tax_id": "12345678900", @@ -822,7 +822,7 @@ def test_create_business_with_standard_kyb(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver, "error": None} - response = self.blindpay.receivers.create_business_with_standard_kyb( + response = self.blindpay.customers.create_business_with_standard_kyb( { "email": "contato@empresa.com.br", "tax_id": "20096178000195", @@ -862,7 +862,7 @@ def test_create_business_with_standard_kyb(self): "proof_of_address_doc_file": "https://example.com/image.png", "id": "ub_000000000000", "instance_id": "in_000000000000", - "receiver_id": "re_IOxAUL24LG7P", + "customer_id": "re_IOxAUL24LG7P", }, ], } @@ -925,19 +925,19 @@ def test_get_receiver(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver, "error": None} - response = self.blindpay.receivers.get("re_YuaMcI2B8zbQ") + response = self.blindpay.customers.get("re_YuaMcI2B8zbQ") assert response["error"] is None assert response["data"] == mocked_receiver - mock_request.assert_called_once_with("GET", "/instances/in_000000000000/receivers/re_YuaMcI2B8zbQ") + mock_request.assert_called_once_with("GET", "/instances/in_000000000000/customers/re_YuaMcI2B8zbQ") def test_update_receiver(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": {"data": None}, "error": None} - response = self.blindpay.receivers.update( + response = self.blindpay.customers.update( { - "receiver_id": "re_YuaMcI2B8zbQ", + "customer_id": "re_YuaMcI2B8zbQ", "email": "bernardo.simonassi@gmail.com", "tax_id": "12345678900", "address_line_1": "Av. Paulista, 1000", @@ -1000,11 +1000,11 @@ def test_delete_receiver(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": {"data": None}, "error": None} - response = self.blindpay.receivers.delete("re_YuaMcI2B8zbQ") + response = self.blindpay.customers.delete("re_YuaMcI2B8zbQ") assert response["error"] is None assert response["data"] == {"data": None} - mock_request.assert_called_once_with("DELETE", "/instances/in_000000000000/receivers/re_YuaMcI2B8zbQ", None) + mock_request.assert_called_once_with("DELETE", "/instances/in_000000000000/customers/re_YuaMcI2B8zbQ", None) def test_get_receiver_limits(self): mocked_receiver_limits = { @@ -1023,17 +1023,17 @@ def test_get_receiver_limits(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_receiver_limits, "error": None} - response = self.blindpay.receivers.get_limits("re_YuaMcI2B8zbQ") + response = self.blindpay.customers.get_limits("re_YuaMcI2B8zbQ") assert response["error"] is None assert response["data"] == mocked_receiver_limits - mock_request.assert_called_once_with("GET", "/instances/in_000000000000/limits/receivers/re_YuaMcI2B8zbQ") + mock_request.assert_called_once_with("GET", "/instances/in_000000000000/limits/customers/re_YuaMcI2B8zbQ") def test_get_limit_increase_requests(self): mocked_limit_increase_requests = [ { "id": "rl_000000000000", - "receiver_id": "re_YuaMcI2B8zbQ", + "customer_id": "re_YuaMcI2B8zbQ", "status": "in_review", "daily": 50000, "monthly": 250000, @@ -1045,7 +1045,7 @@ def test_get_limit_increase_requests(self): }, { "id": "rl_000000000000", - "receiver_id": "re_YuaMcI2B8zbQ", + "customer_id": "re_YuaMcI2B8zbQ", "status": "approved", "daily": 30000, "monthly": 150000, @@ -1060,12 +1060,12 @@ def test_get_limit_increase_requests(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_limit_increase_requests, "error": None} - response = self.blindpay.receivers.get_limit_increase_requests("re_YuaMcI2B8zbQ") + response = self.blindpay.customers.get_limit_increase_requests("re_YuaMcI2B8zbQ") assert response["error"] is None assert response["data"] == mocked_limit_increase_requests mock_request.assert_called_once_with( - "GET", "/instances/in_000000000000/receivers/re_YuaMcI2B8zbQ/limit-increase" + "GET", "/instances/in_000000000000/customers/re_YuaMcI2B8zbQ/limit-increase" ) def test_request_limit_increase(self): @@ -1076,9 +1076,9 @@ def test_request_limit_increase(self): with patch.object(self.blindpay._api, "_request") as mock_request: mock_request.return_value = {"data": mocked_response, "error": None} - response = self.blindpay.receivers.request_limit_increase( + response = self.blindpay.customers.request_limit_increase( { - "receiver_id": "re_YuaMcI2B8zbQ", + "customer_id": "re_YuaMcI2B8zbQ", "daily": 100000, "monthly": 500000, "per_transaction": 50000, @@ -1091,7 +1091,7 @@ def test_request_limit_increase(self): assert response["data"] == mocked_response mock_request.assert_called_once_with( "POST", - "/instances/in_000000000000/receivers/re_YuaMcI2B8zbQ/limit-increase", + "/instances/in_000000000000/customers/re_YuaMcI2B8zbQ/limit-increase", { "daily": 100000, "monthly": 500000,