{
"info": {
"author": "101Loop",
"author_email": "pypidev@civilmachines.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 1.11",
"Framework :: Django :: 2.0",
"Framework :: Django :: 2.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Internet :: WWW/HTTP"
],
"description": "# PayTM | Django REST Framework\n\n**A package for PayTM integration in Django REST Framework**
\n\n`PayTM | Django REST Framework` is a Django packaged app that provides necessary `views` based in Django REST Framework.\nIt enables easy integration of PayTM Payment Gateway with Web/Mobile Application with a RESTful API based server.\n\nContributors: **WE'RE LOOKING FOR SOMEONE WHO CAN CONTRIBUTE IN DOCS**\n- **[Civil Machines Technologies Private Limited](https://github.com/civilmahines)**: For providing me platform and\nfunds for research work. This project is hosted currently with `CMT` only. \n- **[Himanshu Shankar](https://github.com/iamhssingh)**: Himanshu Shankar has initiated this project and worked on this\nproject to collect useful functions and classes that are being used in various projects.\n\n#### Installation\n\n- Download and Install via `pip`\n```\npip install drf_paytm\n```\nor
\nDownload and Install via `easy_install`\n```\neasy_install drf_paytm\n```\n- Add, if wanted, `drfaddons` in `INSTALLED_APPS` (This is although not required!)\n```\nINSTALLED_APPS = [\n ...\n 'drf_paytm',\n ...\n]\n```\n- Also add other dependencies in `INSTALLED_APPS`
\n```\nINSTALLED_APPS = [\n ...\n 'drfaddons',\n ...\n]\n```\n- Include urls of `drf_paytm` in `urls.py`\n```\nurlpatterns = [\n ...\n path('api/paytm/', include('drf_paytm.urls')),\n ...\n]\n\n# or\n\nurlpatterns = [\n ...\n url(r'^api/paytm/', include('drf_paytm.urls')),\n ...\n]\n```\n- Run migrate command:\n```\npython manage.py migrate\n```\n\n### Frontend API Integration Guideline\n1. Prepare `json` data to post on `request/` view: `{\"oid\": \"ORDER_ID\", \"amount\": \"200\", \"callback_url\": \"FRONT_END APP URL\"}`\n2. `callback_url`: FrontEnd URL to open when payment is successful. Must not have any queryset as `?oid=ORDER_ID` is \nappended.\n3. Post to `request/` and parse response to prepare a HTML form as per code shown below.\n4. Don't add `` for empty and `null` fields from json response of `request/` API.\n5. Set `CALLBACK_URL` in HTML from `paytm_callback_url` of JSON.\n6. Once the payment is done, user is redirected to `response/` view which will verify payment.\n7. If payment is verified by Django Backend, user is redirected to `http://callback_url?oid=ORDER_ID`.\n8. Access `order/ORDER_ID/` API to get `is_completed` status. If it's `false`, check `last_payment_status`.\n\n**Note: In case of critical failure, server's JSON response is shown.**\n\nSample HTML Code to be generated by FrontEnd App(from PayTM)\n```\n\n