Skip to main content

Pretix plugin for tracking and reporting payment provider fees (Mollie, SumUp)

Project description

Pretix Payment Fees Tracker

Version License Python Pretix Multilingual

A Pretix plugin that automatically tracks, synchronizes and reports payment provider fees from Mollie and SumUp, providing comprehensive accounting reports with fee breakdowns.

Supported Languages

๐ŸŒ This plugin is available in 8 languages with 100% translation coverage:

  • ๐Ÿ‡ฌ๐Ÿ‡ง English (Base)
  • ๐Ÿ‡ซ๐Ÿ‡ท Franรงais (French)
  • ๐Ÿ‡ฉ๐Ÿ‡ช Deutsch (German)
  • ๐Ÿ‡ช๐Ÿ‡ธ Espaรฑol (Spanish)
  • ๐Ÿ‡ณ๐Ÿ‡ฑ Nederlands (Dutch)
  • ๐Ÿ‡ฎ๐Ÿ‡น Italiano (Italian)
  • ๐Ÿ‡ต๐Ÿ‡น Portuguรชs (Portuguese)
  • ๐Ÿ‡ต๐Ÿ‡ฑ Polski (Polish)

Features

  • Automatic Fee Synchronization: Automatically fetch and sync payment fees from Mollie and SumUp APIs
  • Comprehensive Reporting: Generate detailed accounting reports including:
    • PDF accounting reports with payment provider fee sections
    • Payment and refund lists with fee columns
    • CSV/Excel exports with complete fee data
  • Multi-Provider Support: Currently supports:
    • Mollie (including OAuth integration)
    • SumUp
  • Real-time Fee Display: View payment fees directly in Pretix order details
  • Bulk Operations: Synchronize fees for multiple events at once
  • Smart Caching: Reduces API calls with intelligent Django caching
  • Diagnostic Tools: Monitor cache status and API errors

Installation

Prerequisites

  • Pretix >= 2024.0.0 fre
  • Python >= 3.11
  • Access to Mollie and/or SumUp APIs

Docker Installation (Recommended)

The plugin should be integrated into the Pretix Docker image:

FROM pretix/standalone:stable

USER root

# System dependencies for WeasyPrint
RUN apt-get update && apt-get install -y \
    libpango-1.0-0 libpangoft2-1.0-0 \
    libharfbuzz0b libffi-dev libjpeg-dev \
    libopenjp2-7-dev libcairo2 libgdk-pixbuf2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Install the plugin
RUN pip3 install pretix-payment-fees

USER pretixuser
RUN cd /pretix/src && make production

Run Migrations

After deployment, execute migrations:

docker exec pretix-dev python -m pretix migrate

Configuration

PSP Configuration (Organizer Level)

  1. Login as administrator
  2. Navigate to Organizer โ†’ PSP Configuration
  3. Configure your API keys:

Mollie Setup

  • API Key: Get from Mollie Dashboard
  • Format: live_... (production) or test_... (sandbox)
  • Test Mode: Check if using test key
  • Enable Mollie: Check to activate integration

SumUp Setup

  • API Key: Create OAuth app on SumUp Developer Portal
  • Request payments scope from SumUp
  • Merchant Code: Your SumUp merchant identifier
  • Test Mode: Check if using sandbox environment
  • Enable SumUp: Check to activate integration

Advanced Options

  • Cache Duration: Default 3600 seconds (1h). Increase for high transaction volumes.

Usage

PSP Synchronization

  1. Go to Organizer โ†’ PSP Synchronization
  2. Select events to synchronize
  3. Choose dry run or full sync
  4. Click Synchronize Fees

Generating Reports

Accounting Report with Fees

  1. Navigate to Event โ†’ Data exports
  2. Select Accounting Report (with banking fees)
  3. Configure date range and options
  4. Export as PDF

Payment List with Fees

  1. Navigate to Event โ†’ Data exports
  2. Select Payments and refunds with banking fees
  3. Export in CSV or Excel format

Export Formats

CSV/Excel Columns

Column Description
Payment Date Payment date and time
Order ID Pretix order code
Payment Method Provider (mollie, sumup, etc.)
Gross Amount Total amount paid
PSP Fees Provider transaction fees
Net Amount Gross - Fees
Currency EUR, USD, etc.
PSP Transaction ID Provider transaction ID
Settlement ID Settlement ID (Mollie only)
Status confirmed, refunded, etc.

Report Sections

  1. Main Table: Transaction list
  2. Global Totals: All payment aggregations
  3. PSP Totals: Aggregation by payment method
  4. Accounting Control: Verification that Gross - Fees = Net

Management Commands

# Sync fees for all events of an organizer
python manage.py sync_psp_fees --organizer=your-org

# Sync specific event
python manage.py sync_psp_fees --organizer=your-org --event=your-event

# Dry run mode
python manage.py sync_psp_fees --organizer=your-org --dry-run

API Integrations

Mollie APIs

  • Balances API: /v2/balances/{id}/transactions
  • Settlements API: /v2/settlements/{id}
  • Payments API: /v2/payments/{id}
  • Mollie Documentation

SumUp APIs

  • Transactions API: /v0.1/me/transactions
  • Transaction History: /v0.1/me/transactions/history
  • SumUp Documentation

Known Limitations

