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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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