A pluggable Django application for integrating PayPal Payments Standard or Payments Pro

Overview

Django PayPal

Build Status Latest PyPI version

Django PayPal is a pluggable application that integrates with PayPal Payments Standard and Payments Pro.

See https://django-paypal.readthedocs.org/ for documentation.

django-paypal supports:

  • Django 1.11+
  • Python 2.7, and 3.4+

(Not all combinations are supported).

Project status

This is an Open Source project that is active but in maintenance mode. The maintainers see their primary responsibilities as:

  • fixing any critical data loss or security bugs.
  • keeping the project up-to-date with new versions of Django (or other dependencies).
  • merging well written patches from the community, and doing so promptly.

Large scale development work and feature additions are not planned by the maintainers.

Some important parts of the code base are not covered by automated tests, and may be broken for some versions of Django or Python. These parts of the code base currently issue warnings, and the maintainers are waiting for tests to be contributed by those who actually need those parts, and docs where appropriate.

Please bear these things in mind if filing an issue. If you discover a bug, unless it is a critical data loss or security bug, the maintainers are unlikely to work for free to fix it, and a new feature, or tests for existing functionality, will only be added by the maintainers if they need it themselves.

That said, if you do have large changes that you want to contribute, including large new features (such as implementing newer PayPal payment methods), they will be gladly accepted if they are implemented well.

Please see CONTRIBUTING.rst for more information about using the issue tracker and pull requests. Please do not open issues for support requests.

Paid support

Some of the maintainers are able to provide support on a paid basis for this Open Source project. This includes the following kinds of things:

  • Paying for bug fixes or new features (with the understanding that these changes will become freely available as part of the project and are not 'owned' by the person who paid for them).
  • Debugging or other support for integrating django-paypal into your project.
  • Implementing the integration for you from scratch.

If you are interested in these, you can contact the follower developers:

  • Luke Plant - homepage, email - long time Django expert and contributor.
