Code Monkey home page Code Monkey logo

django-paypal-adaptive's Introduction

Django Paypal Adaptive

Build Status Downloads

The API and the modules in this repository might be subject to smaller changes and not all Paypal Adaptive endpoints are covered. FundedByMe will help make the covering of the Pay, Preapproval and IPN endpoints as good as possible but we might not have the resources to perfect this project.

Making Preapprovals and using them to create Payments is fully supported together with Paypal's IPN push API. Please reach out to us if you're interested in helping maintaining this package.

Installation

Install package from PyPI:

pip install django-paypal-adaptive

Add to your project's INSTALLED_APPS setting:

INSTALLED_APPS = (
    …
    'paypaladaptive',
)

Sync the database:

$ python manage.py syncdb

Or if you're using South you might want to add an initial migration for future changes:

$ python manage.py schemamigration paypaladaptive --initial
$ python manage.py syncdb --migrate

Models

Payment

Status

Possible values are:

'new'  # Payment only exists locally
'created'  # Payment exists on Paypal
'error'  # Something along the process has gone wrong. Check status_detail
         # for more info.
'returned'  # User has returned via the Payment return_url
'completed'  # The Payment is complete
'refunded'  # The Payment is refunded
'canceled'  # The Payment has been canceled

Preapproval

Status

Possible values are:

'new'  # Preapproval only exists locally — not known to Paypal
'created'  # Preapproval has been saved on Paypal
'error'  # Something has gone wrong, check status_detail for more info
'returned'  # User has returned via the Preapproval return_url
'approved'  # Preapproval is completed — ready to be used in payment
'canceled'  # Preapproval has been canceled
'used'  # Preapproval has been used in payment

The status describes

Settings

django.conf.settings.PAYPAL_APPLICATION_ID

Your Paypal application ID. Will default to APP-80W284485P519543T if DEBUG is set to True.

django.conf.settings.PAYPAL_USERID

Paypal User ID

django.conf.settings.PAYPAL_PASSWORD

Paypal password

django.conf.settings.PAYPAL_SIGNATURE

Paypal signature

django.conf.settings.PAYPAL_EMAIL

Paypal Email

django.conf.settings.DEFAULT_CURRENCY

Used by python-money, will default to USD

django.conf.settings.PAYPAL_DECIMAL_PLACES

Number of decimal places assigned to the MoneyField (used by Payment and Preapproval models).

django.conf.settings.PAYPAL_MAX_DIGITS

Max number of digits assigned to the Moneyfield (used by Payment and Preapproval models).

django.conf.settings.PAYPAL_TEST_WITH_MOCK

Set whether tests should be run with built-in mocking responses and requests or if the testing should spawn requests that hits Paypal's APIs directly. Defaults to True. Override in your settings file like this:

PAYPAL_TEST_WITH_MOCK = False

Run tests

To run the tests, first install the test requirements:

$ [sudo] pip install -r requirements_test.txt --use-mirrors

The script that runs the tests simulates an installed Django app and is located in paypaladaptive-testrunner/runtests.py. Execute it like this:

$ python paypaladaptive-testrunner/runtests.py paypaladaptive paypaladaptive

Contributing

Do you want to contribute? We'll gladly accept pull requests as long as your code is well tested and contributes to the goal of this library.

License

Creative Commons-licens
django-paypal-adaptive av FundedByMe är licensierad under en Creative Commons Erkännande 3.0 Unported licens.
Based on a work at https://github.com/gmcguire/django-paypal-adaptive.

django-paypal-adaptive's People

Contributors

antonagestam avatar appel268576 avatar rmeritz avatar gmcguire avatar

Watchers

James Cloos avatar Rulong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.