Package: django-stripe-paypal
Django-Stripe-PayPal (DSP)DSP is a Django app to accept payments (one-time) from Paypal and (one-time and subscriptions) Stripe.Quick SetupAdd "payment" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
        ...
        'payment',
	    ]Include the payment URLconf in your projecturls.pylike this::path('payment/', include('payment.urls')),Insettings.pyadd the following -STRIPE  =  True
PAYPAL  =  True

STRIPE_PRODUCTION = False

STRIPE_API_KEY  =  ''
STRIPE_AMOUNT  =  10000
STRIPE_CURRENCY  =  'gbp'
STRIPE_PRODUCT_NAME  =  ''
STRIPE_WEBHOOK_SECRET = ''    

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'
# For users who cancelled their subscriptions and continue till their period ends
DISCONTINUE_TEMPLATE_PATH = 'template_discontinue.html' or 'appname/template_discontinue.html' 
# For users who cancelled their subscriptions IMMEDIATELY
CANCEL_TEMPLATE_PATH = 'template_cancel.html' or 'appname/template_cancel.html'Migrate the DB (i.e.python manage.py migrate)While using thecheckoutviews, 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>STRIPEandPAYPALdefaults toTruei.e. both the payment services are being used. Change according to your needs. ForSTRIPE_AMOUNT, use the non-decimal representation of currency (i.e. for £10, input 1000) and forPAYPAL_AMOUNT, use the standard notation (i.e. £10 as 10 or 10.00).SUCCESS_TEMPLATE_PATHandFAIL_TEMPLATE_PATHrefer to the templates for payment success and fail/cancel views respectively. Add your custom path here.Thecheckoutandsuccessviews use user object to store records, so ensure that the user is signed in before processing the checkout (LoginRequiredMixinis in place, but consider this a friendly reminder) - make sure yourlogin_urlis configured properly insettings.pySubscriptions GuideStripeSubscriptionview is responsible for initiating a transaction. In your templates, you need to provide parameterpriceidwhich you can obtain fromhttps://dashboard.stripe.com/productsas -><a href="{% url 'stripe-sub' 'priceid' %}">Premium</a>The user is then redirected to Stripe URL and an object is created in theSubscriptionModel which gets updated/deleted upon success/fail respectively.StripeWebhookview records the following events emitted by the Stripe Webhook --'invoice.finalized',
            'invoice.payment_succeeded',
            'invoice.payment_action_required',
            'invoice.payment_failed',
            'invoice.updated',
            'invoice.paid',
            'payment_intent.succeeded',
            'payment_intent.failed',
            'payment_intent.canceled',
            'payment_intent.created',
            'customer.subscription.created',
            'customer.subscription.deleted',
            'customer.subscription.updated',
            'customer.source.expiring',
            'charge.succeeded',
            'charge.failed',StripeSubscriptionCancelview ends the subscription immediately and sets Active state to False for the UserStripeSubscriptionModifyview ends the subscription at the period end date. [Will soon update the ACTIVE status code]Templates Guide (No offence, pros)Project
   |
   |
   |___App1
       |
       |
       |___Templates
           |
           |
           |___App1
               |___template1.htmlIf you follow the above directory structure, insettings.pyunderSUCCESS_TEMPLATE_PATHandFAIL_TEMPLATE_PATHinput as -App1/template1.html.For the users withtemplatesin root, proceed as usual!Live/Production GuidePAYPAL_SANDBOXdefaults toTrueand in live/production, change it toFalseand changeSTRIPE_PRODUCTIONtoTrue