Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .coverage
Binary file not shown.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
push:
branches: [develop, master]
pull_request:
branches: [develop, master]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.13"
- run: uv sync --dev
- run: uv run ruff check src/paydunya tests
- run: uv run ruff format --check src/paydunya tests

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --dev
- run: uv run pytest --cov --cov-report=term

build:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docs

on:
push:
branches: [develop, master]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv sync --no-dev --group docs
- run: uv run mkdocs build --strict
- uses: actions/upload-pages-artifact@v3
with:
path: site/

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
33 changes: 24 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
# Compiled python modules.
# Python
__pycache__/
*.pyc
*.pyo

# Setuptools distribution folder.
# Virtual environments
.venv/

# Setuptools distribution
/dist/
/build/

# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info

# ignore MANIFEST as it is auto-generated by distutils
MANIFEST

# .tox
# tox
.tox/

# emacs buffers
# MkDocs build output
/site/

# Testing
.pytest_cache/
.coverage
.coverage.*
htmlcov/

# Linting
.ruff_cache/

# Dev tooling
.env

# Emacs
*~
*/#*
.#*
/test.py
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: mixed-line-ending
args: ["--fix=lf"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Changelog

## 2.0.0 (2026-07-22)

### Breaking Changes
- Complete rewrite with modern tooling and API design
- `PaydunyaClient(master_key, private_key, token, mode="test"|"live")` replaces
the old `paydunya.debug` and `paydunya.api_keys` module-level globals
- **OPR removed** — the `opr/create` and `opr/charge` endpoints 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 Pydantic `BaseModel` classes with built-in validation
(email format via `EmailStr`, amount bounds, positive quantity, required
fields). Invalid input raises `ValidationError` at the SDK boundary instead
of being sent to the API.
- Python 3.10+ only (dropped all Python 2 and Python < 3.10 support)
- `httpx` replaces `requests`

### Added
- **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.py` with interactive
payment confirmation polling
- Type hints throughout, `py.typed` marker
- Pytest-based test suite with httpx mocking (no network required)
- MkDocs Material documentation in `docs/`

### Changed
- 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

## 1.0.7
- Last stable release under the old architecture
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

46 changes: 0 additions & 46 deletions Makefile

This file was deleted.

Loading
Loading