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.216.676 Times

django-payfast 0.2.2

Company: Mikhail Korobov
Date Added: October 28, 2013  |  Visits: 418

django-payfast

Report Broken Link
Printer Friendly Version


Product Homepage
Download (48 downloads)



A pluggable Django application for integrating payfast.co.za payment system.<br />Install<br /><br />$ pip install django-payfast<br /><br />or<br /><br />$ easy_install django-payfast<br /><br />or<br /><br />$ hg clone http://bitbucket.org/kmike/django-payfast/<br />$ cd django-payfast<br />$ python setup.py install<br /><br />Then add 'payfast' 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 payfast<br /><br />Settings<br /><br />Specify your credentials in settings.py:<br /><br /> * PAYFAST_MERCHANT_ID<br /> * PAYFAST_MERCHANT_KEY<br /><br />If your web server is behind reverse proxy you should also specify PAYFAST_IP_HEADER option. It's a request.META key with client ip address (default is 'REMOTE_ADDR').<br /><br />There is an option with PayFast server IP addresses (PAYFAST_IP_ADDRESSES). It is a list with current PayFast servers' ip addresses. If they will change then override this option in your settings.py.<br /><br />You also have to setup your PayFast account on payfast.co.za. Login into the admin panel, go to 'My Account -> Integration', enable the Instant Transaction Notification (ITN) and provide the Notify URL.<br />Usage<br />Payment form<br /><br />payfast.forms.PayFastForm 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, 'name_first', 'name_last' and 'email_address' fields will be filled automatically if they are 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 payfast.forms import PayFastForm<br /><br />@login_required<br />def pay_with_payfast(request, order_id):<br /><br /> # Order model have to be defined by user, it is not a part<br /> # of django-payfast<br /> order = get_object_or_404(Order, pk = order_id)<br /><br /> form = PayFastForm(initial={<br /> # required params:<br /> 'amount': order.total,<br /> 'item_name': 'the name of the item being charged for',<br /><br /> # optional params:<br /> # 'return_url' : 'http://my-site.com/orders/payfast/return/',<br /> # 'cancel_url' : 'http://my-site.com/orders/payfast/cancel/'<br /> # ... etc.<br /> }, user=order.user)<br /><br /> return direct_to_template(request, 'pay_with_payfast.html', {'form': form})<br /><br />Please refer to PayFast docs (http://www.payfast.co.za/c/std/website-payments-variables) for more options. 'merchant_id', 'merchant_key', 'notify_url' and 'signature' params are handled automatically.<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="Buy Now"></p><br /> </form><br />{% endblock %}<br /><br />The {{ form.as_p }} output will be a number of <input type='hidden'> tags.<br /><br />PayFastForm has a 'target' attribute with PayFast server URL.<br /><br />Please note that it's up to you to implement the order processing logic. Order handling should be performed in payfast.signals.data signal handler.<br />payfast.signals.notify signal<br /><br />When PayFast posts data to the Notify URL payfast.signals.notify signal is sent. This signal won't be sent for suspicious data (when request is coming from untrusted ip, form validation fails or the payment is duplicate).<br /><br />Signal subscribers will get an 'order' argument with PayFastOrder instance.<br /><br />Example:<br /><br />import payfast.signals<br /><br />def data_received(sender, **kwargs):<br /> payfast_order = kwargs['order']<br /><br /> if payfast_order.payment_status == 'COMPLETE':<br /><br /> # The order is paid (merchant_id check and check for duplicate<br /> # payments is already handled by django-payfast)<br /><br /> amount = payfast_order.amount<br /> # your business logic<br /> # ...<br /> else: # the order is not paid<br /> # your business logic<br /> # ...<br /><br />payfast.signals.notify.connect(data_received)<br /><br />urls.py<br /><br />In order to get Notify URL up and running, include payfast.urls in your urls.py:<br /><br />urlpatterns = patterns('',<br /> #...<br /> url(r'^payfast/', include('payfast.urls')),<br /> #...<br />)

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Addresses Argument Djangopayfast Fields Formas Handled Import Logic Ltpgt Notify Option Optional Order Params Payfast Python Server Signal User
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


