Metadata-Version: 2.1
Name: django-stripe-paypal
Version: 0.1.2
Summary: A Django app to integrate stripe and paypal one-time payments.
Home-page: UNKNOWN
License: MIT
Project-URL: GitHub, https://github.com/botent/django-stripe-paypal
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# 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  =  'template_success.html' or 'appname/template_success.html'

	FAIL_TEMPLATE_PATH  =  'template_fail.html' or 'appname/template_fail.html'
	```
	
4. Migrate the DB (i.e. ``python manage.py migrate`` )
5. 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```

## Templates Guide (No offence, pros)
 ```
	Project
	|
	|
	|___App1
	    |
	    |
	    |___Templates
	        |
	        |
	        |___App1
	            |___template1.html
```

If you follow the above directory structure, in ```settings.py``` under ```SUCCESS_TEMPLATE_PATH``` and ```FAIL_TEMPLATE_PATH``` input as - ```App1/template1.html```.

For the users with ```templates``` in root, proceed as usual! 

## Live/Production Guide

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




