{ "info": { "author": "Denis Stebunov", "author_email": "support@unipag.com", "bugtrack_url": null, "classifiers": [], "description": "Unipag Client for Python\n========================\n\n.. image:: https://travis-ci.org/unipag/unipag-python.png?branch=master\n :target: https://travis-ci.org/unipag/unipag-python\n\nRequirements\n------------\n\nPython version 2.6 or 2.7, or PyPy. For better security, we recommend to\ninstall `Python Requests`_ library, since it supports SSL certs verification.\nTo install Requests, simply run: ::\n\n $ pip install requests\n\nor using easy_install: ::\n\n $ easy_install requests\n\nRequests library is optional. If it is not installed, Unipag Client will use\nurllib2 instead. All features of Unipag Client will remain fully functional, but\nit will not verify SSL certificate of Unipag API.\n\n.. _`Python Requests`: http://docs.python-requests.org/\n\nInstallation\n------------\n\nInstall using pip, recommended (`why?`_): ::\n\n $ pip install unipag\n\nor using easy_install: ::\n\n $ easy_install unipag\n\n.. _`why?`: http://www.pip-installer.org/en/latest/other-tools.html#pip-compared-to-easy-install\n\nSample usage\n------------\n\nCreate invoice\n~~~~~~~~~~~~~~\n\n.. code:: python\n\n import unipag\n import unipag.defaults\n\n # Get your key at https://my.unipag.com\n unipag.defaults.api_key = ''\n\n invoice = unipag.Invoice.create(\n amount=42,\n currency='USD'\n )\n\n # Done. invoice.id now contains unique id of this invoice at Unipag.\n\nInstall Unipag widget\n~~~~~~~~~~~~~~~~~~~~~\n\nTry our widget for payments workflow handling. It's quite optional, but you\nmight find it handy and time-saving.\n\n.. code:: html\n\n \n\nPlease note, it is important that you use **public key** for widget.\nPublic keys have restricted access to your data and are supposed to be safe\nfor use in browser.\n\n\nHandle webhook from Unipag\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCreate a standalone page on your website which will handle events sent by\nUnipag. Register URL of this page at ``_ > Settings > Webhooks.\nInitialize page code as following (example for Django):\n\n.. code:: python\n\n import unipag\n import unipag.defaults\n from django.http import HttpResponse, HttpResponseBadRequest\n\n # Get your key at https://my.unipag.com\n unipag.defaults.api_key = ''\n\n\n def handle_unipag_hook(request):\n \"\"\"\n An example of Django view for handling hooks from Unipag.\n \"\"\"\n event = unipag.objects_from_json(request.body)\n\n # Unipag should send correctly constructed event objects\n if not isinstance(event, unipag.Event):\n return HttpResponseBadRequest('Bad request')\n\n # In this example we subscribe to invoice-related events only\n if isinstance(event.related_object, unipag.Invoice):\n\n # Always reload information from Unipag for security reasons:\n invoice = event.related_object.reload()\n\n # Now invoice object contains the most recent information,\n # securely loaded from Unipag.\n\n # ... do something with invoice data ...\n\n # Return HTTP 200 to let Unipag know that we successfully received message\n return HttpResponse('OK')\n\nTip: webhooks can be a pain to debug. Check out Unipag Network Activity log, it\nis available at ``_ > Network Activity. You may find it\nuseful for your webhook handlers debugging.\n\nUsage of invoice \"custom_data\" property\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nInvoice objects have an optional \"custom_data\" property, which can be used to\nstore up to 32KB of arbitrary data in JSON format. You can freely use this field\nto store additional information about invoices, which is specific for your\napplication.\n\nIn Python, you can use dicts, lists, strings, numbers, boolean and None values\nin any combination to store them in custom_data. All of these types will be\nproperly serialized when sending to Unipag and deserialized when fetching them\nback. Consider the following examples, all of them are valid usages of\ncustom_data property:\n\n.. code:: python\n\n import unipag\n import unipag.defaults\n\n # Get your key at https://my.unipag.com\n unipag.defaults.api_key = ''\n\n invoice = unipag.Invoice.create(\n amount=42,\n currency='USD'\n )\n\n # Store dicts, lists and single values\n invoice.custom_data = {\n 'address': {\n 'billing': '5863 Gentle Pond Rise, Suspension, Ontario, CA',\n 'shipping': '9215 Red Ridge, Lancer, Idaho, US',\n },\n 'contact_phones': ['555-4242', '555-9000'],\n 'magic_number': 42,\n }\n invoice.save()\n\n # Clean everything out\n invoice.custom_data = None\n invoice.save()\n\n # Store a single value. Yes, it will be a valid JSON.\n invoice.custom_data = True\n invoice.save()\n\n # Store list as a root element. Let's assume that we need to save cart items:\n invoice.custom_data = [\n {\n \"product\": \"apples\",\n \"price\": 10.0,\n \"quantity\": 1\n },\n {\n \"product\": \"oranges\",\n \"price\": 12.5,\n \"quantity\": 2\n }\n ]\n invoice.save()\n\n\nReport bugs\n-----------\n\nReport issues to the project's `Issues Tracking`_ on Github.\n\n.. _`Issues Tracking`: https://github.com/unipag/unipag-python/issues", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/unipag/unipag-python", "keywords": null, "license": "The ISC License\n\nCopyright (c) 2012, Unipag.com \n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "unipag", "package_url": "https://pypi.org/project/unipag/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/unipag/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/unipag/unipag-python" }, "release_url": "https://pypi.org/project/unipag/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Unipag Client for Python", "version": "0.2.0" }, "last_serial": 855655, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "59dc91b70d53dd1c3feb2cda6d7daa1a", "sha256": "cbfdee774ba59566ed6973282df6b55b96a90e6a0d73747831a1190cbbc9f458" }, "downloads": -1, "filename": "unipag-0.0.1.tar.gz", "has_sig": false, "md5_digest": "59dc91b70d53dd1c3feb2cda6d7daa1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4913, "upload_time": "2012-11-20T10:39:14", "url": "https://files.pythonhosted.org/packages/9f/b3/6da238af21fd33a6f6f2217c3119aacef6bd7f8dbcf6ba005189aff2fcef/unipag-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "80da11d5a37bd9d030de6f8e13aaae82", "sha256": "5555c97d3b6e4713d3a4f33fb9bd8b63cec165241ff246b73578504eff2e7527" }, "downloads": -1, "filename": "unipag-0.0.2.tar.gz", "has_sig": false, "md5_digest": "80da11d5a37bd9d030de6f8e13aaae82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5360, "upload_time": "2013-01-23T15:26:36", "url": "https://files.pythonhosted.org/packages/35/1c/4a5153310d625a338a64c1f574814d48a5d1ccf8dcb745f9f9a27be90086/unipag-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "29be59b0341ad974320e0d4bcd76448c", "sha256": "d0806623fae8004c147e3d2d38aae94620e999754ffdf11f18a368dabf6babeb" }, "downloads": -1, "filename": "unipag-0.0.3.tar.gz", "has_sig": false, "md5_digest": "29be59b0341ad974320e0d4bcd76448c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5806, "upload_time": "2013-01-29T06:24:45", "url": "https://files.pythonhosted.org/packages/db/ec/736a4e225716820bdb8e1fc55649ab7f6943951fb48ee4da787759e177fa/unipag-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "9eebee69fa7e08c2e279d74c511da883", "sha256": "a4314f214933b415ad0c9201e92ecd982d252f69064d6ef84e48d07092c9dd48" }, "downloads": -1, "filename": "unipag-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9eebee69fa7e08c2e279d74c511da883", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8269, "upload_time": "2013-07-09T10:57:10", "url": "https://files.pythonhosted.org/packages/fe/a7/15772f3fad2351603c54a136298c2258bd730bc608f113f060fc7eae6e28/unipag-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7bb1283043c22cf30723537a4636f084", "sha256": "cb6e03ac7a1fd65c06b9002e808e4c71c051d80c2dfc22229c00fbbdbe6237ce" }, "downloads": -1, "filename": "unipag-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7bb1283043c22cf30723537a4636f084", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9842, "upload_time": "2013-08-27T04:58:14", "url": "https://files.pythonhosted.org/packages/ae/08/d9e83fe9898f6f68a54992ef28693cd8fe5ed5784cf21ce22c542a496f0a/unipag-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6dc6e5df422255cf0b13f89963d6d8ad", "sha256": "d7e2b5745359ae69e3469f8724f1f6bb943c204617f79cdf3e4949d477afd31e" }, "downloads": -1, "filename": "unipag-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6dc6e5df422255cf0b13f89963d6d8ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9860, "upload_time": "2013-09-03T12:52:24", "url": "https://files.pythonhosted.org/packages/e7/e4/86a42968a71748e6ac467cec45dcf3e5e4f7812332c3becdbe3cb8709adf/unipag-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6dc6e5df422255cf0b13f89963d6d8ad", "sha256": "d7e2b5745359ae69e3469f8724f1f6bb943c204617f79cdf3e4949d477afd31e" }, "downloads": -1, "filename": "unipag-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6dc6e5df422255cf0b13f89963d6d8ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9860, "upload_time": "2013-09-03T12:52:24", "url": "https://files.pythonhosted.org/packages/e7/e4/86a42968a71748e6ac467cec45dcf3e5e4f7812332c3becdbe3cb8709adf/unipag-0.2.0.tar.gz" } ] }