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', pk=tx.pk)

Project details


Download files

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

Source Distribution

django-paypal2-0.1.1.tar.gz (10.0 kB view details)

Uploaded Source

File details

Details for the file django-paypal2-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-paypal2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 25f72159f044d7f030125de0c3becbf7e59b9309423142bbec3582700389dba7
MD5 d9a32dcd770a7edcae2db5fdc69cf059
BLAKE2b-256 73d22d4b67d2fca7f5942de8db37c5ea585f0c8499ed0c3cfcb4d621e3e8980f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page