python-getpaid-core 0.1.1__tar.gz → 3.0.0a2__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 (64) hide show
  1. python_getpaid_core-3.0.0a2/.github/workflows/ci.yml +33 -0
  2. python_getpaid_core-3.0.0a2/.sisyphus/evidence/task-22-readme-core.txt +7 -0
  3. python_getpaid_core-3.0.0a2/PKG-INFO +107 -0
  4. python_getpaid_core-3.0.0a2/README.md +82 -0
  5. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/pyproject.toml +4 -1
  6. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/__init__.py +1 -1
  7. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_public_api.py +1 -1
  8. python_getpaid_core-3.0.0a2/tests/test_version.py +11 -0
  9. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/uv.lock +0 -1
  10. python_getpaid_core-0.1.1/PKG-INFO +0 -105
  11. python_getpaid_core-0.1.1/README.md +0 -80
  12. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.cookiecutter.json +0 -0
  13. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.gitattributes +0 -0
  14. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.github/dependabot.yml +0 -0
  15. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.github/labels.yml +0 -0
  16. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.github/release-drafter.yml +0 -0
  17. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.github/workflows/constraints.txt +0 -0
  18. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.github/workflows/labeler.yml +0 -0
  19. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.github/workflows/release.yml +0 -0
  20. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.github/workflows/tests.yml +0 -0
  21. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.gitignore +0 -0
  22. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.plans/2026-02-13-getpaid-core-design.md +0 -0
  23. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.plans/2026-02-13-getpaid-core-implementation.md +0 -0
  24. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.pre-commit-config.yaml +0 -0
  25. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/.readthedocs.yml +0 -0
  26. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/CODE_OF_CONDUCT.md +0 -0
  27. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/CONTRIBUTING.md +0 -0
  28. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/LICENSE +0 -0
  29. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/codecov.yml +0 -0
  30. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/changelog.md +0 -0
  31. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/codeofconduct.md +0 -0
  32. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/concepts.md +0 -0
  33. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/conf.py +0 -0
  34. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/contributing.md +0 -0
  35. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/getting-started.md +0 -0
  36. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/index.md +0 -0
  37. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/license.md +0 -0
  38. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/reference.md +0 -0
  39. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/docs/requirements.txt +0 -0
  40. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/backends/__init__.py +0 -0
  41. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/backends/dummy.py +0 -0
  42. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/enums.py +0 -0
  43. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/exceptions.py +0 -0
  44. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/flow.py +0 -0
  45. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/fsm.py +0 -0
  46. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/processor.py +0 -0
  47. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/protocols.py +0 -0
  48. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/py.typed +0 -0
  49. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/registry.py +0 -0
  50. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/types.py +0 -0
  51. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/src/getpaid_core/validators.py +0 -0
  52. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/__init__.py +0 -0
  53. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/conftest.py +0 -0
  54. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_dummy_backend.py +0 -0
  55. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_enums.py +0 -0
  56. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_exceptions.py +0 -0
  57. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_flow.py +0 -0
  58. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_fsm.py +0 -0
  59. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_integration.py +0 -0
  60. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_processor.py +0 -0
  61. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_protocols.py +0 -0
  62. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_registry.py +0 -0
  63. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_types.py +0 -0
  64. {python_getpaid_core-0.1.1 → python_getpaid_core-3.0.0a2}/tests/test_validators.py +0 -0
