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 and is also used to convert partial refunds; full refunds are refunded by PostFinance at the exact remaining transaction amount. 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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pretix_postfinance-1.7.0.tar.gz (71.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pretix_postfinance-1.7.0-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file pretix_postfinance-1.7.0.tar.gz.

File metadata

  • Download URL: pretix_postfinance-1.7.0.tar.gz
  • Upload date:
  • Size: 71.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for pretix_postfinance-1.7.0.tar.gz
Algorithm Hash digest
SHA256 980f7a8d44d83342346dd2ba2631e4bc3125fd5b0b77635700724575f403bc58
MD5 662e86a1c56dba04beb7d5f57a453816
BLAKE2b-256 9ba6ac333dbe6cb60fffc79d763b0d0b5bb12f2d011a5b5c21ba4a649d280cd5

See more details on using hashes here.

File details

Details for the file pretix_postfinance-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: pretix_postfinance-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 56.1 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for pretix_postfinance-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80f07ff728f16592bd57b379b52adbe5c525466c9089ef59dc2ac6ae4aae0ac7
MD5 9371b56fb0d1f942d34bcb21b07b5b43
BLAKE2b-256 d09b60e65882efc69ef9c5869f69124d2b5cc32da938e0a0de1fd99bd5c3d8be

See more details on using hashes here.

Release history Release notifications | RSS feed

1.7.3

2 files

1.7.2

2 files

1.7.1

2 files

This release

1.7.0 This release

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page