MultiSafepay Payments Gateway integration for Django
Project description
django-multisafepay
Payment gateway integration for MultiSafepay. MultiSafepay is a large payment gateway based in The Netherlands that supports many international payment methods.
MultiSafepay offers two methods for payments, see https://www.multisafepay.com/en/Payment-services/:
Fast checkout requires customers to create a MultiSafePay account. You only have to pay a transaction fee, but the account system is not very user-friendly.
Connect provides direct payments. As a merchant, you have to pay a monthly subscription.
Installation
Install via pip:
pip install django-multisafepay
Configuration
In the MultiSafepay merchant site settings, add a new website. Use those settings to configure the application:
- MULTISAFEPAY_ACCOUNT_ID
The account ID, provided by MultiSafepay.
- MULTISAFEPAY_SITE_ID
The site ID, found in the MultiSafepay website settings panel.
- MULTISAFEPAY_SITE_CODE
The site security code, found in the MultiSafepay website settings panel.
- MULTISAFEPAY_TESTING
Whether or not to run in testing mode. Defaults to True.
Add to urls.py:
urlpatterns += patterns('', url(r'^api/multisafepay/', include('django_multisafepay.urls')), )
As recommendation, temporary log all events from this package as well:
LOGGING = { # ... 'handlers': { # ... 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler', }, }, 'loggers': { # ... 'django_multisafepay': { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': True, }, }, }
Usage
Creating a new payment transaction:
from django_multisafepay.client import MultiSafepayClient from django_multisafepay.data import Transaction, Customer from django.shortcuts import redirect def pay(request): client = MultiSafepayClient() reply = client.start_checkout( transaction = Transaction( ), customer = Customer( ) ) return redirect(reply.payment_url)
For the Fast Checkout, use the start_checkout() method.
For the Connect method, use the redirect_transaction() method.
Both methods return an URL to redirect the user to.
Fetching status:
client = MultiSafepayClient() statusreply = client.status(self.transaction_id)
TODO
Integrate nicely in django-merchant or django-getpaid.
Not all XML features are implemented, e.g.:
checkout-shopping-cart
custom-fields
shipping
iDEAL issuers request (simple to add)
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
Built Distribution
File details
Details for the file django-multisafepay-1.1.tar.gz
.
File metadata
- Download URL: django-multisafepay-1.1.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e476eadcdb07a0d3cffa77a429034ad7d251208ca23453abaae808b12d39fdfc |
|
MD5 | 9cec7cc4d5299214df4847d6b879d91a |
|
BLAKE2b-256 | 72bbc7edcf57f85f023ce80f05a20c55428cd6ada59b392357967bf85fa97d01 |
File details
Details for the file django_multisafepay-1.1-py2-none-any.whl
.
File metadata
- Download URL: django_multisafepay-1.1-py2-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02c78fb56ea650a8744c375a8c7dddb3df93b3515614755ab442380e7676a474 |
|
MD5 | c1ac0724d9b26f96d3913f2b3ef1e7ca |
|
BLAKE2b-256 | f10e229397dd1181e2d77a5e18955ee09e2d9951c12ab643d51b96492acd1586 |