Mollie

  • Fees only available if settlement exists
  • Fallback: 2.1% + 0.25 EUR estimation (standard EU card rate)
  • Historical data limited (from July 2022)

SumUp

  • API may require manual approval for payments scope
  • Fees not always directly provided
  • Fallback: 1.95% + 0.15 EUR estimation

General

  • PSP transaction โ†” Pretix payment matching done by stored ID
  • If ID unavailable, matching by amount/date (may be imprecise)
  • Partial refunds may require manual verification

Diagnostics

Diagnostic page available at Organizer โ†’ PSP Diagnostics:

  • Configuration status
  • Cache statistics (count, by provider, age)
  • Recent errors tracking

Development

Project Structure

pretix_payment_fees/
โ”œโ”€โ”€ __init__.py               # Plugin metadata
โ”œโ”€โ”€ signals.py                # Signal receivers
โ”œโ”€โ”€ models.py                 # PSPConfig, PSPTransactionCache
โ”œโ”€โ”€ forms.py                  # PSP configuration forms
โ”œโ”€โ”€ views.py                  # Configuration views
โ”œโ”€โ”€ admin_views.py            # Diagnostic views
โ”œโ”€โ”€ urls.py                   # Plugin URLs
โ”œโ”€โ”€ services/
โ”‚   โ””โ”€โ”€ psp_sync.py           # Sync orchestration
โ”œโ”€โ”€ psp/
โ”‚   โ”œโ”€โ”€ mollie_client.py      # Mollie API client
โ”‚   โ”œโ”€โ”€ mollie_oauth_client.py # Mollie OAuth
โ”‚   โ””โ”€โ”€ sumup_client.py       # SumUp API client
โ”œโ”€โ”€ exporters/
โ”‚   โ”œโ”€โ”€ accounting_report_psp.py  # PDF accounting report
โ”‚   โ””โ”€โ”€ payment_list_psp.py       # Payment list with fees
โ””โ”€โ”€ templates/
    โ””โ”€โ”€ pretix_payment_fees/
        โ”œโ”€โ”€ settings.html      # PSP config page
        โ”œโ”€โ”€ psp_sync.html      # Sync page
        โ””โ”€โ”€ diagnostic.html    # Diagnostic page

Development & Testing

This plugin is designed to run within a Pretix environment. Testing should be done in a development Pretix instance:

  1. Install in development mode:

    docker exec pretix-dev pip install -e /path/to/pretix-payment-fees
    
  2. Test the plugin:

    • Create test events in your Pretix instance
    • Configure PSP credentials (use test/sandbox keys)
    • Process test payments through Mollie/SumUp
    • Use the sync functionality to fetch fees
    • Verify reports and exports
  3. Code quality (optional):

    # Format code
    black pretix_payment_fees/ --line-length=100
    
    # Sort imports
    isort pretix_payment_fees/ --profile=black
    
    # Check translations
    python manage.py makemessages
    python manage.py compilemessages
    

Note: This plugin requires a full Pretix environment to function. Automated testing via CI/CD is not implemented as the plugin is tightly integrated with Pretix core.

Support

For issues and feature requests:

  1. Check logs: docker logs pretix-dev
  2. Review diagnostic page
  3. Verify API keys are valid
  4. Open a GitHub issue

License

Apache License 2.0

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Changelog

0.9.0 (2025-10-04) - Beta Release

  • Initial public beta release
  • Mollie integration with OAuth2 support (tested in production)
  • SumUp integration (โš ๏ธ not yet tested in production, awaiting real merchant account)
  • Multilingual support (EN, FR, DE, ES, NL, IT, PT, PL)
  • CSV, Excel, PDF exports with fee breakdowns
  • Accounting reports with PSP fees section
  • Smart caching system
  • Diagnostic and monitoring tools

Note: Version 1.0.0 will be released after successful SumUp production testing.

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

pretix_payment_fees-1.1.1.tar.gz (185.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_payment_fees-1.1.1-py3-none-any.whl (232.2 kB view details)

Uploaded Python 3

File details

Details for the file pretix_payment_fees-1.1.1.tar.gz.

File metadata

  • Download URL: pretix_payment_fees-1.1.1.tar.gz
  • Upload date:
  • Size: 185.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pretix_payment_fees-1.1.1.tar.gz
Algorithm Hash digest
SHA256 301f1b8966f1af9ceedd933e2ec3777bc4bb9ede5b856739e1becd686785a7a9
MD5 443fdd28622ba0930a3dd5238f9a75e9
BLAKE2b-256 e34e36ff84d58b09a82cdfab6950e7ceff9ad4bc9cc7a06a9985ba421b646993

See more details on using hashes here.

Provenance

The following attestation bundles were made for pretix_payment_fees-1.1.1.tar.gz:

Publisher: release.yml on valentin-gosselin/pretix-payment-fees

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pretix_payment_fees-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pretix_payment_fees-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd795bba97d866834a73c08dc8a6faee368e4df8651bf059a8a3e6793736c489
MD5 9d343a00f437d2f4c1d2bc092869faff
BLAKE2b-256 58fbc4e83db74ff5d2148ed53049a5f91dbd6d75fcbb3e82f33a1adaaaeb9db4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pretix_payment_fees-1.1.1-py3-none-any.whl:

Publisher: release.yml on valentin-gosselin/pretix-payment-fees

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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