Skip to main content

A Django app to integrate stripe and paypal one-time payments.

Project description

Django-Stripe-PayPal (DSP)

DSP is a Django app to accept payments (one-time) from Paypal and Stripe. (Will soon add subscriptions and payouts)

Quick Setup

  1. Add "payment" to your INSTALLED_APPS setting like this::

       INSTALLED_APPS = [
            ...
            'payment',
    	    ]
    
    
  2. Include the payment URLconf in your project urls.py like this::

    path('payment/', include('payment.urls')),

  3. In settings.py add the following -

    STRIPE  =  True
    PAYPAL  =  True
    
    STRIPE_PRODUCTION = False
    
    STRIPE_API_KEY  =  ''
    STRIPE_AMOUNT  =  10000
    STRIPE_CURRENCY  =  'gbp'
    STRIPE_PRODUCT_NAME  =  ''
    
    PAYPAL_SANDBOX  =  True
    PAYPAL_CLIENT_KEY  =  ''
    PAYPAL_SECRET_KEY  =  ''
    PAYPAL_AMOUNT  =  10
    PAYPAL_CURRENCY_CODE  =  'gbp'
      
    SUCCESS_TEMPLATE_PATH  =  'success.html'
    
    FAIL_TEMPLATE_PATH  =  'fail.html'
    

STRIPE and PAYPAL defaults to True i.e. both the payment services are being used. Change according to your needs. For STRIPE_AMOUNT, use the non-decimal representation of currency (i.e. for £10, input 1000) and for PAYPAL_AMOUNT, use the standard notation (i.e. £10 as 10 or 10.00).

SUCCESS_TEMPLATE_PATH and FAIL_TEMPLATE_PATH refer to the templates for payment success and fail/cancel views respectively. Add your custom path here.

The checkout and success views use user object to store records, so ensure that the user is signed in before processing the checkout (LoginRequiredMixin is in place, but consider this a friendly reminder) - make sure your login_url is configured properly in settings.py

Live/Production Guide

PAYPAL_SANDBOX defaults to True and in live/production, change it to False and change STRIPE_PRODUCTION to True

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-stripe-paypal-0.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_stripe_paypal-0.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file django-stripe-paypal-0.1.tar.gz.

File metadata

  • Download URL: django-stripe-paypal-0.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for django-stripe-paypal-0.1.tar.gz
Algorithm Hash digest
SHA256 a963f8610957cbc33e44bfccebdaeea07e7e1b4036fd3f8d850cef7f335e6596
MD5 f71407a5187a76c4069da4a89d7fb02c
BLAKE2b-256 5846915186b81ce3fbfca3cc60990170ab02fb037c01053ca62174eb2965a445

See more details on using hashes here.

File details

Details for the file django_stripe_paypal-0.1-py3-none-any.whl.

File metadata

  • Download URL: django_stripe_paypal-0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for django_stripe_paypal-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a33a905d5df2627344114a3a5dc9538966b07e209dc4f70a8d153e8c0d17f2d4
MD5 3fa84ffc9bd90d7411f409fe15337c9c
BLAKE2b-256 ee671c12fa408258179d1ec811dc1b5b9216e3184187978a9b8d5d13bf3b1c12

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