SaferPay integration for django-payments
Project description
django-payments-saferpay
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
-
Navigate to the sandbox directory:
cd sandbox -
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
-
Load the environment variables:
source .envrc(Or if you have direnv installed, it will load automatically)
-
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
-
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_payments_saferpay-0.0.4.tar.gz.
File metadata
- Download URL: django_payments_saferpay-0.0.4.tar.gz
- Upload date:
- Size: 38.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40a83544a8f2f90f8f0b7467c6221b78c7f2cfa21da7182aa5b7abb68213f407
|
|
| MD5 |
f33fb7db639a6d36cb464e47f09bf3a7
|
|
| BLAKE2b-256 |
a94c5c33a9d4b6634f5acf6275c77382f32d840ef633beed306b5acfe775a870
|
Provenance
The following attestation bundles were made for django_payments_saferpay-0.0.4.tar.gz:
Publisher:
test-and-release.yml on epfl-cede/django-payments-saferpay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_payments_saferpay-0.0.4.tar.gz -
Subject digest:
40a83544a8f2f90f8f0b7467c6221b78c7f2cfa21da7182aa5b7abb68213f407 - Sigstore transparency entry: 205331447
- Sigstore integration time:
-
Permalink:
epfl-cede/django-payments-saferpay@0d1d1d49d6febcab3c1809b14735c55a43ef14bb -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/epfl-cede
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test-and-release.yml@0d1d1d49d6febcab3c1809b14735c55a43ef14bb -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_payments_saferpay-0.0.4-py3-none-any.whl.
File metadata
- Download URL: django_payments_saferpay-0.0.4-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83c4ecc6995239d56ffe7834d6f82aa536ee6d201f2c9f139c4f77fc5434cc51
|
|
| MD5 |
d67f65c5fb21a830d4225f4790d693c2
|
|
| BLAKE2b-256 |
45c7df30f69f82bf853d26971ff8e0d06deb0205cdf5f26078170ec97978012a
|
Provenance
The following attestation bundles were made for django_payments_saferpay-0.0.4-py3-none-any.whl:
Publisher:
test-and-release.yml on epfl-cede/django-payments-saferpay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_payments_saferpay-0.0.4-py3-none-any.whl -
Subject digest:
83c4ecc6995239d56ffe7834d6f82aa536ee6d201f2c9f139c4f77fc5434cc51 - Sigstore transparency entry: 205331448
- Sigstore integration time:
-
Permalink:
epfl-cede/django-payments-saferpay@0d1d1d49d6febcab3c1809b14735c55a43ef14bb -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/epfl-cede
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test-and-release.yml@0d1d1d49d6febcab3c1809b14735c55a43ef14bb -
Trigger Event:
push
-
Statement type: