hostpay 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hostpay-0.2.0 → hostpay-0.2.1}/PKG-INFO +1 -1
- {hostpay-0.2.0 → hostpay-0.2.1}/hostpay/resources.py +4 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/pyproject.toml +1 -1
- {hostpay-0.2.0 → hostpay-0.2.1}/tests/test_client.py +15 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/.gitignore +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/LICENSE +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/README.md +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/hostpay/__init__.py +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/hostpay/_client.py +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/hostpay/_object.py +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/hostpay/errors.py +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/hostpay/models.py +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/hostpay/py.typed +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/hostpay/webhooks.py +0 -0
- {hostpay-0.2.0 → hostpay-0.2.1}/tests/test_webhook_signature.py +0 -0
|
@@ -81,6 +81,10 @@ class Wallets(_Resource):
|
|
|
81
81
|
def balance(self, wallet_id: str) -> Any:
|
|
82
82
|
return self._t.request("GET", f"/api/v1/wallets/{wallet_id}/balance")
|
|
83
83
|
|
|
84
|
+
def list(self, is_active: Optional[bool] = None) -> list[WalletRead]:
|
|
85
|
+
params = {} if is_active is None else {"is_active": is_active}
|
|
86
|
+
return self._t.request("GET", "/api/v1/wallets/", params=params)
|
|
87
|
+
|
|
84
88
|
def disable(self, wallet_id: str) -> Any:
|
|
85
89
|
return self._t.request("POST", f"/api/v1/wallets/{wallet_id}/disable")
|
|
86
90
|
|
|
@@ -123,3 +123,18 @@ def test_lifecycle_and_transactions_paths():
|
|
|
123
123
|
("GET", "/api/v1/transactions/wallet/w1", {}),
|
|
124
124
|
("GET", "/api/v1/transactions/", {"status": "completed", "limit": "10", "offset": "0"}),
|
|
125
125
|
]
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def test_wallets_list_passes_query_params():
|
|
129
|
+
seen = {}
|
|
130
|
+
|
|
131
|
+
def handler(request: httpx.Request) -> httpx.Response:
|
|
132
|
+
seen["path"] = request.url.path
|
|
133
|
+
seen["query"] = dict(request.url.params)
|
|
134
|
+
return httpx.Response(200, json=[{"id": "w1", "balance": "5.00"}])
|
|
135
|
+
|
|
136
|
+
client = _client(handler)
|
|
137
|
+
wallets = client.wallets.list(is_active=True)
|
|
138
|
+
assert seen["path"] == "/api/v1/wallets/"
|
|
139
|
+
assert seen["query"] == {"is_active": "true"}
|
|
140
|
+
assert wallets[0]["id"] == "w1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|