python-getpaid-simulator 3.0.0a3__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 +130 -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/spi.py +31 -0
- getpaid_simulator/ui/__init__.py +1 -0
- getpaid_simulator/ui/routes.py +68 -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.0a3.dist-info/METADATA +112 -0
- python_getpaid_simulator-3.0.0a3.dist-info/RECORD +26 -0
- python_getpaid_simulator-3.0.0a3.dist-info/WHEEL +4 -0
- python_getpaid_simulator-3.0.0a3.dist-info/entry_points.txt +2 -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,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-getpaid-simulator
|
|
3
|
+
Version: 3.0.0a3
|
|
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
|
+
Author-email: Dominik Kozaczko <dominik@kozaczko.info>
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
15
|
+
Classifier: Topic :: Office/Business :: Financial :: Point-Of-Sale
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Requires-Dist: httpx>=0.27.0
|
|
19
|
+
Requires-Dist: jinja2>=3.0
|
|
20
|
+
Requires-Dist: litestar>=2.0
|
|
21
|
+
Requires-Dist: uvicorn[standard]>=0.30.0
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# python-getpaid-simulator
|
|
25
|
+
|
|
26
|
+
Payment gateway simulator host for testing the python-getpaid ecosystem.
|
|
27
|
+
|
|
28
|
+
The simulator no longer owns provider implementations directly. It starts a
|
|
29
|
+
generic Litestar host, discovers provider plugins from installed packages, and
|
|
30
|
+
mounts each provider's API routes and UI flows through entry points.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install python-getpaid-simulator
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The host only becomes useful when at least one provider package exposing the
|
|
39
|
+
simulator plugin entry point is installed in the same environment.
|
|
40
|
+
|
|
41
|
+
## Plugin Model
|
|
42
|
+
|
|
43
|
+
Provider packages must expose an entry point in the
|
|
44
|
+
`getpaid.simulator.providers` group.
|
|
45
|
+
|
|
46
|
+
Example from a provider package:
|
|
47
|
+
|
|
48
|
+
```toml
|
|
49
|
+
[project.entry-points."getpaid.simulator.providers"]
|
|
50
|
+
payu = "getpaid_payu.simulator:get_plugin"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The entry point must resolve to a factory returning a
|
|
54
|
+
`getpaid_simulator.spi.SimulatorProviderPlugin`.
|
|
55
|
+
|
|
56
|
+
The current stable plugin contract requires:
|
|
57
|
+
|
|
58
|
+
- `api_version`
|
|
59
|
+
- `slug`
|
|
60
|
+
- `display_name`
|
|
61
|
+
- `api_handlers`
|
|
62
|
+
- `ui_handlers`
|
|
63
|
+
- `transitions`
|
|
64
|
+
- `load_config(env)`
|
|
65
|
+
- optional `authorize_path_template`
|
|
66
|
+
|
|
67
|
+
The host validates the plugin slug against the entry point name and rejects
|
|
68
|
+
plugins that do not match `getpaid_simulator.spi.SIMULATOR_PLUGIN_API_VERSION`.
|
|
69
|
+
|
|
70
|
+
## Startup Failure Modes
|
|
71
|
+
|
|
72
|
+
Plugin loading is controlled by `SIMULATOR_PLUGIN_FAILURE_MODE` or the CLI flag
|
|
73
|
+
`--plugin-failure-mode`.
|
|
74
|
+
|
|
75
|
+
- `warn` (default): broken plugins are skipped, the simulator starts in
|
|
76
|
+
degraded mode, and failed providers appear in logs, `/`, `/sim/status`, and
|
|
77
|
+
the dashboard.
|
|
78
|
+
- `strict`: the first plugin import, factory, compatibility, or config failure
|
|
79
|
+
aborts startup with `PluginLoadError`.
|
|
80
|
+
|
|
81
|
+
Examples:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
getpaid-simulator --plugin-failure-mode strict
|
|
85
|
+
SIMULATOR_PLUGIN_FAILURE_MODE=warn getpaid-simulator
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Provider Packaging
|
|
89
|
+
|
|
90
|
+
Provider packages should keep simulator support in an optional dependency group
|
|
91
|
+
such as `simulator`, rather than forcing simulator host and Litestar
|
|
92
|
+
dependencies into normal runtime installs.
|
|
93
|
+
|
|
94
|
+
Example:
|
|
95
|
+
|
|
96
|
+
```toml
|
|
97
|
+
[project.optional-dependencies]
|
|
98
|
+
simulator = [
|
|
99
|
+
"python-getpaid-simulator>=3.0.0a3",
|
|
100
|
+
"litestar>=2.0",
|
|
101
|
+
]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Development Notes
|
|
105
|
+
|
|
106
|
+
- Wave 1 storage remains in-memory behind the host storage interface.
|
|
107
|
+
- Provider-local simulator code lives in provider repositories, not under
|
|
108
|
+
`getpaid_simulator.providers`.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
getpaid_simulator/__init__.py,sha256=6bBWm3oGxThDXXtVoT8gTaG5JqMnBamOEFq0OI0opRo,99
|
|
2
|
+
getpaid_simulator/__main__.py,sha256=smgjFzHIOTj9Q_L3OyT9GphTWpi9VoiB8ywCmvf19Lw,3359
|
|
3
|
+
getpaid_simulator/app.py,sha256=O4O1m0S3-uX2bdiZV8IajLQX7DJWo0No7cVH30avskQ,4200
|
|
4
|
+
getpaid_simulator/plugins.py,sha256=68fc_QWvNWelf-zqOAy3plKZkR9jPF_UGbGFdBITbVM,6496
|
|
5
|
+
getpaid_simulator/spi.py,sha256=QQ7qgOdqIJOhInV7XiQQP5p1QDusOGoIv6erOlEuW_w,947
|
|
6
|
+
getpaid_simulator/core/__init__.py,sha256=taAfqQWD3Isj57iqCQmLK7hfixH4kkkIehPYzu6sF0c,33
|
|
7
|
+
getpaid_simulator/core/config.py,sha256=ZpQ3JYAtmQoogzo-jdfWKIVYa4vSRGXd62k6Q751XbY,1747
|
|
8
|
+
getpaid_simulator/core/discovery.py,sha256=nwANWI7kg4P7GhLkOOF2mYDVU7RzFpCp6hKYuiw6mXI,362
|
|
9
|
+
getpaid_simulator/core/state.py,sha256=TBKzZtwms2JMPMX_Z45Y5ADkQ9MjygbFXeFStI929V8,1883
|
|
10
|
+
getpaid_simulator/core/storage.py,sha256=0AWUiWTxVp9zQo-7OqO_f8_Z5aJI1B8zfeNh6jv6yI8,5316
|
|
11
|
+
getpaid_simulator/core/webhooks.py,sha256=1L7vf6m3MxjVesYOfqE81pOy6MiawuqO9kXGSMG0WM8,1788
|
|
12
|
+
getpaid_simulator/ui/__init__.py,sha256=sRAPeVu_KYQc0_xMEtjUMQ_w6pFdsLClDciZBcnAO3k,21
|
|
13
|
+
getpaid_simulator/ui/routes.py,sha256=mOTuXmGWR0q3y5AD0y_FaUgyCy1WSIEXTx6OcAl5FWo,2305
|
|
14
|
+
getpaid_simulator/ui/static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
getpaid_simulator/ui/static/style.css,sha256=A_iej863-UTkiMxoGjbLUzZHX1j-yEv4689BGvnyTRw,5157
|
|
16
|
+
getpaid_simulator/ui/templates/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
getpaid_simulator/ui/templates/authorize.html,sha256=5jI0EbmS7CmYQOmWcxGsUO8qxpQ0h0MyWcNKmER5Uz0,770
|
|
18
|
+
getpaid_simulator/ui/templates/base.html,sha256=ENmY74iTSys-nqKWoUNYOZiejDjb2RaAsAAINfEEtt8,917
|
|
19
|
+
getpaid_simulator/ui/templates/dashboard.html,sha256=bDLE6gjF9_JCobJPj91QaKmX1-o15rc_lCchnhPuMys,2171
|
|
20
|
+
getpaid_simulator/ui/templates/components/dashboard_payment_card.html,sha256=nBHqdWxIlwdFhdXBwkO5lDdajXqcJdcNhNgAisrsexA,258
|
|
21
|
+
getpaid_simulator/ui/templates/components/payment_card.html,sha256=AqK3ef2SjO2sLeHaW4xwGMedG5edgTqS0WJhtiSQfSw,560
|
|
22
|
+
getpaid_simulator/ui/templates/components/status_badge.html,sha256=fWOEtUrycdG1G3hWoukW3xdByl75C9npRAr0t-vvC08,80
|
|
23
|
+
python_getpaid_simulator-3.0.0a3.dist-info/METADATA,sha256=jNzDkxAz00yars_IfjYbjhWO6SPQO4Wvvz7aZtPnKus,3313
|
|
24
|
+
python_getpaid_simulator-3.0.0a3.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
25
|
+
python_getpaid_simulator-3.0.0a3.dist-info/entry_points.txt,sha256=EKlga2W7QZ4qoB0SkMzPgceuRoyV8_uh7GIDJ4Qq0Zg,70
|
|
26
|
+
python_getpaid_simulator-3.0.0a3.dist-info/RECORD,,
|