Comments
  • Fix encrypted buttons under Python 3

    Fix encrypted buttons under Python 3

    Avoid the b'' decoration under Python 3 when mixing binary (encrypted button contents) and normal strings. Fix the examples in the documentation for encrypted buttons to use the encrypted form.

    patch-needs-improvement 
    opened by JonathanRoach 12
  • PayPal IPN test returns 502

    PayPal IPN test returns 502

    I've followed the tutorial almost exactly and I got this response:

    Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request POST /webapps/developer/applications/ipn_simulator. Reason: Error reading from remote server

    Any reason why a 502 Proxy Error is raised when using the IPN simulator: https://developer.paypal.com/webapps/developer/applications/ipn_simulator

    opened by macdonjo 11
  • valid_ipn_received.connect(show_me_the_money) has never called.

    valid_ipn_received.connect(show_me_the_money) has never called.

    I tried the code in the page http://django-paypal.readthedocs.org/en/latest/standard/ipn.html

    I certainly added the valid_ipn_received.connect(show_me_the_money) in my views.py But, show_me_the_money has never called. Is it bug?

    opened by shinriyo 10
  • SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE]

    SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE]

    Hi folks, i am having this issue all day and i cant figure out what should be.

    I am running in the localhost the paypal pro, when i submit the payment form i get this error:

    requests.exceptions.SSLError
    SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
    

    Thanks in advance for any clues and sorry if this is not directly related with the django-paypal.

    o/

    opened by luanfonceca 9
  • UnicodeDecodeError when receiving flag_info info error

    UnicodeDecodeError when receiving flag_info info error

    Hi all,

    First of all thanks to spookylukey (and also dcramer) for this super library. I have recently discovered that sometimes Paypal is returning some unreadable characters in the 'flag_info' field and an UnicodeDecodeException exception is raised in the following line: self.flag_info += info of file: django_paypal-0.1.3-py2.7.egg/paypal/standard/models.py

    I guess that a try/catch surrounding the line and managing the unicode variable properly should be enough to fix it.

    Best regards from Barcelona, Álvaro Vélez.

    opened by alvarovelezgalvez 9
  • Using a different locale breaks the callback from paypal

    Using a different locale breaks the callback from paypal

    Hi,

    We run django-paypal on a website with a fr_FR locale. When django-paypal receive the callback from paypal, that confirms that the payment has been made, it tries to parse the date from paypal using PAYPAL_DATE_FORMAT (defined in standard/forms.py).

    However, as my locale is fr_FR, it is expecting the names in the date in french, and it fails. It returns that an invalid ipn is received… If I turn my locale to en_US, everything works fine.

    Could you fix that problem ? (probably by setting the locale to "C" before parsing the dates, and setting it back to its original value after ?).

    Thanks, palkeo.

    bug needs-info 
    opened by palkeo 8
  • recurring_payment signal never sent

    recurring_payment signal never sent

    The recurring_payment signal is never sent because a recurring payment is also a transaction

            if self.is_transaction():
                if self.flag:
                    payment_was_flagged.send(sender=self)
                elif self.is_refund():
                    payment_was_refunded.send(sender=self)
                elif self.is_reversed():
                    payment_was_reversed.send(sender=self)
                else:
                    payment_was_successful.send(sender=self)
            # Recurring payment signals:
            # XXX: Should these be merged with subscriptions?
            elif self.is_recurring():
                if self.is_recurring_create():
                    recurring_create.send(sender=self)
                elif self.is_recurring_payment():
                    recurring_payment.send(sender=self)
    

    I wanted to change elif self.is_recurring(): into if self.is_recurring(): but this comment stopped me:

        def test_recurring_payment_ipn(self):
            """
            The wat the code is written in
            PayPalIPN.send_signals the recurring_payment
            will never be sent because the paypal ipn
            contains a txn_id, if this test failes you
            might break some compatibility
            """
    

    Is there any reason for not sending both signals?

    opened by chripede 8
  • Confusing PayPal documentation

    Confusing PayPal documentation

    I confused PayPal doc that describes paypal_dict variables that are sent to PayPal with doc describing variables that are returned by PayPal via IPN. As a result, my function that checks if the payment was correct, triggered by the valid_ipn_received signal, used ipn_obj.amount variable instead of ipn_obj.mc_gross.

    The function didn't work as I expected but there were no errors reported on the console. After doing some digging I ended up adding this code in my_app.__int__.py

    from django.conf import settings
    
    class ExceptionLoggingMiddleware(object):
        def __init__(self, get_response):
            self.get_response = get_response
    
        def __call__(self, request):
            response = self.get_response(request)
            return response
    
        def process_exception(self, request, exception):
            if settings.DEBUG:
                print(exception.__class__.__name__)
                return None
    

    and also add to project's settings.py:

    MIDDLEWARE = [
        ...
        'my_project.my_app.ExceptionLoggingMiddleware',
    ]
    

    With this ExceptionLoggingMiddleware class on now I can see errors that makes my function fail.

    opened by TomSteck 7
  • REMOTE_ADDR may contain invalid data when using Nginx as reverse proxy

    REMOTE_ADDR may contain invalid data when using Nginx as reverse proxy

    /paypal/standard/models.py the method named def initialize(self, request): has the following line:

    self.ipaddress = request.META.get('REMOTE_ADDR', '')

    If you ever reverse proxy a connection to django the REMOTE_ADDR does not contain the end-users actual IP, it'll contain nothing or the proxy servers ip or in my case it actually contained literally "b''" (thats B and 2 single quotes in a string).

    There are also cases when someone is using a service such as cloudflare, I changed the self.ipaddress line to the following code so that it'll find an IP somewhere.

    for val in ['HTTP_CF_CONNECTING_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_REAL_IP', 'REMOTE_ADDR']:
        self.ipaddress = request.META.get(val, '').split(',')[0]  # proxys may forwarded multiple ips, first one is clients
        if self.ipaddress:
            break
    
    opened by iarp 7
  • RawPostDataException when trying to test IPN

    RawPostDataException when trying to test IPN

    I am using the chrome plugin Postman to try and test the IPN callback on my localhost. When posting to the callback URL I am getting a RawPostDataException error "You cannot access body after reading from request's data stream"

    Am I doing something wrong here or is there a better why to test the IPN callback locally? Thanks

    opened by dantium 7
  • Fix Paypal making requests using POST instead of GET.

    Fix Paypal making requests using POST instead of GET.

    While I was testing using the Paypal sandbox I found I was getting POST request instead for GET for its notifications. I modified the code in a way that existing code won't break, but it will also handle the POST method. Hope it gets merged. Thanks.

    patch-needs-improvement 
    opened by dhontecillas 7
  • untested warning for is_subscription

    untested warning for is_subscription

    Hi, I'm getting an untested warning for PayPalStandardBase.is_subcription()

    paypal.standard.models:286: This method (or branch) is not covered by automated tests. It is therefore very vulnerable to being accidentally broken by future versions of django-paypal. Please contribute tests to ensure future functionality!
    

    The method itself is just one line:

        def is_subscription(self):
            warn_untested()
            return len(self.subscr_id) > 0
    

    So I wonder what kind of test would be needed for this. Or if it's pointing to the more generic subscription logic?

    opened by newearthmartin 4
  • Custom data got truncated

    Custom data got truncated

    Recently I have got 4 payments where the IPN returned with truncated custom field. I did create the (unencrypted) form with data like:

     'custom': '{"user_plan_id": 310606, "plan_id": 1, "pricing_id": 1, "first_order_id": 43102, "user_email": "[email protected]"}
    

    But i am receiving IPN with only ...&custom={&... in URL, so I can't pair the payment with the data in DB.

    This would probably be error on side of PayPal, but also can be caused by some interaction with the form in browser on user's side (but it happened for 4 different users). I am creating this issue mainly because I want to ask if somebody has similar experience.

    opened by PetrDlouhy 4
  • Encrypted form gives different interface on PayPal

    Encrypted form gives different interface on PayPal

    If I switch to encrypted form, the PayPal shows me interface with much worse UX: Snímek obrazovky_2022-05-03_07-48-03

    In contrast with the interface with unencrypted form: Snímek obrazovky_2022-05-03_07-48-14

    I don't think, this is fault of django-paypal, but I would like to know the reason for this anyway. Also this might be something that should get into documentation.

    opened by PetrDlouhy 1
  • Fix intermittent PDT issues

    Fix intermittent PDT issues

    Fixes issue #239.

    Rather than use the same form for both the PDT callback and the postback, split these apart. We'll take a minimal set of parameters from the callback, and fill in rest using the postback endpoint.

    I've included a test which includes the full set of query parameters I'm seeing on most (but not all) PDT callback requests. Note payment_date is in ISO format in these requests, and notify_version is a string. With this PR both these parameters will be ignored.

    opened by djw 0
  • Received 3 IPNs for the same transaction, only one flagged as duplicate

    Received 3 IPNs for the same transaction, only one flagged as duplicate

    Hi! I received 3 IPNs for the same transaction with the same data, but only one was flagged as duplicate. They have all the same transaction id and all the same payment status, and are all separated by one minute (3:00 am 3:01 am 3:02 am).

    Only one got marked as duplicate so my system ended up processing the same payment twice.

    Screen Shot 2021-10-18 at 12 42 06

    opened by newearthmartin 3
Releases(v1.0.0)
Owner
Luke Plant
Core @django developer, freelancer. spookylukey on Twitter
Luke Plant
A simple page with paypal payment and confiramtion in django

django-paypal a simple page with paypal payment and confiramtion in django Youtube Video : Paypal Smart Button : https://developer.paypal.com/demo/che

Mahmoud Ahmed 5 Feb 19, 2022
A simple demonstration of integrating a sentiment analysis tool in a django project

sentiment-analysis A simple demonstration of integrating a sentiment analysis tool in a django project (watch the video .mp4) To run this project : pi

null 2 Oct 16, 2021
Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.

Django-environ django-environ allows you to use Twelve-factor methodology to configure your Django application with environment variables. import envi

Daniele Faraglia 2.7k Jan 7, 2023
Rosetta is a Django application that eases the translation process of your Django projects

Rosetta Rosetta is a Django application that facilitates the translation process of your Django projects. Because it doesn't export any models, Rosett

Marco Bonetti 909 Dec 26, 2022
django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing

django-dashing django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project.

talPor Solutions 703 Dec 22, 2022
Django-Audiofield is a simple app that allows Audio files upload, management and conversion to different audio format (mp3, wav & ogg), which also makes it easy to play audio files into your Django application.

Django-Audiofield Description: Django Audio Management Tools Maintainer: Areski Contributors: list of contributors Django-Audiofield is a simple app t

Areski Belaid 167 Nov 10, 2022
django Filer is a file management application for django that makes handling of files and images a breeze.

django Filer is a file management application for django that makes handling of files and images a breeze.

django CMS Association 1.6k Jan 6, 2023
Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project

Django URL Shortener Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project Install this package to your Dja

Rishav Sinha 4 Nov 18, 2021
Django application and library for importing and exporting data with admin integration.

django-import-export django-import-export is a Django application and library for importing and exporting data with included admin integration. Featur

null 2.6k Dec 26, 2022
A Django application that provides country choices for use with forms, flag icons static files, and a country field for models.

Django Countries A Django application that provides country choices for use with forms, flag icons static files, and a country field for models. Insta

Chris Beaven 1.2k Jan 7, 2023
Simple yet powerful and really extendable application for managing a blog within your Django Web site.

Django Blog Zinnia Simple yet powerful and really extendable application for managing a blog within your Django Web site. Zinnia has been made for pub

Julien Fache 2.1k Dec 24, 2022
Full-text multi-table search application for Django. Easy to install and use, with good performance.

django-watson django-watson is a fast multi-model full-text search plugin for Django. It is easy to install and use, and provides high quality search

Dave Hall 1.1k Dec 22, 2022
Use Database URLs in your Django Application.

DJ-Database-URL This simple Django utility allows you to utilize the 12factor inspired DATABASE_URL environment variable to configure your Django appl

Jacob Kaplan-Moss 1.3k Dec 30, 2022
Quick example of a todo list application using Django and HTMX

django-htmx-todo-list Quick example of a todo list application using Django and HTMX Background Modified & expanded from https://github.com/jaredlockh

Jack Linke 54 Dec 10, 2022
A Django application that provides country choices for use with forms, flag icons static files, and a country field for models.

Django Countries A Django application that provides country choices for use with forms, flag icons static files, and a country field for models. Insta

Chris Beaven 1.2k Dec 31, 2022
File and Image Management Application for django

Django Filer django Filer is a file management application for django that makes handling of files and images a breeze. Contributing This is a an open

django CMS Association 1.6k Dec 28, 2022
Application made in Django to generate random passwords as based on certain criteria .

PASSWORD GENERATOR Welcome to Password Generator About The App Password Generator is an Open Source project brought to you by Iot Lab,KIIT and it brin

IoT Lab KIIT 3 Oct 21, 2021
Simple application TodoList django with ReactJS

Django & React Django We basically follow the Django REST framework quickstart guide here. Create backend folder with a virtual Python environment: mk

Flavien HUGS 2 Aug 7, 2022
PWA is a simple Django app to develope and deploy a Progressive Web Application.

PWA PWA is a simple Django app to develope and deploy a Progressive Web Application. Detailed documentation is in the "docs" directory. Quick start Ad

Nima 6 Dec 9, 2022