This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

PaymentExpress PxPay Gateway for Django

Installation:

pip install django-pxpay or easy_install django-pxpay

Usage:

You’ll need to add a few items in your settings.py: PXPAY_USERID, PXPAY_KEY and, optionally, PXPAY_CURRENCY.

from django.shortcuts import redirect, render_to_response
from django.template.context import RequestContext
from django.http import Http404
from pxpay.gateway import Gateway


def payment(request, amount):
    # Create a transaction.
    txn = Gateway().transaction(
        TxnType='Purchase',
        AmountInput='%.2f' % amount,
        CurrencyInput='AUD',  # Alternatively, can be provided in settings.py
        MerchantReference='Some reference')

    # Send payment request.
    response = Gateway().process_transaction(
        txn,
        UrlFail=request.build_absolute_uri(reverse('process_payment')),
        UrlSuccess=request.build_absolute_uri(reverse('process_payment')))

    # Redirect to PaymentExpress hosted payment page.
    if response.is_valid:
        return redirect(response.get_data['URI'])

    # Show error.
    else:
        return payment_result(request, False, 'Invalid Transaction Request')


def process_payment(request):
    # Proper PaymentExpress request would always have these.
    if 'result' in request.GET and 'userid' in request.GET:

        # Process PaymentExpress response.
        process_response = Gateway().process_response(
            Response=request.GET['result'])

        # Show payment result.
        return payment_result(
            request,
            bool(int(process_response.get_data['Success'])),
            process_response.get_data['ResponseText'])

    # Rise 404 if no required arguments were passed.
    raise Http404


def payment_result(request, success, msg):
    return render_to_response(
        'payment.html',
        {'success': success, 'msg': msg},
        context_instance=RequestContext(request))
Release History

Release History

0.2.6

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-pxpay-0.2.6.tar.gz (5.2 kB) Copy SHA256 Checksum SHA256 Source Mar 24, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting