Skip to main content

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

  • 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

django-multisafepay-1.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

django_multisafepay-1.0-py2-none-any.whl (25.7 kB view details)

Uploaded Python 2

File details

Details for the file django-multisafepay-1.0.tar.gz.

File metadata

File hashes

Hashes for django-multisafepay-1.0.tar.gz
Algorithm Hash digest
SHA256 41a6a14b7b071a4f2d057132442219603f41b4b5d323647bef745d4cae5eb661
MD5 a85cfd3b64af4270f30800c7988fb436
BLAKE2b-256 60e68de35879454f2fe6c2c5130b88e3d783f3bec3d6c4059f938574fddaeaf0

See more details on using hashes here.

File details

Details for the file django_multisafepay-1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for django_multisafepay-1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 9998df194917fd3b89ede27c061718494794ee789c0f87d8c0bafa16aefe1f69
MD5 e9d81e5a56b05dbb22c15666b17e7633
BLAKE2b-256 3dc9da06e87b2a7376dda0a5f1c6f2c4419b8030f42104af0658af29f5d123e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page