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.1.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.1.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_getpaid_simulator-3.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 c6492e11e7456ad7a6b2997901a39a2c0852b131fb59d48c8093448dcc9f44a0
MD5 7ceec4d07ea7459b060eb4531ff3199c
BLAKE2b-256 558cb1a2310a451693ecae4678db2af511ec06190073a36c35e9fc5179194672

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_getpaid_simulator-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac93aa2db711672d47f56750570114004e746528a97a8330d0fbdcc3cdebdb93
MD5 539192d13997cf20e6b0ef77b7599101
BLAKE2b-256 1eef8dbb3fe274aa876292dcc5f055496a91709541c3e9e14fe237989f5cb058

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