Skip to main content

pretix-postfinance

PostFinance Checkout payment plugin for pretix.

Installation

PyPI

pip install pretix-postfinance

NixOS

For NixOS users, the plugin can be installed using the flake:

{ inputs, pkgs, ... }:
{
  services.pretix = {
    enable = true;
    plugins = [
      inputs.pretix-postfinance.packages.${pkgs.stdenv.hostPlatform.system}.default
    ];
  };
}

Development

Setup with uv

# Create virtual environment
uv venv

# Install with development dependencies
uv pip install -e ".[dev]"

Setup with Nix

# Enter development shell
nix develop

# Or use direnv
direnv allow

Running checks

# Run linting
uv run ruff check .

# Run type checking
uv run ty check pretix_postfinance/

# Run tests with coverage
uv run pytest tests/ --cov=pretix_postfinance --cov-report=term-missing -v

Configuration

Configure the plugin in your pretix settings with:

  • Space ID: Your PostFinance Checkout space ID
  • User ID: API user ID
  • API Secret: API authentication secret
  • Environment: production or sandbox

Features

  • Payment processing via PostFinance Checkout
  • Full and partial refund support
  • Webhook handling for payment and refund notifications
  • Test mode support, including an opt-in option to offer the production space alongside the test space while in test mode, so it can be verified end-to-end before going live
  • Optional alternative payment currency: customers can choose to be charged in a different currency (e.g. CHF on a EUR event) at a configured exchange rate (see below)

Testing the production space

Switching on Offer the production space in test mode in the payment settings makes checkout offer two PostFinance options while the event is in test mode:

  • PostFinance (test space) — uses the test credentials, no real money
  • PostFinance (production space) — uses the live credentials

The option is off by default and requires test credentials. Because it lives in the payment settings, only the people who can reach those settings can expose the production space to buyers in test mode. Leave it off unless you are actively running that verification, and switch it back off afterwards.

[!WARNING] Payments through the production space option are real charges, even though the order is a test mode order. Refund or void them in your PostFinance dashboard before you disable test mode: pretix offers to delete all test mode orders at that point, and deleting the order does not undo the charge — it only removes your record of it.

Set up webhooks for both spaces (there is a separate "Setup webhooks" button next to each set of credentials), otherwise payments in the space without a webhook are never confirmed automatically.

Charging in an alternative currency

Events priced in one currency (e.g. EUR) can offer customers the option to be charged in another (e.g. CHF for Swiss customers). pretix itself keeps all accounting (orders, invoices, refunds) in the event currency; only the charge sent to PostFinance is converted.

To use it, set the alternative payment currency and the exchange rate (how much of that currency is charged per 1 unit of the event currency) in the provider settings. Include a small margin in the rate to cover exchange rate fluctuations.

Customers then see a "Pay in CHF" checkbox with the converted amount when they select PostFinance during checkout. The rate in effect when a payment is started is stored on the payment, together with the amount actually charged. Partial refunds are converted with that stored rate; a refund of the payment's full remaining amount returns what is left of the stored charge instead, so conversion rounding never leaves a cent behind or overshoots the transaction. The charged amount and rate are shown to the customer during checkout and to organizers in the order's payment details.

License

GNU Affero General Public License v3.0 (AGPLv3)

Metadata

Release files for pretix-postfinance 1.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pretix-postfinance 1.7.3
File Size Uploaded Provenance
pretix_postfinance-1.7.3.tar.gz 72.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pretix-postfinance 1.7.3
File Interpreter ABI Platform
pretix_postfinance-1.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 130.1 kB

Release files / pretix_postfinance-1.7.3.tar.gz

Download URL pretix_postfinance-1.7.3.tar.gz
Size 72.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d8be31caf3001ba1bbd12b601244adfe57a1221e3986a4af55b4353bd8786a5b
BLAKE2b-256 checksum
How to use checksums
5b442d00a5b758453c8c53226c5f623dad393bf27e127202031a2ee4d7f0b3f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pretix_postfinance-1.7.3-py3-none-any.whl

Download URL pretix_postfinance-1.7.3-py3-none-any.whl
Size 57.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58d544a74edd2b9b70afd3c5efe3ac1d80742e4a2cc4df0bfea1fdf1a101c45b
BLAKE2b-256 checksum
How to use checksums
000bfe0e1760a45396ab07a60721eb72c9ed7a8d2e6e0d5c24504f12ab4d655b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pretix-postfinance 1.7.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page