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.2.0.tar.gz (206.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.2.0-py3-none-any.whl (260.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pretix_payment_fees-1.2.0.tar.gz
  • Upload date:
  • Size: 206.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.2.0.tar.gz
Algorithm Hash digest
SHA256 1cb6178325125a9f7b8bf71eae1bae10dcc1e51650b36f9c8c7ff500090382a7
MD5 c280064b5201ca638190c8d6f1eda2a1
BLAKE2b-256 6433c37de287b74c40fbda5b1e7e447625eb2ccd740e20055fd1b11d2dc4a752

See more details on using hashes here.

Provenance

The following attestation bundles were made for pretix_payment_fees-1.2.0.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pretix_payment_fees-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97df23c3e4d8989330f90ac3f03d343900aac307c3589880496fc0cd58ca59c3
MD5 122346ab925c8273128d9dcadffeb594
BLAKE2b-256 9fe69b48f43df0a54d9d05a6c5f7628cdb7eeddf6c1ae772befdbb72bc908b76

See more details on using hashes here.

Provenance

The following attestation bundles were made for pretix_payment_fees-1.2.0-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