Skip to main content

A Django app helps to create/fetch an order, subscription-plan, subscription on Paytring.

Project description

Django Paytring Collections is a Django app designed to facilitate the creation and retrieval of orders, subscription plans, and subscriptions on Paytring.

Installation

  1. Install the latest Paytring:

    pip install paytring
  2. Install Django Rest Framework:

    pip install djangorestframework
  3. Install Django Paytring plugin:

    pip install django-paytring

Quick Start

  1. Add “order” to your INSTALLED_APPS setting in your project’s settings.py file:

    INSTALLED_APPS = [
        ...,
        "order",
    ]
  2. Include the order URLconf in your project urls.py:

    path('order/', include("order.urls")),
  3. Add the CALLBACK_URL variable to your settings.py file:

    CALLBACK_URL = "www.xyz.com"
  4. Set up Environment Variables in your settings.py file:

    import os
    os.environ['key'] = "your_key"
    os.environ['secret'] = "your_secret"
  5. Start the development server.

  6. Use “order/create-order” (POST) to create an order on Paytring. Include the following JSON in the request:

    {
        "payment_info": {
            "amount": "100",
            "currency": "INR"
        },
        "customer_info": {
            "cname": "test",
            "email": "abc@gmail.com",
            "phone": "9999999999"
        },
        "billing_info": {
            "firstname": "John",
            "lastname": "Doe",
            "phone": "09999999999",
            "line1": "Address Line 1",
            "line2": "Address Line 2",
            "city": "Gurugram",
            "state": "Haryana",
            "country": "India",
            "zipcode": "122001"
        },
        "shipping_info": {
            "firstname": "John",
            "lastname": "Doe",
            "phone": "09999999999",
            "line1": "Address Line 1",
            "line2": "Address Line 2",
            "city": "Gurugram",
            "state": "Haryana",
            "country": "India",
            "zipcode": "122001"
        },
        "notes": {
            "udf1": "udf1",
            "udf2": "udf2",
            "udf3": "udf3"
        }
    }
  7. Use “order/create-order/{paytring-order-id}” to retrieve order details.

  8. Use “order/subscription-plan” (POST) to create a subscription plan on Paytring. Include the following JSON in the request:

    {
        "payment_info": {
            "amount": "100",
            "currency": "INR"
        },
        "plan_info": {
            "title": "Daily 1 rupee plan",
            "description": "test plan",
            "frequency": "1",
            "cycle": "12"
        },
        "notes": {
            "udf1": "udf1",
            "udf2": "udf2",
            "udf3": "udf3"
        }
    }
  9. Use “order/subscription-plan/{paytring-plan-id}” to retrieve subscription plan details.

  10. Use “order/subscription” (POST) to create a subscription on Paytring. Include the following JSON in the request:

    {
        "payment_info": {
            "amount": "100",
            "currency": "INR"
        },
        "plan_id": "123xxxxxxxxxxxxxxx",
        "customer_info": {
            "cname": "test",
            "email": "abc@gmail.com",
            "phone": "9999999999"
        },
        "billing_info": {
            "firstname": "John",
            "lastname": "Doe",
            "phone": "09999999999",
            "line1": "Address Line 1",
            "line2": "Address Line 2",
            "city": "Gurugram",
            "state": "Haryana",
            "country": "India",
            "zipcode": "122001"
        },
        "shipping_info": {
            "firstname": "John",
            "lastname": "Doe",
            "phone": "09999999999",
            "line1": "Address Line 1",
            "line2": "Address Line 2",
            "city": "Gurugram",
            "state": "Haryana",
            "country": "India",
            "zipcode": "122001"
        },
        "notes": {
            "udf1": "udf1",
            "udf2": "udf2",
            "udf3": "udf3"
        }
    }
  11. Use “order/subscription/{paytring-subscription-id}” to retrieve subscription details.

Note: You will receive order, plan, and subscription IDs in the response after creating them on Paytring.

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

django-paytring-1.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_paytring-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file django-paytring-1.0.0.tar.gz.

File metadata

  • Download URL: django-paytring-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for django-paytring-1.0.0.tar.gz
Algorithm Hash digest
SHA256 03c8d8903d6c649048ac16f6679ac0d3b7fbf488cde7759ca87d4e91fb12c3b2
MD5 67e2acdfd7f4ab8a288da5ebea9162ce
BLAKE2b-256 8db15ea8d873a7a42bee2a547cf2d9cc7867e70be0b16936614c1dac40ddac48

See more details on using hashes here.

File details

Details for the file django_paytring-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_paytring-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cefe97078efa8fb3c98d141cf2c6874bf78622b457434d4b5b8e810e7f9fdb39
MD5 1e5947efbf5d3b887612b5ebb03c9b66
BLAKE2b-256 2b077541d6efaf9fd959c82d8d09ed871e12c14e86ce37b25851d783788ab824

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page