@@ -0,0 +1,33 @@
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: Run tests
33
+ run: uv run pytest --tb=short
@@ -0,0 +1,7 @@
1
+ README.md verification results:
2
+ Line count: 82
3
+ pip install count: 1
4
+ BaseProcessor count: 5
5
+ Wrappers count: 8
6
+
7
+ All verification checks PASSED.
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-getpaid-core
3
+ Version: 3.0.0a2
4
+ Summary: Framework-agnostic payment processing core.
5
+ Project-URL: Homepage, https://github.com/django-getpaid/python-getpaid-core
6
+ Project-URL: Repository, https://github.com/django-getpaid/python-getpaid-core
7
+ Project-URL: Documentation, https://getpaid-core.readthedocs.io
8
+ Project-URL: Changelog, https://github.com/django-getpaid/python-getpaid-core/releases
9
+ Author-email: Dominik Kozaczko <dominik@kozaczko.info>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 3 - Alpha
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: anyio>=4.0
22
+ Requires-Dist: httpx>=0.27.0
23
+ Requires-Dist: transitions>=0.9.0
24
+ Description-Content-Type: text/markdown
25
+
26
+ # python-getpaid-core
27
+
28
+ [![PyPI version](https://img.shields.io/pypi/v/python-getpaid-core)](https://pypi.org/project/python-getpaid-core/)
29
+ [![Python version](https://img.shields.io/pypi/pyversions/python-getpaid-core)](https://pypi.org/project/python-getpaid-core/)
30
+ [![License](https://img.shields.io/pypi/l/python-getpaid-core)](https://github.com/django-getpaid/python-getpaid-core/blob/main/LICENSE)
31
+
32
+ **Framework-agnostic payment processing core.**
33
+
34
+ `python-getpaid-core` is the foundation of the Getpaid ecosystem. It provides the abstract interfaces, finite state machines (FSM), and plugin registry needed to build a robust payment system without coupling your logic to a specific web framework or payment provider.
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pip install python-getpaid-core
40
+ ```
41
+
42
+ ## Quick Start: Creating a Custom Processor
43
+
44
+ To implement a new payment backend, subclass `BaseProcessor` and implement at least `prepare_transaction`.
45
+
46
+ ```python
47
+ from getpaid_core import BaseProcessor
48
+ from getpaid_core.types import TransactionResult
49
+
50
+ class MyPaymentProcessor(BaseProcessor):
51
+ slug = "my-provider"
52
+ display_name = "My Payment Provider"
53
+ accepted_currencies = ["USD", "EUR"]
54
+
55
+ async def prepare_transaction(self, **kwargs) -> TransactionResult:
56
+ # Generate payment link or form data
57
+ return TransactionResult(
58
+ redirect_url=f"https://api.provider.com/pay/{self.payment.id}",
59
+ method="GET"
60
+ )
61
+ ```
62
+
63
+ ### Registering your Processor
64
+
65
+ Register your processor using entry points in your `pyproject.toml` so it can be discovered by the registry:
66
+
67
+ ```toml
68
+ [project.entry-points."getpaid.backends"]
69
+ my-provider = "my_package.processors:MyPaymentProcessor"
70
+ ```
71
+
72
+ ## Architecture Overview
73
+
74
+ - **BaseProcessor**: The abstract base class that all payment gateway plugins must implement. It provides the standard interface for transaction preparation, callback handling, charging, and refunds.
75
+ - **PaymentFlow**: Manages the payment lifecycle using a Finite State Machine (FSM) powered by the `transitions` library. It ensures that payments move between states (e.g., `NEW` -> `PREPARED` -> `PAID`) according to strict business rules.
76
+ - **PluginRegistry**: A central service for discovering and managing payment processors registered via `getpaid.backends` entry points.
77
+ - **State Machine (FSM)**: Dynamically attaches state-machine triggers to payment objects at runtime, allowing for clean and predictable state transitions.
78
+
79
+ ## API Summary
80
+
81
+ | Class / Module | Role |
82
+ | --- | --- |
83
+ | `BaseProcessor` | Abstract base for implementing payment gateways. |
84
+ | `PaymentFlow` | FSM logic for managing payment lifecycles. |
85
+ | `PaymentStatus` | Enum for all possible payment states (NEW, PAID, FAILED, etc.). |
86
+ | `registry` | Singleton registry for backend discovery. |
87
+ | `TransactionResult` | Standard response for transaction initiation. |
88
+ | `GetPaidException` | Base exception for all payment-related errors. |
89
+
90
+ ## Ecosystem
91
+
92
+ `getpaid-core` is the heart of a larger ecosystem designed to make payment processing easy in any Python web application.
93
+
94
+ ### Framework Wrappers
95
+ - [django-getpaid](https://github.com/django-getpaid/django-getpaid) — Official Django integration.
96
+ - [litestar-getpaid](https://github.com/django-getpaid/litestar-getpaid) — Official Litestar integration.
97
+ - [fastapi-getpaid](https://github.com/django-getpaid/fastapi-getpaid) — Official FastAPI integration.
98
+
99
+ ### Processor Plugins
100
+ - [python-getpaid-payu](https://github.com/django-getpaid/python-getpaid-payu) — PayU backend.
101
+ - [python-getpaid-paynow](https://github.com/django-getpaid/python-getpaid-paynow) — Paynow backend.
102
+ - [python-getpaid-bitpay](https://github.com/django-getpaid/python-getpaid-bitpay) — BitPay backend.
103
+ - [python-getpaid-przelewy24](https://github.com/django-getpaid/python-getpaid-przelewy24) — Przelewy24 backend.
104
+
105
+ ## License
106
+
107
+ This project is licensed under the MIT License.
@@ -0,0 +1,82 @@
1
+ # python-getpaid-core
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/python-getpaid-core)](https://pypi.org/project/python-getpaid-core/)
4
+ [![Python version](https://img.shields.io/pypi/pyversions/python-getpaid-core)](https://pypi.org/project/python-getpaid-core/)
5
+ [![License](https://img.shields.io/pypi/l/python-getpaid-core)](https://github.com/django-getpaid/python-getpaid-core/blob/main/LICENSE)
6
+
7
+ **Framework-agnostic payment processing core.**
8
+
9
+ `python-getpaid-core` is the foundation of the Getpaid ecosystem. It provides the abstract interfaces, finite state machines (FSM), and plugin registry needed to build a robust payment system without coupling your logic to a specific web framework or payment provider.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install python-getpaid-core
15
+ ```
16
+
17
+ ## Quick Start: Creating a Custom Processor
18
+
19
+ To implement a new payment backend, subclass `BaseProcessor` and implement at least `prepare_transaction`.
20
+
21
+ ```python
22
+ from getpaid_core import BaseProcessor
23
+ from getpaid_core.types import TransactionResult
24
+
25
+ class MyPaymentProcessor(BaseProcessor):
26
+ slug = "my-provider"
27
+ display_name = "My Payment Provider"
28
+ accepted_currencies = ["USD", "EUR"]
29
+
30
+ async def prepare_transaction(self, **kwargs) -> TransactionResult:
31
+ # Generate payment link or form data
32
+ return TransactionResult(
33
+ redirect_url=f"https://api.provider.com/pay/{self.payment.id}",
34
+ method="GET"
35
+ )
36
+ ```
37
+
38
+ ### Registering your Processor
39
+
40
+ Register your processor using entry points in your `pyproject.toml` so it can be discovered by the registry:
41
+
42
+ ```toml
43
+ [project.entry-points."getpaid.backends"]
44
+ my-provider = "my_package.processors:MyPaymentProcessor"
45
+ ```
46
+
47
+ ## Architecture Overview
48
+
49
+ - **BaseProcessor**: The abstract base class that all payment gateway plugins must implement. It provides the standard interface for transaction preparation, callback handling, charging, and refunds.
50
+ - **PaymentFlow**: Manages the payment lifecycle using a Finite State Machine (FSM) powered by the `transitions` library. It ensures that payments move between states (e.g., `NEW` -> `PREPARED` -> `PAID`) according to strict business rules.
51
+ - **PluginRegistry**: A central service for discovering and managing payment processors registered via `getpaid.backends` entry points.
52
+ - **State Machine (FSM)**: Dynamically attaches state-machine triggers to payment objects at runtime, allowing for clean and predictable state transitions.
53
+
54
+ ## API Summary
55
+
56
+ | Class / Module | Role |
57
+ | --- | --- |
58
+ | `BaseProcessor` | Abstract base for implementing payment gateways. |
59
+ | `PaymentFlow` | FSM logic for managing payment lifecycles. |
60
+ | `PaymentStatus` | Enum for all possible payment states (NEW, PAID, FAILED, etc.). |
61
+ | `registry` | Singleton registry for backend discovery. |
62
+ | `TransactionResult` | Standard response for transaction initiation. |
63
+ | `GetPaidException` | Base exception for all payment-related errors. |
64
+
65
+ ## Ecosystem
66
+
67
+ `getpaid-core` is the heart of a larger ecosystem designed to make payment processing easy in any Python web application.
68
+
69
+ ### Framework Wrappers
70
+ - [django-getpaid](https://github.com/django-getpaid/django-getpaid) — Official Django integration.
71
+ - [litestar-getpaid](https://github.com/django-getpaid/litestar-getpaid) — Official Litestar integration.
72
+ - [fastapi-getpaid](https://github.com/django-getpaid/fastapi-getpaid) — Official FastAPI integration.
73
+
74
+ ### Processor Plugins
75
+ - [python-getpaid-payu](https://github.com/django-getpaid/python-getpaid-payu) — PayU backend.
76
+ - [python-getpaid-paynow](https://github.com/django-getpaid/python-getpaid-paynow) — Paynow backend.
77
+ - [python-getpaid-bitpay](https://github.com/django-getpaid/python-getpaid-bitpay) — BitPay backend.
78
+ - [python-getpaid-przelewy24](https://github.com/django-getpaid/python-getpaid-przelewy24) — Przelewy24 backend.
79
+
80
+ ## License
81
+
82
+ This project is licensed under the MIT License.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = 'python-getpaid-core'
3
- version = "0.1.1"
3
+ dynamic = ["version"]
4
4
  description = 'Framework-agnostic payment processing core.'
5
5
  readme = 'README.md'
6
6
  license = {text = 'MIT'}
@@ -52,6 +52,9 @@ build-backend = 'hatchling.build'
52
52
  [tool.hatch.build.targets.wheel]
53
53
  packages = ['src/getpaid_core']
54
54
 
55
+ [tool.hatch.version]
56
+ path = "src/getpaid_core/__init__.py"
57
+
55
58
  [tool.pytest.ini_options]
56
59
  testpaths = ['tests']
57
60
  asyncio_mode = 'auto'
@@ -1,6 +1,6 @@
1
1
  """Getpaid Core -- framework-agnostic payment processing."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "3.0.0a2"
4
4
 
5
5
  from getpaid_core.enums import BackendMethod
6
6
  from getpaid_core.enums import ConfirmationMethod
@@ -5,7 +5,7 @@ import getpaid_core
5
5
 
6
6
  class TestPublicAPI:
7
7
  def test_version(self):
8
- assert getpaid_core.__version__ == "0.1.0"
8
+ assert getpaid_core.__version__ == "3.0.0a2"
9
9
 
10
10
  def test_exports_enums(self):
11
11
  assert getpaid_core.PaymentStatus is not None
@@ -0,0 +1,11 @@
1
+ """Tests for package version consistency."""
2
+
3
+ from importlib.metadata import version
4
+
5
+ import getpaid_core
6
+
7
+
8
+ def test_version_consistency():
9
+ """Ensure __version__ matches package metadata."""
10
+ pkg_version = version("python-getpaid-core")
11
+ assert getpaid_core.__version__ == pkg_version
@@ -585,7 +585,6 @@ wheels = [
585
585
 
586
586
  [[package]]
587
587
  name = "python-getpaid-core"
588
- version = "0.1.1"
589
588
  source = { editable = "." }
590
589
  dependencies = [
591
590
  { name = "anyio" },
@@ -1,105 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python-getpaid-core
3
- Version: 0.1.1
4
- Summary: Framework-agnostic payment processing core.
5
- Project-URL: Homepage, https://github.com/django-getpaid/python-getpaid-core
6
- Project-URL: Repository, https://github.com/django-getpaid/python-getpaid-core
7
- Project-URL: Documentation, https://getpaid-core.readthedocs.io
8
- Project-URL: Changelog, https://github.com/django-getpaid/python-getpaid-core/releases
9
- Author-email: Dominik Kozaczko <dominik@kozaczko.info>
10
- License: MIT
11
- License-File: LICENSE
12
- Classifier: Development Status :: 3 - Alpha
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: anyio>=4.0
22
- Requires-Dist: httpx>=0.27.0
23
- Requires-Dist: transitions>=0.9.0
24
- Description-Content-Type: text/markdown
25
-
26
- # getpaid-core
27
-
28
- [![PyPI](https://img.shields.io/pypi/v/python-getpaid-core.svg)](https://pypi.org/project/python-getpaid-core/)
29
- [![Python Version](https://img.shields.io/pypi/pyversions/python-getpaid-core)](https://pypi.org/project/python-getpaid-core/)
30
- [![License](https://img.shields.io/pypi/l/python-getpaid-core)](https://github.com/django-getpaid/python-getpaid-core/blob/main/LICENSE)
31
-
32
- Framework-agnostic payment processing library for Python. Provides the core
33
- abstractions — enums, protocols, FSM, processor base class, plugin registry,
34
- and exception hierarchy — that framework-specific adapters build on.
35
-
36
- ## Architecture
37
-
38
- getpaid-core defines the **what** of payment processing without coupling to
39
- any web framework:
40
-
41
- - **Enums** (`PaymentStatus`, `FraudStatus`, `BackendMethod`, `ConfirmationMethod`)
42
- define all valid states and methods.
43
- - **Protocols** (`Payment`, `Order`, `PaymentRepository`) define structural
44
- contracts that framework models must satisfy.
45
- - **FSM** (`create_payment_machine`, `create_fraud_machine`) attaches
46
- state-machine triggers to payment objects at runtime using the `transitions`
47
- library.
48
- - **BaseProcessor** is an abstract class that payment gateway plugins subclass
49
- to implement `prepare_transaction`, `handle_callback`, `charge`, etc.
50
- - **PluginRegistry** discovers and stores payment backend processors via
51
- entry points or manual registration.
52
- - **Exceptions** provide a structured hierarchy for payment errors.
53
-
54
- ## Framework Adapters
55
-
56
- - **[django-getpaid](https://github.com/django-getpaid/django-getpaid)** —
57
- Django adapter (models, views, forms, admin)
58
- - **[fastapi-getpaid](https://github.com/django-getpaid/fastapi-getpaid)** —
59
- FastAPI adapter (async routes, SQLAlchemy, Pydantic config)
60
- - **[litestar-getpaid](https://github.com/django-getpaid/litestar-getpaid)** —
61
- Litestar adapter (controllers, Provide DI, SQLAlchemy, Pydantic config)
62
-
63
- ## Installation
64
-
65
- ```bash
66
- pip install python-getpaid-core
67
- ```
68
-
69
- You typically install this as a dependency of a framework adapter rather than
70
- directly.
71
-
72
- ## Quick Example
73
-
74
- ```python
75
- from getpaid_core.enums import PaymentStatus
76
- from getpaid_core.fsm import create_payment_machine
77
-
78
- # Any object satisfying the Payment protocol works
79
- payment = MyPayment(status=PaymentStatus.NEW, amount_required=100)
80
- machine = create_payment_machine(payment)
81
-
82
- # FSM trigger methods are attached directly to the object
83
- payment.confirm_prepared()
84
- assert payment.status == PaymentStatus.PREPARED
85
- ```
86
-
87
- ## Requirements
88
-
89
- - Python 3.12+
90
- - transitions
91
- - httpx
92
- - anyio
93
-
94
- ## License
95
-
96
- MIT
97
-
98
- ## Disclaimer
99
-
100
- This project has nothing in common with the
101
- [getpaid](http://code.google.com/p/getpaid/) plone project.
102
-
103
- ## Credits
104
-
105
- Created by [Dominik Kozaczko](https://github.com/dekoza).
@@ -1,80 +0,0 @@
1
- # getpaid-core
2
-
3
- [![PyPI](https://img.shields.io/pypi/v/python-getpaid-core.svg)](https://pypi.org/project/python-getpaid-core/)
4
- [![Python Version](https://img.shields.io/pypi/pyversions/python-getpaid-core)](https://pypi.org/project/python-getpaid-core/)
5
- [![License](https://img.shields.io/pypi/l/python-getpaid-core)](https://github.com/django-getpaid/python-getpaid-core/blob/main/LICENSE)
6
-
7
- Framework-agnostic payment processing library for Python. Provides the core
8
- abstractions — enums, protocols, FSM, processor base class, plugin registry,
9
- and exception hierarchy — that framework-specific adapters build on.
10
-
11
- ## Architecture
12
-
13
- getpaid-core defines the **what** of payment processing without coupling to
14
- any web framework:
15
-
16
- - **Enums** (`PaymentStatus`, `FraudStatus`, `BackendMethod`, `ConfirmationMethod`)
17
- define all valid states and methods.
18
- - **Protocols** (`Payment`, `Order`, `PaymentRepository`) define structural
19
- contracts that framework models must satisfy.
20
- - **FSM** (`create_payment_machine`, `create_fraud_machine`) attaches
21
- state-machine triggers to payment objects at runtime using the `transitions`
22
- library.
23
- - **BaseProcessor** is an abstract class that payment gateway plugins subclass
24
- to implement `prepare_transaction`, `handle_callback`, `charge`, etc.
25
- - **PluginRegistry** discovers and stores payment backend processors via
26
- entry points or manual registration.
27
- - **Exceptions** provide a structured hierarchy for payment errors.
28
-
29
- ## Framework Adapters
30
-
31
- - **[django-getpaid](https://github.com/django-getpaid/django-getpaid)** —
32
- Django adapter (models, views, forms, admin)
33
- - **[fastapi-getpaid](https://github.com/django-getpaid/fastapi-getpaid)** —
34
- FastAPI adapter (async routes, SQLAlchemy, Pydantic config)
35
- - **[litestar-getpaid](https://github.com/django-getpaid/litestar-getpaid)** —
36
- Litestar adapter (controllers, Provide DI, SQLAlchemy, Pydantic config)
37
-
38
- ## Installation
39
-
40
- ```bash
41
- pip install python-getpaid-core
42
- ```
43
-
44
- You typically install this as a dependency of a framework adapter rather than
45
- directly.
46
-
47
- ## Quick Example
48
-
49
- ```python
50
- from getpaid_core.enums import PaymentStatus
51
- from getpaid_core.fsm import create_payment_machine
52
-
53
- # Any object satisfying the Payment protocol works
54
- payment = MyPayment(status=PaymentStatus.NEW, amount_required=100)
55
- machine = create_payment_machine(payment)
56
-
57
- # FSM trigger methods are attached directly to the object
58
- payment.confirm_prepared()
59
- assert payment.status == PaymentStatus.PREPARED
60
- ```
61
-
62
- ## Requirements
63
-
64
- - Python 3.12+
65
- - transitions
66
- - httpx
67
- - anyio
68
-
69
- ## License
70
-
71
- MIT
72
-
73
- ## Disclaimer
74
-
75
- This project has nothing in common with the
76
- [getpaid](http://code.google.com/p/getpaid/) plone project.
77
-
78
- ## Credits
79
-
80
- Created by [Dominik Kozaczko](https://github.com/dekoza).