Skip to main content

django-razorpay

Razorpay payment gateway integration in a django project

Installation

  1. Install using pip:

    pip install django-razorpay
    
  2. Add to INSTALLED_APPS in your settings.py:

    INSTALLED_APPS = (
        # ...
        "django_razorpay",
        # ...
    )
    
    DJ_RAZORPAY = {
     "organization_name": "Acme Corp",
     "organization_email": "something@gmail.com",  # Optional
     "organization_domain": "https://something.com",
     "organization_logo": "https://company.com/orlogo.png",  # Optional,
     "nav_links": [("Membership Fee", "/payments/membership-fee"),
                   ("Transactions", "/payments/transactions"),
                   ("Adhoc Pay", "/payments/adhoc"),
                   ("Manual transaction", "/payments/manual-transaction")
                   ],
     "RAZORPAY_VARIANTS": {
         "public_key": "rzp_test_6GvpLSAmWckaMk",
         "secret_key": "Vo9OgyOw1FqGufiqhlWu4Fy32kl",
         "currency": "inr"
     },
      "RAZORPAY_ENABLE_CONVENIENCE_FEE": True,     # You charge a convenience fee to your customer.
      "USE_PAYMENT_LINK": True                     # If enabled it will create payment link, will not use checkout page
    }
    
    from django.contrib.messages import constants as messages
    MESSAGE_TAGS = {
      messages.DEBUG: 'alert-info',
      messages.INFO: 'alert-info',
      messages.SUCCESS: 'alert-success',
      messages.WARNING: 'alert-warning',
      messages.ERROR: 'alert-danger',
    }
    
  3. Include the django_razorpay URLconf in your project urls.py like this to urls.py:

    from django.urls import path, include
    urlpatterns = [
        path('payments/', include('django_razorpay.urls', namespace="django_razorpay")),
        # ....
    ]
    
  4. Run python manage.py migrate to create the django_razorpay models.

  5. Run python manage.py dj_razorpay_init to initialize models models.

  6. If you want to add members, create superuser, login and add.

  7. Visit http://127.0.0.1:8000/payments/ for payments.

Demo

A demo app is provided in example. You can run it from your virtualenv with python manage.py runserver.

Release files for django-razorpay 1.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for django-razorpay 1.1.6
File Interpreter ABI Platform
django_razorpay-1.1.6-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / django_razorpay-1.1.6-py2.py3-none-any.whl

Download URL django_razorpay-1.1.6-py2.py3-none-any.whl
Size 288.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a36cc1d058e6c1528cf1b39e56e6c36887a5ee437991998b8edfc801923f514c
BLAKE2b-256 checksum
How to use checksums
02e3910e485328075a3fd4f16f949891d0dd67534bafe1c6360071d80c366f30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.1.6 This release

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.0.30

1 release file

1.0.28

1 release file

1.0.27

1 release file

1.0.18

1 release file

1.0.17

1 release file

1.0.16

1 release file

1.0.4

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page