python-getpaid-payu 0.1.0__tar.gz → 3.0.0__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.
Files changed (55) hide show
  1. python_getpaid_payu-3.0.0/.github/release-drafter.yml +31 -0
  2. python_getpaid_payu-3.0.0/.github/workflows/ci.yml +36 -0
  3. python_getpaid_payu-3.0.0/.github/workflows/release.yml +60 -0
  4. python_getpaid_payu-3.0.0/.sisyphus/evidence/task-26-readme-payu.txt +3 -0
  5. python_getpaid_payu-3.0.0/.sisyphus/evidence/task-5-baseline-payu.txt +200 -0
  6. python_getpaid_payu-3.0.0/PKG-INFO +146 -0
  7. python_getpaid_payu-3.0.0/README.md +119 -0
  8. python_getpaid_payu-3.0.0/docs/changelog.md +51 -0
  9. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/concepts.md +10 -10
  10. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/pyproject.toml +19 -3
  11. python_getpaid_payu-3.0.0/sandbox_keys.txt +17 -0
  12. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/src/getpaid_payu/__init__.py +1 -1
  13. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/src/getpaid_payu/client.py +16 -18
  14. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/src/getpaid_payu/processor.py +124 -75
  15. python_getpaid_payu-3.0.0/src/getpaid_payu/simulator/__init__.py +6 -0
  16. python_getpaid_payu-3.0.0/src/getpaid_payu/simulator/plugin.py +59 -0
  17. python_getpaid_payu-3.0.0/src/getpaid_payu/simulator/routes.py +409 -0
  18. python_getpaid_payu-3.0.0/src/getpaid_payu/simulator/signing.py +14 -0
  19. python_getpaid_payu-3.0.0/src/getpaid_payu/simulator/transitions.py +9 -0
  20. python_getpaid_payu-3.0.0/src/getpaid_payu/simulator/webhooks.py +77 -0
  21. python_getpaid_payu-3.0.0/tests/conftest.py +117 -0
  22. python_getpaid_payu-3.0.0/tests/test_callback.py +123 -0
  23. python_getpaid_payu-3.0.0/tests/test_entry_points.py +12 -0
  24. python_getpaid_payu-3.0.0/tests/test_processor.py +232 -0
  25. python_getpaid_payu-3.0.0/tests/test_public_api.py +18 -0
  26. python_getpaid_payu-3.0.0/tests/test_simulator_plugin.py +157 -0
  27. python_getpaid_payu-3.0.0/tests/test_url_construction.py +444 -0
  28. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/uv.lock +500 -5
  29. python_getpaid_payu-0.1.0/PKG-INFO +0 -152
  30. python_getpaid_payu-0.1.0/README.md +0 -128
  31. python_getpaid_payu-0.1.0/docs/changelog.md +0 -22
  32. python_getpaid_payu-0.1.0/tests/conftest.py +0 -143
  33. python_getpaid_payu-0.1.0/tests/test_callback.py +0 -290
  34. python_getpaid_payu-0.1.0/tests/test_processor.py +0 -449
  35. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/.gitignore +0 -0
  36. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/.pre-commit-config.yaml +0 -0
  37. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/.python-version +0 -0
  38. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/.readthedocs.yml +0 -0
  39. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/CODE_OF_CONDUCT.md +0 -0
  40. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/CONTRIBUTING.md +0 -0
  41. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/LICENSE +0 -0
  42. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/codeofconduct.md +0 -0
  43. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/conf.py +0 -0
  44. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/configuration.md +0 -0
  45. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/contributing.md +0 -0
  46. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/getting-started.md +0 -0
  47. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/index.md +0 -0
  48. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/license.md +0 -0
  49. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/reference.md +0 -0
  50. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/docs/requirements.txt +0 -0
  51. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/src/getpaid_payu/py.typed +0 -0
  52. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/src/getpaid_payu/types.py +0 -0
  53. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/tests/__init__.py +0 -0
  54. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/tests/test_client.py +0 -0
  55. {python_getpaid_payu-0.1.0 → python_getpaid_payu-3.0.0}/tests/test_types.py +0 -0
