Skip to main content

django-payments-saferpay

PyPI - Version PyPI - Python Version

A Django Payments plugin that integrates Saferpay payment provider with Django Payments.

Features

  • Easy integration with Django Payments framework
  • Support for Saferpay payment processing
  • Sandbox mode for testing
  • Simple configuration

Installation

pip install django-payments-saferpay

Configuration

Basic Setup

Add the Saferpay payment variant to your Django settings:

PAYMENT_VARIANTS = {
    "saferpay": (
        "django_payments_saferpay.provider.SaferpayProvider",
        {
            "customer_id": "your-customer-id",
            "terminal_id": "your-terminal-id",
            "username": "your-username",
            "password": "your-password",
            "sandbox": True,  # Set to True for testing, False for production
        }
    )
}

Configuration Options

Option Description Required
customer_id Your Saferpay customer ID Yes
terminal_id Your terminal ID from Saferpay Yes
username The username for Saferpay API authentication Yes
password The password for Saferpay API authentication Yes
sandbox Boolean flag to enable or disable sandbox mode (default: True) No

Environment Variables

For security, it's recommended to store sensitive data in environment variables:

import os

PAYMENT_VARIANTS = {
    "saferpay": (
        "django_payments_saferpay.provider.SaferpayProvider",
        {
            "customer_id": os.environ.get("SAFERPAY_CUSTOMER_ID"),
            "terminal_id": os.environ.get("SAFERPAY_TERMINAL_ID"),
            "username": os.environ.get("SAFERPAY_API_USERNAME"),
            "password": os.environ.get("SAFERPAY_API_PASSWORD"),
            "sandbox": True,
        }
    )
}

Sandbox Testing Environment

The project includes a sandbox application that demonstrates a simple implementation of Django Payments with the SaferPay payment variant. You can use it to:

  • See a complete working implementation example
  • Test your SaferPay credentials
  • Experiment with different payment flows

Setting Up the Sandbox

  1. Navigate to the sandbox directory:

    cd sandbox
    
  2. Create an environment file (.envrc) with your Saferpay credentials:

    export PAYMENT_HOST=localhost:8000
    export SAFERPAY_CUSTOMER_ID=your-customer-id
    export SAFERPAY_TERMINAL_ID=your-terminal-id
    export SAFERPAY_API_PASSWORD=your-password
    export SAFERPAY_API_USERNAME=API_username_here
    
  3. Load the environment variables:

    source .envrc
    

    (Or if you have direnv installed, it will load automatically)

  4. Set up and run the sandbox server:

    uv venv                          # Create virtual environment
    source .venv/bin/activate        # Activate virtual environment
    uv pip install ..                # Install the package
    python manage.py migrate         # Set up the database
    python manage.py runserver       # Start the server
    
  5. Open your browser and navigate to:

    http://localhost:8000/create-payment/
    

Documentation

For more detailed information, refer to:

Contributing

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

License

django-payments-saferpay is distributed under the terms of the BSD 3-Clause license.

Metadata

Release files for django-payments-saferpay 0.0.4

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

Source distribution (sdist)

Source distribution for django-payments-saferpay 0.0.4
File Size Uploaded Provenance Actions
django_payments_saferpay-0.0.4.tar.gz 38.6 kB With provenance Details for django_payments_saferpay-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-payments-saferpay 0.0.4
File Interpreter ABI Platform Actions
django_payments_saferpay-0.0.4-py3-none-any.whl Python 3 none any Details for django_payments_saferpay-0.0.4-py3-none-any.whl

Total release size: 49.1 kB

Release files / django_payments_saferpay-0.0.4.tar.gz

Download URL django_payments_saferpay-0.0.4.tar.gz
Size 38.6 kB
Tags Source
SHA-256 checksum
How to use checksums
40a83544a8f2f90f8f0b7467c6221b78c7f2cfa21da7182aa5b7abb68213f407
BLAKE2b-256 checksum
How to use checksums
a94c5c33a9d4b6634f5acf6275c77382f32d840ef633beed306b5acfe775a870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 1, 2025.

Transparency log

Release files / django_payments_saferpay-0.0.4-py3-none-any.whl

Download URL django_payments_saferpay-0.0.4-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83c4ecc6995239d56ffe7834d6f82aa536ee6d201f2c9f139c4f77fc5434cc51
BLAKE2b-256 checksum
How to use checksums
45c7df30f69f82bf853d26971ff8e0d06deb0205cdf5f26078170ec97978012a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 1, 2025.

Transparency log

Security for django-payments-saferpay 0.0.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for django_payments_saferpay-0.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 1, 2025.

Transparency log

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