Getting Started
Installation
uv add paydunya
# or
pip install paydunya
API Keys
- Create a PayDunya Business account
- Go to Integration API
- Create a new application ("AppDunya")
- Choose Test mode and Enable production mode
- Retrieve your three API keys from the application details page
You'll receive:
- PAYDUNYA-MASTER-KEY — main key
- PAYDUNYA-PRIVATE-KEY — private key (test_private_... or live_private_...)
- PAYDUNYA-TOKEN — application token
Test Mode
In test mode, use your test keys and create fictitious customer accounts in the dashboard to simulate payments. Payments are deducted from the fictitious customer's balance.
from paydunya import PaydunyaClient
client = PaydunyaClient(
master_key="your-master-key",
private_key="test_private_...",
token="your-token",
mode="test",
)
Production
When ready:
- Update your application configuration in the dashboard: Enable production mode → Yes
- Replace test keys with production keys
- Switch to
mode="live"
client = PaydunyaClient(
master_key="your-live-master-key",
private_key="live_private_...",
token="your-live-token",
mode="live",
)