Chapter 8. Getting Started with PayPal on Django

A brief walkthrough on how to accept payments on your Django application, using the PayPal APIs

Introduction

This tutorial describes how to integrate Django with PayPal by implementing a simple online store that sells downloadable content. Django is a powerful, Python-based web framework suitable for rapidly building web applications. It has an active community, is easy to use, and drives a number of prominent sites. PayPal offers an easy way to send and receive payments, has a comprehensive API, and is suitable for developers to use for online transactions.

Requirements

Paypal Accounts

If you don’t already have one, create a PayPal developer account at https://developer.paypal.com/ for testing. After creating your main developer account, you will also need to create seller and buyer test accounts. If you want to start accepting real money, you will also need to sign up for a live account at https://www.paypal.com/

PDT (Payment Data Transfer)

PayPal provides a number of methods for authenticating a transaction once the buyer returns to your site. This example uses the PDT method of authenticating transactions, so you need to enable PDT on your seller account. Instructions for doing this are at https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_html_paymentdatatransfer. When updating the configuration settings on your Django application, use the PDT token obtained from the above link.

Django

You ...

Get Building eCommerce Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.