Skip to main content

Payment gateway simulator for testing the python-getpaid ecosystem.

Project description

python-getpaid-simulator

Payment gateway simulator host for testing the python-getpaid ecosystem.

The simulator no longer owns provider implementations directly. It starts a generic Litestar host, discovers provider plugins from installed packages, and mounts each provider's API routes and UI flows through entry points.

Installation

pip install python-getpaid-simulator

The host only becomes useful when at least one provider package exposing the simulator plugin entry point is installed in the same environment.

Plugin Model

Provider packages must expose an entry point in the getpaid.simulator.providers group.

Example from a provider package:

[project.entry-points."getpaid.simulator.providers"]
payu = "getpaid_payu.simulator:get_plugin"

The entry point must resolve to a factory returning a getpaid_simulator.spi.SimulatorProviderPlugin.

The current stable plugin contract requires:

  • api_version
  • slug
  • display_name
  • api_handlers
  • ui_handlers
  • transitions
  • load_config(env)
  • optional authorize_path_template

The host validates the plugin slug against the entry point name and rejects plugins that do not match getpaid_simulator.spi.SIMULATOR_PLUGIN_API_VERSION.

Startup Failure Modes

Plugin loading is controlled by SIMULATOR_PLUGIN_FAILURE_MODE or the CLI flag --plugin-failure-mode.

  • warn (default): broken plugins are skipped, the simulator starts in degraded mode, and failed providers appear in logs, /, /sim/status, and the dashboard.
  • strict: the first plugin import, factory, compatibility, or config failure aborts startup with PluginLoadError.

Examples:

getpaid-simulator --plugin-failure-mode strict
SIMULATOR_PLUGIN_FAILURE_MODE=warn getpaid-simulator

Provider Packaging

Provider packages should keep simulator support in an optional dependency group such as simulator, rather than forcing simulator host and Litestar dependencies into normal runtime installs.

Example:

[project.optional-dependencies]
simulator = [
    "python-getpaid-simulator>=3.0.0",
    "litestar>=2.0",
]

Development Notes

  • Wave 1 storage remains in-memory behind the host storage interface.
  • Provider-local simulator code lives in provider repositories, not under getpaid_simulator.providers.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_getpaid_simulator-3.2.0.tar.gz (130.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_getpaid_simulator-3.2.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file python_getpaid_simulator-3.2.0.tar.gz.

File metadata

  • Download URL: python_getpaid_simulator-3.2.0.tar.gz
  • Upload date:
  • Size: 130.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for python_getpaid_simulator-3.2.0.tar.gz
Algorithm Hash digest
SHA256 43a055f9511a62138fa4ca3dcfc37b56573a79cc8495195524c02cffddd1ece1
MD5 e05228a6c474a8fafdfb70e8b81d7cfc
BLAKE2b-256 a7fbd85e0127a6853f0524b0a8922d645ee50e5fd820052041a0e0e5c0130818

See more details on using hashes here.

File details

Details for the file python_getpaid_simulator-3.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_getpaid_simulator-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b265a367f1e4ed35fd7774199718f8142dd479cca1197cf3fbd0fcd06a8d5061
MD5 215f8b43bd554a27681ba78ab78ba1fc
BLAKE2b-256 764b2ff337df459b1fadda7fe511f79c24abe04992791987da9b8fc9cf526064

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page