Package: django-plans-paypal
Almost automatic integration betweendjango-plansanddjango-paypal.
This will add subscribe buttons to the order page and automatically confirm theOrderafter the payment.Currently it is in experimetal stage, wher only recurring payments (subscribtions) are supported.DocumentationThe full documentation is athttps://django-plans-paypal.readthedocs.io.QuickstartInstall and configuredjango-plansanddjango-paypalapps.
Capture mode is not yet supported, soPAYMENT_VARINANTSwith'capture': Falsewill not get confirmed.Install Django plans paypal:pip install django-plans-paypalAdd it to yourINSTALLED_APPS, before theplans:INSTALLED_APPS=(...'payments','paypal.standard.ipn','plans_paypal',...)Add your bussiness account e-mail address to settings:PAYPAL_BUSSINESS_EMAIL="foo@bar.com"# To enable encrypted PayPal form:PAYPAL_ENCRYPTED_FORM=TruePAYPAL_PRIVATE_CERT=os.path.join(BASE_DIR,'certs/paypal_private.pem')PAYPAL_PUBLIC_CERT=os.path.join(BASE_DIR,'certs/paypal_public.pem')PAYPAL_CERT=os.path.join(BASE_DIR,'certs/paypal_cert.pem')PAYPAL_CERT_ID='xxxxx'Add Djangoplans_paypalto the URL patterns:urlpatterns=[...url(r'^plans-paypal',include('plans_paypal.urls')),...]Overridedjango-plansclassCreateOrderViewso thatget_success_url()returns url ofpaypal-paymentview:defget_success_url(self):returnreverse("paypal-payment",kwargs={'order_id':self.object.id})Sandbox testingSet following settings:PAYPAL_TEST_BUSSINESS_EMAIL="foo@bar.com"PAYPAL_TEST=True# For encrypted PayPal sandbox form:PAYPAL_TEST_PRIVATE_CERT=os.path.join(BASE_DIR,'certs/paypal_private.pem')PAYPAL_TEST_PUBLIC_CERT=os.path.join(BASE_DIR,'certs/paypal_public.pem')PAYPAL_TEST_CERT=os.path.join(BASE_DIR,'certs/paypal_sandbox_cert.pem')PAYPAL_TEST_CERT_ID='xxxx'Redirect user topaypal-payment-sandboxinstead ofpaypal-paymentview.FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.6.0 (2023-03-22)Fix amount received on recurring payments, add tests0.5.1 (2023-02-11)allow only logged users to access the failure view0.5.0 (2022-12-14)Fix tax received on recurring paymentsMore robust receiving original Order ID (if PayPal fails to handle custom_data)update to Django 4.1fix completing recurring payments if first order status is returnedonly log error if custom data can’t be parsed0.4.10 (2022-04-29)fix problem with duplicate paymentsPayPalPaymentAdmin: display connected IPN fields0.4.9 (2022-03-07)make parsing custom_data more robust0.4.8 (2022-01-19)fix last releaseadd tests and test on all supported Django/Python versions through GitHub actions0.4.7 (2022-01-13)fix problem if there was ‘ in custom payment data0.4.6 (2021-12-02)fix problem with creating bad JSON0.4.5 (2021-12-01)fix IPN field editing in PayPalPaymentAdminstore also user e-mail in custom to enable search in IPN admin0.4.4 (2021-12-01)create PayPalPayment before completing the order0.4.3 (2021-11-30)fix problem with recurring paymentsadd created/modified/author auto fields0.4.2 (2021-11-08)fix problem with other IPN types0.4.1 (2021-10-18)cancel order after returning to failure URL0.4.0 (2021-10-18)allow to set up encrypted PayPal form0.3.0 (2021-10-15)fixes and improvements to the sandbox/production functionalityreverse sandbox logic - if noPAYPAL_TEST, the sandbox view would return production so nobody can pay through sandbox on production server0.2.2 (2021-10-12)fix foregotten pudb0.2.1 (2021-10-12)add sandbox view, so both production and sandbox can be used on one server0.2.0 (2021-10-11)fix periods to complain with PayPal maximal durations0.1.0 (2021-10-08)hook ipn.PayPalIpn object with plans.Order (for later usage e.g. determining PayPal fee)set plan renewal for django-plans0.0.2 (2018-08-05)Payment process without capturing should workAutomatic buttons generation0.0.1 (2018-07-23)First release on PyPI.