Skip to content

Commit 55dc86d

Browse files
feat: sync SDK with API changes
1 parent 2d4bf9d commit 55dc86d

8 files changed

Lines changed: 134 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "blindpay"
3-
version = "2.2.0"
3+
version = "2.3.0"
44
description = "Official Python SDK for the Blindpay API — Global payments infrastructure"
55
readme = "README.md"
66
authors = [{ name = "Blindpay", email = "[email protected]" }]

src/blindpay/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "2.2.0"
1+
__version__ = "2.3.0"
22

33
from ._internal.exceptions import BlindPayError
44
from .client import BlindPay, BlindPaySync

src/blindpay/client.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from blindpay.resources.payouts.payouts import PayoutsResource, PayoutsResourceSync
2626
from blindpay.resources.quotes.quotes import QuotesResource, QuotesResourceSync
2727
from blindpay.resources.receivers.receivers import ReceiversResource, ReceiversResourceSync
28+
from blindpay.resources.receivers.rfi import RfiResource, RfiResourceSync
2829
from blindpay.resources.terms_of_service.terms_of_service import (
2930
TermsOfServiceResource,
3031
TermsOfServiceResourceSync,
@@ -39,7 +40,7 @@
3940
from blindpay.resources.wallets.offramp import OfframpWalletsResource, OfframpWalletsResourceSync
4041
from blindpay.resources.webhooks.webhooks import WebhookEndpointsResource, WebhookEndpointsResourceSync
4142

42-
__version__ = "2.2.0"
43+
__version__ = "2.3.0"
4344

4445
T = TypeVar("T")
4546

@@ -220,6 +221,12 @@ def bank_accounts(self) -> "BankAccountsResource":
220221

221222
return create_bank_accounts_resource(self._instance_id, self._api)
222223

224+
@cached_property
225+
def rfi(self) -> "RfiResource":
226+
from blindpay.resources.receivers.rfi import create_rfi_resource
227+
228+
return create_rfi_resource(self._instance_id, self._api)
229+
223230
def __getattr__(self, name: str) -> Any:
224231
return getattr(self._base, name)
225232

@@ -450,6 +457,12 @@ def bank_accounts(self) -> "BankAccountsResourceSync":
450457

451458
return create_bank_accounts_resource_sync(self._instance_id, self._api)
452459

460+
@cached_property
461+
def rfi(self) -> "RfiResourceSync":
462+
from blindpay.resources.receivers.rfi import create_rfi_resource_sync
463+
464+
return create_rfi_resource_sync(self._instance_id, self._api)
465+
453466
def __getattr__(self, name: str) -> Any:
454467
return getattr(self._base, name)
455468

src/blindpay/resources/bank_accounts/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
AchCopDocument,
44
AchType,
55
ArgentinaTransfers,
6+
BankAccount,
67
BankAccountsResource,
78
BankAccountsResourceSync,
89
CreateAchInput,
@@ -32,6 +33,7 @@
3233
PixType,
3334
RtpType,
3435
SpeiBitsoType,
36+
SwiftPaymentCode,
3537
TedType,
3638
TransfersBitsoType,
3739
WireType,
@@ -42,6 +44,7 @@
4244
__all__ = [
4345
"create_bank_accounts_resource",
4446
"create_bank_accounts_resource_sync",
47+
"BankAccount",
4548
"BankAccountsResource",
4649
"BankAccountsResourceSync",
4750
"CreatePixInput",
@@ -63,6 +66,7 @@
6366
"PixSafeType",
6467
"TransfersBitsoType",
6568
"SpeiBitsoType",
69+
"SwiftPaymentCode",
6670
"WireType",
6771
"RtpType",
6872
"TedType",

src/blindpay/resources/bank_accounts/bank_accounts.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
RecipientRelationship,
1313
SpeiProtocol,
1414
)
15+
from ..receivers.receivers import BusinessIndustry
1516

1617
ArgentinaTransfers = Literal["CVU", "CBU", "ALIAS"]
1718
AchCopDocument = Literal["CC", "CE", "NIT", "PASS", "PEP"]
@@ -27,6 +28,8 @@
2728
PixSafeType = Literal["pix_safe"]
2829
TedType = Literal["ted"]
2930

31+
SwiftPaymentCode = Literal["hk_swift_charitabledonation", "hk_swift_goods", "hk_swift_personal", "hk_swift_services"]
32+
3033

3134
class OfframpWallet(TypedDict):
3235
address: str
@@ -83,6 +86,7 @@ class BankAccount(TypedDict):
8386
swift_intermediary_bank_account_number_iban: Optional[str]
8487
swift_intermediary_bank_name: Optional[str]
8588
swift_intermediary_bank_country: Optional[Country]
89+
swift_ifsc_branch_code: Optional[str]
8690
tron_wallet_hash: Optional[str]
8791
offramp_wallets: Optional[List[OfframpWallet]]
8892
created_at: str
@@ -208,7 +212,7 @@ class CreateAchInput(_CreateAchInputRequired, total=False):
208212
country: Country
209213
postal_code: str
210214
address_line_2: Optional[str]
211-
business_industry: Optional[str]
215+
business_industry: Optional[BusinessIndustry]
212216
phone_number: Optional[str]
213217
tax_id: Optional[str]
214218
date_of_birth: Optional[str]
@@ -256,7 +260,7 @@ class CreateWireInput(_CreateWireInputRequired, total=False):
256260
state_province_region: str
257261
country: Country
258262
postal_code: str
259-
business_industry: Optional[str]
263+
business_industry: Optional[BusinessIndustry]
260264
phone_number: Optional[str]
261265
tax_id: Optional[str]
262266
date_of_birth: Optional[str]
@@ -306,8 +310,9 @@ class CreateInternationalSwiftInput(_CreateInternationalSwiftInputRequired, tota
306310
swift_intermediary_bank_country: Optional[Country]
307311
swift_intermediary_bank_name: Optional[str]
308312
swift_intermediary_bank_swift_code_bic: Optional[str]
309-
swift_payment_code: Optional[str]
310-
business_industry: Optional[str]
313+
swift_ifsc_branch_code: Optional[str]
314+
swift_payment_code: Optional[SwiftPaymentCode]
315+
business_industry: Optional[BusinessIndustry]
311316
phone_number: Optional[str]
312317
tax_id: Optional[str]
313318
date_of_birth: Optional[str]
@@ -344,6 +349,7 @@ class CreateInternationalSwiftResponse(TypedDict):
344349
swift_intermediary_bank_account_number_iban: Optional[str]
345350
swift_intermediary_bank_name: Optional[str]
346351
swift_intermediary_bank_country: Optional[Country]
352+
swift_ifsc_branch_code: Optional[str]
347353
created_at: str
348354

349355

@@ -364,7 +370,7 @@ class CreateRtpInput(_CreateRtpInputRequired, total=False):
364370
state_province_region: str
365371
country: Country
366372
postal_code: str
367-
business_industry: Optional[str]
373+
business_industry: Optional[BusinessIndustry]
368374
phone_number: Optional[str]
369375
tax_id: Optional[str]
370376
date_of_birth: Optional[str]

src/blindpay/resources/receivers/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
CreateIndividualWithEnhancedKYCResponse,
1212
CreateIndividualWithStandardKYCInput,
1313
CreateIndividualWithStandardKYCResponse,
14+
Decision,
1415
EnhancedKycType,
1516
EstimatedAnnualRevenue,
1617
FraudWarning,
@@ -38,6 +39,7 @@
3839
ReceiversResource,
3940
ReceiversResourceSync,
4041
ReceiverStatus,
42+
ReceiverType,
4143
RequestLimitIncreaseInput,
4244
RequestLimitIncreaseResponse,
4345
SoleProprietorDocType,
@@ -49,12 +51,27 @@
4951
create_receivers_resource,
5052
create_receivers_resource_sync,
5153
)
54+
from .rfi import (
55+
Rfi,
56+
RfiResource,
57+
RfiResourceSync,
58+
RfiSection,
59+
RfiStatus,
60+
SubmitRfiInput,
61+
SubmitRfiResponse,
62+
create_rfi_resource,
63+
create_rfi_resource_sync,
64+
)
5265

5366
__all__ = [
5467
"create_receivers_resource",
5568
"create_receivers_resource_sync",
69+
"create_rfi_resource",
70+
"create_rfi_resource_sync",
5671
"ReceiversResource",
5772
"ReceiversResourceSync",
73+
"RfiResource",
74+
"RfiResourceSync",
5875
"IndividualWithStandardKYC",
5976
"IndividualWithEnhancedKYC",
6077
"BusinessWithStandardKYB",
@@ -89,6 +106,7 @@
89106
"RequestLimitIncreaseInput",
90107
"RequestLimitIncreaseResponse",
91108
"ReceiverStatus",
109+
"ReceiverType",
92110
"AccountPurpose",
93111
"ReceiverBusinessType",
94112
"BusinessIndustry",
@@ -101,4 +119,10 @@
101119
"AmlHits",
102120
"ListReceiversInput",
103121
"ListReceiversPaginatedResponse",
122+
"Decision",
123+
"Rfi",
124+
"RfiSection",
125+
"RfiStatus",
126+
"SubmitRfiInput",
127+
"SubmitRfiResponse",
104128
]

src/blindpay/resources/receivers/receivers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"112120",
9595
"113310",
9696
"115114",
97+
"446120",
9798
"541211",
9899
"541810",
99100
"541430",
@@ -270,6 +271,10 @@
270271

271272
AmlStatus = Literal["clear", "hit", "error"]
272273

274+
Decision = Literal["approved", "rejected"]
275+
276+
ReceiverType = Literal["business", "individual"]
277+
273278

274279
class FraudWarning(TypedDict):
275280
id: Optional[str]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
from typing import List, Optional
2+
3+
from typing_extensions import Literal, TypedDict
4+
5+
from ..._internal.api_client import InternalApiClient, InternalApiClientSync
6+
from ...types import BlindpayApiResponse
7+
8+
RfiStatus = Literal["pending", "submitted", "expired", "cancelled"]
9+
10+
ReceiverType = Literal["individual", "business"]
11+
12+
13+
class RfiSection(TypedDict):
14+
# RfiSection fields would need to be defined based on API specification
15+
# Using minimal structure for now
16+
field: str
17+
value: str
18+
19+
20+
class Rfi(TypedDict):
21+
id: str
22+
receiver_id: str
23+
instance_id: str
24+
status: RfiStatus
25+
request: List[RfiSection]
26+
response: object
27+
expires_at: str
28+
submitted_at: Optional[str]
29+
created_at: str
30+
receiver_type: ReceiverType
31+
receiver_aiprise_session_id: Optional[str]
32+
receiver_kyc_status: str
33+
34+
35+
class SubmitRfiResponse(TypedDict):
36+
success: bool
37+
38+
39+
class SubmitRfiInput(TypedDict):
40+
response: object
41+
42+
43+
class RfiResource:
44+
def __init__(self, instance_id: str, client: InternalApiClient):
45+
self._instance_id = instance_id
46+
self._client = client
47+
48+
async def get_open_rfi(self, receiver_id: str) -> BlindpayApiResponse[Rfi]:
49+
return await self._client.get(f"/instances/{self._instance_id}/receivers/{receiver_id}/rfi")
50+
51+
async def submit_rfi_response(
52+
self, receiver_id: str, data: SubmitRfiInput
53+
) -> BlindpayApiResponse[SubmitRfiResponse]:
54+
return await self._client.post(f"/instances/{self._instance_id}/receivers/{receiver_id}/rfi", data)
55+
56+
57+
class RfiResourceSync:
58+
def __init__(self, instance_id: str, client: InternalApiClientSync):
59+
self._instance_id = instance_id
60+
self._client = client
61+
62+
def get_open_rfi(self, receiver_id: str) -> BlindpayApiResponse[Rfi]:
63+
return self._client.get(f"/instances/{self._instance_id}/receivers/{receiver_id}/rfi")
64+
65+
def submit_rfi_response(self, receiver_id: str, data: SubmitRfiInput) -> BlindpayApiResponse[SubmitRfiResponse]:
66+
return self._client.post(f"/instances/{self._instance_id}/receivers/{receiver_id}/rfi", data)
67+
68+
69+
def create_rfi_resource(instance_id: str, client: InternalApiClient) -> RfiResource:
70+
return RfiResource(instance_id, client)
71+
72+
73+
def create_rfi_resource_sync(instance_id: str, client: InternalApiClientSync) -> RfiResourceSync:
74+
return RfiResourceSync(instance_id, client)

0 commit comments

Comments
 (0)