DJANGO-PAYFAST RELATED
Modules  -  Solace Node Reference 6.x-1.0-beta6
This module extends the nodereference fields by providing a filter based searching engine in order to automatically fill it using the Solace API filters features as backend.This means you can attach a SolR filter instance to node reference fields....
30.72 KB  
Server Tools  -  JiJiTechnologies AD Bulk Manager 2.0.0.9.3
JIJiTechnologies AD Bulk manager Enables Active Directory Bulk Export Import Active Directory Bulk Users Creation Modification Active Directory Password Reset Bulk User Account Control Remove Delete Unlock Users Move ActiveDirectory Bulk Export...
4.27 MB  
Science  -  Thinknowlogy 1
Thinknowlogy is grammar-based software, designed to utilize the logic contained within grammar, in order to create intelligence through natural language, which is demonstrated by: * Programming in natural language; * Reasoning in natural language:...
4.53 MB  
Modules  -  Track Trace TPG 1.2
Adds fields to the database for order tracking number and allows the user to track from a single click inside his history overview.(Since this file was no longer available, I thought a good thing to upload for users that have a need for this)
 
Programming  -  django-netcash 0.4.0
A pluggable Django application for integrating netcash.co.za payment system. Install $ pip install django-netcash or $ easy_install django-netcash or $ hg clone...
10.24 KB  
Games  -  Fields Separation 1. 2. 2000
In this game there will be a piece of land with some houses on it, each house will bare a number. Your job is to put in fences so that the land is separated into rectangular fields, each field should contain exactly one house and the area of the...
262 KB  
Modules  -  Extra Fields Checkout Pane 6.x-2.0-beta1
This modules allows an administrator to define additional (billing and shipping) address fields (i.e. VAT) in Ubercart ecommerce suite.Two additional panes with these fields will be available during checkout process and in order handling...
10 KB  
Modules  -  Email Directory 1.3
This component allows your visitors to add and list their email addresses on your site. The component includes anti-spam protection using GD library or cloaking if GD not available. Logged-in users are able to contact listed emails using an online...
122.88 KB  
Network & Internet  -  django-immutablefield 0.1.1
django-immutablefield is inspired by a Google search that didn't turn up a reusable solution for making fields immutable inside of a Django model. Installing One of the following: Via the ole' standby:
10.24 KB  
Email  -  Soupermail for HTML Mail 1.0.8
Soupermail is a free, generic, highly configurable form to email CGI program.Soupermail is a generic HTML form handling script designed to provide a high degree of control over a form's behaviour and output.It provides the following features:-...
102.4 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, NETWORK & INTERNET
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  
Network & Internet  -  Free WiFi Hotspot 3.3.1
Free WiFi Hotspot is a super easy solution to turn your laptop or notebook into a portable Wi-Fi hotspot, wirelessly sharing your internet connections like DSL, Cable, Bluetooth, Mobile Broadband Card, Dial-Up, etc. through the built-in wireless...
1.04 MB  
Network & Internet  -  Easy Uploads 1.8
Easy uploads is a file storage media streaming application designed by Filestreamers that allows you to upload, store, and stream your files from their virtually unlimited file storage server. Easy Uploads can backup,share, and stream your files...
615.97 KB  
Network & Internet  -  PacketFence ZEN 3.1.0
PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) system. Boosting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, 802.1X...
1024 MB  
Network & Internet  -  django-dbstorage 1.3
A Django file storage backend for files in the database.
10.24 KB  
Network & Internet  -  SQL Inject Me 0.4.5
SQL Inject Me is a Firefox extension used to test for SQL Injection vulnerabilities. The tool works by submitting your HTML forms and substituting the form value with strings that are representative of an SQL Injection attack.
133.12 KB