Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.477.913 Times

django-netcash 0.4.0

Company: Mikhail Korobov
Date Added: September 07, 2013  |  Visits: 745

django-netcash

Report Broken Link
Printer Friendly Version


Product Homepage
Download (38 downloads)

A pluggable Django application for integrating netcash.co.za payment system.<br />Install<br /><br />$ pip install django-netcash<br /><br />or<br /><br />$ easy_install django-netcash<br /><br />or<br /><br />$ hg clone http://bitbucket.org/kmike/django-netcash/<br />$ cd django-netcash<br />$ python setup.py install<br /><br />Then add 'netcash' to INSTALLED_APPS and execute<br /><br />$ python manage.py syncdb<br /><br />or (if South is in use)<br /><br />$ python manage.py migrate<br /><br />If South is used then the NetcashGateway instance will be created. Otherwise go to admin and add the NetcashGateway instance. It is neccessary to have at least one NetcashGateway instance in DB.<br />Settings<br /><br />Specify your credentials in settings.py:<br /><br /> * NETCASH_USERNAME<br /> * NETCASH_PASSWORD<br /> * NETCASH_PIN<br /> * NETCASH_TERMINAL_NUMBER<br /><br />If your web server is behind reverse proxy you should also specify NETCASH_IP_HEADER option. It's a request.META key with client ip address (default is 'REMOTE_ADDR').<br /><br />You also have to setup your Netcash account on netcash.co.za. Login into the admin panel, go to 'credit cards' section then go to 'Adjust Gateway Defaults' and then paste your Data URL. Data URL can be found in django admin changelist page for NetcashGateway model.<br />Usage<br />Payment form<br /><br />netcash.forms.NetcashForm can be used to construct the html form. It is a helper form for html output and it shouldn't perform any validation.<br /><br />Pass all the fields to form 'initial' argument. Form also has an optional 'user' parameter: it is the User instance the order is purchased by. If 'user' is specified, 'm_9' (cardholder email address) will be filled automatically if it is not passed with 'initial'.<br /><br />Example:<br /><br /># views.py<br /><br />from django.shortcuts import get_object_or_404<br />from django.views.generic.simple import direct_to_template<br />from django.contrib.auth.decorators import login_required<br /><br />from netcash.forms import NetcashForm<br /><br />@login_required<br />def pay_with_netcash(request, order_id)<br /><br /> # Order model have to be defined by user, it is not a part<br /> # of django-netcash<br /> order = get_object_or_404(Order, pk = order_id)<br /><br /> form = NetcashForm(initial={<br /><br /> # required params:<br /> 'p3': 'description of the goods',<br /> 'p4': order.total,<br /><br /> # optional params:<br /><br /> # 'p10': '/cancel/button/url',<br /> # 'Budget': 'Y', # will display the budget option in the Gateway popup<br /> # 'm_4': 'extra param 1',<br /> # 'm_5': 'extra param 2',<br /> # 'm_6': 'extra param 3',<br /> # 'm_9': order.user.email # cardholder email address<br /> }, user=order.user)<br /><br /> return direct_to_template(request, 'pay_with_netcash.html', {'form': form})<br /><br />The template:<br /><br />{% extends 'base.html' %}<br /><br />{% block content %}<br /> <form action="{{ form.target }}" method="POST"><br /> <p>{{ form.as_p }}</p><br /> <p><input type="submit" value="Pay by Credit Card"></p><br /> </form><br />{% endblock %}<br /><br />The {{ form.as_p }} output will be a number of <input type='hidden'> tags.<br /><br />NetcashForm has a 'target' attribute with Netcash URL.<br /><br />Please note that it's up to you to implement the order processing logic. Order handling should be performed in netcash.signals.data signal handler.<br />netcash.signals.data signal<br /><br />When Netcash posts data to Data URL netcash.signals.data signal is sent. This signal won't be sent for suspicious data (when request is coming from untrusted ip or form validation fails).<br /><br />Signal subscribers will get an 'order' argument with NetcashOrder instance.<br /><br />Example:<br /><br />import netcash.signals<br /><br />def data_received(sender, **kwargs):<br /> netcash_order = kwargs['order']<br /><br /> if netcash_order.TransactionAccepted: # order is paid<br /> amount = netcash_order.Amount<br /> # your business logic<br /> # ...<br /> else: # order is not paid<br /> # your business logic<br /> # ...<br /><br />netcash.signals.data.connect(data_received)<br /><br />urls.py<br /><br />In order to get Data URL, Accept URL and Reject URL up and running, include netcash.urls in your urls.py:<br /><br />urlpatterns = patterns('',<br /> #...<br /> url(r'^netcash/', include('netcash.urls')),<br /> #...<br />)<br /><br />Templates<br /><br /> * netcash/accept.html - Accept URL page. Has an 'order' variable in template context with NetcashOrder instance.<br /> * netcash/accept.html - Reject URL page. Has an 'order' variable in template context with NetcashOrder instance.

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Address Admin Argument Extra Gateway Import Instance Logic Netcash Netcashaccepthtml Netcashgateway Netcashorder Optional Order Param Python Signal Template User
Users rating: 0/10

