python-getpaid-payu 3.0.0a4__tar.gz → 3.0.0a5__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.
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/PKG-INFO +3 -3
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/README.md +1 -1
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/pyproject.toml +1 -1
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/__init__.py +1 -1
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/plugin.py +1 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/routes.py +23 -8
- python_getpaid_payu-3.0.0a5/tests/test_public_api.py +18 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/test_simulator_plugin.py +4 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/uv.lock +4 -4
- python_getpaid_payu-3.0.0a4/tests/test_public_api.py +0 -7
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/.github/workflows/ci.yml +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/.gitignore +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/.pre-commit-config.yaml +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/.python-version +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/.readthedocs.yml +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/.sisyphus/evidence/task-26-readme-payu.txt +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/.sisyphus/evidence/task-5-baseline-payu.txt +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/CODE_OF_CONDUCT.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/CONTRIBUTING.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/LICENSE +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/changelog.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/codeofconduct.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/concepts.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/conf.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/configuration.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/contributing.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/getting-started.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/index.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/license.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/reference.md +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/docs/requirements.txt +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/sandbox_keys.txt +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/client.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/processor.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/py.typed +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/__init__.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/signing.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/transitions.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/webhooks.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/types.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/__init__.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/conftest.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/test_callback.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/test_client.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/test_entry_points.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/test_processor.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/test_types.py +0 -0
- {python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/tests/test_url_construction.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-getpaid-payu
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0a5
|
|
4
4
|
Summary: PayU payment gateway integration for python-getpaid ecosystem.
|
|
5
5
|
Project-URL: Homepage, https://github.com/django-getpaid/python-getpaid-payu
|
|
6
6
|
Project-URL: Repository, https://github.com/django-getpaid/python-getpaid-payu
|
|
@@ -19,7 +19,7 @@ Classifier: Topic :: Office/Business :: Financial :: Point-Of-Sale
|
|
|
19
19
|
Classifier: Typing :: Typed
|
|
20
20
|
Requires-Python: >=3.12
|
|
21
21
|
Requires-Dist: httpx>=0.27.0
|
|
22
|
-
Requires-Dist: python-getpaid-core>=3.0.
|
|
22
|
+
Requires-Dist: python-getpaid-core>=3.0.0a4
|
|
23
23
|
Provides-Extra: simulator
|
|
24
24
|
Requires-Dist: litestar>=2.0; extra == 'simulator'
|
|
25
25
|
Requires-Dist: python-getpaid-simulator>=3.0.0a3; extra == 'simulator'
|
|
@@ -134,7 +134,7 @@ PayU provides a sandbox environment for testing. You can use the example keys pr
|
|
|
134
134
|
## Requirements
|
|
135
135
|
|
|
136
136
|
- Python 3.12+
|
|
137
|
-
- `python-getpaid-core >= 3.0.
|
|
137
|
+
- `python-getpaid-core >= 3.0.0a4`
|
|
138
138
|
- `httpx >= 0.27.0`
|
|
139
139
|
|
|
140
140
|
## License
|
{python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/routes.py
RENAMED
|
@@ -4,6 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from datetime import UTC
|
|
6
6
|
from datetime import datetime
|
|
7
|
+
from decimal import Decimal
|
|
8
|
+
from decimal import InvalidOperation
|
|
7
9
|
from inspect import isawaitable
|
|
8
10
|
from typing import Any
|
|
9
11
|
from urllib.parse import parse_qsl
|
|
@@ -31,6 +33,23 @@ def _provider_config(request: Request[Any, Any, Any]) -> dict[str, Any]:
|
|
|
31
33
|
return dict(request.app.state.provider_configs["payu"])
|
|
32
34
|
|
|
33
35
|
|
|
36
|
+
def _format_amount_for_display(
|
|
37
|
+
order: dict[str, Any],
|
|
38
|
+
provider_config: dict[str, Any],
|
|
39
|
+
) -> str:
|
|
40
|
+
amount_raw = order.get("totalAmount", 0)
|
|
41
|
+
try:
|
|
42
|
+
amount_value = Decimal(str(amount_raw))
|
|
43
|
+
except (InvalidOperation, TypeError, ValueError):
|
|
44
|
+
return str(amount_raw)
|
|
45
|
+
|
|
46
|
+
minor_unit_places = int(provider_config.get("amount_minor_unit_places", 2))
|
|
47
|
+
if minor_unit_places >= 0:
|
|
48
|
+
amount_value /= Decimal(10) ** minor_unit_places
|
|
49
|
+
|
|
50
|
+
return f"{amount_value:.2f} {order.get('currencyCode', 'PLN')}"
|
|
51
|
+
|
|
52
|
+
|
|
34
53
|
def _unauthorized_response() -> Response[dict[str, dict[str, str]]]:
|
|
35
54
|
return Response(
|
|
36
55
|
content={
|
|
@@ -329,14 +348,10 @@ async def payu_authorize_get(
|
|
|
329
348
|
if order.get("status") in ("COMPLETED", "CANCELED"):
|
|
330
349
|
raise HTTPException(status_code=400, detail="Payment already processed")
|
|
331
350
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
f"{amount_value:.2f} {order.get('currencyCode', 'PLN')}"
|
|
337
|
-
)
|
|
338
|
-
except (ValueError, TypeError):
|
|
339
|
-
formatted_amount = str(amount_raw)
|
|
351
|
+
formatted_amount = _format_amount_for_display(
|
|
352
|
+
order,
|
|
353
|
+
_provider_config(request),
|
|
354
|
+
)
|
|
340
355
|
|
|
341
356
|
return Template(
|
|
342
357
|
template_name="authorize.html",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Tests for the public package API."""
|
|
2
|
+
|
|
3
|
+
import tomllib
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import getpaid_payu
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_version() -> None:
|
|
10
|
+
assert getpaid_payu.__version__ == "3.0.0a4"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_core_dependency_floor() -> None:
|
|
14
|
+
pyproject_data = tomllib.loads(Path("pyproject.toml").read_text())
|
|
15
|
+
assert (
|
|
16
|
+
"python-getpaid-core>=3.0.0a4"
|
|
17
|
+
in pyproject_data["project"]["dependencies"]
|
|
18
|
+
)
|
|
@@ -94,6 +94,10 @@ def test_load_provider_config_reads_env_override(
|
|
|
94
94
|
assert load_provider_config()["second_key"] == "override-second-key"
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
def test_load_provider_config_includes_amount_minor_unit_places() -> None:
|
|
98
|
+
assert load_provider_config()["amount_minor_unit_places"] == 2
|
|
99
|
+
|
|
100
|
+
|
|
97
101
|
@pytest.mark.asyncio
|
|
98
102
|
async def test_trigger_payu_webhook_signs_and_delivers_payload() -> None:
|
|
99
103
|
storage = FakeStorage(
|
|
@@ -829,16 +829,16 @@ wheels = [
|
|
|
829
829
|
|
|
830
830
|
[[package]]
|
|
831
831
|
name = "python-getpaid-core"
|
|
832
|
-
version = "3.0.
|
|
832
|
+
version = "3.0.0a4"
|
|
833
833
|
source = { registry = "https://pypi.org/simple" }
|
|
834
834
|
dependencies = [
|
|
835
835
|
{ name = "anyio" },
|
|
836
836
|
{ name = "httpx" },
|
|
837
837
|
{ name = "transitions" },
|
|
838
838
|
]
|
|
839
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
839
|
+
sdist = { url = "https://files.pythonhosted.org/packages/5c/22/c7a3d249398b609022179299f1cde51207db8e4e9556d4cfe7112f276422/python_getpaid_core-3.0.0a4.tar.gz", hash = "sha256:7784ce418391efe3ec1b6c7fddbfe4d8e1741991a9d0ca3a00ada7807ecb8230", size = 52993, upload-time = "2026-03-25T19:06:56.261Z" }
|
|
840
840
|
wheels = [
|
|
841
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
841
|
+
{ url = "https://files.pythonhosted.org/packages/9e/42/e52551b13b91474e02bcda4517adc2ea21bbb4920f7daae292a5ef795279/python_getpaid_core-3.0.0a4-py3-none-any.whl", hash = "sha256:322afe2a3a777958c1956d1c6ce576f42c93c0cf6ecd1a260bae189a9fa6a97f", size = 15077, upload-time = "2026-03-25T19:06:57.081Z" },
|
|
842
842
|
]
|
|
843
843
|
|
|
844
844
|
[[package]]
|
|
@@ -875,7 +875,7 @@ docs = [
|
|
|
875
875
|
requires-dist = [
|
|
876
876
|
{ name = "httpx", specifier = ">=0.27.0" },
|
|
877
877
|
{ name = "litestar", marker = "extra == 'simulator'", specifier = ">=2.0" },
|
|
878
|
-
{ name = "python-getpaid-core", specifier = ">=3.0.
|
|
878
|
+
{ name = "python-getpaid-core", specifier = ">=3.0.0a4" },
|
|
879
879
|
{ name = "python-getpaid-simulator", marker = "extra == 'simulator'", specifier = ">=3.0.0a3" },
|
|
880
880
|
]
|
|
881
881
|
provides-extras = ["simulator"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/__init__.py
RENAMED
|
File without changes
|
{python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/signing.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_getpaid_payu-3.0.0a4 → python_getpaid_payu-3.0.0a5}/src/getpaid_payu/simulator/webhooks.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|