python-getpaid-payu
PayU payment processor plugin for the python-getpaid ecosystem.
Provides a fully async HTTP client (PayUClient) and a payment processor (PayUProcessor) implementing the getpaid-core BaseProcessor interface. Communicates with PayU via their REST API v2.1 using OAuth2 authentication.
Features
- Full Payment Lifecycle: Supports prepared, locked, paid, failed, and refunded states.
- Pre-authorization: Reserve funds on customer's card (lock) and capture them later (charge).
- Refunds: Full and partial refund support via API.
- Multiple Currencies: Support for 15 currencies across Europe and beyond.
- Asynchronous: Built with
httpxfor non-blocking API communication. - Security: Robust callback signature verification (SHA-256 and MD5).
- Comprehensive API: Wraps every PayU REST API v2.1 endpoint.
Supported Currencies
The following 15 currencies are supported: BGN, CHF, CZK, DKK, EUR, GBP, HRK, HUF, NOK, PLN, RON, RUB, SEK, UAH, USD.
Installation
pip install python-getpaid-payu
Install simulator support only when you want this package to register its local
simulator plugin with python-getpaid-simulator:
pip install python-getpaid-payu[simulator]
This extra installs the simulator host and Litestar dependencies, then exposes
the payu plugin through the getpaid.simulator.providers entry point.
Simulator Plugin
When python-getpaid-payu[simulator] is installed alongside
python-getpaid-simulator, the simulator host auto-discovers the PayU plugin.
Typical local setup:
pip install python-getpaid-simulator python-getpaid-payu[simulator]
getpaid-simulator
The plugin contributes:
- PayU OAuth and order/refund simulator API routes
- PayU authorization UI at
/sim/payu/authorize/{order_id} - PayU-specific webhook signing and state transitions
Useful simulator environment variables:
SIMULATOR_PAYU_SECOND_KEYSIMULATOR_PLUGIN_FAILURE_MODE(warnorstrict)
Configuration
To use the PayU backend, register it in your getpaid configuration and provide the following settings:
| Key | Type | Default | Description |
|---|---|---|---|
pos_id |
int |
— | PayU POS (point of sale) identifier |
second_key |
str |
— | Second key (MD5) from PayU panel, used for signature verification |
oauth_id |
int |
— | OAuth client ID from PayU panel |
oauth_secret |
str |
— | OAuth client secret from PayU panel |
sandbox |
bool |
True |
Use sandbox (secure.snd.payu.com) or production (secure.payu.com) |
notify_url |
str |
None |
Notification callback URL template, e.g. https://example.com/payments/{payment_id}/notify |
continue_url |
str |
None |
Redirect URL template after payment, e.g. https://example.com/payments/{payment_id}/continue |
Example configuration:
GETPAID_BACKENDS = {
"payu": {
"pos_id": "300746",
"second_key": "b6ca15b0d1020e8094d9b5f8d163db54",
"oauth_id": "300746",
"oauth_secret": "2ee86a66e5d97e3fadc400c9f19b065d",
"notify_url": "https://your-domain.com/payments/payu/callback/",
"continue_url": "https://your-domain.com/payments/payu/success/",
"sandbox": True,
}
}
Sandbox Mode
PayU provides a sandbox environment for testing. You can use the example keys provided above for testing in PLN.
Ecosystem
python-getpaid-payu is part of the larger python-getpaid ecosystem. Use it with one of our web framework wrappers:
Requirements
- Python 3.12+
python-getpaid-core >= 3.0.0httpx >= 0.27.0
License
MIT
Credits
Created by Dominik Kozaczko.
Metadata
Release files for python-getpaid-payu 3.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_getpaid_payu-3.2.0.tar.gz | 123.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_getpaid_payu-3.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 146.3 kB
Release files / python_getpaid_payu-3.2.0.tar.gz
| Download URL | python_getpaid_payu-3.2.0.tar.gz |
|---|---|
| Size | 123.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9581a39f2aaea97bbae9f88036d3c2b75e4288b183b068b1fc2d4b5b324f405b
|
|
BLAKE2b-256 checksum How to use checksums |
a9c85d2b10b925559cd33d7734227cc28352003cdd360a17d08fd1c880b05277
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / python_getpaid_payu-3.2.0-py3-none-any.whl
| Download URL | python_getpaid_payu-3.2.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dcd2ce4f2b9d83ab6b89f32bf7a5b72c77d75e0c9dfc31b73c7f0143c398aae0
|
|
BLAKE2b-256 checksum How to use checksums |
c7a08a0ac3dffa6e21b3c45adbaaeda0e37fe61e173bc0fe4f52877880fc4bd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|