|
1 | 1 | # ZendFi Python SDK |
2 | 2 |
|
3 | | -A lightweight, production-ready Python SDK for the ZendFi API. Supports payments, customers, invoices, webhooks, subscriptions, payment links, installment plans, and escrows. |
| 3 | +A lightweight, production-ready Python SDK for the ZendFi API. Supports payments, customers, invoices, webhooks, subscriptions, payment links, and installment plans. |
4 | 4 |
|
5 | 5 | **Package:** [`zendfi-sdk`](https://pypi.org/project/zendfi-sdk) on PyPI |
6 | 6 | **License:** MIT |
@@ -228,33 +228,6 @@ plans = client.installment_plans.list_customer_plans(customer_id="cust_xxx") |
228 | 228 | client.installment_plans.cancel(plan_id="inst_xxx") |
229 | 229 | ``` |
230 | 230 |
|
231 | | -### Escrows |
232 | | - |
233 | | -```python |
234 | | -# Create an escrow |
235 | | -escrow = client.escrows.create( |
236 | | - amount=500.0, |
237 | | - currency="USD", |
238 | | - buyer_id="cust_buyer_xxx", |
239 | | - seller_id="cust_seller_xxx" |
240 | | -) |
241 | | - |
242 | | -# Approve an escrow |
243 | | -escrow = client.escrows.approve(escrow_id="esc_xxx") |
244 | | - |
245 | | -# Refund an escrow |
246 | | -escrow = client.escrows.refund(escrow_id="esc_xxx") |
247 | | - |
248 | | -# Dispute an escrow |
249 | | -escrow = client.escrows.dispute(escrow_id="esc_xxx", reason="Item not received") |
250 | | - |
251 | | -# Retrieve an escrow |
252 | | -escrow = client.escrows.get(escrow_id="esc_xxx") |
253 | | - |
254 | | -# List escrows |
255 | | -escrows = client.escrows.list(limit=20) |
256 | | -``` |
257 | | - |
258 | 231 | --- |
259 | 232 |
|
260 | 233 | ## Testing |
@@ -318,68 +291,6 @@ except Exception as e: |
318 | 291 |
|
319 | 292 | --- |
320 | 293 |
|
321 | | -## Publishing to PyPI |
322 | | - |
323 | | -### Prerequisites |
324 | | - |
325 | | -Generate a PyPI API token: https://pypi.org/manage/account/tokens/ |
326 | | - |
327 | | -### Manual Publish |
328 | | - |
329 | | -```bash |
330 | | -pip install twine |
331 | | -python -m build |
332 | | -python -m twine upload dist/* |
333 | | -``` |
334 | | - |
335 | | -### Automated via GitHub Actions |
336 | | - |
337 | | -1. Add `PYPI_API_TOKEN` secret to your GitHub repository settings |
338 | | -2. Tag and push a release: |
339 | | - ```bash |
340 | | - git tag v0.1.0 |
341 | | - git push origin v0.1.0 |
342 | | - ``` |
343 | | -3. The `.github/workflows/publish.yml` workflow will build and publish automatically |
344 | | - |
345 | | ---- |
346 | | - |
347 | | -## Development |
348 | | - |
349 | | -### Setup |
350 | | - |
351 | | -```bash |
352 | | -git clone https://github.com/zendfi/zendfi-python-toolkit.git |
353 | | -cd zendfi-python-toolkit |
354 | | -python -m venv .venv |
355 | | -source .venv/bin/activate # On Windows: .venv\Scripts\activate |
356 | | -pip install -r requirements-dev.txt |
357 | | -``` |
358 | | - |
359 | | -### Build |
360 | | - |
361 | | -```bash |
362 | | -python -m build |
363 | | -``` |
364 | | - |
365 | | -### Lint & Type Check |
366 | | - |
367 | | -```bash |
368 | | -ruff check . |
369 | | -mypy zendfi/ |
370 | | -``` |
371 | | - |
372 | | ---- |
373 | | - |
374 | | -## Security |
375 | | - |
376 | | -- **Never commit API keys or tokens** to the repository |
377 | | -- Use environment variables for secrets |
378 | | -- For CI/CD, use GitHub Secrets or your platform's secret management |
379 | | -- Webhook signatures are verified using HMAC-SHA256 |
380 | | - |
381 | | ---- |
382 | | - |
383 | 294 | ## Support |
384 | 295 |
|
385 | 296 | For issues, feature requests, or questions, open an issue on GitHub: |
|
0 commit comments