License: Freeware Size: 10.24 KB
DJANGO-NETCASH RELATED
Specialized Tools  -  django-attachments 0.3.1
django-attachments is a generic set of template tags for the Django framework to attach any kind of files to models. Installattion: Put attachments to your INSTALLED_APPS in your settings.py within your django project. This...
61.44 KB  
Specialized Tools  -  django-generic-flatblocks 0.3.0
django-generic-flatblocks is a Django plugin that solves this problem as it knows nothing about the content itself. You attach your hand made content node (a simple model) where you can define any fields you want. Installation
10.24 KB  
Networking Tools  -  TCP Profiles Manager 1.7
TCP Profiles Manager is a utility to easily change local IP address, subnet mask, network, gateway, DNS ... all without rebooting.You can store multiple profiles per network interface (ex : MyHome, MyOffice...).Useful when you connect to multiple...
1.44 MB  
File Management  -  Using Import for Reading Configuration Files 1.0
Using Import for Reading Configuration Files script allows you to read Python-based configuration files that are specified at runtime.Reading configuration files is a common activity in scientific programming. Engineers typically create extensive...
 
Misc. Web Browser Tools  -  Network map extractor 1.0.0.3
Network map extractor is a small, easy to use tool specially designed to offer users a network admin / PC team tool that extracts mapped network drives from the registry off and online and offline user and saves a registry file. for WindowsAll
 
Network & Internet  -  django-payfast 0.2.2
A pluggable Django application for integrating payfast.co.za payment system. Install $ pip install django-payfast or $ easy_install django-payfast or $ hg clone...
10.24 KB  
Modules  -  Address Book Enhancer 1.3
These modifications allow you to assign specific address book entries to a default shipping and a default billing address. In my circumstances, I import osc data into an accounting software package that allows for a statement address...
 
HTML Utilities  -  django-secretballot 0.2.3
django-secretballot Django voting application that allows voting without a logged in user. Provides abstract base model for types that the user wishes to allow voting on as well as related utilities including generic views to...
10.24 KB  
Libraries  -  Mail::RFC822::Address 0.3
Mail::RFC822::Address is a Perl extension for validating email addresses according to RFC822. SYNOPSIS use Mail::RFC822::Address qw(valid validlist); if (valid("pdw@ex-parrot.com")) { print "Thats a valid addressn"; } if...
5.12 KB  
Modules  -  Product Extra Fields 2.0j 1.0
This contribution allows people to add fields labeled the way they want, and then display them in the product page of the catalog. I've grabbed enough contributions, so i figured I owe the community this one.After this is added you can access the...
 
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB