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.0.0.tar.gz (41.5 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.0.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_getpaid_simulator-3.0.0.tar.gz
  • Upload date:
  • Size: 41.5 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.0.0.tar.gz
Algorithm Hash digest
SHA256 6b0027ea90883a33cde19788ea697fee4a0f6ac761ac27946436c5343de79f8e
MD5 35658f9c253e58a713a305b7580010f9
BLAKE2b-256 031369bb0b2d01fa2d0cfa741e2b014fca300579778f021a7abd100d3727616a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_getpaid_simulator-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aeabdf3c3a0a9abbab2aea0362113fe70e05c5da2a84640a0d4b3f4977dba2a2
MD5 131e1db25dcfac278152af516dd35343
BLAKE2b-256 2e0c9cdd4b3827fbd81413d1ecc76b3e9d1c2db4fcbbe85ba82e74c89581de72

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