python-getpaid-simulator 3.0.0__py3-none-any.whl
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.
- getpaid_simulator/__init__.py +3 -0
- getpaid_simulator/__main__.py +112 -0
- getpaid_simulator/app.py +132 -0
- getpaid_simulator/core/__init__.py +1 -0
- getpaid_simulator/core/config.py +57 -0
- getpaid_simulator/core/discovery.py +12 -0
- getpaid_simulator/core/state.py +58 -0
- getpaid_simulator/core/storage.py +155 -0
- getpaid_simulator/core/webhooks.py +60 -0
- getpaid_simulator/plugins.py +216 -0
- getpaid_simulator/py.typed +0 -0
- getpaid_simulator/spi.py +31 -0
- getpaid_simulator/ui/__init__.py +1 -0
- getpaid_simulator/ui/routes.py +104 -0
- getpaid_simulator/ui/static/.gitkeep +0 -0
- getpaid_simulator/ui/static/style.css +262 -0
- getpaid_simulator/ui/templates/.gitkeep +0 -0
- getpaid_simulator/ui/templates/authorize.html +24 -0
- getpaid_simulator/ui/templates/base.html +31 -0
- getpaid_simulator/ui/templates/components/dashboard_payment_card.html +9 -0
- getpaid_simulator/ui/templates/components/payment_card.html +17 -0
- getpaid_simulator/ui/templates/components/status_badge.html +3 -0
- getpaid_simulator/ui/templates/dashboard.html +45 -0
- python_getpaid_simulator-3.0.0.dist-info/METADATA +115 -0
- python_getpaid_simulator-3.0.0.dist-info/RECORD +28 -0
- python_getpaid_simulator-3.0.0.dist-info/WHEEL +4 -0
- python_getpaid_simulator-3.0.0.dist-info/entry_points.txt +2 -0
- python_getpaid_simulator-3.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}Dashboard{% endblock %}
|
|
4
|
+
|
|
5
|
+
{% block content %}
|
|
6
|
+
<div class="dashboard-header">
|
|
7
|
+
<h2>Payments Dashboard</h2>
|
|
8
|
+
{% if failed_plugins %}
|
|
9
|
+
<div class="empty-state" style="text-align: left; padding: 1.5rem; margin-bottom: 1.5rem; background-color: #2f1818; border: 1px solid #b45309; border-radius: var(--border-radius);">
|
|
10
|
+
<h3 style="margin-top: 0;">Plugin warnings</h3>
|
|
11
|
+
<p style="margin-bottom: 0.75rem; color: var(--text-muted);">The simulator started in degraded mode. Some provider plugins failed to initialize.</p>
|
|
12
|
+
<ul style="margin: 0; padding-left: 1.2rem;">
|
|
13
|
+
{% for failure in failed_plugins %}
|
|
14
|
+
<li><strong>{{ failure.slug }}</strong> ({{ failure.stage }}): {{ failure.error }}</li>
|
|
15
|
+
{% endfor %}
|
|
16
|
+
</ul>
|
|
17
|
+
</div>
|
|
18
|
+
{% endif %}
|
|
19
|
+
<div class="provider-filters" style="margin-bottom: 2rem;">
|
|
20
|
+
<span>Filter by provider:</span>
|
|
21
|
+
<a href="/sim/dashboard" class="btn {% if not current_provider %}btn-neutral{% endif %}">All</a>
|
|
22
|
+
{% for provider_filter in provider_filters %}
|
|
23
|
+
<a href="/sim/dashboard?provider={{ provider_filter.slug }}" class="btn {% if current_provider == provider_filter.slug %}btn-neutral{% endif %}">{{ provider_filter.display_name }}</a>
|
|
24
|
+
{% endfor %}
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="payments-list">
|
|
29
|
+
{% if orders %}
|
|
30
|
+
{% for order in orders %}
|
|
31
|
+
{% set amount = order.formatted_amount %}
|
|
32
|
+
{% set status = order.status %}
|
|
33
|
+
{% set order_id = order.id %}
|
|
34
|
+
{% set provider = order.provider_display_name %}
|
|
35
|
+
{% set authorize_url = order.authorize_url %}
|
|
36
|
+
{% include "components/dashboard_payment_card.html" %}
|
|
37
|
+
{% endfor %}
|
|
38
|
+
{% else %}
|
|
39
|
+
<div class="empty-state" style="text-align: center; padding: 3rem; background-color: var(--bg-card); border: 1px dashed var(--text-muted); border-radius: var(--border-radius);">
|
|
40
|
+
<h3>No payments yet</h3>
|
|
41
|
+
<p style="color: var(--text-muted);">Create a payment via your application to see it here.</p>
|
|
42
|
+
</div>
|
|
43
|
+
{% endif %}
|
|
44
|
+
</div>
|
|
45
|
+
{% endblock %}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-getpaid-simulator
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: Payment gateway simulator for testing the python-getpaid ecosystem.
|
|
5
|
+
Project-URL: Homepage, https://github.com/django-getpaid/python-getpaid-simulator
|
|
6
|
+
Project-URL: Repository, https://github.com/django-getpaid/python-getpaid-simulator
|
|
7
|
+
Project-URL: Documentation, https://python-getpaid-simulator.readthedocs.io
|
|
8
|
+
Project-URL: Changelog, https://github.com/django-getpaid/python-getpaid-simulator/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: jinja2>=3.0
|
|
23
|
+
Requires-Dist: litestar>=2.0
|
|
24
|
+
Requires-Dist: uvicorn[standard]>=0.30.0
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# python-getpaid-simulator
|
|
28
|
+
|
|
29
|
+
Payment gateway simulator host for testing the python-getpaid ecosystem.
|
|
30
|
+
|
|
31
|
+
The simulator no longer owns provider implementations directly. It starts a
|
|
32
|
+
generic Litestar host, discovers provider plugins from installed packages, and
|
|
33
|
+
mounts each provider's API routes and UI flows through entry points.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install python-getpaid-simulator
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The host only becomes useful when at least one provider package exposing the
|
|
42
|
+
simulator plugin entry point is installed in the same environment.
|
|
43
|
+
|
|
44
|
+
## Plugin Model
|
|
45
|
+
|
|
46
|
+
Provider packages must expose an entry point in the
|
|
47
|
+
`getpaid.simulator.providers` group.
|
|
48
|
+
|
|
49
|
+
Example from a provider package:
|
|
50
|
+
|
|
51
|
+
```toml
|
|
52
|
+
[project.entry-points."getpaid.simulator.providers"]
|
|
53
|
+
payu = "getpaid_payu.simulator:get_plugin"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The entry point must resolve to a factory returning a
|
|
57
|
+
`getpaid_simulator.spi.SimulatorProviderPlugin`.
|
|
58
|
+
|
|
59
|
+
The current stable plugin contract requires:
|
|
60
|
+
|
|
61
|
+
- `api_version`
|
|
62
|
+
- `slug`
|
|
63
|
+
- `display_name`
|
|
64
|
+
- `api_handlers`
|
|
65
|
+
- `ui_handlers`
|
|
66
|
+
- `transitions`
|
|
67
|
+
- `load_config(env)`
|
|
68
|
+
- optional `authorize_path_template`
|
|
69
|
+
|
|
70
|
+
The host validates the plugin slug against the entry point name and rejects
|
|
71
|
+
plugins that do not match `getpaid_simulator.spi.SIMULATOR_PLUGIN_API_VERSION`.
|
|
72
|
+
|
|
73
|
+
## Startup Failure Modes
|
|
74
|
+
|
|
75
|
+
Plugin loading is controlled by `SIMULATOR_PLUGIN_FAILURE_MODE` or the CLI flag
|
|
76
|
+
`--plugin-failure-mode`.
|
|
77
|
+
|
|
78
|
+
- `warn` (default): broken plugins are skipped, the simulator starts in
|
|
79
|
+
degraded mode, and failed providers appear in logs, `/`, `/sim/status`, and
|
|
80
|
+
the dashboard.
|
|
81
|
+
- `strict`: the first plugin import, factory, compatibility, or config failure
|
|
82
|
+
aborts startup with `PluginLoadError`.
|
|
83
|
+
|
|
84
|
+
Examples:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
getpaid-simulator --plugin-failure-mode strict
|
|
88
|
+
SIMULATOR_PLUGIN_FAILURE_MODE=warn getpaid-simulator
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Provider Packaging
|
|
92
|
+
|
|
93
|
+
Provider packages should keep simulator support in an optional dependency group
|
|
94
|
+
such as `simulator`, rather than forcing simulator host and Litestar
|
|
95
|
+
dependencies into normal runtime installs.
|
|
96
|
+
|
|
97
|
+
Example:
|
|
98
|
+
|
|
99
|
+
```toml
|
|
100
|
+
[project.optional-dependencies]
|
|
101
|
+
simulator = [
|
|
102
|
+
"python-getpaid-simulator>=3.0.0",
|
|
103
|
+
"litestar>=2.0",
|
|
104
|
+
]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Development Notes
|
|
108
|
+
|
|
109
|
+
- Wave 1 storage remains in-memory behind the host storage interface.
|
|
110
|
+
- Provider-local simulator code lives in provider repositories, not under
|
|
111
|
+
`getpaid_simulator.providers`.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
getpaid_simulator/__init__.py,sha256=-5iOqjjuKesGNRhqgIx2uYkSvuzeMjnnvHlH9pz3Ccg,97
|
|
2
|
+
getpaid_simulator/__main__.py,sha256=smgjFzHIOTj9Q_L3OyT9GphTWpi9VoiB8ywCmvf19Lw,3359
|
|
3
|
+
getpaid_simulator/app.py,sha256=FJhEXxv3gaJp_t31LiIfK7DuiukwnsPUMLMFtAl68IA,4411
|
|
4
|
+
getpaid_simulator/plugins.py,sha256=68fc_QWvNWelf-zqOAy3plKZkR9jPF_UGbGFdBITbVM,6496
|
|
5
|
+
getpaid_simulator/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
getpaid_simulator/spi.py,sha256=QQ7qgOdqIJOhInV7XiQQP5p1QDusOGoIv6erOlEuW_w,947
|
|
7
|
+
getpaid_simulator/core/__init__.py,sha256=taAfqQWD3Isj57iqCQmLK7hfixH4kkkIehPYzu6sF0c,33
|
|
8
|
+
getpaid_simulator/core/config.py,sha256=ZpQ3JYAtmQoogzo-jdfWKIVYa4vSRGXd62k6Q751XbY,1747
|
|
9
|
+
getpaid_simulator/core/discovery.py,sha256=nwANWI7kg4P7GhLkOOF2mYDVU7RzFpCp6hKYuiw6mXI,362
|
|
10
|
+
getpaid_simulator/core/state.py,sha256=TBKzZtwms2JMPMX_Z45Y5ADkQ9MjygbFXeFStI929V8,1883
|
|
11
|
+
getpaid_simulator/core/storage.py,sha256=0AWUiWTxVp9zQo-7OqO_f8_Z5aJI1B8zfeNh6jv6yI8,5316
|
|
12
|
+
getpaid_simulator/core/webhooks.py,sha256=1L7vf6m3MxjVesYOfqE81pOy6MiawuqO9kXGSMG0WM8,1788
|
|
13
|
+
getpaid_simulator/ui/__init__.py,sha256=sRAPeVu_KYQc0_xMEtjUMQ_w6pFdsLClDciZBcnAO3k,21
|
|
14
|
+
getpaid_simulator/ui/routes.py,sha256=gg9EcrIb214YahjwwO-Uel-ThN-KSabnWa7Uh4YcSZY,3232
|
|
15
|
+
getpaid_simulator/ui/static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
getpaid_simulator/ui/static/style.css,sha256=A_iej863-UTkiMxoGjbLUzZHX1j-yEv4689BGvnyTRw,5157
|
|
17
|
+
getpaid_simulator/ui/templates/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
getpaid_simulator/ui/templates/authorize.html,sha256=5jI0EbmS7CmYQOmWcxGsUO8qxpQ0h0MyWcNKmER5Uz0,770
|
|
19
|
+
getpaid_simulator/ui/templates/base.html,sha256=ENmY74iTSys-nqKWoUNYOZiejDjb2RaAsAAINfEEtt8,917
|
|
20
|
+
getpaid_simulator/ui/templates/dashboard.html,sha256=bDLE6gjF9_JCobJPj91QaKmX1-o15rc_lCchnhPuMys,2171
|
|
21
|
+
getpaid_simulator/ui/templates/components/dashboard_payment_card.html,sha256=nBHqdWxIlwdFhdXBwkO5lDdajXqcJdcNhNgAisrsexA,258
|
|
22
|
+
getpaid_simulator/ui/templates/components/payment_card.html,sha256=AqK3ef2SjO2sLeHaW4xwGMedG5edgTqS0WJhtiSQfSw,560
|
|
23
|
+
getpaid_simulator/ui/templates/components/status_badge.html,sha256=fWOEtUrycdG1G3hWoukW3xdByl75C9npRAr0t-vvC08,80
|
|
24
|
+
python_getpaid_simulator-3.0.0.dist-info/METADATA,sha256=aOaYCu2yc8dJu8TDJXTzrv1KB6SqsA1NHoOnpZ1crR8,3511
|
|
25
|
+
python_getpaid_simulator-3.0.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
26
|
+
python_getpaid_simulator-3.0.0.dist-info/entry_points.txt,sha256=EKlga2W7QZ4qoB0SkMzPgceuRoyV8_uh7GIDJ4Qq0Zg,70
|
|
27
|
+
python_getpaid_simulator-3.0.0.dist-info/licenses/LICENSE,sha256=Nds7k4ZmahVulUUqzk6BZ3Lib61U75QHrBzWXqAhjZQ,1072
|
|
28
|
+
python_getpaid_simulator-3.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2022 Dominik Kozaczko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|