Django app for PayPal's NVP API. Fixed from the original version linked below to be more Django like and to fix some of the method signatures/settings.
Switch branches/tags
Nothing to show
Latest commit 706a356 Mar 17, 2014 @leepa Use HTTP/1.1 for PayPal API as per their changes
That was obtuse in their e-mail. But easy enough to fix as urllib2 =
HTTP/1.1 and urlib is HTTP/1.0 - so we just flip which urlopen() we use.
Job done.
Failed to load latest commit information.
LICENSE initial checkin Dec 22, 2009
README initial checkin Dec 22, 2009 Fix non-utf 8 chars in author's name May 14, 2010


README for django-paypal-driver
Pluggable PayPal NVP (Name Value Pair) API implementation for Django based web applications.

    All you need to do is copying the "paypal" directory (or make a symbolink) under one of the directories in your PYTHON_PATH such as:

    If you are using Python 2.5;
    - /usr/local/lib/python2.5/site-packages/
    - /usr/lib/python2.5/site-packages/

    If you are using Python 2.6;
    - /usr/local/lib/python2.6/dist-packages/
    - /usr/lib/python2.6/dist-packages/


Once you copy the "paypal" drectory under your PYTHON_PATH; you can enter shell by typing "python shell" command under your project root. 

You need to define your PayPal API Credientials in your projects settings file. Those are;
    - PAYPAL_USER (api username)
    - PAYPAL_PASSWORD (api password)
    - PAYPAL_SIGNATURE (api signature)

Then you can actually perform the following methods;

    In [1]: from paypal.driver import PayPal

    In [2]: p = PayPal(debug = True)

    In [3]: p.SetExpressCheckout("10.00", "USD", "http://localhost/return", "http://localhost/cancel")

    - - - - - - - - - - 
    You can see the error that the server sends bu calling
    - p.apierror

    Also, you can see the full response that comes from the PayPal server by typing
    - p.api_response

    when you are in python shell.
    - - - - - - - - - - 
    In [4]: p.DoExpressCheckoutPayment("USD", "10.00", "token", "payerid")
Also you can refund money;

   In [5]: p.RefundTransaction(transid = "transactionid", refundtype = "Partial", currency = "USD", amount = "10.00")