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
-
Add "payment" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ... 'payment', ]
-
Include the payment URLconf in your project
urls.py
like this::path('payment/', include('payment.urls')),
-
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'
-
While using the
checkout
views, make sure the URL has string argument as shown on the template file using (was made to ease the process and is an integral part) -<div> <a href="{% url 'checkout' 'Stripe' %}">Stripe Checkout</a> <a href="{% url 'checkout' 'Paypal' %}">PayPal Checkout</a> </div>
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
Built Distribution
Hashes for django-stripe-paypal-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 481387d854d4d855f98509c457828e4738c20c27cc1ddd0ab91e4bfc72307cfb |
|
MD5 | 11e93fb52f1bbfc6be186f5a8c26623f |
|
BLAKE2b-256 | f53b83d66a135ef8319c6005d95179cd37e3bc3a29b8d5d1987c39c9d31b0531 |
Hashes for django_stripe_paypal-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4748d8957b77a5c16e5da6fb8b214aea8f66f42cac46ca4888e8083dd7095a17 |
|
MD5 | 3dda00637279ed8dd51fd6bf439361c7 |
|
BLAKE2b-256 | 8cdd0393c1c31ff36a0744ded8c3e2b1ff615cff322160cbe744e92c1c7c580f |