Skip to main content

paypal for django

Project description

提供paypal支付相关的view和方法

Quick start

  1. Install:

    pip install django_paypal2
    
  2. Add “paypal” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'paypal',
    ]
    
  3. Add paypal config to settings.py:

    PAYPAL = {
        "SERVER_URL": "http://localhost:8000", # current site host and port
        "sandbox": False,  # True or False
        "client_id": "xxx",
        "client_secret": "", # you can get id and secret from paypal
    }
    
  4. Include the polls URLconf in your project urls.py like this:

    url(r'^paypal/', include('paypal.urls')),
    
  5. Migrate db

  6. Create transaction and redirect to paypal

    from paypal.models import PaypalTransaction
    
    tx = PaypalTransaction(description="sample pay")
    tx.add_item("sample", 'USD', float(amount))
    tx.reference_id = "your reference id"
    tx.save()
    return redirect('paypal_redirect', uid=tx.uid)
    

Project details


Release history Release notifications

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.4.4

History Node

0.4.3

History Node

0.4.2

History Node

0.4.1

This version
History Node

0.4.0

History Node

0.3.1

History Node

0.3.0

History Node

0.2.0

History Node

0.1.1

History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-paypal2-0.4.0.tar.gz (10.7 kB) Copy SHA256 hash SHA256 Source None Sep 14, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page