Framework-agnostic payment processing core.
Project description
python-getpaid-core
Framework-agnostic payment processing core.
python-getpaid-core is the foundation of the Getpaid ecosystem. It provides the abstract interfaces, semantic payment update engine, and plugin registry needed to build a robust payment system without coupling your logic to a specific web framework or payment provider.
Installation
pip install python-getpaid-core
Quick Start: Creating a Custom Processor
To implement a new payment backend, subclass BaseProcessor and implement at least prepare_transaction.
from getpaid_core import BaseProcessor
from getpaid_core.types import TransactionResult
class MyPaymentProcessor(BaseProcessor):
slug = "my-provider"
display_name = "My Payment Provider"
accepted_currencies = ["USD", "EUR"]
async def prepare_transaction(self, **kwargs) -> TransactionResult:
# Generate payment link or form data
return TransactionResult(
redirect_url=f"https://api.provider.com/pay/{self.payment.id}",
method="GET"
)
Registering your Processor
Register your processor using entry points in your pyproject.toml so it can be discovered by the registry:
[project.entry-points."getpaid.backends"]
my-provider = "my_package.processors:MyPaymentProcessor"
Architecture Overview
- BaseProcessor: The abstract base class that all payment gateway plugins must implement. It provides the standard interface for transaction preparation, callback handling, charging, and refunds.
- PaymentFlow: Manages the payment lifecycle using semantic payment update objects. It ensures that payments move between states (e.g.,
NEW->PREPARED->PAID) according to strict business rules. - PluginRegistry: A central service for discovering and managing payment processors registered via
getpaid.backendsentry points. - State Engine: Applies semantic payment and fraud events to payment objects, merges provider metadata, and tracks idempotent provider event IDs.
API Summary
| Class / Module | Role |
|---|---|
BaseProcessor |
Abstract base for implementing payment gateways. |
PaymentFlow |
Semantic orchestration for payment lifecycles. |
PaymentStatus |
Enum for all possible payment states (NEW, PAID, FAILED, etc.). |
registry |
Singleton registry for backend discovery. |
TransactionResult |
Standard response for transaction initiation. |
GetPaidException |
Base exception for all payment-related errors. |
Ecosystem
getpaid-core is the heart of a larger ecosystem designed to make payment processing easy in any Python web application.
Framework Wrappers
- django-getpaid — Official Django integration.
- litestar-getpaid — Official Litestar integration.
- fastapi-getpaid — Official FastAPI integration.
Processor Plugins
- python-getpaid-payu — PayU backend.
- python-getpaid-paynow — Paynow backend.
- python-getpaid-bitpay — BitPay backend.
- python-getpaid-przelewy24 — Przelewy24 backend.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_getpaid_core-3.0.0a4.tar.gz.
File metadata
- Download URL: python_getpaid_core-3.0.0a4.tar.gz
- Upload date:
- Size: 53.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7784ce418391efe3ec1b6c7fddbfe4d8e1741991a9d0ca3a00ada7807ecb8230
|
|
| MD5 |
f4000b056c75e562c16b97190f6430bc
|
|
| BLAKE2b-256 |
5c22c7a3d249398b609022179299f1cde51207db8e4e9556d4cfe7112f276422
|
File details
Details for the file python_getpaid_core-3.0.0a4-py3-none-any.whl.
File metadata
- Download URL: python_getpaid_core-3.0.0a4-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
322afe2a3a777958c1956d1c6ce576f42c93c0cf6ecd1a260bae189a9fa6a97f
|
|
| MD5 |
32ee1a1f772042ff1f7e0bc6455700e7
|
|
| BLAKE2b-256 |
9e42e52551b13b91474e02bcda4517adc2ea21bbb4920f7daae292a5ef795279
|