{ "info": { "author": "Simon Fransson", "author_email": "simon@dessibelle.se", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Topic :: Software Development" ], "description": "Django SHOP Payer Backend\n=========================\n\n|Build Status| |Coverage Status| |Latest Version|\n\nDjango SHOP payment backend for `Payer `__. Uses\n`python-payer-api `__\nfor interacting with the API.\n\nInstallation\n------------\n\n::\n\n pip install django-shop-payer-backend\n\nAdd to installed apps\n\n.. code:: python\n\n INSTALLED_APPS = [\n ...\n 'polymorphic',\n 'shop'\n 'shop.addressmodel',\n 'django_shop_payer_backend',\n ...\n ]\n\nConfigure one ore more payment backends\n\n.. code:: python\n\n SHOP_PAYMENT_BACKENDS = [\n 'django_shop_payer_backend.backends.PayerCreditCardPaymentBackend',\n 'django_shop_payer_backend.backends.PayerBankPaymentBackend',\n 'django_shop_payer_backend.backends.PayerInvoicePaymentBackend',\n 'django_shop_payer_backend.backends.PayerPhonePaymentBackend',\n ]\n\nYou could also use the ``GenericPayerBackend`` in order to let the user\nchoose payment method *after* being redirected to Payer, or define a\nsubclass of your own, listing a custom set of methods in the\n``payment_methods`` property. This might be a good option if you are\nusing the Payer backend along with other backends such as Paypal etc.\n\nConfiguration\n-------------\n\nAdd your keys to settings.py\n\n.. code:: python\n\n SHOP_PAYER_BACKEND_AGENT_ID = \"AGENT_ID\"\n SHOP_PAYER_BACKEND_ID1 = \"6866ef97a972ba3a2c6ff8bb2812981054770162\"\n SHOP_PAYER_BACKEND_ID2 = \"1388ac756f07b0dda2961436ba8596c7b7995e94\"\n\nThe following settings are optional\n\n.. code:: python\n\n # Used for white/blacklisting callback IPs\n SHOP_PAYER_BACKEND_IP_WHITELIST = [\"192.168.0.1\"]\n SHOP_PAYER_BACKEND_IP_BLACKLIST = [\"10.0.1.1\"] \n # Used for suppliying an address model\n SHOP_PAYER_BACKEND_ADDRESS_HANDLER = 'project.app.path.to.address_model_callback'\n\n SHOP_PAYER_BACKEND_HIDE_DETAILS = False # Hide order details during payment\n SHOP_PAYER_BACKEND_DEBUG_MODE = 'verbose' # 'silent', 'brief'\n SHOP_PAYER_BACKEND_TEST_MODE = True\n\nConsiderations\n--------------\n\nDue to the fact that django SHOP by default does not store any relation\nbetween the Order model and the AddressModel model there is no good way\nfor payment backends to determine the shipping/billing address for a\ngiven order. For some backends this might not be an issue, but in this\ncase Payer expects to address data in the order details.\n\ndjango-shop-payer-backend tries to tackle by determining the order\n(billing) address using the following strategy:\n\n1. Try to fetch AddressModel from current user (if\n ``user.is_authenticated()``).\n2. Try to load an AddressModel using a callback supplied in the\n ``SHOP_PAYER_BACKEND_ADDRESS_HANDLER`` setting.\n3. Try to extract address details from ``order.billing_address_text`` by\n reverse parsing the address template used by django SHOP.\n4. Let you override/complete the data returned using the above methods\n using the ``populate_buyer_details_dict`` signal.\n\nThis has two implications:\n\n1. For non-authenticated users it is simply not possible get an\n AddressModel object using the default setup. In this case a reverse\n parsing of the address template string django SHOP uses to store the\n textual address representation on the Order object. Due to the\n somewhat fragile nature of this parsing method, you should take\n extreme precautions when modifying the ``SHOP_ADDRESS_TEMPLATE``\n setting. For the parser to function it is recommended that you use\n some form identifying \"key\" to identify each keyword (as with\n \"Name:\"\" etc. in the default pattern). Patterns such as\n ``%(name)s, %(address)s,[...]`` will likely fail as there is nothing\n differentiating the ``name`` and ``address`` keywords in the string\n format, and alas the regexp will not be able to identify the keywords\n correctly.\n2. Fields supported by the Payer API that do not have an obvious\n counterpart on the AddressModel model (e.g. email, phone,\n organisation, etc.) will unsurprisingly not be included in the\n PayerBuyerDetails data using the default settings. To make sure they\n are included, use the methods described in the *Extensibility*\n section below.\n\nThe way to tackle both of the issues outlined above, is probably to add\na foreign key to AddressModel on Order and store the object used when\nsetting ``order.billing_address_text``. That way you could add a address\nmodel callback handler (described below), which will let you return that\n(or any other) object to the backend.\n\nExtensibility\n-------------\n\nLet's say you have a custom address model based on\n``shop.addressmodel.models.Address`` which adds the field ``company``.\nNaturally you would want this data sent to Payer as well, in order to\nhave it appear on invoices etc. To accomplish that, add a receiver for\nthe ``populate_buyer_details_dict`` signal and update the buyer details\ndict like so:\n\n.. code:: python\n\n from django_shop_payer_backend.helper import populate_buyer_details_dict\n from django.dispatch import receiver\n\n @receiver(populate_buyer_details_dict)\n def add_additional_buyer_details(sender, **kwargs):\n\n buyer_details_dict = kwargs.get('buyer_details_dict', None)\n user = kwargs.get('user', None)\n address = kwargs.get('address', None)\n order = kwargs.get('order', None)\n\n buyer_details_dict.update({\n 'organisation': address.company,\n })\n\nThere is a similar signal, ``populate_order_item_dict``, for order\nitems, allowing you to modify the data that before the PayerOrderItem\nobject is initialized. This can be useful for example if your Product\nmodel has a field holding VAT percentages, in which case you could\ninject that value using this method.\n\nAnother option for supplying an address to the backend is to implement\nand address callback handler, and return an AddressModel object. This is\na good option if you are using a custom Order model that has foreign\nkeys to the AddressModel. In that case, you can implement a callback\nsomething along the lines of the following:\n\n.. code:: python\n\n def address_model_callback(*args, **kwargs):\n\n address = kwargs.get('address', None)\n order = kwargs.get('order', None)\n\n if address is None and order is not None:\n try:\n address = order.billing_address\n except Exception:\n pass\n\n return address\n\nAnd add the following to ``settings.py``:\n\n.. code:: python\n\n SHOP_PAYER_BACKEND_ADDRESS_HANDLER = 'project.app.path.to.address_model_callback'\n\n.. |Build Status| image:: https://travis-ci.org/dessibelle/django-shop-payer-backend.svg?branch=master\n :target: https://travis-ci.org/dessibelle/django-shop-payer-backend\n.. |Coverage Status| image:: https://coveralls.io/repos/dessibelle/django-shop-payer-backend/badge.svg?branch=master\n :target: https://coveralls.io/r/dessibelle/django-shop-payer-backend?branch=master\n.. |Latest Version| image:: https://pypip.in/version/django-shop-payer-backend/badge.svg?style=flat\n :target: https://pypi.python.org/pypi/django-shop-payer-backend/", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/dessibelle/django-shop-payer-backend/archive/0.1.7.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dessibelle/django-shop-payer-backend", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-shop-payer-backend", "package_url": "https://pypi.org/project/django-shop-payer-backend/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-shop-payer-backend/", "project_urls": { "Download": "https://github.com/dessibelle/django-shop-payer-backend/archive/0.1.7.tar.gz", "Homepage": "https://github.com/dessibelle/django-shop-payer-backend" }, "release_url": "https://pypi.org/project/django-shop-payer-backend/0.1.7/", "requires_dist": null, "requires_python": null, "summary": "Payment backend for django SHOP and Payer.", "version": "0.1.7" }, "last_serial": 1425670, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a871b7cceebc9dd156492d9594c842c8", "sha256": "da1779494cb2ad4a581333e72c5b9df21260e34c2dcbcf74544392795d20811d" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a871b7cceebc9dd156492d9594c842c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5251, "upload_time": "2015-01-29T23:28:27", "url": "https://files.pythonhosted.org/packages/33/10/a78c01648b11f9b21ddeba37e18a4cec87048f738880c4a20a00ebae0c89/django-shop-payer-backend-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "05cecb3820762c6e673073169caf5875", "sha256": "11c1e941c7ca6082b23cbc91c2b302b788446933ca20cf8b8281fb185c11c9ff" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.1.tar.gz", "has_sig": false, "md5_digest": "05cecb3820762c6e673073169caf5875", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8477, "upload_time": "2015-02-01T12:50:23", "url": "https://files.pythonhosted.org/packages/3b/3f/d0fde7710f26c19fdf989c842cf21b4c493f5c9d9b4e2f456cac5b187914/django-shop-payer-backend-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f45e01e4d59c0615fee6cdcb5daf5d65", "sha256": "52f8a1aafe3a2593126b7c1598c1d38e49a0076036dddf8bf861814be07bd4fb" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f45e01e4d59c0615fee6cdcb5daf5d65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11198, "upload_time": "2015-02-01T17:28:03", "url": "https://files.pythonhosted.org/packages/b3/5d/a9a827990061250fd7bb265465955424b56d45b50211350424afa581235f/django-shop-payer-backend-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6ca9f517b38226354a7bcba42838ba72", "sha256": "c8435d4339556d303046ccf8ba61c3a6242b75881bbb443a709b5dbb88f2535b" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.3r4.tar.gz", "has_sig": false, "md5_digest": "6ca9f517b38226354a7bcba42838ba72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13173, "upload_time": "2015-02-01T18:30:55", "url": "https://files.pythonhosted.org/packages/b5/cd/c617c9b0d9c819d228c1177d7c1ac2f9f61d2c9a5dabb7a2cd1cb5fd8f7c/django-shop-payer-backend-0.1.3r4.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "04fd31f9e5b1880362031be60fc34cef", "sha256": "c289ba9a16312f18b2cc6f0afb36f1376802448d3203cdbd711f19066e74aba3" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.4.tar.gz", "has_sig": false, "md5_digest": "04fd31f9e5b1880362031be60fc34cef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13169, "upload_time": "2015-02-01T18:35:10", "url": "https://files.pythonhosted.org/packages/3f/6f/f21992d1d017360d2817b1f6d0f9d9874116bff1d8eb559c9fb2bdbf17ed/django-shop-payer-backend-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "916359cfa60d2b1f0dba97b7556a55f4", "sha256": "2c97c1a55ee6b6e6d8e6914a7191f821221605f3cacf565e19d71d6401e0b215" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.5.tar.gz", "has_sig": false, "md5_digest": "916359cfa60d2b1f0dba97b7556a55f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13784, "upload_time": "2015-02-05T10:01:56", "url": "https://files.pythonhosted.org/packages/41/4b/a90f566dbfd63d5794a96626e8a9da9703ab3bf50b5ef27c9edccc2d3827/django-shop-payer-backend-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "747a4108c428f7e22a9cda17393a29d5", "sha256": "8e8bb27669903926eb9fb16fe6ac9def63c5a4be8548431bb8a1fb69756b8c81" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.6.tar.gz", "has_sig": false, "md5_digest": "747a4108c428f7e22a9cda17393a29d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13805, "upload_time": "2015-02-05T10:44:38", "url": "https://files.pythonhosted.org/packages/dc/ba/f7c71b75015f3a81e5b8648f49397f86bcf14649a3c6f93e9d50ef8cb709/django-shop-payer-backend-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "56abe0e7943f1a5c5a35c5ba1eb52174", "sha256": "7f002a83b66fd5d0524381aa287505aa3a0b107692150694b217865e8c9e67e0" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.7.tar.gz", "has_sig": false, "md5_digest": "56abe0e7943f1a5c5a35c5ba1eb52174", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17405, "upload_time": "2015-02-16T17:38:59", "url": "https://files.pythonhosted.org/packages/45/3a/473e3e83ab3d0af5c62489f5109aacb4aa27396aade6b87e128e5e9d09a8/django-shop-payer-backend-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56abe0e7943f1a5c5a35c5ba1eb52174", "sha256": "7f002a83b66fd5d0524381aa287505aa3a0b107692150694b217865e8c9e67e0" }, "downloads": -1, "filename": "django-shop-payer-backend-0.1.7.tar.gz", "has_sig": false, "md5_digest": "56abe0e7943f1a5c5a35c5ba1eb52174", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17405, "upload_time": "2015-02-16T17:38:59", "url": "https://files.pythonhosted.org/packages/45/3a/473e3e83ab3d0af5c62489f5109aacb4aa27396aade6b87e128e5e9d09a8/django-shop-payer-backend-0.1.7.tar.gz" } ] }