@@ -0,0 +1,31 @@
1
+ name-template: 'v$RESOLVED_VERSION'
2
+ tag-template: 'v$RESOLVED_VERSION'
3
+ categories:
4
+ - title: ':boom: Breaking Changes'
5
+ label: 'breaking'
6
+ - title: ':rocket: Features'
7
+ label: 'enhancement'
8
+ - title: ':fire: Removals and Deprecations'
9
+ label: 'removal'
10
+ - title: ':beetle: Fixes'
11
+ label: 'bug'
12
+ - title: ':racehorse: Performance'
13
+ label: 'performance'
14
+ - title: ':rotating_light: Testing'
15
+ label: 'testing'
16
+ - title: ':construction_worker: Continuous Integration'
17
+ label: 'ci'
18
+ - title: ':books: Documentation'
19
+ label: 'documentation'
20
+ - title: ':hammer: Refactoring'
21
+ label: 'refactoring'
22
+ - title: ':lipstick: Style'
23
+ label: 'style'
24
+ - title: ':package: Dependencies'
25
+ labels:
26
+ - 'dependencies'
27
+ - 'build'
28
+ template: |
29
+ ## Changes
30
+
31
+ $CHANGES
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.12", "3.13"]
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python ${{ matrix.python-version }}
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: ${{ matrix.python-version }}
22
+
23
+ - name: Install uv
24
+ run: pip install uv
25
+
26
+ - name: Install dependencies
27
+ run: uv sync
28
+
29
+ - name: Lint with ruff
30
+ run: uv run ruff check .
31
+
32
+ - name: Audit dependencies
33
+ run: uv run pip-audit --strict
34
+
35
+ - name: Run tests
36
+ run: uv run pytest --tb=short
@@ -0,0 +1,60 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+
9
+ jobs:
10
+ release:
11
+ name: Release
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Check out the repository
15
+ uses: actions/checkout@v4
16
+ with:
17
+ fetch-depth: 0 # Full history needed for version detection
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.12"
23
+
24
+ - name: Install uv
25
+ run: pip install uv
26
+
27
+ # Version is read from __init__.py (dynamic via hatch)
28
+ - name: Detect version from __init__.py
29
+ id: get-version
30
+ run: |
31
+ init_py=$(grep -A2 '\[tool\.hatch\.version\]' pyproject.toml | grep '^path\s*=' | head -1 | sed -E "s/path\s*=\s*['\"]([^'\"]+)['\"].*/\1/")
32
+ version=$(grep '__version__' "$init_py" | head -1 | sed -E "s/.*= ['\"]([^'\"]+)['\"].*/\1/")
33
+ echo "version=$version" >> "$GITHUB_OUTPUT"
34
+
35
+ - name: Check if tag already exists
36
+ id: check-tag
37
+ run: |
38
+ tag="v${{ steps.get-version.outputs.version }}"
39
+ if git rev-parse "$tag" >/dev/null 2>&1; then
40
+ echo "already_tagged=true" >> "$GITHUB_OUTPUT"
41
+ else
42
+ echo "already_tagged=false" >> "$GITHUB_OUTPUT"
43
+ fi
44
+
45
+ - name: Tag new version
46
+ if: steps.check-tag.outputs.already_tagged == 'false'
47
+ run: |
48
+ tag="v${{ steps.get-version.outputs.version }}"
49
+ git config user.name "github-actions[bot]"
50
+ git config user.email "github-actions[bot]@users.noreply.github.com"
51
+ git tag -a "$tag" -m "Release $tag"
52
+ git push origin "$tag"
53
+
54
+ - name: Build package
55
+ run: uv build
56
+
57
+ - name: Publish package on PyPI
58
+ uses: pypa/gh-action-pypi-publish@release/v1
59
+ with:
60
+ password: ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,200 @@
1
+ ================================================================================
2
+ TASK 5 BASELINE: python-getpaid-payu
3
+ Executed: 2026-02-18
4
+ ================================================================================
5
+
6
+ DIRECTORY: /home/minder/projekty/python-getpaid/getpaid-payu/
7
+
8
+ ================================================================================
9
+ 1. PYTEST RESULTS
10
+ ================================================================================
11
+
12
+ Command: uv run pytest
13
+
14
+ Output:
15
+ ============================= test session starts ==============================
16
+ platform linux -- Python 3.12.10, pytest-9.0.2, pluggy-1.6.0
17
+ rootdir: /home/minder/projekty/python-getpaid/getpaid-payu
18
+ configfile: pyproject.toml
19
+ testpaths: tests
20
+ plugins: asyncio-1.3.0, cov-7.0.0, anyio-4.12.1, respx-0.22.0
21
+ asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_fixture_scope=function
22
+ collected 115 items
23
+
24
+ tests/test_callback.py ................... [ 16%]
25
+ tests/test_client.py ................................................... [ 60%]
26
+ ......... [ 68%]
27
+ tests/test_processor.py ......................... [ 90%]
28
+ tests/test_types.py ........... [100%]
29
+
30
+ ============================= 115 passed in 2.57s ==============================
31
+
32
+ STATUS: ✓ ALL TESTS PASSED
33
+
34
+ ================================================================================
35
+ 2. BUILD RESULTS
36
+ ================================================================================
37
+
38
+ Command: uv build
39
+
40
+ Output:
41
+ Building source distribution...
42
+ Building wheel from source distribution...
43
+ Successfully built dist/python_getpaid_payu-0.1.1.tar.gz
44
+ Successfully built dist/python_getpaid_payu-0.1.1-py3-none-any.whl
45
+
46
+ STATUS: ✓ BUILD SUCCESSFUL
47
+
48
+ Artifacts:
49
+ - dist/python_getpaid_payu-0.1.1.tar.gz (source distribution)
50
+ - dist/python_getpaid_payu-0.1.1-py3-none-any.whl (wheel)
51
+
52
+ ================================================================================
53
+ 3. PACKAGE METADATA INVENTORY
54
+ ================================================================================
55
+
56
+ Project Name: python-getpaid-payu
57
+ Version: 0.1.1
58
+ Python Requirement: >= 3.12
59
+ License: MIT (text format)
60
+ Authors: Dominik Kozaczko <dominik@kozaczko.info>
61
+
62
+ Description: PayU payment gateway integration for python-getpaid ecosystem.
63
+
64
+ Dependencies:
65
+ - python-getpaid-core >= 0.1.0
66
+ - httpx >= 0.27.0
67
+
68
+ Development Dependencies:
69
+ - pytest >= 8.0
70
+ - pytest-asyncio >= 0.24.0
71
+ - pytest-cov >= 5.0
72
+ - respx >= 0.22.0
73
+ - ruff >= 0.9.0
74
+ - pre-commit >= 4.0
75
+ - ty >= 0.0.16
76
+
77
+ Documentation Dependencies:
78
+ - furo >= 2024.8.6
79
+ - sphinx >= 8.0
80
+ - myst-parser >= 4.0
81
+
82
+ URLs:
83
+ - Homepage: https://github.com/django-getpaid/python-getpaid-payu
84
+ - Repository: https://github.com/django-getpaid/python-getpaid-payu
85
+ - Documentation: https://getpaid-payu.readthedocs.io/
86
+ - Changelog: https://github.com/django-getpaid/python-getpaid-payu/releases
87
+
88
+ Build System: hatchling
89
+
90
+ Classifiers:
91
+ - Development Status :: 3 - Alpha
92
+ - Intended Audience :: Developers
93
+ - License :: OSI Approved :: MIT License
94
+ - Programming Language :: Python :: 3.12
95
+ - Programming Language :: Python :: 3.13
96
+ - Topic :: Office/Business :: Financial
97
+ - Topic :: Office/Business :: Financial :: Point-Of-Sale
98
+ - Typing :: Typed
99
+
100
+ ================================================================================
101
+ 4. LICENSE CHECK
102
+ ================================================================================
103
+
104
+ LICENSE File Status: ✓ PRESENT
105
+ Format: MIT License
106
+ Copyright: 2022-2026 Dominik Kozaczko
107
+ Consistency: ✓ Matches pyproject.toml declaration (MIT)
108
+
109
+ ================================================================================
110
+ 5. README.MD CHECK
111
+ ================================================================================
112
+
113
+ README File Status: ✓ PRESENT
114
+ Size: ~4.5 KB (129 lines)
115
+ Content Verification:
116
+ ✓ Project description (PayU payment gateway plugin)
117
+ ✓ Architecture section (PayUClient + PayUProcessor)
118
+ ✓ Key features listed
119
+ ✓ Quick usage examples (async context manager)
120
+ ✓ Configuration table with all parameters
121
+ ✓ Supported currencies listed
122
+ ✓ Requirements section
123
+ ✓ Related projects links
124
+ ✓ License information
125
+ ✓ Disclaimer section
126
+ ✓ Credits
127
+
128
+ ================================================================================
129
+ 6. GITHUB WORKFLOWS (.github/workflows/)
130
+ ================================================================================
131
+
132
+ Status: ✗ NOT PRESENT
133
+
134
+ No .github/workflows/ directory found in the repository.
135
+ Note: Project is part of the python-getpaid umbrella but does not have its own CI configuration.
136
+
137
+ ================================================================================
138
+ 7. ENTRY-POINTS ANALYSIS [CRITICAL]
139
+ ================================================================================
140
+
141
+ Section Name: [project.entry-points."getpaid.backends"]
142
+ Status: ✗ ENTRY-POINTS NOT DEFINED
143
+
144
+ Current State:
145
+ - pyproject.toml does NOT contain any [project.entry-points] section
146
+ - grep search: "No entry-points found in pyproject.toml"
147
+
148
+ Impact Analysis:
149
+ The PayUProcessor is the main integration point with getpaid-core.
150
+ Entry-points are REQUIRED for plugin auto-discovery by framework adapters
151
+ (e.g., django-getpaid).
152
+
153
+ Expected Entry-Point (if needed):
154
+ [project.entry-points."getpaid.backends"]
155
+ payu = "getpaid_payu.processor:PayUProcessor"
156
+
157
+ OR (if supporting multiple backends):
158
+ [project.entry-points."getpaid.backends"]
159
+ payu = "getpaid_payu.processor:PayUProcessor"
160
+
161
+ Recommendation:
162
+ TASK 10 (Add entry-points configuration) IS REQUIRED
163
+ Current state prevents framework adapters from auto-discovering PayUProcessor.
164
+
165
+ ================================================================================
166
+ 8. PYPROJECT.TOML STRUCTURE
167
+ ================================================================================
168
+
169
+ Build Section: ✓ Present (hatchling)
170
+ Test Configuration: ✓ Present (pytest)
171
+ Coverage Config: ✓ Present
172
+ Linter Config (ruff): ✓ Present
173
+ Type Checker (ty): ✓ Present
174
+ Project Metadata: ✓ Complete
175
+
176
+ Entry-Points Section: ✗ MISSING (BLOCKING FOR TASK 10)
177
+
178
+ ================================================================================
179
+ SUMMARY
180
+ ================================================================================
181
+
182
+ ✓ Pytest: 115 passed (2.57s)
183
+ ✓ Build: Successful (tarball + wheel)
184
+ ✓ License: MIT, properly formatted
185
+ ✓ README: Comprehensive documentation
186
+ ✓ Version: 0.1.1 (consistent across build artifacts)
187
+ ✓ Metadata: Complete and correct
188
+
189
+ ✗ Entry-Points: NOT DEFINED
190
+ → PayUProcessor cannot be auto-discovered by framework adapters
191
+ → Task 10 required to add: [project.entry-points."getpaid.backends"]
192
+
193
+ BLOCKERS: Entry-points missing (expected, noted in Metis feedback)
194
+
195
+ NEXT STEPS:
196
+ - Task 10: Add entry-points configuration
197
+ - Ensure PayUProcessor class is properly exported for discovery
198
+
199
+ ================================================================================
200
+ EOF
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-getpaid-payu
3
+ Version: 3.0.0
4
+ Summary: PayU payment gateway integration for python-getpaid ecosystem.
5
+ Project-URL: Homepage, https://github.com/django-getpaid/python-getpaid-payu
6
+ Project-URL: Repository, https://github.com/django-getpaid/python-getpaid-payu
7
+ Project-URL: Documentation, https://getpaid-payu.readthedocs.io/
8
+ Project-URL: Changelog, https://github.com/django-getpaid/python-getpaid-payu/releases
9
+ Author-email: Dominik Kozaczko <dominik@kozaczko.info>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Office/Business :: Financial
18
+ Classifier: Topic :: Office/Business :: Financial :: Point-Of-Sale
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: httpx>=0.27.0
22
+ Requires-Dist: python-getpaid-core>=3.0.0
23
+ Provides-Extra: simulator
24
+ Requires-Dist: litestar>=2.0; extra == 'simulator'
25
+ Requires-Dist: python-getpaid-simulator>=3.0.0; extra == 'simulator'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # python-getpaid-payu
29
+
30
+ [![PyPI version](https://img.shields.io/pypi/v/python-getpaid-payu.svg)](https://pypi.org/project/python-getpaid-payu/)
31
+ [![Python versions](https://img.shields.io/pypi/pyversions/python-getpaid-payu.svg)](https://pypi.org/project/python-getpaid-payu/)
32
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
33
+
34
+ PayU payment processor plugin for the [python-getpaid](https://github.com/django-getpaid/python-getpaid-core) ecosystem.
35
+
36
+ Provides a fully async HTTP client (`PayUClient`) and a payment processor (`PayUProcessor`) implementing the [getpaid-core](https://github.com/django-getpaid/python-getpaid-core) `BaseProcessor` interface. Communicates with PayU via their REST API v2.1 using OAuth2 authentication.
37
+
38
+ ## Features
39
+
40
+ - **Full Payment Lifecycle**: Supports prepared, locked, paid, failed, and refunded states.
41
+ - **Pre-authorization**: Reserve funds on customer's card (lock) and capture them later (charge).
42
+ - **Refunds**: Full and partial refund support via API.
43
+ - **Multiple Currencies**: Support for 15 currencies across Europe and beyond.
44
+ - **Asynchronous**: Built with `httpx` for non-blocking API communication.
45
+ - **Security**: Robust callback signature verification (SHA-256 and MD5).
46
+ - **Comprehensive API**: Wraps every PayU REST API v2.1 endpoint.
47
+
48
+ ## Supported Currencies
49
+
50
+ The following 15 currencies are supported:
51
+ BGN, CHF, CZK, DKK, EUR, GBP, HRK, HUF, NOK, PLN, RON, RUB, SEK, UAH, USD.
52
+
53
+ ## Installation
54
+
55
+ ```bash
56
+ pip install python-getpaid-payu
57
+ ```
58
+
59
+ Install simulator support only when you want this package to register its local
60
+ simulator plugin with `python-getpaid-simulator`:
61
+
62
+ ```bash
63
+ pip install python-getpaid-payu[simulator]
64
+ ```
65
+
66
+ This extra installs the simulator host and Litestar dependencies, then exposes
67
+ the `payu` plugin through the `getpaid.simulator.providers` entry point.
68
+
69
+ ## Simulator Plugin
70
+
71
+ When `python-getpaid-payu[simulator]` is installed alongside
72
+ `python-getpaid-simulator`, the simulator host auto-discovers the PayU plugin.
73
+
74
+ Typical local setup:
75
+
76
+ ```bash
77
+ pip install python-getpaid-simulator python-getpaid-payu[simulator]
78
+ getpaid-simulator
79
+ ```
80
+
81
+ The plugin contributes:
82
+
83
+ - PayU OAuth and order/refund simulator API routes
84
+ - PayU authorization UI at `/sim/payu/authorize/{order_id}`
85
+ - PayU-specific webhook signing and state transitions
86
+
87
+ Useful simulator environment variables:
88
+
89
+ - `SIMULATOR_PAYU_SECOND_KEY`
90
+ - `SIMULATOR_PLUGIN_FAILURE_MODE` (`warn` or `strict`)
91
+
92
+ ## Configuration
93
+
94
+ To use the PayU backend, register it in your `getpaid` configuration and provide the following settings:
95
+
96
+ | Key | Type | Default | Description |
97
+ |-----|------|---------|-------------|
98
+ | `pos_id` | `int` | — | PayU POS (point of sale) identifier |
99
+ | `second_key` | `str` | — | Second key (MD5) from PayU panel, used for signature verification |
100
+ | `oauth_id` | `int` | — | OAuth client ID from PayU panel |
101
+ | `oauth_secret` | `str` | — | OAuth client secret from PayU panel |
102
+ | `sandbox` | `bool` | `True` | Use sandbox (`secure.snd.payu.com`) or production (`secure.payu.com`) |
103
+ | `notify_url` | `str` | `None` | Notification callback URL template, e.g. `https://example.com/payments/{payment_id}/notify` |
104
+ | `continue_url` | `str` | `None` | Redirect URL template after payment, e.g. `https://example.com/payments/{payment_id}/continue` |
105
+
106
+ Example configuration:
107
+
108
+ ```python
109
+ GETPAID_BACKENDS = {
110
+ "payu": {
111
+ "pos_id": "300746",
112
+ "second_key": "b6ca15b0d1020e8094d9b5f8d163db54",
113
+ "oauth_id": "300746",
114
+ "oauth_secret": "2ee86a66e5d97e3fadc400c9f19b065d",
115
+ "notify_url": "https://your-domain.com/payments/payu/callback/",
116
+ "continue_url": "https://your-domain.com/payments/payu/success/",
117
+ "sandbox": True,
118
+ }
119
+ }
120
+ ```
121
+
122
+ ### Sandbox Mode
123
+
124
+ PayU provides a sandbox environment for testing. You can use the example keys provided above for testing in PLN.
125
+
126
+ ## Ecosystem
127
+
128
+ `python-getpaid-payu` is part of the larger `python-getpaid` ecosystem. Use it with one of our web framework wrappers:
129
+
130
+ - [django-getpaid](https://github.com/django-getpaid/django-getpaid)
131
+ - [litestar-getpaid](https://github.com/django-getpaid/litestar-getpaid)
132
+ - [fastapi-getpaid](https://github.com/django-getpaid/fastapi-getpaid)
133
+
134
+ ## Requirements
135
+
136
+ - Python 3.12+
137
+ - `python-getpaid-core >= 3.0.0`
138
+ - `httpx >= 0.27.0`
139
+
140
+ ## License
141
+
142
+ MIT
143
+
144
+ ## Credits
145
+
146
+ Created by [Dominik Kozaczko](https://github.com/dekoza).
@@ -0,0 +1,119 @@
1
+ # python-getpaid-payu
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/python-getpaid-payu.svg)](https://pypi.org/project/python-getpaid-payu/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/python-getpaid-payu.svg)](https://pypi.org/project/python-getpaid-payu/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ PayU payment processor plugin for the [python-getpaid](https://github.com/django-getpaid/python-getpaid-core) ecosystem.
8
+
9
+ Provides a fully async HTTP client (`PayUClient`) and a payment processor (`PayUProcessor`) implementing the [getpaid-core](https://github.com/django-getpaid/python-getpaid-core) `BaseProcessor` interface. Communicates with PayU via their REST API v2.1 using OAuth2 authentication.
10
+
11
+ ## Features
12
+
13
+ - **Full Payment Lifecycle**: Supports prepared, locked, paid, failed, and refunded states.
14
+ - **Pre-authorization**: Reserve funds on customer's card (lock) and capture them later (charge).
15
+ - **Refunds**: Full and partial refund support via API.
16
+ - **Multiple Currencies**: Support for 15 currencies across Europe and beyond.
17
+ - **Asynchronous**: Built with `httpx` for non-blocking API communication.
18
+ - **Security**: Robust callback signature verification (SHA-256 and MD5).
19
+ - **Comprehensive API**: Wraps every PayU REST API v2.1 endpoint.
20
+
21
+ ## Supported Currencies
22
+
23
+ The following 15 currencies are supported:
24
+ BGN, CHF, CZK, DKK, EUR, GBP, HRK, HUF, NOK, PLN, RON, RUB, SEK, UAH, USD.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install python-getpaid-payu
30
+ ```
31
+
32
+ Install simulator support only when you want this package to register its local
33
+ simulator plugin with `python-getpaid-simulator`:
34
+
35
+ ```bash
36
+ pip install python-getpaid-payu[simulator]
37
+ ```
38
+
39
+ This extra installs the simulator host and Litestar dependencies, then exposes
40
+ the `payu` plugin through the `getpaid.simulator.providers` entry point.
41
+
42
+ ## Simulator Plugin
43
+
44
+ When `python-getpaid-payu[simulator]` is installed alongside
45
+ `python-getpaid-simulator`, the simulator host auto-discovers the PayU plugin.
46
+
47
+ Typical local setup:
48
+
49
+ ```bash
50
+ pip install python-getpaid-simulator python-getpaid-payu[simulator]
51
+ getpaid-simulator
52
+ ```
53
+
54
+ The plugin contributes:
55
+
56
+ - PayU OAuth and order/refund simulator API routes
57
+ - PayU authorization UI at `/sim/payu/authorize/{order_id}`
58
+ - PayU-specific webhook signing and state transitions
59
+
60
+ Useful simulator environment variables:
61
+
62
+ - `SIMULATOR_PAYU_SECOND_KEY`
63
+ - `SIMULATOR_PLUGIN_FAILURE_MODE` (`warn` or `strict`)
64
+
65
+ ## Configuration
66
+
67
+ To use the PayU backend, register it in your `getpaid` configuration and provide the following settings:
68
+
69
+ | Key | Type | Default | Description |
70
+ |-----|------|---------|-------------|
71
+ | `pos_id` | `int` | — | PayU POS (point of sale) identifier |
72
+ | `second_key` | `str` | — | Second key (MD5) from PayU panel, used for signature verification |
73
+ | `oauth_id` | `int` | — | OAuth client ID from PayU panel |
74
+ | `oauth_secret` | `str` | — | OAuth client secret from PayU panel |
75
+ | `sandbox` | `bool` | `True` | Use sandbox (`secure.snd.payu.com`) or production (`secure.payu.com`) |
76
+ | `notify_url` | `str` | `None` | Notification callback URL template, e.g. `https://example.com/payments/{payment_id}/notify` |
77
+ | `continue_url` | `str` | `None` | Redirect URL template after payment, e.g. `https://example.com/payments/{payment_id}/continue` |
78
+
79
+ Example configuration:
80
+
81
+ ```python
82
+ GETPAID_BACKENDS = {
83
+ "payu": {
84
+ "pos_id": "300746",
85
+ "second_key": "b6ca15b0d1020e8094d9b5f8d163db54",
86
+ "oauth_id": "300746",
87
+ "oauth_secret": "2ee86a66e5d97e3fadc400c9f19b065d",
88
+ "notify_url": "https://your-domain.com/payments/payu/callback/",
89
+ "continue_url": "https://your-domain.com/payments/payu/success/",
90
+ "sandbox": True,
91
+ }
92
+ }
93
+ ```
94
+
95
+ ### Sandbox Mode
96
+
97
+ PayU provides a sandbox environment for testing. You can use the example keys provided above for testing in PLN.
98
+
99
+ ## Ecosystem
100
+
101
+ `python-getpaid-payu` is part of the larger `python-getpaid` ecosystem. Use it with one of our web framework wrappers:
102
+
103
+ - [django-getpaid](https://github.com/django-getpaid/django-getpaid)
104
+ - [litestar-getpaid](https://github.com/django-getpaid/litestar-getpaid)
105
+ - [fastapi-getpaid](https://github.com/django-getpaid/fastapi-getpaid)
106
+
107
+ ## Requirements
108
+
109
+ - Python 3.12+
110
+ - `python-getpaid-core >= 3.0.0`
111
+ - `httpx >= 0.27.0`
112
+
113
+ ## License
114
+
115
+ MIT
116
+
117
+ ## Credits
118
+
119
+ Created by [Dominik Kozaczko](https://github.com/dekoza).
@@ -0,0 +1,51 @@
1
+ # Changelog
2
+
3
+ ## v3.0.0 (2026-06-04)
4
+
5
+ Major stable release — PayU payment gateway integration for the python-getpaid ecosystem.
6
+
7
+ ### Breaking Changes
8
+
9
+ - Complete rewrite as a framework-agnostic plugin for `python-getpaid-core` v3
10
+ - Requires Python 3.12+
11
+ - Now depends on `python-getpaid-core>=3.0.0` instead of standalone django-getpaid
12
+
13
+ ### Features
14
+
15
+ - Full PayU REST API v2.1 coverage
16
+ - Async HTTP client (`PayUClient`) with OAuth2 token management
17
+ - Payment processor (`PayUProcessor`) implementing `BaseProcessor`
18
+ - All order operations: create, cancel, capture, retrieve
19
+ - Refund operations: create, retrieve single/all
20
+ - Payment methods retrieval
21
+ - Transaction details retrieval
22
+ - Shop info and payout operations
23
+ - Token deletion
24
+ - Automatic amount centification/normalization
25
+ - Signature verification (MD5 and SHA-256)
26
+ - PUSH callback handling with semantic payment updates
27
+ - PULL status polling
28
+ - Full pre-authorization support (lock, charge, release)
29
+
30
+ ---
31
+
32
+ ## v0.1.0 (2026-02-14)
33
+
34
+ Initial release.
35
+
36
+ ### Features
37
+
38
+ - Full PayU REST API v2.1 coverage
39
+ - Async HTTP client (`PayUClient`) with OAuth2 token management
40
+ - Payment processor (`PayUProcessor`) implementing `BaseProcessor`
41
+ - All order operations: create, cancel, capture, retrieve
42
+ - Refund operations: create, retrieve single/all
43
+ - Payment methods retrieval
44
+ - Transaction details retrieval
45
+ - Shop info and payout operations
46
+ - Token deletion
47
+ - Automatic amount centification/normalization
48
+ - Signature verification (MD5 and SHA-256)
49
+ - PUSH callback handling with semantic payment updates
50
+ - PULL status polling
51
+ - Full pre-authorization support (lock, charge, release)