- Complete rewrite with modern tooling and API design
PaydunyaClient(master_key, private_key, token, mode="test"|"live")replaces the oldpaydunya.debugandpaydunya.api_keysmodule-level globals- OPR removed — the
opr/createandopr/chargeendpoints no longer exist in PayDunya's current documentation. Use the JavaScript-based PSR flow (documented at https://developers.paydunya.com/doc/EN/psr_plugins/api_psr) where your server creates a checkout invoice and returns the token - Pydantic v2 — all models (
Store,InvoiceItem,Customer,Tax,Actions) are now PydanticBaseModelclasses with built-in validation (email format viaEmailStr, amount bounds, positive quantity, required fields). Invalid input raisesValidationErrorat the SDK boundary instead of being sent to the API. - Python 3.10+ only (dropped all Python 2 and Python < 3.10 support)
httpxreplacesrequests
- DMP API — Payment Request API: send invoices via SMS/Email
(
DMP.create()/DMP.check_status()) - IPN helper —
verify_ipn_hash()for SHA-512 hash verification on callbacks - Customer pre-fill —
Invoice.set_customer(name, email, phone)to pre-fill payment page fields - Docs-compliant items format — items now keyed as
item_0,item_1, ... matching the official HTTP/JSON documentation - Sandbox E2E example —
examples/sandbox_e2e.pywith interactive payment confirmation polling - Type hints throughout,
py.typedmarker - Pytest-based test suite with httpx mocking (no network required)
- MkDocs Material documentation in
docs/
- Package layout:
src/paydunya/(PEP 621) - Build system: hatchling instead of setuptools/setup.py
- Linting: ruff replaces flake8/pep8/pyflakes
- CI: GitHub Actions replaces Travis CI
- uv for dependency management
- Last stable release under the old architecture