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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hostpay
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Python SDK for the HostPay payments API
5
5
  Project-URL: Homepage, https://hpay.host-sl.com
6
6
  Project-URL: Documentation, https://hpay.host-sl.com/docs
@@ -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
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hostpay"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Python SDK for the HostPay payments API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -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