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

pypay provides a clean API for confirming Paypal payments via PDT or IPN. It takes the boilerplate out of interacting with these services and normalises the Paypal response into something sensible.

Under the hood pypay uses the excellent Requests library for handling http.

Installation

pip install pypay

Usage

To check a payment via PDT

import pypay

response = pypay.pdt_confirm('your_transaction_id', 'your_identity_token')

To check a payment via IPN

import pypay

response = pypay.ipn_confirm('query_params_from_paypal')

You can pass the query params as either a string (e.g. ‘quantity=1&name=joe’) or a dict. This is particularly useful if you’re using Django as you can drop in request.POST and everything with just work.

Response objects

Response objects always have two properties

response.confirmed # bool indicating if payment is verified

response.details # dict containing all the Paypal variables that were returned

Handling exceptions

In the event of a problem making the http call to Paypal, pypay will raise a pypay.exceptions.RequestError.

The values passed to pdt_confirm and ipn_confirm are sanity checked and a pypay.exceptions.InvalidPaypalData will be raised if they are of the wrong type.

Python version support

pypay runs on Python 2.6, 2.7, 3.3 and 3.4 using the Six compatibility library.

Running tests

Run the test suite with Tox

pip install tox

Tests are written with pytest

Release History

Release History

0.1.1

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

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
pypay-0.1.1.tar.gz (4.4 kB) Copy SHA256 Checksum SHA256 Source May 20, 2014

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