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

DPS payment processing for django. (Almost) completely agnostic about your models. By default, you never handle credit card details. Handles one-off and recurring payments.

Usage:

You’ll need to add a few items in your settings.py: PXPAY_USERID and PXPAY_KEY for interactive payments and recurring payment setup, and PXPOST_USERID and PXPOST_KEY for non-interactive and recurring billing.

You’ll also need to include('dps.urls') in your urls somewhere.

Then, just call this function:

dps.transactions.make_payment(obj, request=None, attrs={}) where:

  • obj implements dps.models.BasicTransactionProtocol or dps.models.FullTransactionProtocol.
  • request is a Django request object or None.

If you intend to make an interactive payment e.g. by redirecting the user to the DPS page, then provide a request. (It’s needed to build fully-specified URLs for DPS to redirect back to.)

If request is None, the function will attempt to find and use a stored billing token (as described in the protocol implementations in dps/models.py) and make a non-interactive recurring payment.

  • attrs is a dictionary of PxPay or PxPost request parameters to be merged in to the transaction request to DPS.

This allows you to do anything, really, as you could override default parameters, provide credit-card details directly, specify a refund rather than purchase – anything DPS supports.

To put an accessor/relationship on your own model to it’s transactions, just use GenericRelation:

class MyModel(models.Model):
    ...
    transactions = generic.GenericRelation(Transaction)

There’s also a dps.admin.TransactionInlineAdmin which you can use with your own model admins like so:

class MyModelAdmin(admin.ModelAdmin):
    ...
    inlines = [TransactionInlineAdmin]

admin.site.register(MyModel, MyModelAdmin)

Running tests

Create a file called tests/dps_settings.py and add PXPAY_USERID and PXPAY_KEY values - you’ll need valid PXPAY testing credentials. Then, assuming virtualenvwrapper is installed:

> cd path-to/django-dps
> mkvirtualenv test
> pip install requests
> ./setup.py install
> ./runtests.py

To run the tests across all supported Python and Django versions, use tox:

> cd path-to/django-dps
> mkvirtualenv test
> pip install tox
> tox
Release History

Release History

0.5

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

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-dps-0.5.tar.gz (12.3 kB) Copy SHA256 Checksum SHA256 Source May 24, 2016

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