Skip to main content

Framework-agnostic payment processing core.

Project description

getpaid-core

PyPI Python Version License

Framework-agnostic payment processing library for Python. Provides the core abstractions — enums, protocols, FSM, processor base class, plugin registry, and exception hierarchy — that framework-specific adapters build on.

Architecture

getpaid-core defines the what of payment processing without coupling to any web framework:

  • Enums (PaymentStatus, FraudStatus, BackendMethod, ConfirmationMethod) define all valid states and methods.
  • Protocols (Payment, Order, PaymentRepository) define structural contracts that framework models must satisfy.
  • FSM (create_payment_machine, create_fraud_machine) attaches state-machine triggers to payment objects at runtime using the transitions library.
  • BaseProcessor is an abstract class that payment gateway plugins subclass to implement prepare_transaction, handle_callback, charge, etc.
  • PluginRegistry discovers and stores payment backend processors via entry points or manual registration.
  • Exceptions provide a structured hierarchy for payment errors.

Framework Adapters

  • django-getpaid — Django adapter (models, views, forms, admin)
  • fastapi-getpaid — FastAPI adapter (async routes, SQLAlchemy, Pydantic config)
  • litestar-getpaid — Litestar adapter (controllers, Provide DI, SQLAlchemy, Pydantic config)

Installation

pip install python-getpaid-core

You typically install this as a dependency of a framework adapter rather than directly.

Quick Example

from getpaid_core.enums import PaymentStatus
from getpaid_core.fsm import create_payment_machine

# Any object satisfying the Payment protocol works
payment = MyPayment(status=PaymentStatus.NEW, amount_required=100)
machine = create_payment_machine(payment)

# FSM trigger methods are attached directly to the object
payment.confirm_prepared()
assert payment.status == PaymentStatus.PREPARED

Requirements

  • Python 3.12+
  • transitions
  • httpx
  • anyio

License

MIT

Disclaimer

This project has nothing in common with the getpaid plone project.

Credits

Created by Dominik Kozaczko.

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_core-0.1.1.tar.gz (92.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_core-0.1.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file python_getpaid_core-0.1.1.tar.gz.

File metadata

  • Download URL: python_getpaid_core-0.1.1.tar.gz
  • Upload date:
  • Size: 92.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for python_getpaid_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5d9a205215555e99408ee7e41f3ba874d0bc170225acc849b73a44f58fbe7334
MD5 46f8e117cc275aa788d550b3be1c43fd
BLAKE2b-256 0629afa39ea38c845f9a2c8dcd822dfeb3f25119e93548d97a9a79c6ee842789

See more details on using hashes here.

File details

Details for the file python_getpaid_core-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: python_getpaid_core-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for python_getpaid_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a56b684e540dd1a6b86b88c985ceb707b033017d2d096ad38d29f44ce3c5349
MD5 39ca3fc5ead062fc2c19b86a1e8dbe11
BLAKE2b-256 76fb9bfd58567e15c9a9ce54669a2b71dbd1d497eb180411edd731ce00e7985d

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