GithubHelp home page GithubHelp logo

isabella232 / django-multisafepay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edoburu/django-multisafepay

0.0 0.0 0.0 4.23 MB

MultiSafepay integration for Django

License: Apache License 2.0

Python 100.00%

django-multisafepay's Introduction

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)

django-multisafepay's People

Contributors

vdboor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.