{ "info": { "author": "Oleg Kleschunov", "author_email": "igorkleschunov@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=================================\ndjango-ok-payparts |PyPI version|\n=================================\n\n|Build Status| |Code Health| |Python Versions| |Requirements Status| |license| |PyPI downloads|\n\nSimple django integration for API \"\u041e\u043f\u043b\u0430\u0442\u0430 \u0427\u0430\u0441\u0442\u044f\u043c\u0438 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435\": `\u0421\u0445\u0435\u043c\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u21161 (\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0442\u0435\u0436\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u041e\u043f\u043b\u0430\u0442\u0430 \u0447\u0430\u0441\u0442\u044f\u043c\u0438/\u041c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0441\u0441\u0440\u043e\u0447\u043a\u0430)`_.\n\nInstallation\n============\n\nInstall with pip:\n\n.. code:: shell\n\n $ pip install django-ok-payparts\n\n\nUpdate INSTALLED_APPS:\n\n.. code:: python\n\n INSTALLED_APPS = [\n ...\n 'payparts',\n ...\n ]\n\n\nAdd ``payparts.urls`` to your project urlpatterns:\n\n.. code:: python\n\n urlpatterns = [\n ...\n path('', include('payparts.urls')),\n ...\n ]\n\n\nMake migrations:\n\n.. code:: shell\n\n $ python manage.py migrate\n\n\nAvailable settings\n==================\n\n``PAYPARTS_API_PASSWORD`` - Password of your store.\n\n``PAYPARTS_API_STORE_ID`` - Your store's ID.\n\n``PAYPARTS_API_URL`` - Url for creation of a payment. By default: `https://payparts2.privatbank.ua/ipp/v2/`.\n\n``PAYPARTS_API_REDIRECT_URL`` - Url to redirect after a success payment. By default: `https://payparts2.privatbank.ua/ipp/v2/payment`.\n\nUsage\n=====\n\nHow to create a payment\n-----------------------\n\n1. Prepare your order's data:\n\n.. code:: python\n\n data = {\n \"order_id\": f\"order-123\",\n \"amount\": 400.00,\n \"parts_count\": 2, # optional, default value is '2'\n \"merchant_type\": \"II\", # optional, default value is 'II'\n \"products\": [\n {\n \"name\": \"\u0422\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\",\n \"count\": 2,\n \"price\": 100.00\n },\n {\n \"name\": \"\u041c\u0438\u043a\u0440\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u043a\u0430\",\n \"count\": 1,\n \"price\": 200.00\n }\n ],\n # also optional fields (can be set in your cabinet):\n \"response_url\": \"http://shop.com/response\", \n \"redirect_url\": \"http://shop.com/redirect\",\n }\n\n\n2. Get your redirect url:\n\n.. code:: python\n\n from payparts.use_cases import GetRedirectUrlUseCase\n redirect_url = GetRedirectUrlUseCase().execute(data)\n\n\n3. Redirect a user to the url.\n\n\nHow to process a callback\n-------------------------\n\nWhenever a callback is processed a signal will be sent with the result of the transaction.\n\nThere are two signals (``payparts.signals``):\n\n1) ``pay_parts_success_callback`` - if signature is valid.\n2) ``pay_parts_invalid_callback`` - if signature is not valid.\n\nConnect the signals to actions to perform the needed operations when a successful payment is received:\n\n.. code:: python\n\n from payparts.signals import pay_parts_success_callback, pay_parts_invalid_callback\n\n from orders.models import Order\n\n\n def success_callback(sender, log, request, **kwargs):\n # ensure success state\n if log.is_success:\n order = Order.objects.get(pk=log.order_id)\n order.set_success_payment_state()\n\n pay_parts_success_callback.connect(success_callback)\n\n\n.. |PyPI version| image:: https://badge.fury.io/py/django-ok-payparts.svg\n :target: https://badge.fury.io/py/django-ok-payparts\n.. |Build Status| image:: https://travis-ci.org/LowerDeez/ok-payparts.svg?branch=master\n :target: https://travis-ci.org/LowerDeez/ok-payparts\n :alt: Build status\n.. |Code Health| image:: https://api.codacy.com/project/badge/Grade/ec55733ec684421aaee9e3a334c5f4a7 \n :target: https://www.codacy.com/app/LowerDeez/ok-payparts\n :alt: Code health\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/django-ok-payparts.svg\n :target: https://pypi.org/project/django-ok-payparts/\n :alt: Python versions\n.. |license| image:: https://img.shields.io/pypi/l/django-ok-payparts.svg\n :alt: Software license\n :target: https://github.com/LowerDeez/ok-payparts/blob/master/LICENSE\n.. |PyPI downloads| image:: https://img.shields.io/pypi/dm/django-ok-payparts.svg\n :alt: PyPI downloads\n.. |Requirements Status| image:: https://requires.io/github/LowerDeez/ok-payparts/requirements.svg?branch=master\n\n\n.. _\u0421\u0445\u0435\u043c\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u21161 (\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0442\u0435\u0436\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u041e\u043f\u043b\u0430\u0442\u0430 \u0447\u0430\u0441\u0442\u044f\u043c\u0438/\u041c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0441\u0441\u0440\u043e\u0447\u043a\u0430): https://bw.gitbooks.io/api-oc/content/pay.html", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/LowerDeez/ok-payparts", "keywords": "python,payparts,django", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-ok-payparts", "package_url": "https://pypi.org/project/django-ok-payparts/", "platform": "", "project_url": "https://pypi.org/project/django-ok-payparts/", "project_urls": { "Homepage": "https://github.com/LowerDeez/ok-payparts" }, "release_url": "https://pypi.org/project/django-ok-payparts/0.3/", "requires_dist": null, "requires_python": "", "summary": "Django integration for API \"https://bw.gitbooks.io/api-oc/content/pay.html\".", "version": "0.3" }, "last_serial": 5275956, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "729322cb19d3c3096c78c19782d4f590", "sha256": "e49ba7e250044f95f766c63789addb1e0ae4854a5964d80b3ed740ec4ab483eb" }, "downloads": -1, "filename": "django-ok-payparts-0.1.tar.gz", "has_sig": false, "md5_digest": "729322cb19d3c3096c78c19782d4f590", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10375, "upload_time": "2019-04-05T11:33:43", "url": "https://files.pythonhosted.org/packages/2b/aa/a46bf286db8f61e17fac0c86ab8ac98f6946db05dfdc951cadca778b81ee/django-ok-payparts-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f2b33d48b6a252c82c007860f7ebe658", "sha256": "75865db2bb6e8668e119e63f4a5eb5048892827f966a4f2d6db26eecf3d16d27" }, "downloads": -1, "filename": "django-ok-payparts-0.2.tar.gz", "has_sig": false, "md5_digest": "f2b33d48b6a252c82c007860f7ebe658", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10608, "upload_time": "2019-04-18T14:15:49", "url": "https://files.pythonhosted.org/packages/d9/5b/5ff480da50cb7dbc5e0d556a2ed378aaef2326c71768d7372e79bf93867a/django-ok-payparts-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "7461fb39afe0aa8d82bd5826dc38b415", "sha256": "2812c92e8df986717865d37a4c562b8ad1c596b5bfd96cbe33fbce5b8f6ae1bf" }, "downloads": -1, "filename": "django-ok-payparts-0.3.tar.gz", "has_sig": false, "md5_digest": "7461fb39afe0aa8d82bd5826dc38b415", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13034, "upload_time": "2019-05-16T07:08:34", "url": "https://files.pythonhosted.org/packages/b3/41/628865e02d4cc737286eb61b2d8d71936fa55ef68f41ceaa2faf7babe38d/django-ok-payparts-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7461fb39afe0aa8d82bd5826dc38b415", "sha256": "2812c92e8df986717865d37a4c562b8ad1c596b5bfd96cbe33fbce5b8f6ae1bf" }, "downloads": -1, "filename": "django-ok-payparts-0.3.tar.gz", "has_sig": false, "md5_digest": "7461fb39afe0aa8d82bd5826dc38b415", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13034, "upload_time": "2019-05-16T07:08:34", "url": "https://files.pythonhosted.org/packages/b3/41/628865e02d4cc737286eb61b2d8d71936fa55ef68f41ceaa2faf7babe38d/django-ok-payparts-0.3.tar.gz" } ] }